Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,10 +204,13 @@ if st.session_state.screen == 2:
|
|
| 204 |
height, width, channels = st.session_state.boxed_image.shape
|
| 205 |
st.session_state.blank_img = np.zeros((height + 640, width + 640, 3), np.uint8)
|
| 206 |
st.session_state.blank_img[0:height, 0:width] = st.session_state.boxed_image
|
|
|
|
| 207 |
for i in range(0, width, 600):
|
| 208 |
for j in range(0, height, 600):
|
| 209 |
-
|
| 210 |
-
cv2.
|
|
|
|
|
|
|
| 211 |
st.image(st.session_state.blank_img, use_column_width=True)
|
| 212 |
|
| 213 |
with row5_col3:
|
|
|
|
| 204 |
height, width, channels = st.session_state.boxed_image.shape
|
| 205 |
st.session_state.blank_img = np.zeros((height + 640, width + 640, 3), np.uint8)
|
| 206 |
st.session_state.blank_img[0:height, 0:width] = st.session_state.boxed_image
|
| 207 |
+
|
| 208 |
for i in range(0, width, 600):
|
| 209 |
for j in range(0, height, 600):
|
| 210 |
+
# draw the rectangle
|
| 211 |
+
cv2.rectangle(st.session_state.blank_img, (i, j), (i + 640, j + 640), (0, 255, 0), 10)
|
| 212 |
+
# add the number of the rectangle
|
| 213 |
+
cv2.putText(st.session_state.blank_img, str(int(i / 600) * 10 + int(j / 600)), (i + 200, j + 320), cv2.FONT_HERSHEY_SIMPLEX, 10, (0, 255, 0), 10)
|
| 214 |
st.image(st.session_state.blank_img, use_column_width=True)
|
| 215 |
|
| 216 |
with row5_col3:
|