Preyanshz commited on
Commit
9bfe85b
·
verified ·
1 Parent(s): c686517

Update app.py

Browse files

fixed rgb format

Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -79,10 +79,9 @@ def yolo_inference_tool():
79
 
80
  # Annotated image
81
  try:
82
- annotated_img_bgr = r.plot(conf=True, boxes=True, labels=True)
83
- annotated_img_rgb = Image.fromarray(annotated_img_bgr[..., ::-1])
84
  st.subheader("Annotated Image")
85
- st.image(annotated_img_rgb, caption="Inference Output", use_container_width=True)
86
  except Exception as e:
87
  st.error(f"Error generating annotated image: {e}")
88
 
 
79
 
80
  # Annotated image
81
  try:
82
+ annotated_img_pil = r.plot(conf=True, boxes=True, labels=True, pil=True)
 
83
  st.subheader("Annotated Image")
84
+ st.image(annotated_img_pil, caption="Inference Output", use_container_width=True)
85
  except Exception as e:
86
  st.error(f"Error generating annotated image: {e}")
87