Spaces:
Build error
Build error
Commit
·
4a8f1bb
1
Parent(s):
865c417
Update app.py
Browse files
app.py
CHANGED
@@ -22,9 +22,9 @@ def predict(
|
|
22 |
model,
|
23 |
img
|
24 |
):
|
25 |
-
if model=="
|
26 |
weights = "checkpoints_model_final_imagenet_40k_synthetic.pth"
|
27 |
-
|
28 |
weights = "checkpoints_model_final_imagenet_100k_synthetic.pth"
|
29 |
cfg.MODEL.WEIGHTS=weights
|
30 |
predictor = DefaultPredictor(cfg)
|
@@ -36,12 +36,12 @@ def predict(
|
|
36 |
title = "Indoor Pet Detection"
|
37 |
description = "Demo for Indoor Pet Detection"
|
38 |
examples = [
|
39 |
-
["
|
40 |
-
["
|
41 |
]
|
42 |
|
43 |
|
44 |
-
gr.Interface(predict, [gr.inputs.Dropdown(["
|
45 |
description=description,
|
46 |
# article=article,
|
47 |
examples=examples).launch(debug=True)
|
|
|
22 |
model,
|
23 |
img
|
24 |
):
|
25 |
+
if model=="40k synthetic":
|
26 |
weights = "checkpoints_model_final_imagenet_40k_synthetic.pth"
|
27 |
+
elif model == "100k synthetic":
|
28 |
weights = "checkpoints_model_final_imagenet_100k_synthetic.pth"
|
29 |
cfg.MODEL.WEIGHTS=weights
|
30 |
predictor = DefaultPredictor(cfg)
|
|
|
36 |
title = "Indoor Pet Detection"
|
37 |
description = "Demo for Indoor Pet Detection"
|
38 |
examples = [
|
39 |
+
["100k synthetic", 'example.jpg'],
|
40 |
+
["40k synthetic", 'example.jpg']
|
41 |
]
|
42 |
|
43 |
|
44 |
+
gr.Interface(predict, [gr.inputs.Dropdown(["40k synthetic", "100k synthetic"]), gr.inputs.Image(type="file")], outputs=gr.outputs.Image(type="pil"),enable_queue=True, title=title,
|
45 |
description=description,
|
46 |
# article=article,
|
47 |
examples=examples).launch(debug=True)
|