Spaces:
Runtime error
Runtime error
sfmig
commited on
Commit
·
8dab660
1
Parent(s):
b761da9
adding cat pb
Browse files
DLC_models/DLC_Cat_resnet_50_iteration-0_shuffle-0/snapshot-75000.pb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d44893d1d7a0a07afd37b28c8c00cd8178ae69a0ff49152f16c08c53b8efa4da
|
| 3 |
+
size 98887790
|
app.py
CHANGED
|
@@ -116,6 +116,7 @@ def predict_dlc(list_np_crops,DLCmodel,dlc_proc):
|
|
| 116 |
|
| 117 |
list_kpts_per_crop = []
|
| 118 |
for crop in list_np_crops:
|
|
|
|
| 119 |
keypts = dlc_live.get_pose(crop) # third column is llk!
|
| 120 |
list_kpts_per_crop.append(keypts)
|
| 121 |
|
|
@@ -145,11 +146,11 @@ def predict_pipeline(img_input):
|
|
| 145 |
|
| 146 |
|
| 147 |
# # Produce final image
|
| 148 |
-
fig = plt.Figure(md_results.imgs[0].shape[:2]) #figsize=(10,10)) #md_results.imgs[0].shape)
|
| 149 |
for ic, (np_crop, kpts_crop) in enumerate(zip(list_crops,
|
| 150 |
list_kpts_per_crop)):
|
| 151 |
|
| 152 |
-
|
| 153 |
img_crop = Image.fromarray(np_crop)
|
| 154 |
draw_keypoints_on_image(img_crop,
|
| 155 |
kpts_crop, # a numpy array with shape [num_keypoints, 2].
|
|
@@ -157,9 +158,8 @@ def predict_pipeline(img_input):
|
|
| 157 |
radius=2,
|
| 158 |
use_normalized_coordinates=False) # if True, then I should use md_results.xyxyn
|
| 159 |
|
| 160 |
-
|
| 161 |
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.paste
|
| 162 |
-
|
| 163 |
img_input.paste(img_crop,
|
| 164 |
box = tuple([int(math.floor(t)) for t in md_results.xyxy[0][ic,:2]]))
|
| 165 |
|
|
|
|
| 116 |
|
| 117 |
list_kpts_per_crop = []
|
| 118 |
for crop in list_np_crops:
|
| 119 |
+
# scale crop?
|
| 120 |
keypts = dlc_live.get_pose(crop) # third column is llk!
|
| 121 |
list_kpts_per_crop.append(keypts)
|
| 122 |
|
|
|
|
| 146 |
|
| 147 |
|
| 148 |
# # Produce final image
|
| 149 |
+
# fig = plt.Figure(md_results.imgs[0].shape[:2]) #figsize=(10,10)) #md_results.imgs[0].shape)
|
| 150 |
for ic, (np_crop, kpts_crop) in enumerate(zip(list_crops,
|
| 151 |
list_kpts_per_crop)):
|
| 152 |
|
| 153 |
+
## Draw keypts on crop
|
| 154 |
img_crop = Image.fromarray(np_crop)
|
| 155 |
draw_keypoints_on_image(img_crop,
|
| 156 |
kpts_crop, # a numpy array with shape [num_keypoints, 2].
|
|
|
|
| 158 |
radius=2,
|
| 159 |
use_normalized_coordinates=False) # if True, then I should use md_results.xyxyn
|
| 160 |
|
| 161 |
+
## Paste crop in original image
|
| 162 |
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.paste
|
|
|
|
| 163 |
img_input.paste(img_crop,
|
| 164 |
box = tuple([int(math.floor(t)) for t in md_results.xyxy[0][ic,:2]]))
|
| 165 |
|