Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,6 @@ from helper import load_image_from_url, render_results_in_image
|
|
| 6 |
|
| 7 |
def get_pipeline_prediction(pil_image):
|
| 8 |
|
| 9 |
-
od_pipe = pipeline("object-detection", "facebook/detr-resnet-50")
|
| 10 |
-
|
| 11 |
pipeline_output = od_pipe(pil_image)
|
| 12 |
|
| 13 |
processed_image = render_results_in_image(pil_image,
|
|
@@ -15,10 +13,12 @@ def get_pipeline_prediction(pil_image):
|
|
| 15 |
return processed_image
|
| 16 |
|
| 17 |
|
| 18 |
-
gr.Interface(
|
| 19 |
fn=get_pipeline_prediction,
|
| 20 |
inputs=gr.Image(label="Input image",
|
| 21 |
type="pil"),
|
| 22 |
outputs=gr.Image(label="Output image with predicted instances",
|
| 23 |
type="pil")
|
| 24 |
-
)
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def get_pipeline_prediction(pil_image):
|
| 8 |
|
|
|
|
|
|
|
| 9 |
pipeline_output = od_pipe(pil_image)
|
| 10 |
|
| 11 |
processed_image = render_results_in_image(pil_image,
|
|
|
|
| 13 |
return processed_image
|
| 14 |
|
| 15 |
|
| 16 |
+
demo = gr.Interface(
|
| 17 |
fn=get_pipeline_prediction,
|
| 18 |
inputs=gr.Image(label="Input image",
|
| 19 |
type="pil"),
|
| 20 |
outputs=gr.Image(label="Output image with predicted instances",
|
| 21 |
type="pil")
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
demo.launch()
|