【发布时间】:2020-10-18 02:49:11
【问题描述】:
我正在尝试使用 streamlit 展示我的深度学习工作,其中涉及在图像中检测到的对象上绘制矩形。但是,在其上看不到矩形。那么它有什么问题呢?
这里是sn-p的代码:
fig, ax = plt.subplots(1, 1, figsize=(32, 16))
for box in boxes:
x1, y1, x2, y2 = box
cv2.rectangle(img=sample,
pt1=(y1, x1),
pt2=(y2, x2),
color=(0, 0, 255), thickness=3)
ax.set_axis_off()
im = ax.imshow(sample)
st.pyplot()
st.write("# Results")
st.dataframe(pd.DataFrame(results))
【问题讨论】:
-
您可以尝试打印
x1, y1, x2, y2吗? -
我试过了,还是不行。
标签: python opencv drawrectangle streamlit