Skip to content

hama-jsoh/pasta-gan-plusplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PASTA-GAN-plusplus Inference Server


PASTA-GAN++ with AWS


1. Getting started

Dataset & model

  • [Training] download dataset --> UPT dataset : Google_drive
  • [Required] download pastagan-plusplus pretrained_model --> Google_drive
  • [Required] download openpose pretrained_model --> Google_drive
  • [Required] download graphonomy pretrained_model --> Google_drive

Step 1: Set Up the Folder Structure

setup.sh <-- Automatic setup script

  • download & setup dataset
  • download & setup model(checkpoint)
git clone https://github.com/hama-jsoh/pasta-gan-plusplus.git && cd pasta-gan-plusplus && bash setup.sh

Step 2: Docker build & run

USER_ID=$UID docker-compose -f docker/docker-compose.yaml up -d
  • Step 2-1: Enter container
    docker exec -it pastagan_plusplus_dev bash

Step 3: Inference

python3 -W ignore inference.py

Step 4: Check result

cd test_results/full && ls

2. EXPERIMENT

Step 1: TEST

bash test.sh 3

options

  • 1 : upper
  • 2 : pants
  • 3 : full

Step 2: Check result

cd test_results/full && ls

3. Sample Code

# inference.py
...

if __name__ == "__main__":
    # 1. openpose(preprocessing)
    openpose = PreProcessor(
        UriInput("keypoints", "./test_samples/image"),
        FileOutput("json", "./test_samples/keypoints")
    )
    openpose.start()

    # 2. graphonomy(preprocessing)
    graphonomy = PreProcessor(
        UriInput("parsing", "./test_samples/image"),
        FileOutput("img", "./test_samples/parsing")
    )
    graphonomy.start()

    # 3. write_txt(permutation)
    with open("./test_samples/test_pairs.txt", "w") as f:
        filelist = os.listdir("./test_samples/image")
        cloth, human = filelist
        f.write(f"{cloth} {human}")

    # 4. synthesis_result
    generate_images(
        dataroot='test_samples',
        testtxt='test_pairs.txt',
        outdir='test_results/full',
        testpart='full'
    )