Skip to content

Commit 0a02dd1

Browse files
authored
Update transforms.py
1 parent 63d564b commit 0a02dd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/utils/transforms.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def flip_back(output_flipped, matched_parts):
1919
assert output_flipped.ndim == 4,\
2020
'output_flipped should be [batch_size, num_joints, height, width]'
2121

22-
output_flipped = output_flipped[:, :, :, ::-1]
22+
output_flipped = output_flipped[:, :, :, ::-1]#沿着width左右翻转
2323

24-
for pair in matched_parts:
24+
for pair in matched_parts:#大概率是用于tracking的吧 左右翻转之后关键点坐标也要翻一下??
2525
tmp = output_flipped[:, pair[0], :, :].copy()
2626
output_flipped[:, pair[0], :, :] = output_flipped[:, pair[1], :, :]
2727
output_flipped[:, pair[1], :, :] = tmp
@@ -82,7 +82,7 @@ def get_affine_transform(
8282
dst[2:, :] = get_3rd_point(dst[0, :], dst[1, :])
8383

8484
if inv:
85-
trans = cv2.getAffineTransform(np.float32(dst), np.float32(src))
85+
trans = cv2.getAffineTransform(np.float32(dst), np.float32(src))#仿射变换 保持二维图形的平直性
8686
else:
8787
trans = cv2.getAffineTransform(np.float32(src), np.float32(dst))
8888

0 commit comments

Comments
 (0)