Skip to content

[Bug]: Lab 4 preprocess_input requires 0–255 input — multiply input_image by 255 before calling #89

@alexwolson

Description

@alexwolson

Describe your issue

skimage.transform.resize returns float images in [0.0, 1.0]. The ResNet50 preprocess_input expects image pixel values in the 0–255 range. If the image is not scaled up, the preprocessing is incorrect and the model produces wrong predictions.

Steps to reproduce

Run the notebook cell that resizes the image and calls preprocess_input (in section Classification of an Image in lab_4.ipynb).
Observe decoded predictions; they will be incorrect or meaningless.

What was the expected result?

preprocess_input should receive image values in the 0–255 range (float32 or uint8) so that the model preprocessing (mean subtraction / scaling) works as intended and predictions are meaningful.

Put here any screenshots or videos (optional)

No response

Put here the code owner you'd like to review this issue.

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions