Spaces:
Running
on
Zero
Running
on
Zero
A newer version of the Gradio SDK is available:
5.25.2
Data Preprocessing Pipeline by AvatarArtist
This repo describes how to process your own data for using our model.
π Overview

βοΈ Requirements and Installation
We recommend the requirements as follows.
Environment
git clone --depth=1 https://github.com/ant-research/AvatarArtist
cd AvatarArtist
conda create -n avatarartis python=3.9.0
conda activate avatarartist
pip install -r requirements.txt
Download Weights
The weights are available at π€HuggingFace, you can download it with the following commands. Please move the required files into the pretrained_model
directory:
# if you are in china mainland, run this first: export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download --repo-type model \
KUMAPOWER/AvatarArtist \
--local-dir pretrained_model
ποΈ Usage
Process the target video to obtain the target pose motion and mesh.
python3 input_img_align_extract_ldm.py --input_dir ./demo_data/hongyu_2.mp4 --is_video --save_dir ./demo_data/data_process_out
Process the image to extract the source image.
python3 input_img_align_extract_ldm.py --input_dir ./demo_data/ip_imgs --is_img --save_dir ./demo_data/data_process_out
Our code supports step-by-step data processing. For example, if your images are already aligned, you can proceed directly to the next step.
python3 input_img_align_extract_ldm.py --input_dir ./demo_data/ip_imgs --is_img --save_dir ./demo_data/data_process_out --already_align
Once ready, the data will be organized in this format:
π¦ datasets/
βββ π dataset/
β βββ π coeffs/
β βββ π images512x512/
β βββ π uvRender256x256/
β βββ π orthRender256x256_face_eye/
β βββ π motions/
βββ π crop_fv_tracking/
βββ π realign_detections/
βββ π realign_detections/
βββ π realign/
βββ π raw_detection/
βββ π align_3d_landmark/
βββ π raw_frames/
π Credits
- This code builds on Portrait4D and InvertAvatar. We have integrated and organized their data processing code. Thanks for open-sourcing!