Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,20 +31,20 @@ VALID_ZEROSHOT_VIDEOCLASSIFICATION_MODELS = [
|
|
31 |
processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
|
32 |
model = AutoModel.from_pretrained(DEFAULT_MODEL)
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
|
49 |
|
50 |
def select_model(model_name):
|
@@ -93,9 +93,16 @@ 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 |
-
|
99 |
|
100 |
with gr.Row():
|
101 |
with gr.Column():
|
@@ -107,9 +114,9 @@ with app:
|
|
107 |
)
|
108 |
model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
|
109 |
with gr.Tab(label="Youtube URL"):
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
youtube_url = gr.Textbox(label="Youtube URL:", show_label=True)
|
114 |
youtube_url_labels_text = gr.Textbox(
|
115 |
label="Labels Text:", show_label=True
|
|
|
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):
|
|
|
93 |
app = gr.Blocks()
|
94 |
with app:
|
95 |
gr.Markdown(
|
96 |
+
"# **<p align='center'>Zero-shot Video Classification with 🤗 Transformers</p>**"
|
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():
|
108 |
with gr.Column():
|
|
|
114 |
)
|
115 |
model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
|
116 |
with gr.Tab(label="Youtube URL"):
|
117 |
+
gr.Markdown(
|
118 |
+
"### **Provide a Youtube video URL and a list of labels separated by commas**"
|
119 |
+
)
|
120 |
youtube_url = gr.Textbox(label="Youtube URL:", show_label=True)
|
121 |
youtube_url_labels_text = gr.Textbox(
|
122 |
label="Labels Text:", show_label=True
|