Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,8 +59,10 @@ def draw_bounding_boxes(image, detections, font_path=None, font_size=20):
|
|
| 59 |
else:
|
| 60 |
|
| 61 |
text_size = draw.textbbox((xmin, ymin), text)
|
|
|
|
| 62 |
|
| 63 |
-
|
|
|
|
| 64 |
draw.text((xmin, ymin), text, fill="white", font=font)
|
| 65 |
|
| 66 |
return draw_image
|
|
@@ -75,6 +77,6 @@ def detect_object(image):
|
|
| 75 |
demo = gr.Interface(fn=detect_object,
|
| 76 |
inputs=[gr.Image(label="Select Image",type="pil")],
|
| 77 |
outputs=[gr.Image(label="Processed Image", type="pil")],
|
| 78 |
-
title="Venus Project
|
| 79 |
description="THIS APPLICATION WILL BE USED TO DETECT OBJECTS INSIDE THE PROVIDED INPUT IMAGE.")
|
| 80 |
demo.launch()
|
|
|
|
| 59 |
else:
|
| 60 |
|
| 61 |
text_size = draw.textbbox((xmin, ymin), text)
|
| 62 |
+
|
| 63 |
|
| 64 |
+
|
| 65 |
+
draw.rectangle([(text_size[0], text_size[1]), (text_size[2], text_size[3])], fill="red")
|
| 66 |
draw.text((xmin, ymin), text, fill="white", font=font)
|
| 67 |
|
| 68 |
return draw_image
|
|
|
|
| 77 |
demo = gr.Interface(fn=detect_object,
|
| 78 |
inputs=[gr.Image(label="Select Image",type="pil")],
|
| 79 |
outputs=[gr.Image(label="Processed Image", type="pil")],
|
| 80 |
+
title="Venus Project : Object Detector",
|
| 81 |
description="THIS APPLICATION WILL BE USED TO DETECT OBJECTS INSIDE THE PROVIDED INPUT IMAGE.")
|
| 82 |
demo.launch()
|