arcface-pytorch icon indicating copy to clipboard operation
arcface-pytorch copied to clipboard

Question of the test.py?

Open Lin-plax opened this issue 2 years ago • 3 comments

def load_image(img_path): image = cv2.imread(img_path, 0) #image = cv2.resize(image, (112,112)).astype('float32') image = cv2.resize(image, (128,128)).astype('float32') if image is None: return None image = np.dstack((image, np.fliplr(image))) image = image.transpose((2, 0, 1)) image = image[:, np.newaxis, :, :] image = image.astype(np.float32, copy=False) image -= 127.5 image /= 127.5 return image

why the number is 127.5 but not 128?

Lin-plax avatar Feb 06 '23 08:02 Lin-plax