{"id":15639652,"url":"https://github.com/zhiqiangdon/pose-adv-aug","last_synced_at":"2025-04-30T07:08:50.569Z","repository":{"id":112374626,"uuid":"139478953","full_name":"zhiqiangdon/pose-adv-aug","owner":"zhiqiangdon","description":"Code for \"Jointly Optimize Data Augmentation and Network Training: Adversarial Data Augmentation in Human Pose Estimation\" (CVPR 2018)","archived":false,"fork":false,"pushed_at":"2018-07-15T03:49:04.000Z","size":5520,"stargazers_count":84,"open_issues_count":5,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T07:08:42.511Z","etag":null,"topics":["adversarial-learning","data-augmentation","human-pose-estimation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhiqiangdon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T18:20:34.000Z","updated_at":"2024-01-04T16:24:19.000Z","dependencies_parsed_at":"2023-06-07T23:45:48.664Z","dependency_job_id":null,"html_url":"https://github.com/zhiqiangdon/pose-adv-aug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2Fpose-adv-aug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2Fpose-adv-aug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2Fpose-adv-aug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2Fpose-adv-aug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhiqiangdon","download_url":"https://codeload.github.com/zhiqiangdon/pose-adv-aug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658207,"owners_count":21622820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial-learning","data-augmentation","human-pose-estimation"],"created_at":"2024-10-03T11:26:50.936Z","updated_at":"2025-04-30T07:08:50.549Z","avatar_url":"https://github.com/zhiqiangdon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jointly Optimize Data Augmentation and Network Training: Adversarial Data Augmentation in Human Pose Estimation\n\nTraining code for the paper \n**[Jointly Optimize Data Augmentation and Network Training: Adversarial Data Augmentation in Human Pose Estimation](https://arxiv.org/pdf/1805.09707.pdf)**, CVPR 2018\n\n## Overview\nTraditional random augmentation has two limitations. It doesn't consider the individual difference of training samples when doing augmentation. And it is also independent of the training status of the target network. To tackle these problems, we design an agent to learn more effective data augmentation. \n\u003cp align=\"center\"\u003e\u003cimg src=\"figures/overview-1.jpg\" alt=\"Adversarial Data Augmentation in Human Pose Estimation\" width=\"400\"\u003e\u003c/p\u003e\nWe model the training process as an adversarial learning problem. The agent (generator), conditioning on the individual samples and network status, tries to generate ''hard'' augmentations for the target network. The target network (discriminator), on the other hand, tries to learn better from the augmentations.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"figures/overview-2.jpg\" alt=\"Adversarial Data Augmentation in Human Pose Estimation\" width=\"600\"\u003e\u003c/p\u003e\n\n### Prerequisites\n\nThis package has the following requirements:\n\n* `Python 2.7`\n* `Pytorch 0.3.0.post4`\n\n\n### Installing\n\nInstall pytorch:\n```\npip install http://download.pytorch.org/whl/cu90/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl\n```\nInstall torchvision, scipy, matplotlib, dominate and visdom:\n```\npip install torchvision scipy matplotlib dominate visdom\n```\n\n## Training\n\nThe training is divided into three stages. First, we pretrain the pose network for 10 epochs. Then we use the fixed pose network to pretrain the augmentation agent. Finally, we jointly optimize these two.\n\n### 1. Pretrain the Pose Network\n\n```\npython stack-hg.py --gpu_id 0 --exp_id stack-2-hgs --vis_env stack-2-hgs --is_train true --bs 24\n```\n\n### 2. Pretrain the Augmentation Agent\n\nUse the pose network to collect the scale and rotation distributions to train the agent:\n\n```\npython collect-scale-ditri.py --gpu_id 0 --exp_id stack-2-hgs --load_prefix_pose lr-0.00025-10.pth.tar --bs 10\n```\n```\npython collect-rotation-ditri.py --gpu_id 0 --exp_id stack-2-hgs --load_prefix_pose lr-0.00025-10.pth.tar --bs 10\n```\nPretrain the agent:\n```\npython pretrain-s-r-agent.py --gpu_id 0 --exp_id stack-2-hgs --load_prefix_pose lr-0.00025-10.pth.tar --bs 24\n```\n### 3. Jointly Train the Pose Network and Agent\n\n```\npython joint-train-pose-s-r-agent.py --gpu_id 0 --exp_id stack-2-hgs --load_prefix_pose lr-0.00025-10.pth.tar --load_prefix_sr lr-0.00025-1.pth.tar --vis_env stack-2-hgs-joint --is_train true --bs 24 \n```\n\n## Citation\nIf you find this code useful in your research, please consider citing:\n\n```\n@inproceedings{peng2018jointly,\n  title={Jointly optimize data augmentation and network training: Adversarial data augmentation in human pose estimation},\n  author={Peng, Xi and Tang, Zhiqiang and Yang, Fei and Feris, Rogerio S and Metaxas, Dimitris},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  pages={2226--2234},\n  year={2018}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiqiangdon%2Fpose-adv-aug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhiqiangdon%2Fpose-adv-aug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiqiangdon%2Fpose-adv-aug/lists"}