Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,17 +28,13 @@ def detect_image(model_choice, input_image=None, sample_image_choice=None):
|
|
28 |
model = load_model(models[model_choice])
|
29 |
if sample_image_choice:
|
30 |
input_image = Image.open(sample_images[sample_image_choice])
|
31 |
-
|
32 |
-
return model.detect_image(input_image)
|
33 |
-
return None
|
34 |
|
35 |
def detect_video(model_choice, input_video=None, sample_video_choice=None):
|
36 |
model = load_model(models[model_choice])
|
37 |
if sample_video_choice:
|
38 |
input_video = sample_videos[sample_video_choice]
|
39 |
-
|
40 |
-
return model.detect_video(input_video)
|
41 |
-
return None
|
42 |
|
43 |
app = gr.Blocks()
|
44 |
|
@@ -77,4 +73,4 @@ with app:
|
|
77 |
outputs=video_output
|
78 |
)
|
79 |
|
80 |
-
app.launch(share=True)
|
|
|
28 |
model = load_model(models[model_choice])
|
29 |
if sample_image_choice:
|
30 |
input_image = Image.open(sample_images[sample_image_choice])
|
31 |
+
return model.detect_image(input_image)
|
|
|
|
|
32 |
|
33 |
def detect_video(model_choice, input_video=None, sample_video_choice=None):
|
34 |
model = load_model(models[model_choice])
|
35 |
if sample_video_choice:
|
36 |
input_video = sample_videos[sample_video_choice]
|
37 |
+
return model.detect_video(input_video)
|
|
|
|
|
38 |
|
39 |
app = gr.Blocks()
|
40 |
|
|
|
73 |
outputs=video_output
|
74 |
)
|
75 |
|
76 |
+
app.launch(share=True)
|