Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,22 +31,6 @@ VALID_ZEROSHOT_VIDEOCLASSIFICATION_MODELS = [
|
|
31 |
processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
|
32 |
model = AutoModel.from_pretrained(DEFAULT_MODEL)
|
33 |
|
34 |
-
examples = [
|
35 |
-
[
|
36 |
-
"https://www.youtu.be/l1dBM8ZECao",
|
37 |
-
"sleeping dog,cat fight club,birds of prey",
|
38 |
-
],
|
39 |
-
[
|
40 |
-
"https://youtu.be/VMj-3S1tku0",
|
41 |
-
"programming course,eating spaghetti,playing football",
|
42 |
-
],
|
43 |
-
[
|
44 |
-
"https://youtu.be/BRw7rvLdGzU",
|
45 |
-
"game of thrones,the lord of the rings,vikings",
|
46 |
-
],
|
47 |
-
]
|
48 |
-
|
49 |
-
|
50 |
def select_model(model_name):
|
51 |
global processor, model
|
52 |
processor = AutoProcessor.from_pretrained(model_name)
|
@@ -93,15 +77,7 @@ def predict(youtube_url_or_file_path, labels_text):
|
|
93 |
app = gr.Blocks()
|
94 |
with app:
|
95 |
gr.Markdown(
|
96 |
-
"# **<p align='center'>
|
97 |
-
)
|
98 |
-
gr.Markdown(
|
99 |
-
"""
|
100 |
-
<p style='text-align: center'>
|
101 |
-
Follow me for more!
|
102 |
-
<br> <a href='https://twitter.com/fcakyon' target='_blank'>twitter</a> | <a href='https://github.com/fcakyon' target='_blank'>github</a> | <a href='https://www.linkedin.com/in/fcakyon/' target='_blank'>linkedin</a> | <a href='https://fcakyon.medium.com/' target='_blank'>medium</a>
|
103 |
-
</p>
|
104 |
-
"""
|
105 |
)
|
106 |
|
107 |
with gr.Row():
|
@@ -158,11 +134,5 @@ with app:
|
|
158 |
inputs=[video_file, local_video_labels_text],
|
159 |
outputs=[predictions, video_gif],
|
160 |
)
|
161 |
-
gr.Markdown(
|
162 |
-
"""
|
163 |
-
\n Demo created by: <a href=\"https://github.com/fcakyon\">fcakyon</a>.
|
164 |
-
<br> Based on this <a href=\"https://huggingface.co/docs/transformers/main/model_doc/xclip">HuggingFace model</a>.
|
165 |
-
"""
|
166 |
-
)
|
167 |
|
168 |
app.launch()
|
|
|
31 |
processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
|
32 |
model = AutoModel.from_pretrained(DEFAULT_MODEL)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
def select_model(model_name):
|
35 |
global processor, model
|
36 |
processor = AutoProcessor.from_pretrained(model_name)
|
|
|
77 |
app = gr.Blocks()
|
78 |
with app:
|
79 |
gr.Markdown(
|
80 |
+
"# **<p align='center'> PROTOG - VIOLENCE DETECTION MODULE</p>**"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
)
|
82 |
|
83 |
with gr.Row():
|
|
|
134 |
inputs=[video_file, local_video_labels_text],
|
135 |
outputs=[predictions, video_gif],
|
136 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
app.launch()
|