Update app.py
Browse files
app.py
CHANGED
|
@@ -25,20 +25,21 @@ def plot_results(image, results, threshold=0.7):
|
|
| 25 |
def predict(image):
|
| 26 |
# make the object detection pipeline
|
| 27 |
obj_detector = pipeline(
|
| 28 |
-
"object-detection", model="Antoine101/detr-resnet-50-
|
| 29 |
)
|
| 30 |
results = obj_detector(image)
|
| 31 |
return plot_results(image, results)
|
| 32 |
|
| 33 |
-
title = "
|
| 34 |
description = """
|
| 35 |
-
DETR model finetuned on "
|
| 36 |
"""
|
| 37 |
|
| 38 |
demo = gr.Interface(
|
| 39 |
fn=predict,
|
| 40 |
inputs=gr.Image(label="Input Image", type="pil"),
|
| 41 |
outputs="image",
|
|
|
|
| 42 |
title=title,
|
| 43 |
description=description
|
| 44 |
)
|
|
|
|
| 25 |
def predict(image):
|
| 26 |
# make the object detection pipeline
|
| 27 |
obj_detector = pipeline(
|
| 28 |
+
"object-detection", model="Antoine101/detr-resnet-50-fashionpedia-finetuned"
|
| 29 |
)
|
| 30 |
results = obj_detector(image)
|
| 31 |
return plot_results(image, results)
|
| 32 |
|
| 33 |
+
title = "Are you fashion?"
|
| 34 |
description = """
|
| 35 |
+
DETR model finetuned on "detection-datasets/fashionpedia" for apparels detection.
|
| 36 |
"""
|
| 37 |
|
| 38 |
demo = gr.Interface(
|
| 39 |
fn=predict,
|
| 40 |
inputs=gr.Image(label="Input Image", type="pil"),
|
| 41 |
outputs="image",
|
| 42 |
+
examples=[["examples/example1.jpg"], ["examples/example2.jpg"]],
|
| 43 |
title=title,
|
| 44 |
description=description
|
| 45 |
)
|