Git Product home page Git Product logo

garment_generation's Introduction

GAN-based Garment Generation Using Sewing Pattern Images

We propose a garment generation model, which can support most gar-ment topologies and patterns, human body shapes and sizes, and garment materials.

GAN-based Garment Generation Using Sewing Pattern Images
Yu Shen, Junbang Liang, Ming C. Lin. University of Maryland, College Park In ECCV 2020.

  • Our results

Prerequisites

  • Linux
  • Python 2 or 3
  • NVIDIA GPU (11G memory or larger) + CUDA cuDNN

Getting Started

Installation

Python: dominate, geomloss, OpenCV, PyTorch C++: OpenCV CMake

Dataset

  • We publish a garment dataset here (122G).

Folder name format: C[ID1]M[ID2]H[ID3], where ID1 represents 3-digit cloth id, ID2 represents 2-digit material id, ID3 represents 2-digit human body sequence id, e.g., C050M00H03.

In each folder, [ID4]_00.obj is garment model file, where ID4 represents garment model id in this sequence, while obs[ID5]_00.obj is human model file, where ID5 represents human model id in this sequence. Also, gt.pkl contains the original human pose and shape information, and we provide python script to extract them in the next step.

The raw dataset (including sewing patterns) we used came from multiple sources, and some of them are public available:

  • Dataset from the Research Group led by Prof. Huamin Wang (Ohio State University): here
  • Dataset from the Research Group led by Prof. Alla Sheffer (University of British Columbia): here, here

Data preparation

Extract human pose and shape from pkl file

python extract_pose_shape.py [dataset path] [output path]

Sample:

python extract_pose_shape.py all_data/garment_dataset all_data/train_data

Prepare displacement_map, dp_map, and legal_map

Compile reconstruction/new_enc.cpp with provided CMakeList.txt

cd reconstruction
mkdir build
cd build
cmake ../
make

You will get an executable file "ProcessMesh". Then run bash file

cd ../../script/batch_multithread.sh
batch batch_multithread.sh

Remember to modify the folder path in the bash file.

2D garment representation generation

Config

Check options/base_options.py e.g., --name, --dataroot Check options/train_options.py Check options/test_options.py

Training

Notice the files should be aligned in folders train_pose, train_shape, train_legal_map, train_displacement_map

python train.py

After training, see checkpoints in ./checkpoints/[name]

Testing

Set test_legal_map, test_pose, and test_shape. Keep reconstruct_dp_map.

python test.py

Reconstruction

First create reconstruct_mesh under your target folder. Then

cd reconstruction
mkdir build
cd build
cmake ../
make
./ProcessMesh 1 ../../results/[name]/test_latest/images/ [training data path]/reconstruct_dp_map/ [training data path]/test_legal_map/ [output path] 0 7

Sample:

./ProcessMesh 1 ../../results/garments/test_latest/images/ ../../all_data/train_data/reconstruct_dp_map/ ../../all_data/train_data/test_legal_map/ ../../all_data/train_data/ 0 7

Then you can find the new garments in [output path]/reconstruct_mesh folder.

Citation

If you find this useful for your research, please use the following.

@inproceedings{shen2020garmentgeneration,
  title={GAN-based Garment Generation Using Sewing Pattern Images},
  author={Yu Shen and Junbang Liang and Ming C. Lin},  
  booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
  year={2020}
}

Acknowledgments

We would like to thank the Research Groups led by Prof. Eitan Grinspun (Columbia University), Prof. Alla Sheffer (University of British Columbia), and Prof. Huamin Wang (Ohio State University) for sharing their design patterns datasets for the benchmarking and demonstration in this paper.

This code borrows heavily from NVIDIA/pix2pixHD. Also, Junbang Liang made great contribution in this project.

garment_generation's People

Contributors

yushen0118 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.