Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,10 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
-
import pipeline
|
| 4 |
-
import transformers
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
#def image_classifier(inp):
|
| 8 |
-
# return {'cat': 0.3, 'dog': 0.7}
|
| 9 |
|
| 10 |
def get_pipeline_prediction(pil_image):
|
| 11 |
-
|
| 12 |
pipeline_output = od_pipe(pil_image)
|
| 13 |
-
|
| 14 |
-
#Then process the image using the pipeline output
|
| 15 |
processed_image = render_results_in_image(pil_image,
|
| 16 |
pipeline_output)
|
| 17 |
return processed_image
|
|
@@ -24,6 +17,4 @@ demo = gr.Interface(
|
|
| 24 |
type="pil")
|
| 25 |
)
|
| 26 |
|
| 27 |
-
|
| 28 |
-
#demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
| 29 |
-
demo.launch()
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
def get_pipeline_prediction(pil_image):
|
| 5 |
+
|
| 6 |
pipeline_output = od_pipe(pil_image)
|
| 7 |
+
|
|
|
|
| 8 |
processed_image = render_results_in_image(pil_image,
|
| 9 |
pipeline_output)
|
| 10 |
return processed_image
|
|
|
|
| 17 |
type="pil")
|
| 18 |
)
|
| 19 |
|
| 20 |
+
demo.close()
|
|
|
|
|
|