Spaces:
Runtime error
Runtime error
Commit
•
b1f8974
1
Parent(s):
a68cb02
Update app.py
Browse files
app.py
CHANGED
@@ -232,7 +232,7 @@ class VideoClassifier:
|
|
232 |
# except:
|
233 |
# transcript=self.audio_extraction_space(video_input)
|
234 |
|
235 |
-
if checkbox==
|
236 |
start_time_caption = time.time()
|
237 |
video = cv2.VideoCapture(video_input)
|
238 |
length = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
@@ -465,11 +465,13 @@ class VideoClassifier:
|
|
465 |
["Image Captions"],
|
466 |
)
|
467 |
demo = gr.Interface(fn=self.classify_video, inputs=["playablevideo",checkbox],allow_flagging='never', examples=[
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
|
|
|
|
473 |
cache_examples=False, outputs=["text"],
|
474 |
css=css_code, title="Interactive Advertising Bureau (IAB) compliant Video-Ad classification")
|
475 |
# demo.launch(debug=True)
|
|
|
232 |
# except:
|
233 |
# transcript=self.audio_extraction_space(video_input)
|
234 |
|
235 |
+
if checkbox=="Image Captions":
|
236 |
start_time_caption = time.time()
|
237 |
video = cv2.VideoCapture(video_input)
|
238 |
length = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
|
|
465 |
["Image Captions"],
|
466 |
)
|
467 |
demo = gr.Interface(fn=self.classify_video, inputs=["playablevideo",checkbox],allow_flagging='never', examples=[
|
468 |
+
# Each example should be a sublist with corresponding values for each input component
|
469 |
+
[os.path.join(os.path.dirname(__file__), "American_football_heads_to_India_clip.mp4"), ["Image Captions"]],
|
470 |
+
[os.path.join(os.path.dirname(__file__), "PersonalFinance_clip.mp4"), ["Image Captions"]],
|
471 |
+
[os.path.join(os.path.dirname(__file__), "Motorcycle_clip.mp4"), ["Image Captions"]],
|
472 |
+
[os.path.join(os.path.dirname(__file__), "Spirituality_1_clip.mp4"), ["Image Captions"]],
|
473 |
+
[os.path.join(os.path.dirname(__file__), "Science_clip.mp4"), ["Image Captions"]],
|
474 |
+
],
|
475 |
cache_examples=False, outputs=["text"],
|
476 |
css=css_code, title="Interactive Advertising Bureau (IAB) compliant Video-Ad classification")
|
477 |
# demo.launch(debug=True)
|