Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -301,7 +301,10 @@ def predict(image):
|
|
| 301 |
print("annotated_img shape after normalization:", annotated_img.shape)
|
| 302 |
|
| 303 |
# Convert to PIL Image
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
return annotated_img
|
| 307 |
|
|
@@ -309,8 +312,8 @@ def predict(image):
|
|
| 309 |
demo = gr.Interface(
|
| 310 |
fn=predict,
|
| 311 |
inputs=gr.Image(sources=["webcam"], type="numpy"), # Accepts image input
|
| 312 |
-
outputs="image" # Customize based on your output format
|
| 313 |
-
|
| 314 |
)
|
| 315 |
|
| 316 |
if __name__ == "__main__":
|
|
|
|
| 301 |
print("annotated_img shape after normalization:", annotated_img.shape)
|
| 302 |
|
| 303 |
# Convert to PIL Image
|
| 304 |
+
annotated_img = Image.fromarray(annotated_img)
|
| 305 |
+
|
| 306 |
+
print("PIL Image type:", type(annotated_img))
|
| 307 |
+
# print("PIL Image shape:", annotated_img.shape)
|
| 308 |
|
| 309 |
return annotated_img
|
| 310 |
|
|
|
|
| 312 |
demo = gr.Interface(
|
| 313 |
fn=predict,
|
| 314 |
inputs=gr.Image(sources=["webcam"], type="numpy"), # Accepts image input
|
| 315 |
+
# outputs="image" # Customize based on your output format
|
| 316 |
+
outputs=gr.Image(type="pil"), # Accepts image input
|
| 317 |
)
|
| 318 |
|
| 319 |
if __name__ == "__main__":
|