Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question of the test.py? #108

Open
Lin-plax opened this issue Feb 6, 2023 · 3 comments
Open

Question of the test.py? #108

Lin-plax opened this issue Feb 6, 2023 · 3 comments

Comments

@Lin-plax
Copy link

Lin-plax commented Feb 6, 2023

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?

@tumble-weed
Copy link

if range of values in uint8 is between 0-255, then using 127.5 as mean makes minimum to be -127.5 and maximum to 127.5. try it with 128, and it wont be equal

@mtalhaubaid
Copy link

@tumble-weed @Lin-plax @ronghuaiyang do you have requirements file to run this repo?

@tumble-weed
Copy link

sorry @mtalhaubaid am not a maintainer of the repo, and since i tried running it within an existing environment, the requirements will be cluttered with other libraries as well as conda installed libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants