Giter Site home page Giter Site logo

cp-vtryon-plus-flask-app's Introduction

cp-VTryon-plus-Flask-App

Falsk App version of https://github.com/minar09/cp-vton-plus (CPU based) for custom images. Thank you so much @minar09 for your Great Work!!!

Installation

conda install pytorch=0.4.1 torchvision=0.2.1 -c pytorch. For all packages, run pip install -r requirements.txt

Pretrained Models

Download pretrained models and paste in folder "checkpoints/"

Tryon(GMM & TOM)Models - https://1drv.ms/u/s!Ai8t8GAHdzVUiQA-o3C7cnrfGN6O?e=EaRiFP

Graphonomy - https://drive.google.com/uc?id=1eUe18HoH05p0yFUd_sN6GXdTj82aW0m9

OpenPose - !wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel and openpose_pose_coco.prototxt

Testing with custom images

to run the model with custom internet images, make sure you have the following:

Create "data/test/cloth, cloth-mask, image, image-mask, image-parse, image-parse-new, pose, warp-cloth, warp-mask" (total 9 folders)

  1. image (image of a person, crop/resize to 192 x 256 (width x height) pixels) - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L44

  2. image-parse (you can generate with CIHP_PGN or Graphonomy pretrained networks from the person image. See this comment) - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L61

  3. cloth (in-shop cloth image, crop/resize to 192 x 256 (width x height) pixels)

  4. cloth-mask (binary mask of cloth image, you can generate it with simple pillow/opencv function) - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L57

  5. pose (pose keypoints of the person, generate with openpose COCO-18 model (OpenPose from the official repository is preferred)) - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L72

  6. Also, make a test_pairs.txt file for your custom images. Follow the VITON dataset format to keep same arrangements, otherwise you can modify the code.- https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L76

  7. Run Geometric Matching Module(GMM) Model - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L81

  8. Copy "result/GMM/test/warp-cloth & warp-mask folders to "data/test/"

  9. Run Try-on Module(TOM) Model - https://github.com/vinodbukya6/cp-VTryon-plus-Flask-App/blob/36860ed0ebaaabf4bea2c02c49d2f0dff346b9b9/app.py#L93 Results in "result/TOM/test/try-on/"

Testing

Create virtual environment and install packages. Copy home.html and result.html to "templates" folder.

copy "dataloaders", "networks" "sync_batchnorm" folders from https://github.com/Gaoyiminggithub/Graphonomy to working directory.

Run "python app.py"

Upload target person image and cloth image. Get results!!!

cp-vtryon-plus-flask-app's People

Contributors

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