We recommend a python version =3.9.12
and cuda version =11.6
.
pip install -r requirements.txt
-
Download trained weights from Google Drive
-
Then, these weights should be organized as follows:
model |-- omnipose | |-- checkpoint_ppe.pth | |-- checkpoint_hpe.pth | `... |-- pg2 | |-- checkpoints | | |-- PG2-1 | | | |-- events.out.tfevents.1566133862.wangbudui.39385.0 | | | `-- G1.pth | | `-- PG2-2 | | |-- events.out.tfevents.1566139204.wangbudui.40174.0 | | `-- G2.pth | `... `...
-
Prepare
.env
file to./backend
ACCESS_KEY={s3_access_key} SECRET_KEY={s3_secret_key} REGION_KEY={s3_region} BUCKET_NAME={s3_bucket_name}
-
run
./backend/app.py
-
request api to flask server
- Method: POST
- URI: '/pgpg'
# 1. Declare variables
generation_id = {any_integer}
condition_image_url = {your_condition_image_url}
target_image_url = {your_target_image_url}
# 2. HPE + PPE
omnipose.run_infer.run_infer(generation_id, condition_image_url, target_image_url)
# 3. mpii2coco + generate annotation, pairs
pe2pg.Pe2Pg(generation_id).save_anno_csv()
# 4. generate posemap & mask
pg2.tool.generate_pose_map_add_mask.main("market", "inference", generation_id)
# 5. PG2
pg2.run.main(generation_id)
- OmniPose
- PG2