Antonio commited on
Commit ·
5a8dd6a
1
Parent(s): 279c957
Changed interface code
Browse files
app.py
CHANGED
|
@@ -179,7 +179,6 @@ decision_frameworks = {
|
|
| 179 |
"Rule-Based": rule_based_method
|
| 180 |
}
|
| 181 |
|
| 182 |
-
# Define the prediction function
|
| 183 |
def predict(video_file, video_model_name, audio_model_name, framework_name):
|
| 184 |
|
| 185 |
image_processor = VivitImageProcessor.from_pretrained("google/vivit-b-16x2-kinetics400")
|
|
@@ -216,17 +215,14 @@ def predict(video_file, video_model_name, audio_model_name, framework_name):
|
|
| 216 |
"Consensus Label": consensus_label
|
| 217 |
}
|
| 218 |
|
| 219 |
-
# Create Gradio Interface
|
| 220 |
inputs = [
|
| 221 |
-
gr.
|
| 222 |
-
gr.
|
| 223 |
-
gr.
|
| 224 |
-
gr.
|
| 225 |
]
|
| 226 |
|
| 227 |
-
outputs =
|
| 228 |
-
gr.outputs.JSON(label="Predictions")
|
| 229 |
-
]
|
| 230 |
|
| 231 |
iface = gr.Interface(
|
| 232 |
fn=predict,
|
|
|
|
| 179 |
"Rule-Based": rule_based_method
|
| 180 |
}
|
| 181 |
|
|
|
|
| 182 |
def predict(video_file, video_model_name, audio_model_name, framework_name):
|
| 183 |
|
| 184 |
image_processor = VivitImageProcessor.from_pretrained("google/vivit-b-16x2-kinetics400")
|
|
|
|
| 215 |
"Consensus Label": consensus_label
|
| 216 |
}
|
| 217 |
|
|
|
|
| 218 |
inputs = [
|
| 219 |
+
gr.File(label="Upload Video"),
|
| 220 |
+
gr.Dropdown(["video_model_60_acc.pth", "video_model_80_acc.pth"], label="Select Video Model"),
|
| 221 |
+
gr.Dropdown(["audio_model_state_dict_6e.pth"], label="Select Audio Model"),
|
| 222 |
+
gr.Dropdown(list(decision_frameworks.keys()), label="Select Decision Framework")
|
| 223 |
]
|
| 224 |
|
| 225 |
+
outputs = gr.JSON(label="Predictions")
|
|
|
|
|
|
|
| 226 |
|
| 227 |
iface = gr.Interface(
|
| 228 |
fn=predict,
|