Downloads · 30 days
0
mambazjp/REC-MV_preprocess
REC-MV_preprocess is a machine learning model from mambazjp. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
The data pre-processing part includes img, mask, normal, parsing (garment segmentation), camera, smpl parameters (beta & theta), featurelines, skinning weight. set up the environment (or you can directly use REC-MV en…
Downloads · 30 days
0
Access
Public
Updated Aug 11, 2023
Repo size
2.7 GB
Likes
6
Public
Click a slice to open those files.
.pt1.5 GB · 57%
From the Hugging Face model README
The data pre-processing part includes img, mask, normal, parsing (garment segmentation), camera, smpl parameters (beta & theta), featurelines, skinning weight.
set up the environment (or you can directly use REC-MV environment)
pip install -r requirements.txt
You should make directory to save all processed data, named, to say, xiaoming. And you turn the video into images:
encodepngffmpeg()
{
# $1: target folder
# $2: save video name
ffmpeg -r ${1} -pattern_type glob -i '*.png' -vcodec libx264 -crf 18 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p ${2}
}
encodepngffmpeg 30 ./xiaoming.mp4
Then, your data directory:
xiaoming/
└── imgs
Get the normal map, parsing mask, masks.
python prcess_data_all.py --gid <gpu_id> --root <Your data root> --gender <data gender>
# example
python prcess_data_all.py --gid 0 --root /data/xiaoming --gender male
Your data directory:
xiaoming/
├── imgs
├── masks
├── normals
└── parsing_SCH_ATR
To get smpl paramaters (pose and shape), here we use videoavatar:
xiaoming/openpose, which I use Openpose.keypoints.hdf5, masks.hdf5, camera.hdf5. Or you can just use my script: cd videoavatars; python get_reconstructed_poses.py --root xiaoming --out xiaoming --gender malebash run_step1.shAfter you run through videoavatar, you will get camera.pkl, reconstructed_poses.hdf5. Put it also under the root(xiaoming).
You can get smpl_rec.npz, camera.npz by running:
python get_smpl_rec_camera.py --root xiaoming --save_root xiaoming --gender male
Note: You can use any other smpl estimation algorithm, but you should follow the way how smpl_rec.npz save pose, shape, and trans.
We follow fite to get the lbs skinning weight to prevent artifacts.
In fite's readme, you'll get a skining weight cube after finishing 3.Diffused Skinning. Name it diffused_skinning_weights.npy and put it under xiaoming.