Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def predict(img):
|
|
16 |
#img = PILImage.create(img)
|
17 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(384),tfms.A.Normalize()])
|
18 |
pred_dict = models.torchvision.faster_rcnn.end2end_detect(img, infer_tfms, model.to("cpu"), class_map=class_map, detection_threshold=0.5)
|
19 |
-
return
|
20 |
|
21 |
# Creamos la interfaz y la lanzamos.
|
22 |
gr.Interface(fn=predict, inputs=gr.inputs.Image(type='filepath'), outputs=gr.outputs.Image(type='pil'), examples=['00001.jpg','00002.jpg']).launch(share=False)
|
|
|
16 |
#img = PILImage.create(img)
|
17 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(384),tfms.A.Normalize()])
|
18 |
pred_dict = models.torchvision.faster_rcnn.end2end_detect(img, infer_tfms, model.to("cpu"), class_map=class_map, detection_threshold=0.5)
|
19 |
+
return pred_dict['img']
|
20 |
|
21 |
# Creamos la interfaz y la lanzamos.
|
22 |
gr.Interface(fn=predict, inputs=gr.inputs.Image(type='filepath'), outputs=gr.outputs.Image(type='pil'), examples=['00001.jpg','00002.jpg']).launch(share=False)
|