Skip to content

Question of the test.py? #108

@Lin-plax

Description

@Lin-plax

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions