app file
Browse files- summarizer.py +1 -1
- transcript.py +19 -0
summarizer.py
CHANGED
@@ -128,7 +128,7 @@ def getSummary(link, lexrank_switch, rpunkt_switch):
|
|
128 |
proc_list = fr.extractImagesFromVideo(dict_timestamp_summary.keys())
|
129 |
print('frames: '+str(proc_list))
|
130 |
|
131 |
-
html_file = ts.
|
132 |
images = ts.getImages(dict_timestamp_summary)
|
133 |
|
134 |
return html_file, images
|
|
|
128 |
proc_list = fr.extractImagesFromVideo(dict_timestamp_summary.keys())
|
129 |
print('frames: '+str(proc_list))
|
130 |
|
131 |
+
html_file = ts.convertToJSON(dict_timestamp_summary)
|
132 |
images = ts.getImages(dict_timestamp_summary)
|
133 |
|
134 |
return html_file, images
|
transcript.py
CHANGED
@@ -99,6 +99,25 @@ def getSentences(raw_transcript):
|
|
99 |
|
100 |
#return dsl
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
def convertToHTML(dsl):
|
103 |
#workdir = 'file/workdir/'
|
104 |
workdir = '../workdir/'
|
|
|
99 |
|
100 |
#return dsl
|
101 |
|
102 |
+
def convertToJSON(dsl):
|
103 |
+
workdir = 'file/workdir/'
|
104 |
+
cnt=1
|
105 |
+
json_rows = '['
|
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
|
116 |
+
json_rows = json_rows[:-1] + ']'
|
117 |
+
|
118 |
+
return json_rows
|
119 |
+
|
120 |
+
|
121 |
def convertToHTML(dsl):
|
122 |
#workdir = 'file/workdir/'
|
123 |
workdir = '../workdir/'
|