Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query in calculating the depth and pose metric #6

Closed
VIROBO-15 opened this issue Aug 2, 2022 · 1 comment · Fixed by #8
Closed

Query in calculating the depth and pose metric #6

VIROBO-15 opened this issue Aug 2, 2022 · 1 comment · Fixed by #8
Labels
documentation Improvements or additions to documentation

Comments

@VIROBO-15
Copy link

VIROBO-15 commented Aug 2, 2022

Hi....
Can you Please help me calculating the Depth and Pose metric.....

eval "$(conda shell.bash hook)"
conda activate gmpi
export MKL_NUM_THREADS=5 && export NUMEXPR_NUM_THREADS=5 &&
python ${REPO_DIR}/gmpi/eval/prepare_fake_data.py
--ckpt_path ${CKPT_DIR}/generator.pth
--seed ${SEED}
--save_dir ${GEO_DIR}
--nplanes ${N_PLANES}
--n_imgs ${N_GEO}
--task geometry
--exp_config ${CKPT_DIR}/config.pth
--save_depth 1
--dataset ${DATASET}
--truncation_psi ${TRUNCATION_PSI}
--stylegan2_sanity_check ${SANITY_CHECK}

eval "$(conda shell.bash hook)"
conda activate mtcnn_env
export MKL_NUM_THREADS=5 && export NUMEXPR_NUM_THREADS=5 &&
python ${REPO_DIR}/gmpi/eval/prepare_face_landmarks.py
--data_dir ${GEO_DIR}/geometry/rgb

eval "$(conda shell.bash hook)"
conda activate deep3d_pytorch
cd ${Deep3DFaceRecon_PATH}
python ${Deep3DFaceRecon_PATH}/estimate_pose_gmpi.py
--name=pretrained
--epoch=20
--gmpi_img_root ${GEO_DIR}/geometry/rgb
--gmpi_depth_root ${GEO_DIR}/geometry/depth
--gmpi_detect_root ${GEO_DIR}/geometry/rgb/detections

eval "$(conda shell.bash hook)"
conda activate gmpi
python ${REPO_DIR}/gmpi/eval/compute_geometry.py
--geo_dir ${GEO_DIR}/geometry
--angle_err 1

Script of training

bash ${GMPI_ROOT}/gmpi/eval/eval.sh ${GMPI_ROOT} FFHQ256 20220727_102024290372 ${Deep3DFaceRecon_PATH} nodebug

Error:

warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Transfer BFM09 to BFM_model_front......
Traceback (most recent call last):
File "/home/x_fahkh/.conda/envs/deep3d_pytorch/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 39, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: 'BFM/01_MorphableModel.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/estimate_pose_gmpi.py", line 133, in
main(0, opt, opt.gmpi_img_root, opt.gmpi_depth_root, opt.gmpi_detect_root)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/estimate_pose_gmpi.py", line 64, in main
model = create_model(opt)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/models/init.py", line 65, in create_model
instance = model(opt)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/models/facerecon_model.py", line 95, in init
is_train=self.isTrain, default_name=opt.bfm_model
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/models/bfm.py", line 40, in init
transferBFM09(bfm_folder)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/Deep3DFaceRecon_pytorch/util/load_mats.py", line 34, in transferBFM09
original_BFM = loadmat(osp.join(bfm_folder, '01_MorphableModel.mat'))
File "/home/x_fahkh/.conda/envs/deep3d_pytorch/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 216, in loadmat
with _open_file_context(file_name, appendmat) as f:
File "/home/x_fahkh/.conda/envs/deep3d_pytorch/lib/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/home/x_fahkh/.conda/envs/deep3d_pytorch/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 19, in _open_file_context
f, opened = _open_file(file_like, appendmat, mode)
File "/home/x_fahkh/.conda/envs/deep3d_pytorch/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 45, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: 'BFM/01_MorphableModel.mat'
0%| | 0/1023 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/compute_geometry.py", line 93, in
tmp_depth_err = compute_depth_err(tmp_aligned_depth_f, tmp_pred_depth_f, tmp_pred_mask_f)
File "/proj/cvl/users/x_fahkh/mn/ml-gmpi/gmpi/eval/compute_geometry.py", line 26, in compute_depth_err
depth = np.load(alinged_depth_f)
File "/home/x_fahkh/.conda/envs/gmpi/lib/python3.7/site-packages/numpy/lib/npyio.py", line 416, in load
fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: '/proj/cvl/users/x_fahkh/mn/ml-gmpi/ckpts/gmpi_pretrained/20220727_102024290372/planes_96_n_1024/psi_1.0/geometry/recon/aligned_depth/000000.npy'

@Xiaoming-Zhao
Copy link
Collaborator

Xiaoming-Zhao commented Aug 2, 2022

I recommend reading the full README of Deep3DFaceRecon_pytorch if possible. So to setup the repo of Deep3DFaceRecon_pytorch, you need:

  1. Install some packages and setup the environment: see this link
  2. Download some data: see this link

Your trace log states that you do not have a required model:
FileNotFoundError: [Errno 2] No such file or directory: 'BFM/01_MorphableModel.mat'

@fangchangma fangchangma added the documentation Improvements or additions to documentation label Aug 2, 2022
fangchangma added a commit that referenced this issue Aug 2, 2022
Clearer doc about the setup of Deep3DFaceRecon_pytorch (#6 and #7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants