lmoroney / dlaicourse

Notebooks for learning deep learning
5.66k stars 5.38k forks source link

Image classification code, image rescaling missing when images uploaded (rock paper scissors and horse/humans dataset) #129

Open HaraBeron opened 3 years ago

HaraBeron commented 3 years ago

I have a comment regarding the following code: https://github.com/lmoroney/dlaicourse/blob/09767115b53c8ac99df7b85fc67a3cea9fed2482/Course%202%20-%20Part%208%20-%20Lesson%202%20-%20Notebook%20(RockPaperScissors).ipynb

At the end there are images uploaded and the model applied to give predictions for the specific uploaded image. However, we should also rescale the values to [0,1] (by dividing by 255). We are doing this when applying the imagedatagenerator. When we manually upload the images, we just resize, but don't rescale. It is necessary to add the rescaling.

Same problem in case of horse and humans in the parts where images are uploaded (uploaded = files.upload()): https://github.com/lmoroney/dlaicourse/blob/842e3b1099082dc8631301c26afb6ec71f158eee/Course%201%20-%20Part%208%20-%20Lesson%204%20-%20Notebook.ipynb

https://github.com/lmoroney/dlaicourse/blob/8349cf3839603254b2e41fcc15007f6b8a0de39c/Course%201%20-%20Part%208%20-%20Lesson%202%20-%20Notebook.ipynb

https://github.com/lmoroney/dlaicourse/blob/8349cf3839603254b2e41fcc15007f6b8a0de39c/Course%201%20-%20Part%208%20-%20Lesson%203%20-%20Notebook.ipynb

https://github.com/lmoroney/dlaicourse/blob/842e3b1099082dc8631301c26afb6ec71f158eee/Horse_or_Human_NoValidation.ipynb

chinitaberrio commented 3 years ago

I have noticed the same! I tried to reach out to Coursera but it was impossible to get an answer.