Spaces:
Build error
Build error
Commit
·
dba8779
1
Parent(s):
8154fce
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,8 @@ def predict(
|
|
| 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)
|
| 31 |
im = cv2.imread(img.name)
|
|
@@ -44,7 +46,7 @@ examples = [
|
|
| 44 |
]
|
| 45 |
|
| 46 |
|
| 47 |
-
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,
|
| 48 |
description=description,
|
| 49 |
# article=article,
|
| 50 |
examples=examples).launch(debug=True)
|
|
|
|
| 26 |
weights = "checkpoints_model_final_imagenet_40k_synthetic.pth"
|
| 27 |
elif model == "100k synthetic":
|
| 28 |
weights = "checkpoints_model_final_imagenet_100k_synthetic.pth"
|
| 29 |
+
else:
|
| 30 |
+
weights = "checkpoints_model_final_imagenet_5k_synthetic.pth"
|
| 31 |
cfg.MODEL.WEIGHTS=weights
|
| 32 |
predictor = DefaultPredictor(cfg)
|
| 33 |
im = cv2.imread(img.name)
|
|
|
|
| 46 |
]
|
| 47 |
|
| 48 |
|
| 49 |
+
gr.Interface(predict, [gr.inputs.Dropdown(["5k synthetic", "40k synthetic", "100k synthetic"]), gr.inputs.Image(type="file")], outputs=gr.outputs.Image(type="pil"),enable_queue=True, title=title,
|
| 50 |
description=description,
|
| 51 |
# article=article,
|
| 52 |
examples=examples).launch(debug=True)
|