zhaofang0627 / AnchorUDF

MIT License
62 stars 9 forks source link

Learning Anchored Unsigned Distance Functions with Gradient Direction Alignment for Single-view Garment Reconstruction (ICCV 2021 Oral)

This repository contains the code for the paper:

Learning Anchored Unsigned Distance Functions with Gradient Direction Alignment for Single-view Garment Reconstruction
Fang Zhao, Wenhao Wang, Shengcai Liao and Ling Shao

Requirements

To install all python dependencies for this project:

conda env create -f env_anchor_udf.yml
conda activate AnchorUDF

Dataset

We provide the preprocessed data used for model training and evaluation. You can prepare your own data by following the data generation steps of PIFu.

Demo

To do a quick test, download the trained models and run:

python -m apps.eval --results_path {path_of_output} --name {folder_of_output} --dataroot {path_of_dataset} --test_folder_path {folder_of_test_data, e.g., 290-1} --load_netG_checkpoint_path ./checkpoints/anchor_udf_df3d/netG_epoch_59 --anchor --num_steps 5 --filter_val 0.007

For the HD version:

python -m apps.eval_hd --results_path {path_of_output} --name {folder_of_output} --dataroot {path_of_dataset} --test_folder_path {folder_of_test_data, e.g., 290-1} --load_netMR_checkpoint_path ./checkpoints/anchor_udf_hd_df3d/netMR_epoch_14 --anchor --merge_layer 2 --joint_train --loadSize 1024 --num_steps 5 --filter_val 0.007

Optionally, you can remove outliers by statistical outlier removal:

python -m apps.remove_outlier --file_path {path_of_file} --nb_neighbors 5 --std_ratio 10.0

Training

To generate targets for training:

python -m apps.gen_targets --dataroot {path_of_dataset} --sigma {0.003, 0.02, AND 0.08, separately} --point_num 600

To train the model:

Evaluation

To evaluate the model:

Acknowledgement

Our code is based on PIFu and NDF. We thank the authors for their excellent work!

Citation

If you use this code for your research, please consider citing:

@inproceedings{zhao2021learning,
  title={Learning Anchored Unsigned Distance Functions with Gradient Direction Alignment for Single-view Garment Reconstruction},
  author={Zhao, Fang and Wang, Wenhao and Liao, Shengcai and Shao, Ling},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={12674--12683},
  year={2021}
}