Code Monkey home page Code Monkey logo

textured-novel-pose-rendering's Introduction

textured-novel-pose-rendering

πŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•ΊπŸ•Ί

  1. Stand still, take a photo from your front side, take a photo from your back side.
  2. Prepare you favourite dance video, split it to frames, and save into the images folder

Then you can get the motion_video.mp4, you are dancing~

  • input

front and back image


favourite dance video

motion_video.mp4
  • output
motion_video.mp4

This project is built on the great and useful projects: textured_smplx, romp, smplify-x, humannerf

Since the complex dependence, basically you can refer to textured_smplx and romp

choose one way to run the code:

  1. run pipeline directly
  2. run step by step

Pipeline

python pipeline.py data/obj1 data/obj1/images/P01125-150055.jpg data/obj1/images/P01125-150146.jpg 

Run pipeline by steps

step0: prepare motion sequences

# prepare a folder of frames in images/, if you have the video, try ffmpeg or use romp deal with video directly.
romp --mode=video --calc_smpl --render_mesh -i=images/ -o=romp_output/ -t -sc=1. 

Then get npz with SMPL params sequences.

step1: prepare your image data

example can be find in ./data/obj1/images

step2: openpose pose detection

openpose.bin --display 0 --render_pose 1 --image_dir ./data/obj1/images --write_json ./data/obj1/keypoints --write_images ./data/obj1/pose_images --hand --face

step3: fit smpl/smplx model

Please follow the instruction here

python smplifyx/main.py --config cfg_files/fit_smpl.yaml --data_folder ../data/obj1 --output_folder ../data/obj1/smpl  --model_folder models --vposer_ckpt V02_05

data_folder should contain images folder and keypoints folder in ../data/obj1, and the output contain fitted obj and pkl (SMPL param relative)

step4: texture generation

run python demo.py data_path front_img back_img smplx

step5: render

run python prepare_smpl_sequences to get images of novel pose save the images in motion_snapshots folder

step6: images to video

run ffmpeg, for example:

ffmpeg -f image2 -i motion_snapshots/%06d.png motion_video.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.