All Projects → zekeriyyaa → MaskRCNN-Modanet-Fashion-Segmentation-and-Classification

zekeriyyaa / MaskRCNN-Modanet-Fashion-Segmentation-and-Classification

Licence: other
Using modanet fashion dataset, the clothes images were classified under 5 season (summer,winter,spring,autumn,all).

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to MaskRCNN-Modanet-Fashion-Segmentation-and-Classification

Baby
Create models from a JSON file, even a Baby can do it.
Stars: ✭ 214 (+289.09%)
Mutual labels:  model
visual-compatibility
Context-Aware Visual Compatibility Prediction (https://arxiv.org/abs/1902.03646)
Stars: ✭ 92 (+67.27%)
Mutual labels:  fashion
color cloth
color_cloth gets the main colors and its proportions from a cloth image ignoring the background, it uses the EM algorithm from OpenCV library, the algorithm needs an image with an item in the center of the picture.
Stars: ✭ 20 (-63.64%)
Mutual labels:  fashion
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (+332.73%)
Mutual labels:  model
Kaleido-BERT
(CVPR2021) Kaleido-BERT: Vision-Language Pre-training on Fashion Domain.
Stars: ✭ 252 (+358.18%)
Mutual labels:  fashion
street2shopTriplet
Challenge the customer to shop task with tripletNet
Stars: ✭ 14 (-74.55%)
Mutual labels:  fashion
Model
The base model traits of Esensi
Stars: ✭ 203 (+269.09%)
Mutual labels:  model
react-native-fashion
Fashion inspiration and shopping app helping you wear that's in style. Made with Typescript & ReactNative.
Stars: ✭ 47 (-14.55%)
Mutual labels:  fashion
Fashion-Clothing-Parsing
FCN, U-Net models implementation in TensorFlow for fashion clothing parsing
Stars: ✭ 29 (-47.27%)
Mutual labels:  fashion
HRNet-for-Fashion-Landmark-Estimation.PyTorch
Fashion Landmark Estimation with HRNet
Stars: ✭ 84 (+52.73%)
Mutual labels:  fashion
Live2dmodel
页面上加载的模型
Stars: ✭ 241 (+338.18%)
Mutual labels:  model
Whc model
iOS平台高效转换引擎json->model,model->json,model->Dictionary,支持模型类继承其他模型类,支持指定路径转换,不区分json的key和模型属性名称大小写,自动处理json中null
Stars: ✭ 244 (+343.64%)
Mutual labels:  model
pytorch-deepfashion
pytorch implementation of the deepfashion architecture (https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Liu_DeepFashion_Powering_Robust_CVPR_2016_paper.pdf)
Stars: ✭ 35 (-36.36%)
Mutual labels:  fashion
Open model zoo
Pre-trained Deep Learning models and demos (high quality and extremely fast)
Stars: ✭ 2,925 (+5218.18%)
Mutual labels:  model
basicwardrobe.info
A website to help you establish a wardrobe.
Stars: ✭ 23 (-58.18%)
Mutual labels:  fashion
Lol Model Viewer
League of legends model and animation viewer based on WebGL. https://tengge1.github.io/lol-model-viewer
Stars: ✭ 211 (+283.64%)
Mutual labels:  model
carbon-footprint
Calculate your carbon footprint 🏭👣 from food, transport, purchases, fashion, electricity and digital activities like streaming, NFT or blockchain.
Stars: ✭ 59 (+7.27%)
Mutual labels:  fashion
Fashion Mnist
A MNIST-like fashion product database. Benchmark 👇
Stars: ✭ 9,675 (+17490.91%)
Mutual labels:  fashion
fashion-parser
Fashion item segmentation with deep learning
Stars: ✭ 22 (-60%)
Mutual labels:  fashion
grailer
web scraping tool for grailed.com
Stars: ✭ 30 (-45.45%)
Mutual labels:  fashion

MaskRCNN-Modanet-Fashion-Segmentation-and-Classification

With the contributions of Sergen and Murat.

The project aims to classify the clothes in terms of its type (shirt, tshirt, pant etc.) and season (summer, winter etc.) simultaneously. Initially, image segmentation was applied to images to get clothes types and their boundaries. Then, the annotations of clothes were generated from boundaries and fed into the image classification model. Concequently, images were classified as skirt_summer, pant_spring, tshirt_autumn etc.

There are three main subprocess exist as given below:

  1. Training Model-1 from Modanet Dataset and Generate Custom Dataset's Labels
  2. Training Model-2 from Custom Dataset
  3. Evaluate test results

For training the model, it is needed to labeled images but our custom dataset is not labeled. There are so many image to label and we do not want to waste time for it. The our idea which can handle this issue is use prelabeled fashion dataset to train a model. And then, our custom dataset is given as input into produced model and got segmentation of clothes as result. From this segmentation result's mask, the labels are produces for each clothes in each images.

In this way, the labels are produced by automatically from using model1. After that, our custom dataset's labels is ready to train for classification of season.

1. Training Model1 from Modanet Dataset and Generate Custom Dataset's Labels

Prepare Modanet Dataset

Modanet dataset has over 40GB fashion clothes images and its annotations. While downloading, it is possible to choice which 40GB or 2GB dataset. In order to more manageable, we prefer 2GB dataset. The annotation data format of ModaNet follows the same style as COCO-dataset.

We suggest that use google colab to download dataset. There is our Modanet-Download-Colab-File.

After download, there are over 10.000 images and json file which is include their labels. We parsed dataset into %80 instances_train.json, %10 instances_test.json and %10 instances_val.json. It is remember that the json file is also need to seperate as given percentages.

But there is an issue that about annotations type. The modanet is provide us annotations with coco format but we used Vgg-annotation type. Therefore, we converted parsed coco json files to vgg json files and located them into train and validation folder as namely via_region_data.json.

As a result, we have given annotations format:

{
 "377": {
  "filename": "0000377.jpg",
  "size": -1,
  "regions": [
   {
    "shape_attributes": {
     "name": "polygon",
     "all_points_x": [
      244,
      247,
      248 ...
     ],
     "all_points_y": [
      234,
      257,
      271 ...
     ]
    },
    "region_attributes": {
     "fashion": "1"
    }
   }
  ],
  "file_attributes": {
   "width": 400,
   "height": 600
  }
 }
}

The dataset should be located into dataset folder with its annotations json file seperately as train and validation. The test images are located into images folder which is located into base folder.

Labels

Each polygon (bounding box, segmentation mask) annotation is assigned to one of the following labels:

Label Description Fine-Grained-categories
1 bag bag
2 belt belt
3 boots boots
4 footwear footwear
5 outer coat/jacket/suit/blazers/cardigan/sweater/Jumpsuits/Rompers/vest
6 dress dress/t-shirt dress
7 sunglasses sunglasses
8 pants pants/jeans/leggings
9 top top/blouse/t-shirt/shirt
10 shorts shorts
11 skirt skirt
12 headwear headwear
13 scarf & tie scartf & tie

Train Model-1 using Modanet Dataset

Our custom training and test files is located into given folder as link. You can start to training without any pretrained model as give model parameter as --model=coco . In this way, the coco weighted model will downloaded automatically. In other option is use own model.

You can run command directly from the command line as such:

# Train a new model starting from pre-trained COCO weights
python3 model1/samples/custom/trainModaNet.py train --dataset=/path/to/coco/ --model=coco

# Continue training a model that you had trained earlier
python3 model1/samples/custom/trainModaNet.py train --dataset=/path/to/coco/ --model=/path/to/weights.h5

# For our model
python3 model1/samples/custom/trainModaNet.py train --dataset=/path/to/coco/ --model=mask_rcnn_Modanet.h5

You can also run the evaluation code with:

# Run evaluation code on the last trained model
python3 testModaNet.py

Segmentation Results

Sample segmentation result is shown as below:

Generate Custom Dataset's Labels

Our custom dataset was passing into trained model mask_rcnn_Modanet.h5 as input. As a result, we got segmentation of clothes. The segmentation result has mask of segmented clothes and their class ID. Using this mask we produced detected clothes's boundaries and their labels as vgg annotation type. This is how we can handle the issue which is already talked above as our unlabel dataset.

The generateVggAnno.py file is used for generate vgg annotations from our custom dataset. It is used mask_rcnn_Modanet.h5 model for images segmentation and labelling them.

# Run evaluation code on the last trained model
python3 generateVggAnno.py

After the run generateVggAnno.py, the custom_dataset_annotations.json is produced as a result on the same folder. We use this annotations file for training model-2.

2. Training Model-2 from Custom Dataset

Prepare Custom Dataset

After the annotations are generated from previous step as custom_dataset_annotations.json, the json file and also dataset is parsed into %80 train, %10 validation and test as given percentage. The annotations files for train and validation images namely via_region_data.json are also located into same folder with train and validation images under dataset folder. The test images are located into images folder which is located into base folder.

Labels

Our custom dataset has normally 10 different fashion and its season labels. We can get class name and season label from images file name. In the generateVggAnno.py, these file names are used for generate annotations. Actually each class has 5 subclass which specified seasons as summer, winter, autumn, spring and all. Because of unsufficient number of sample, we had to decrease class label and just use the most exist ones.

Each polygon (bounding box, segmentation mask) annotation is assigned to one of the following labels:

usage: fashionClassName_category

Categories: yaz->summer, sonb->autumn, ilkb->spring, kis->winter, 4mev->all

Label Description
1 skirt_yaz
2 bag_yaz
3 footwear_sonb
4 top_yaz
5 bag_4mev
6 footwear_yaz
7 footwear_kis
8 shorts_yaz
9 skirt_ilkb

Train Model-2 using Custom Dataset

Our custom training and test files is located into given folder as link. You can start to training without any pretrained model as give model parameter as --model=coco . In this way, the coco weighted model will downloaded automatically. In other option is use own model. But we prefer use our pretrained model produced from model-1 --model=mask_rcnn_Modanet.h5-rcnn-

You can run command directly from the command line as such:

# Train a new model starting from pre-trained COCO weights
python3 model2/samples/custom/trainSeasonData.py train --dataset=/path/to/coco/ --model=coco

# Continue training a model that you had trained earlier
python3 model2/samples/custom/trainSeasonData.py train --dataset=/path/to/coco/ --model=/path/to/weights.h5

# For our model
python3 model2/samples/custom/trainSeasonData.py train --dataset=/path/to/coco/ --model=mask_rcnn_Modanet.h5

3. Evaluate test results

After the training of model-2 from custom dataset, the mask_rcnn_Modanet.h5 is produced as result. And now using this model, we can get seasons of clothes from given images as input.

You can run the evaluation code with:

# Run evaluation code on the last trained model
python3 testSeason.py

Compare Model-1 and Model-2 Results

Model-1 Outputs Model-2 Outputs
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].