app file
Browse files- transcript.py +4 -4
transcript.py
CHANGED
@@ -106,10 +106,10 @@ def convertToJSON(dsl):
|
|
106 |
for (key,val) in dsl.items():
|
107 |
image='frame_'+f"{int(cnt):04d}"+'.jpg'
|
108 |
sentence = val
|
109 |
-
row = '{"
|
110 |
-
row = row + '"
|
111 |
-
row = row + '"
|
112 |
-
row = row + '"
|
113 |
json_rows = json_rows + row
|
114 |
cnt = cnt+1
|
115 |
# remove the comma from the last item
|
|
|
106 |
for (key,val) in dsl.items():
|
107 |
image='frame_'+f"{int(cnt):04d}"+'.jpg'
|
108 |
sentence = val
|
109 |
+
row = '{"image_id": "'+str(cnt)+'",'
|
110 |
+
row = row + '"timestamp": "'+key+'",'
|
111 |
+
row = row + '"image": "'+workdir+image+'",'
|
112 |
+
row = row + '"caption": "'+sentence+'"},'
|
113 |
json_rows = json_rows + row
|
114 |
cnt = cnt+1
|
115 |
# remove the comma from the last item
|