Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +15 -3
src/streamlit_app.py
CHANGED
|
@@ -151,9 +151,21 @@ if uploaded is not None:
|
|
| 151 |
|
| 152 |
pts = to_xy(pred)
|
| 153 |
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
st.subheader('Keypoints table (x, y)')
|
| 159 |
# Build a nice table using target_cols order
|
|
|
|
| 151 |
|
| 152 |
pts = to_xy(pred)
|
| 153 |
|
| 154 |
+
st.subheader('Prediction (keypoints on original image)')
|
| 155 |
+
|
| 156 |
+
w, h = pil_img.size # original size
|
| 157 |
+
scale_x = w / 96.0
|
| 158 |
+
scale_y = h / 96.0
|
| 159 |
+
|
| 160 |
+
pts_scaled = [(x * scale_x, y * scale_y) for (x, y) in pts]
|
| 161 |
+
|
| 162 |
+
overlay = draw_keypoints(pil_img, pts_scaled)
|
| 163 |
+
st.image(overlay, use_container_width=True)
|
| 164 |
+
|
| 165 |
+
st.subheader('Prediction (keypoints on 96×96)')
|
| 166 |
+
img96 = pil_img.resize((96, 96)).convert('RGB')
|
| 167 |
+
overlay96 = draw_keypoints(img96, pts)
|
| 168 |
+
st.image(overlay96, use_container_width=False)
|
| 169 |
|
| 170 |
st.subheader('Keypoints table (x, y)')
|
| 171 |
# Build a nice table using target_cols order
|