Spaces:
Sleeping
Sleeping
Rameshwari Siddharam Kadrame commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,13 +5,14 @@ from PIL import Image, ImageDraw, ImageFont
|
|
| 5 |
# Use a pipeline as a high-level helper
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
-
#model_path = ("../Models/models--facebook--detr-resnet-50/snapshots
|
|
|
|
| 9 |
|
| 10 |
object_detector = pipeline("object-detection",
|
| 11 |
model="facebook/detr-resnet-50")
|
| 12 |
|
| 13 |
-
#object_detector = pipeline("object-detection",
|
| 14 |
-
|
| 15 |
|
| 16 |
|
| 17 |
def draw_bounding_boxes(image, detections, font_path=None, font_size=20):
|
|
@@ -74,7 +75,7 @@ def detect_object(image):
|
|
| 74 |
demo = gr.Interface(fn=detect_object,
|
| 75 |
inputs=[gr.Image(label="Select Image",type="pil")],
|
| 76 |
outputs=[gr.Image(label="Processed Image", type="pil")],
|
| 77 |
-
title="
|
| 78 |
description="THIS APPLICATION WILL BE USED TO DETECT OBJECTS INSIDE THE PROVIDED INPUT IMAGE.")
|
| 79 |
demo.launch()
|
| 80 |
|
|
|
|
| 5 |
# Use a pipeline as a high-level helper
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
+
# model_path = ("../Models/models--facebook--detr-resnet-50/snapshots"
|
| 9 |
+
# "/1d5f47bd3bdd2c4bbfa585418ffe6da5028b4c0b")
|
| 10 |
|
| 11 |
object_detector = pipeline("object-detection",
|
| 12 |
model="facebook/detr-resnet-50")
|
| 13 |
|
| 14 |
+
# object_detector = pipeline("object-detection",
|
| 15 |
+
# model=model_path)
|
| 16 |
|
| 17 |
|
| 18 |
def draw_bounding_boxes(image, detections, font_path=None, font_size=20):
|
|
|
|
| 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="@GenAILearniverse Project 6: Object Detector",
|
| 79 |
description="THIS APPLICATION WILL BE USED TO DETECT OBJECTS INSIDE THE PROVIDED INPUT IMAGE.")
|
| 80 |
demo.launch()
|
| 81 |
|