Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,13 +63,10 @@ def process_zip_files(zip_file_paths):
|
|
63 |
return captions
|
64 |
|
65 |
def save_captions_to_csv(captions, csv_file_path='image_captions.csv'):
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
writer.writerows(captions)
|
71 |
-
else:
|
72 |
-
print("No captions to save.")
|
73 |
return csv_file_path
|
74 |
|
75 |
def gr_process(zip_files, image_files):
|
|
|
63 |
return captions
|
64 |
|
65 |
def save_captions_to_csv(captions, csv_file_path='image_captions.csv'):
|
66 |
+
with open(csv_file_path, mode='w', newline='') as file:
|
67 |
+
writer = csv.writer(file)
|
68 |
+
writer.writerow(['Image Name', 'Caption'])
|
69 |
+
writer.writerows(captions)
|
|
|
|
|
|
|
70 |
return csv_file_path
|
71 |
|
72 |
def gr_process(zip_files, image_files):
|