GithubHelp home page GithubHelp logo

cameronking4 / clothware Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 3.0 1.74 MB

Rendering realistic 3d garments from photo/video

Python 46.56% Shell 0.04% Makefile 0.01% Jupyter Notebook 48.56% Cython 0.42% C++ 1.63% C 0.28% Cuda 2.50%

clothware's Introduction

Digital-clothing

This repository contains a code for obtaining a 3D reconstuction of a garment. This is a "proof-of-concept" version of a potential solution for a garment reconstruction task by monocular images. Currently the code supports 2 types of garment ('shirt', 'pants').

For reconstruction you need to have an image of clothing lying on a flat surface. There are 2 variants of usage:

  • using front side image of a garment;
  • using both: front and back side images.

The reconstruction lies in transfering texture from the image to the corresponding 3D template-mesh of the garment type. The garment type needs to be specified with the input.

Installation

Prerequisites

Setup

conda create -n grecon python=3.7.9
conda activate grecon

# For CUDA 10
# conda install -c pytorch -c conda-forge pytorch=1.10.1 torchvision=0.11.2 cudatoolkit=10.2
# For CUDA 11
conda install -c pytorch -c conda-forge pytorch=1.10.1 torchvision=0.11.2 cudatoolkit=11.1

pip install -r requirements.txt
mkdir input

KDGet installation

cd kgdet/deepfashion2_api/PythonAPI
pip install -e .
cd ../../mmdetection
python setup.py develop
cd ../../

Checkpoints and Meshes

Download checkpoints and meshes and unzip them at the root folder.

Input data

Place a garment images at ./input folder. You can also use another folder for that purpose, but you will need to specify it for demo.py script via --root argument.

You can dowload demo-data here and extract it at the root folder.

Usage

Any of scripts needs to invoked from the root directory. For now there are available 2 possible classes for the reconstruction: shirt and pants.

Note, that a folder for output needs to be empty, otherwise its content will be removed automatically.

After invoking demo.py script check results at the folder specified via --out argument.

usage: demo.py [-h] [--root ROOT] [--out OUT] [--mesh MESH]
               [--checkpoints CHECKPOINTS] --type {pants,shirt} --front FRONT
               [--back BACK] [--verbose]

optional arguments:
  -h, --help            show this help message and exit
  --root ROOT           Directory, where images are placed.
  --out OUT             Directory for output results.
  --mesh MESH           Directory of a folder containing pattern-meshes.
  --checkpoints CHECKPOINTS
                        Directory of a folder containing checkpoints for
                        kgdet.
  --type {pants,shirt}  Target type of garment for reconstruction.
  --front FRONT         Path to image of a front side of a garment.
  --back BACK           Path to image of a front side of a garment.

Example

python demo.py --root ./input --type shirt --front shirt6.jpg --back shirt6_b.jpg 
python demo.py --root ./input/pants1 --type pants --front 1.png
python demo.py --root ./input/pants3 --type pants --front 3_f.png --back 3_b.png 

clothware's People

Contributors

cameronking4 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nrep epem inma8743

clothware's Issues

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.