Train, validation, and test all work. Random images don't

Viewed 19

I pulled some data off Kaggle (https://www.kaggle.com/datasets/ashishjangra27/gender-recognition-200k-images-celeba) to make a gender classifier and the train, validation, and testing all work well. However, when I pull images off the internet, it always classifies as male. The images on Kaggle are very diverse and I have tried training over 20,000 images (the test set on Kaggle). I decided to not use the train and validation as they seemed like overkill. I have a high accuracy on train, test, and validate and if I test with any of the images given to me in their dataset, it works perfectly (even the ones from the train and validation folders which I didn't use to train). But pulling images off the internet only classifies as male.

Link to code: https://github.com/Preebie/MaleOrFemale/blob/main/GenClassv2/Untitled.ipynb

Any help on the issue or best practices (or literally anything) would be appreciated! Thank you!!

0 Answers
Related