This repo is code of FashionAI Global Challenge—Attributes Recognition of Apparel based on PyTorch. This repo only for learning.
- Operating system: Ubuntu 17.10
- Data would take up to 25GB disk memory
- Memory cost would be around 20GB
- Dependencies:
- CUDA and cuDNN with GPU
- PyTorch with packages (torchvision) installed
-
Download this repo
git clone https://github.com/Lmy0217/FashionAI.git cd FashionAI
-
Install requirements
pip3 install -r requirements.txt
-
(Unnecessary) Download the Attributes Recognition of Apparel dataset and extract the tar file in the folder
datasets
(now, this folder should contain three folder named 'base', 'web' and 'rank' respectively)
The training and testing scripts come with several options, which can be listed with the --help
flag.
python3 main.py --help
To run the training and testing, simply run main.py. By default, the script runs resnet34 on attribute 'coat_length_labels' with 50 epochs.
To training and testing resnet34 on attribute 'collar_design_labels' with 100 epochs and some learning parameters:
python3 main.py --model 'resnet34' --attribute 'collar_design_labels' --epochs 100 --batch-size 128 --lr 0.01 --momentum 0.5
Every epoch trained model will be saved in the folder save/[attribute]/[model]
.
The code is licensed with the MIT license.