Spaces:
Runtime error
Runtime error
Vincent Claes
commited on
Commit
·
717c8fd
1
Parent(s):
347714e
add examples
Browse files
app.py
CHANGED
|
@@ -13,37 +13,37 @@ DEFAULT_MODEL = "microsoft/xclip-base-patch16-zero-shot"
|
|
| 13 |
processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
|
| 14 |
model = AutoModel.from_pretrained(DEFAULT_MODEL)
|
| 15 |
|
| 16 |
-
|
| 17 |
"bathroom,sauna,living room, bedroom,kitchen,toilet,hallway,dressing,attic,basement,home office,garage"
|
| 18 |
)
|
| 19 |
examples = [
|
| 20 |
[
|
| 21 |
"movies/bathroom.mp4",
|
| 22 |
-
|
| 23 |
],
|
| 24 |
[
|
| 25 |
"movies/bedroom.mp4",
|
| 26 |
-
|
| 27 |
],
|
| 28 |
[
|
| 29 |
"movies/dressing.mp4",
|
| 30 |
-
|
| 31 |
],
|
| 32 |
[
|
| 33 |
"movies/home-office.mp4",
|
| 34 |
-
|
| 35 |
],
|
| 36 |
[
|
| 37 |
"movies/kitchen.mp4",
|
| 38 |
-
|
| 39 |
],
|
| 40 |
[
|
| 41 |
"movies/living-room.mp4",
|
| 42 |
-
|
| 43 |
],
|
| 44 |
[
|
| 45 |
"movies/toilet.mp4",
|
| 46 |
-
|
| 47 |
],
|
| 48 |
]
|
| 49 |
|
|
@@ -118,7 +118,7 @@ with app:
|
|
| 118 |
with gr.Row():
|
| 119 |
with gr.Column():
|
| 120 |
video_file = gr.Video(label="Video File:", show_label=True)
|
| 121 |
-
local_video_labels_text = gr.Textbox(label="
|
| 122 |
submit_button = gr.Button(value="Predict")
|
| 123 |
with gr.Column():
|
| 124 |
predictions = gr.Label(label="Predictions:", show_label=True)
|
|
|
|
| 13 |
processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
|
| 14 |
model = AutoModel.from_pretrained(DEFAULT_MODEL)
|
| 15 |
|
| 16 |
+
ROOM_TYPES = (
|
| 17 |
"bathroom,sauna,living room, bedroom,kitchen,toilet,hallway,dressing,attic,basement,home office,garage"
|
| 18 |
)
|
| 19 |
examples = [
|
| 20 |
[
|
| 21 |
"movies/bathroom.mp4",
|
| 22 |
+
ROOM_TYPES,
|
| 23 |
],
|
| 24 |
[
|
| 25 |
"movies/bedroom.mp4",
|
| 26 |
+
ROOM_TYPES,
|
| 27 |
],
|
| 28 |
[
|
| 29 |
"movies/dressing.mp4",
|
| 30 |
+
ROOM_TYPES,
|
| 31 |
],
|
| 32 |
[
|
| 33 |
"movies/home-office.mp4",
|
| 34 |
+
ROOM_TYPES,
|
| 35 |
],
|
| 36 |
[
|
| 37 |
"movies/kitchen.mp4",
|
| 38 |
+
ROOM_TYPES,
|
| 39 |
],
|
| 40 |
[
|
| 41 |
"movies/living-room.mp4",
|
| 42 |
+
ROOM_TYPES,
|
| 43 |
],
|
| 44 |
[
|
| 45 |
"movies/toilet.mp4",
|
| 46 |
+
ROOM_TYPES,
|
| 47 |
],
|
| 48 |
]
|
| 49 |
|
|
|
|
| 118 |
with gr.Row():
|
| 119 |
with gr.Column():
|
| 120 |
video_file = gr.Video(label="Video File:", show_label=True)
|
| 121 |
+
local_video_labels_text = gr.Textbox(value=ROOM_TYPES,label="Room Types", show_label=True)
|
| 122 |
submit_button = gr.Button(value="Predict")
|
| 123 |
with gr.Column():
|
| 124 |
predictions = gr.Label(label="Predictions:", show_label=True)
|