From afe56f80119e7725dafd782e8f78e33ff4bd6db1 Mon Sep 17 00:00:00 2001 From: 2AJ <62715949+2AJ@users.noreply.github.com> Date: Thu, 27 Jan 2022 21:59:41 +0300 Subject: [PATCH] Update __init__.py replace two calls to np.swapaxes with a single np.rollaxis --- detectors/dsfd/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/detectors/dsfd/__init__.py b/detectors/dsfd/__init__.py index 3f56333..bf06116 100644 --- a/detectors/dsfd/__init__.py +++ b/detectors/dsfd/__init__.py @@ -34,8 +34,7 @@ def detect_faces(self, image, conf_th=0.8, scales=[1]): for s in scales: scaled_img = cv2.resize(image, dsize=(0, 0), fx=s, fy=s, interpolation=cv2.INTER_LINEAR) - scaled_img = np.swapaxes(scaled_img, 1, 2) - scaled_img = np.swapaxes(scaled_img, 1, 0) + scaled_img = np.rollaxis(scaled_img, 2, 0) scaled_img = scaled_img[[2, 1, 0], :, :] scaled_img = scaled_img.astype('float32') scaled_img -= img_mean