Predicting-Clothing-Types
Predicting 10 different clothing types using Xception pre-trained model from Keras library. It is reimplemented version from lesson 8-deep learning held by DataTalksClub.
Model Demo
About the Dataset
Data Source
I use the dataset from here: https://github.com/alexeygrigorev/clothing-dataset-small
Dataset Information
This is a small dataset contains 10 different clothing types (dress, hat, longsleeve, outwear, pants, shirt, shoes, shorts, skirt, t-shirt).
Short Description of the Files
- used transfer learning to get Xception model pretrained on Imagnet.
- freeze its CNN layers and train the dense layers.
- used callbacks to save the best model over multiple epochs.
- did some data augmentation to prevent overfitting and generalize our model.
- Evalutaing the model, Aciheved 90% accuracy.
-
streamlit_DLapp.py It deploy the trained model to streamlit cloud
-
xception_v5_1_10_0.889.h5 - Best model from training saved in this binary format to load it easily.
-
Pipfile and Pipfile.lock - Python package dependencies, in the pipfile you can find all necessary librares and packages to be able to run the scripts with no problem.
How to run this model
- open this link
- Upload an image from test dataset or any image from your device that has one clothing type.
- click on Predict Class button.
Note: watch this video to see the model in action
How to reproduce this model
- clone this repo to get all the code.
- clone the dataset using this command
!git clone git@github.com:alexeygrigorev/clothing-dataset-small.git
- install pipenv -which is a packaging tool that will help installing all dependencies- , use this command on your terminal.
pip install pipenv
- install all dependencies using pipenv by typing this command in your terminal inside your cloned repo folder
pipenv install
- Deploying the app locally or on the web 5.1. Locally: open the terminal and use this command
streamlit run streamlit_DLapp.py
5.2. on the web: check the documentation from official website.
Note
If you like my project, I appreciate you starring this repo. Please feel free to fork the content and contact me if you have any questions.