Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,24 +15,24 @@ def object_detection(im, size=640):
|
|
| 15 |
results.render() # updates results.imgs with boxes and labels
|
| 16 |
return Image.fromarray(results.imgs[0])
|
| 17 |
|
| 18 |
-
title = "
|
| 19 |
description = """Esse modelo é uma pequena demonstração baseada em uma análise de cerca de 60 imagens somente. Para resultados mais confiáveis e genéricos, são necessários mais exemplos (imagens).
|
| 20 |
"""
|
| 21 |
|
| 22 |
image = gr.inputs.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Imagem", optional=False)
|
| 23 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
| 24 |
|
| 25 |
-
gr.Interface(detect,[gr.Image(type="pil"), gr.Image(type="pil")],description="demo for <a href='https://github.com/WongKinYiu/yolov7' style='text-decoration: underline' target='_blank'>WongKinYiu/yolov7</a> Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
| 15 |
results.render() # updates results.imgs with boxes and labels
|
| 16 |
return Image.fromarray(results.imgs[0])
|
| 17 |
|
| 18 |
+
title = "Visual Pollution Detection"
|
| 19 |
description = """Esse modelo é uma pequena demonstração baseada em uma análise de cerca de 60 imagens somente. Para resultados mais confiáveis e genéricos, são necessários mais exemplos (imagens).
|
| 20 |
"""
|
| 21 |
|
| 22 |
image = gr.inputs.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Imagem", optional=False)
|
| 23 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
| 24 |
|
| 25 |
+
#gr.Interface(detect,[gr.Image(type="pil"), gr.Image(type="pil")],description="demo for <a href='https://github.com/WongKinYiu/yolov7' style='text-decoration: underline' target='_blank'>WongKinYiu/yolov7</a> Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
+
gr.Interface(
|
| 31 |
+
fn=object_detection,
|
| 32 |
+
inputs=image,
|
| 33 |
+
outputs=outputs,
|
| 34 |
+
title="Visual Pollution Detection",
|
| 35 |
+
description="demo for <a href='https://github.com/WongKinYiu/yolov7' style='text-decoration: underline' target='_blank'>WongKinYiu/yolov7</a> Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors",
|
| 36 |
+
examples=[["sample_images/0a1ea4614a9df912eeb8d1b40bffee74.JPG"], ["sample_images/0a2bc0dc2371794509f4b776aff0dd88.JPG"],
|
| 37 |
+
["sample_images/0a4e0e88a05abd96670c8c0c3a67fc73.JPG"], ["sample_images/0a584ddb325ed1ab4083d341280caaa8.JPG"]]
|
| 38 |
+
,cache_examples=False).launch()
|