Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -275,11 +275,13 @@ def predict(image):
|
|
275 |
annotated_img = output[0]
|
276 |
# annotated_img = (output[0] / 255.0 - mean)/std
|
277 |
# annotated_img = classes[output[0][0].argmax(0)]
|
278 |
-
print("
|
279 |
-
print(annotated_img)
|
|
|
|
|
280 |
|
281 |
# Convert to PIL Image
|
282 |
-
annotated_img = Image.fromarray(annotated_img)
|
283 |
|
284 |
return annotated_img
|
285 |
|
@@ -287,8 +289,8 @@ def predict(image):
|
|
287 |
demo = gr.Interface(
|
288 |
fn=predict,
|
289 |
inputs=gr.Image(sources=["webcam"], type="numpy"), # Accepts image input
|
290 |
-
|
291 |
-
outputs=gr.Image(type="pil"), # Accepts image input
|
292 |
)
|
293 |
|
294 |
if __name__ == "__main__":
|
|
|
275 |
annotated_img = output[0]
|
276 |
# annotated_img = (output[0] / 255.0 - mean)/std
|
277 |
# annotated_img = classes[output[0][0].argmax(0)]
|
278 |
+
print("Annotated image type:", type(annotated_img))
|
279 |
+
print("Annotated image:", annotated_img)
|
280 |
+
print("Min value of image:", np.min(annotated_img))
|
281 |
+
print("Max value of image:", np.max(annotated_img))
|
282 |
|
283 |
# Convert to PIL Image
|
284 |
+
# annotated_img = Image.fromarray(annotated_img)
|
285 |
|
286 |
return annotated_img
|
287 |
|
|
|
289 |
demo = gr.Interface(
|
290 |
fn=predict,
|
291 |
inputs=gr.Image(sources=["webcam"], type="numpy"), # Accepts image input
|
292 |
+
outputs="image" # Customize based on your output format
|
293 |
+
# outputs=gr.Image(type="pil"), # Accepts image input
|
294 |
)
|
295 |
|
296 |
if __name__ == "__main__":
|