Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import tempfile
|
|
| 10 |
import os
|
| 11 |
|
| 12 |
# Load models
|
| 13 |
-
resnet = ResNetModel.from_pretrained("
|
| 14 |
resnet.eval()
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
resnet = resnet.to(device)
|
|
@@ -143,8 +143,8 @@ iface = gr.Interface(
|
|
| 143 |
inputs=[
|
| 144 |
gr.Video(label="Upload a Video"),
|
| 145 |
gr.Image(type="pil", label="Upload a Query Image"),
|
| 146 |
-
gr.Slider(minimum=0, maximum=10, step=1,
|
| 147 |
-
gr.Slider(minimum=0.0, maximum=1.0, step=0.01,
|
| 148 |
],
|
| 149 |
outputs=[
|
| 150 |
gr.JSON(label="Result")
|
|
@@ -162,4 +162,4 @@ iface = gr.Interface(
|
|
| 162 |
)
|
| 163 |
|
| 164 |
if __name__ == "__main__":
|
| 165 |
-
iface.launch()
|
|
|
|
| 10 |
import os
|
| 11 |
|
| 12 |
# Load models
|
| 13 |
+
resnet = ResNetModel.from_pretrained("microsoft/resnet-50")
|
| 14 |
resnet.eval()
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
resnet = resnet.to(device)
|
|
|
|
| 143 |
inputs=[
|
| 144 |
gr.Video(label="Upload a Video"),
|
| 145 |
gr.Image(type="pil", label="Upload a Query Image"),
|
| 146 |
+
gr.Slider(minimum=0, maximum=10, step=1, value=5, label="Skip Frames"),
|
| 147 |
+
gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.47, label="Threshold")
|
| 148 |
],
|
| 149 |
outputs=[
|
| 150 |
gr.JSON(label="Result")
|
|
|
|
| 162 |
)
|
| 163 |
|
| 164 |
if __name__ == "__main__":
|
| 165 |
+
iface.launch()
|