Speed up preprocessing.
This commit is contained in:
@@ -199,7 +199,8 @@ class TopDown:
|
||||
# See: /mmpose/models/pose_estimators/topdown.py - add_pred_to_datasample()
|
||||
th, tw = region.shape[:2]
|
||||
bw, bh = [p.box[2] - p.box[0], p.box[3] - p.box[1]]
|
||||
kp[:, :2] = kp[:, :2] / np.array([tw, th]) * np.array([bw, bh])
|
||||
kp[:, :2] /= np.array([tw, th])
|
||||
kp[:, :2] *= np.array([bw, bh])
|
||||
kp[:, :2] += np.array([p.box[0] + bw / 2, p.box[1] + bh / 2])
|
||||
kp[:, :2] -= 0.5 * np.array([bw, bh])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user