Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -834,6 +834,17 @@ from your webcam and run YOLOv8 detection on it.
|
|
| 834 |
st.image(result["annotated_image"], caption="Detections", width=520)
|
| 835 |
st.write(f"YOLO inference time: {result['yolo_inference_time_sec']*1000:.1f} ms")
|
| 836 |
st.write(f"Number of detections: {len(result['detections'])}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 837 |
|
| 838 |
|
| 839 |
# ------------------------------------------------------------
|
|
|
|
| 834 |
st.image(result["annotated_image"], caption="Detections", width=520)
|
| 835 |
st.write(f"YOLO inference time: {result['yolo_inference_time_sec']*1000:.1f} ms")
|
| 836 |
st.write(f"Number of detections: {len(result['detections'])}")
|
| 837 |
+
if result["detections"]:
|
| 838 |
+
st.markdown("### Detected objects")
|
| 839 |
+
df_det = pd.DataFrame([
|
| 840 |
+
{
|
| 841 |
+
"YOLO label": det["label"],
|
| 842 |
+
"YOLO confidence level": det["conf_yolo"],
|
| 843 |
+
|
| 844 |
+
}
|
| 845 |
+
for det in result["detections"]
|
| 846 |
+
])
|
| 847 |
+
st.dataframe(df_det, width = 520)
|
| 848 |
|
| 849 |
|
| 850 |
# ------------------------------------------------------------
|