/Music2Dance

Generating Dance steps for given music with deep learning

Primary LanguageJupyter NotebookMIT LicenseMIT

πŸ‘― Music2Dance πŸ’ƒ

Generating Dance steps for given music (CNN + LSTM + MDN)

Execution Steps:

1. Installing
    * sudo pip3 install torch torchvision tensorboardX tensorflow numpy scipy imageio opencv-python

2. Creating dataset from videos (Preprocessing videos)
    * python PoseNet/converter/tfjs2python.py
    * python index2_video_shot_processing.py
    * python index3_create_Only_in_out_dataset.py

3. Training
    * python index4_train_mdn_simple_rnn_bnc.py

4. Testing (works directly as pretrained weights included in repo)
    * run jupyter notebook in root directory
    * open index5_test_trained_model_simplernn_for_bnc.ipynb and run all cells
    * use some software(may be windows 10 photos app) to combine generated video and input audio

Results:

Classical Western Mixed
Music2Dance Classical Music2Dance Western Music2Dance Mixed

Music2Dance Cheat Sheet

Directory Structure:

Music2Dance(project root)
|
β”‚   index2_video_shot_processing.py            - Process mp4 video files present in data directory
β”‚   index3_create_Only_in_out_dataset.py       - Creating input/output bundles for training the model
β”‚   index4_train_mdn_simple_rnn.py             - Process and train with training data
β”‚   index4_train_mdn_simple_rnn_for_bnc.py     - Same as above but if training data has two types of dances (like western and classical)
β”‚   index5_test_trained_model_simplernn.ipynb  - Testing trained model with random audio file
β”‚   index5_test_trained_model_simplernn_for_bnc.ipynb
β”‚   ReadMe.md
β”‚
β”œβ”€β”€β”€custom_utils                  - Utilities
β”‚       datastft.py
β”‚       mobilenet.py
β”‚       video_shot_processing_utils.py
β”‚
β”œβ”€β”€β”€data
β”‚   β”œβ”€β”€β”€test_audio
β”‚   |       test_audio.wav
|   β”œβ”€β”€β”€audio_wav_indexed
|   |       audio (1).wav
|   └───video_wav_indexed
|           video (1).mp4
β”‚
β”œβ”€β”€β”€Object_detection              - Object Detection model to detect human bounding box before finding the pose 
β”‚   β”‚   mscoco_label_map.pbtxt
β”‚   β”‚   string_int_label_map.proto
β”‚   β”‚   visualization_utils.py
β”‚   β”‚
β”‚   └───ssd_mobilenet_v1_coco_2018_01_28
β”‚       β”‚   checkpoint
β”‚       β”‚   frozen_inference_graph.pb
β”‚       β”‚   model.ckpt.data-00000-of-00001
β”‚       β”‚   model.ckpt.index
β”‚       β”‚   model.ckpt.meta
β”‚       β”‚   pipeline.config
β”‚       β”‚
β”‚       └───saved_model
β”‚           β”‚   saved_model.pb
β”‚           β”‚
β”‚           └───variables
β”œβ”€β”€β”€output
β”‚   β”œβ”€β”€β”€motiondance_simplernn     - Saved weights
β”‚   β”‚   └───checkpoints
β”‚   β”‚           epoch_{num}.pth.tar
β”‚   β”‚
β”‚   β”œβ”€β”€β”€motiondance_simplernn_bnc
β”‚   β”‚   └───checkpoints
β”‚   β”‚           epoch_bnc_{num}.pth.tar
β”‚   β”‚
β”‚   β”œβ”€β”€β”€Result                    - Test result video files are saved here
β”‚   β”œβ”€β”€β”€Result_Audio
β”‚   └───Result_Video
└───PoseNet
    └───converter
        β”‚   config.yaml
        β”‚   manifest.json
        β”‚   tfjs2python.py        - Converting TensorflowJs model to python tensorflow understandable model
        β”‚   wget.py
        β”‚
        └───checkpoints
                checkpoint
                model.ckpt.data-00000-of-00001
                model.ckpt.index
                model.ckpt.meta        

References:


Copyright Β© 2018, Ajay Sreeram