Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -102,9 +102,7 @@ class VideoClassifier:
|
|
102 |
time_taken_1 = round(end - start, 3)
|
103 |
# print("Time taken from video to transcript:", time_taken_1)
|
104 |
|
105 |
-
|
106 |
-
if not os.path.exists(path):
|
107 |
-
os.mkdir(path)
|
108 |
video = cv2.VideoCapture(video_input)
|
109 |
length = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
110 |
# print(f'There are {length} frames in this video')
|
@@ -118,15 +116,7 @@ class VideoClassifier:
|
|
118 |
video.set(cv2.CAP_PROP_POS_FRAMES, currentframe)
|
119 |
ret,frame = video.read()
|
120 |
if ret:
|
121 |
-
|
122 |
-
name = './results/frames/frame' + str(currentframe) + '.jpg'
|
123 |
-
# writing the extracted images
|
124 |
-
# print ('Creating...' + name)
|
125 |
-
cv2.imwrite(name, frame)
|
126 |
-
image_paths = []
|
127 |
-
img_path = '/results/frames/frame' + str(currentframe) + '.jpg'
|
128 |
-
image_paths.append(img_path)
|
129 |
-
content = self.img_cap.predict_step(image_paths)
|
130 |
print("content",content)
|
131 |
caption_text.append(content[0])
|
132 |
currentframe += temp_div-1
|
|
|
102 |
time_taken_1 = round(end - start, 3)
|
103 |
# print("Time taken from video to transcript:", time_taken_1)
|
104 |
|
105 |
+
|
|
|
|
|
106 |
video = cv2.VideoCapture(video_input)
|
107 |
length = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
108 |
# print(f'There are {length} frames in this video')
|
|
|
116 |
video.set(cv2.CAP_PROP_POS_FRAMES, currentframe)
|
117 |
ret,frame = video.read()
|
118 |
if ret:
|
119 |
+
content = self.img_cap.predict_step([frame])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
print("content",content)
|
121 |
caption_text.append(content[0])
|
122 |
currentframe += temp_div-1
|