Coder Social home page Coder Social logo

aihgf / fashionai-keypoints-detection-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alwc/fashionai-keypoints-detection-pytorch

0.0 2.0 0.0 1.5 MB

[WIP] A refactored version of https://github.com/gathierry/FashionAI-KeyPointsDetectionOfApparel

License: Apache License 2.0

Python 3.72% Jupyter Notebook 96.28%

fashionai-keypoints-detection-pytorch's Introduction

Introduction

The code is originally from Shiyu's GitHub repository (gathierry/FashionAI-KeyPointsDetectionOfApparel/), which provided his solution that achieved LB 3.82% in Tianchi FashionAI Global Challenge, 17th place out 2322 teams. For educational purpose, I've refactored most of his code and added plenty of documentations to help me understand what's happening behind the scene.

I could have made some mistakes along the way. For the most accurate implementation, please check the original repository.

Model overview

The code uses Cascaded Pyramid Network (CPN), which wins the 2017 COCO Keypoints Challenge. In Shiyu's implementation, he made a variety of modification and found two models perform the best: 1) CPN with pretrained ResNet-152 backbone and 2) CPN with pretrained SENet-154.

Here are some additional literatures that I've found useful to understand the models:

Requirements

Here are the key libraries that I've used to run the models:

  • Python 3.6.5
  • CUDA Toolkit 9.0+
  • torch 0.4.0
  • cv2
  • pandas
  • numpy
  • fire
  • nvidia-ml-py3
  • py3nvml
  • visdom

The easiest way to run the code is to use Docker image provided by FloydHub: docker pull floydhub/pytorch:0.4.0-gpu.cuda9cudnn7-py3.30. You'll need nvidia-docker if you're running Docker on GPUs.

Data Preparation

I follow the same directory structure as gathierry/FashionAI-KeyPointsDetectionOfApparel/. You can download FashionAI dataset from here (Login required).

Make sure to change the proj_path and db_path in utils/config.py.

Training / Evaluation / Prediction

Below are sample commands for running the models. Feel free to change/add keyword arguments by looking at utils/config.py.

To train:

python3 trainval.py main --category=skirt --model=cpn-senet --lr=1e-5
python3 trainval.py main --category=outwear --model=cpn-resnet
python3 trainval.py main --category=blouse --model=ensemble --batch_size=8

To evaluate:

python3 evaluate/predict_one.py main --category=outwear --model=cpn-resnet
python3 evaluate/predict_ensemble.py main --category=dress --model=ensemble

To predict (for submission):

python3 submission/predict_one.py main --category=outwear --model=cpn-senet
python3 submission/predict_ensemble.py main --category=dress --model=ensemble

fashionai-keypoints-detection-pytorch's People

Contributors

alwc avatar

Watchers

James Cloos avatar AIHGF avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.