Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,9 +84,9 @@ if os.path.exists('best_model.pth'):
|
|
| 84 |
model.load_state_dict(checkpoint['model_state_dict'])
|
| 85 |
print("✓ Trained model loaded successfully!")
|
| 86 |
except Exception as e:
|
| 87 |
-
print(f"
|
| 88 |
else:
|
| 89 |
-
print("
|
| 90 |
|
| 91 |
model.eval()
|
| 92 |
|
|
@@ -336,11 +336,11 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
| 336 |
gr.Markdown("### Upload Video")
|
| 337 |
|
| 338 |
with gr.Group(elem_id="upload-zone"):
|
| 339 |
-
video_input = gr.
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
|
| 345 |
# Add a second video component for playback
|
| 346 |
video_preview = gr.Video(
|
|
|
|
| 84 |
model.load_state_dict(checkpoint['model_state_dict'])
|
| 85 |
print("✓ Trained model loaded successfully!")
|
| 86 |
except Exception as e:
|
| 87 |
+
print(f" Could not load trained weights: {str(e)}")
|
| 88 |
else:
|
| 89 |
+
print(" No trained model found. Using random initialization.")
|
| 90 |
|
| 91 |
model.eval()
|
| 92 |
|
|
|
|
| 336 |
gr.Markdown("### Upload Video")
|
| 337 |
|
| 338 |
with gr.Group(elem_id="upload-zone"):
|
| 339 |
+
video_input = gr.File(
|
| 340 |
+
label="Drop video file here or click to upload",
|
| 341 |
+
file_types=["video"],
|
| 342 |
+
type="filepath"
|
| 343 |
+
)
|
| 344 |
|
| 345 |
# Add a second video component for playback
|
| 346 |
video_preview = gr.Video(
|