Skip to content

Fix resize scale bug in lab_4.ipynb#90

Merged
RohanAlexander merged 1 commit intomainfrom
89-bug-lab-4-preprocess_input-requires-0255-input-multiply-input_image-by-255-before-calling
Oct 29, 2025
Merged

Fix resize scale bug in lab_4.ipynb#90
RohanAlexander merged 1 commit intomainfrom
89-bug-lab-4-preprocess_input-requires-0255-input-multiply-input_image-by-255-before-calling

Conversation

@alexwolson
Copy link
Contributor

  • Add scaling by 255 after skimage.transform.resize to convert from [0,1] to [0,255] range
  • ResNet50 preprocess_input expects [0,255] range, not [0,1] range
  • Fixes incorrect predictions caused by wrong preprocessing
  • Applied to both cat image classification and webcam exercise cells
  • Students still implement preprocess_input and predict steps themselves

Fixes #89

- Add scaling by 255 after skimage.transform.resize to convert from [0,1] to [0,255] range
- ResNet50 preprocess_input expects [0,255] range, not [0,1] range
- Fixes incorrect predictions caused by wrong preprocessing
- Applied to both cat image classification and webcam exercise cells
- Students still implement preprocess_input and predict steps themselves
@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@RohanAlexander RohanAlexander merged commit e37178f into main Oct 29, 2025
1 check passed
@alexwolson alexwolson deleted the 89-bug-lab-4-preprocess_input-requires-0255-input-multiply-input_image-by-255-before-calling branch October 29, 2025 00:24
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

Successfully merging this pull request may close these issues.

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

2 participants