From 053ea8c61280e0e8af5956afa805781fd4fd4764 Mon Sep 17 00:00:00 2001 From: KanagawaYamada Date: Sun, 13 Sep 2026 22:31:34 +0700 Subject: [PATCH] Fix invert X and Y? (not yet tested much) Signed-off-by: KanagawaYamada --- tracker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracker.py b/tracker.py index 47c3a8f..667e118 100644 --- a/tracker.py +++ b/tracker.py @@ -745,8 +745,8 @@ class Tracker(): t_off_y = np.take_along_axis(tensor[c1:c2].reshape((c0,self.out_res_i * self.out_res_i)), indices, 1).reshape((c0,)) t_off_x = res * logit_arr(t_off_x, self.logit_factor) t_off_y = res * logit_arr(t_off_y, self.logit_factor) - t_x = crop_y1 + scale_y * (res * np.floor(t_m / self.out_res_i) / self.out_res + t_off_x) - t_y = crop_x1 + scale_x * (res * np.floor(np.mod(t_m, self.out_res_i)) / self.out_res + t_off_y) + t_x = crop_x1 + scale_x * (res * np.mod(t_m, self.out_res_i) / self.out_res + t_off_x) + t_y = crop_y1 + scale_y * (res * np.floor(t_m / self.out_res_i) / self.out_res + t_off_y) avg_conf = np.average(t_conf) lms = np.stack([t_x, t_y, t_conf], 1) lms[np.isnan(lms).any(axis=1)] = np.array([0.,0.,0.], dtype=np.float32) @@ -1172,7 +1172,7 @@ class Tracker(): lms = face_info.lms[:, 0:2] x1, y1 = tuple(lms[0:66].min(0)) x2, y2 = tuple(lms[0:66].max(0)) - bbox = (y1, x1, y2 - y1, x2 - x1) + bbox = (x1, y1, x2 - x1, y2 - y1) face_info.bbox = bbox detected.append(bbox) results.append(face_info)