Created
February 5, 2021 08:18
-
-
Save NoamGaash/45f147e9de08dd5f8ee3631cfefeae1a to your computer and use it in GitHub Desktop.
create EveryBodyDanceNow dataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p EverybodyDanceNow/datasets/noam/frames | |
# step 1 - video 2 frames | |
ffmpeg -i EverybodyDanceNow/datasets/noam/noam.mp4 EverybodyDanceNow/datasets/noam/frames/frame_%05d.bmp | |
# step 2 - running openpose and get json output | |
sudo docker run -v $PWD/EverybodyDanceNow/datasets/noam:/noam --gpus=all -it --rm -e NVIDIA_VISIBLE_DEVICES=0 cwaffles/openpose \ | |
./build/examples/openpose/openpose.bin \ | |
-image_dir ../noam/frames \ | |
-hand -disable_blending -face \ | |
-output_resolution 320x-1 \ | |
-number_people_max 1 \ | |
-no_gui_verbose \ | |
--render_pose 0 \ | |
-display 0 \ | |
--write_json ../noam/openpose_json_output/ | |
# step 3 - create train (non normalized) dataset | |
python $PWD/EverybodyDanceNow/data_prep/graph_train.py \ | |
--keypoints_dir $PWD/EverybodyDanceNow/datasets/noam/openpose_json_output/ \ | |
--frames_dir $PWD/EverybodyDanceNow/datasets/noam/frames/ \ | |
--save_dir $PWD/EverybodyDanceNow/datasets/noam/train_dataset/ \ | |
--spread 0 6331 1 \ | |
--facetexts | |
# step 4 - train noam's network | |
# global stage - train a model at 512x256 resolution | |
python $PWD/EverybodyDanceNow/train_fullts.py \ | |
--name noam_model_global \ | |
--dataroot $PWD/EverybodyDanceNow/datasets/noam/train_dataset/ \ | |
--checkpoints_dir $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/ \ | |
--loadSize 512 \ | |
--no_instance \ | |
--no_flip \ | |
--tf_log \ | |
--label_nc 6 | |
# local stage - train a model at 1024x512 resolution | |
python $PWD/EverybodyDanceNow/train_fullts.py \ | |
--name noam_model_local \ | |
--dataroot $PWD/EverybodyDanceNow/datasets/noam/train_dataset/ \ | |
--checkpoints_dir $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/ \ | |
--load_pretrain $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/noam_model_global \ | |
--netG local \ | |
--ngf 32 \ | |
--num_D 3 \ | |
--resize_or_crop none \ | |
--no_instance \ | |
--no_flip \ | |
--tf_log \ | |
--label_nc 6 | |
# continue training | |
python $PWD/EverybodyDanceNow/train_fullts.py \ | |
--name noam_model_local \ | |
--dataroot $PWD/EverybodyDanceNow/datasets/noam/train_dataset/ \ | |
--checkpoints_dir $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/ \ | |
--netG local \ | |
--ngf 32 \ | |
--num_D 3 \ | |
--resize_or_crop none \ | |
--no_instance \ | |
--no_flip \ | |
--tf_log \ | |
--label_nc 6 \ | |
--continue_train | |
# face stage - train a model specialized to the face region | |
python $PWD/EverybodyDanceNow/train_fullts.py \ | |
--name noam_model_face \ | |
--dataroot $PWD/EverybodyDanceNow/datasets/noam/train_dataset/ \ | |
--load_pretrain $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/noam_model_local \ | |
--checkpoints_dir $PWD/EverybodyDanceNow/datasets/noam/checkpoints_dir/ \ | |
--face_discrim \ | |
--face_generator \ | |
--faceGtype global \ | |
--niter_fix_main 10 \ | |
--netG local \ | |
--ngf 32 \ | |
--num_D 3 \ | |
--resize_or_crop none \ | |
--no_instance \ | |
--no_flip \ | |
--tf_log \ | |
--label_nc 6 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment