Spaces:
Runtime error
Runtime error
sharyash1101
commited on
Commit
•
c0b1c76
1
Parent(s):
036a816
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import torch
|
|
2 |
import gradio as gr
|
3 |
from gradio import components
|
4 |
from PIL import Image
|
5 |
-
import os
|
6 |
|
7 |
model = None
|
8 |
|
@@ -14,7 +13,7 @@ def object_detection(im):
|
|
14 |
results.render()
|
15 |
return Image.fromarray(results.ims[0])
|
16 |
|
17 |
-
image = components.Image(shape=(640, 640), image_mode="RGB", source="upload", label="
|
18 |
outputs = components.Image(type="pil", label="Output Image")
|
19 |
|
20 |
iface = gr.Interface(
|
@@ -22,7 +21,6 @@ iface = gr.Interface(
|
|
22 |
inputs=image,
|
23 |
outputs=outputs,
|
24 |
title='Garbage Detection',
|
25 |
-
description='A simple demo app for an object detection model to detect garbage in natural and urban environments.'
|
26 |
-
examples=sorted([f'examples/{filename}' for filename in os.listdir('examples')]),
|
27 |
)
|
28 |
-
iface.launch(debug=True)
|
|
|
2 |
import gradio as gr
|
3 |
from gradio import components
|
4 |
from PIL import Image
|
|
|
5 |
|
6 |
model = None
|
7 |
|
|
|
13 |
results.render()
|
14 |
return Image.fromarray(results.ims[0])
|
15 |
|
16 |
+
image = components.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Image")
|
17 |
outputs = components.Image(type="pil", label="Output Image")
|
18 |
|
19 |
iface = gr.Interface(
|
|
|
21 |
inputs=image,
|
22 |
outputs=outputs,
|
23 |
title='Garbage Detection',
|
24 |
+
description='A simple demo app for an object detection model to detect garbage in natural and urban environments.'
|
|
|
25 |
)
|
26 |
+
iface.launch(debug=True)
|