Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,7 +47,7 @@ def visualize_prediction(img, output_dict, threshold=0.5, id2label=None):
|
|
| 47 |
if id2label is not None:
|
| 48 |
labels = [id2label[x] for x in labels]
|
| 49 |
|
| 50 |
-
plt.figure(figsize=(
|
| 51 |
plt.imshow(img)
|
| 52 |
ax = plt.gca()
|
| 53 |
colors = COLORS * 100
|
|
@@ -136,7 +136,7 @@ with demo:
|
|
| 136 |
with gr.Row():
|
| 137 |
with gr.Column():
|
| 138 |
url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
|
| 139 |
-
original_image = gr.Image(shape=(
|
| 140 |
with gr.Column():
|
| 141 |
img_output_from_url = gr.Image(shape=(750,750))
|
| 142 |
|
|
@@ -148,7 +148,7 @@ with demo:
|
|
| 148 |
with gr.TabItem('Image Upload'):
|
| 149 |
with gr.Row():
|
| 150 |
img_input = gr.Image(type='pil',shape=(750,750))
|
| 151 |
-
img_output_from_upload= gr.Image()
|
| 152 |
|
| 153 |
with gr.Row():
|
| 154 |
example_images = gr.Dataset(components=[img_input],
|
|
@@ -159,7 +159,7 @@ with demo:
|
|
| 159 |
|
| 160 |
with gr.TabItem('WebCam'):
|
| 161 |
with gr.Row():
|
| 162 |
-
web_input = gr.Image(source='webcam',type='pil',shape=(
|
| 163 |
img_output_from_webcam= gr.Image(shape=(750,750))
|
| 164 |
|
| 165 |
cam_but = gr.Button('Detect')
|
|
|
|
| 47 |
if id2label is not None:
|
| 48 |
labels = [id2label[x] for x in labels]
|
| 49 |
|
| 50 |
+
plt.figure(figsize=(50, 50))
|
| 51 |
plt.imshow(img)
|
| 52 |
ax = plt.gca()
|
| 53 |
colors = COLORS * 100
|
|
|
|
| 136 |
with gr.Row():
|
| 137 |
with gr.Column():
|
| 138 |
url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
|
| 139 |
+
original_image = gr.Image(shape=(750,750))
|
| 140 |
with gr.Column():
|
| 141 |
img_output_from_url = gr.Image(shape=(750,750))
|
| 142 |
|
|
|
|
| 148 |
with gr.TabItem('Image Upload'):
|
| 149 |
with gr.Row():
|
| 150 |
img_input = gr.Image(type='pil',shape=(750,750))
|
| 151 |
+
img_output_from_upload= gr.Image(750,750)
|
| 152 |
|
| 153 |
with gr.Row():
|
| 154 |
example_images = gr.Dataset(components=[img_input],
|
|
|
|
| 159 |
|
| 160 |
with gr.TabItem('WebCam'):
|
| 161 |
with gr.Row():
|
| 162 |
+
web_input = gr.Image(source='webcam',type='pil',shape=(750,750),streaming=True)
|
| 163 |
img_output_from_webcam= gr.Image(shape=(750,750))
|
| 164 |
|
| 165 |
cam_but = gr.Button('Detect')
|