barisgecer / OSTeC

TF implementation of our CVPR 2021 paper: OSTeC: One-Shot Texture Completion
https://openaccess.thecvf.com/content/CVPR2021/html/Gecer_OSTeC_One-Shot_Texture_Completion_CVPR_2021_paper.html
Other
189 stars 28 forks source link

Deep3Dfacerecon #11

Closed Randa-NACHET closed 2 years ago

Randa-NACHET commented 2 years ago

Can you help me please to solve this problem? I try to run test.py for Deep3Dfacerecon.

----------------- Options --------------- add_image: True
bfm_folder: BFM
bfm_model: BFM_model_front.mat
camera_d: 10.0
center: 112.0
checkpoints_dir: ./checkpoints
dataset_mode: None
ddp_port: 12355
display_per_batch: True
epoch: latest
eval_batch_nums: inf
focal: 1015.0
gpu_ids: 0
img_folder: examples
init_path: checkpoints/init_model/resnet50-0676ba61.pth isTrain: False [default: None] model: facerecon
name: face_recon
net_recon: resnet50
phase: test
suffix:
use_ddp: False [default: True] use_last_fc: False
verbose: False
vis_batch_nums: 1
world_size: 1
z_far: 15.0
z_near: 5.0
----------------- End ------------------- model [FaceReconModel] was created loading the model from ./checkpoints/face_recon/epoch_latest.pth 0 examples/000002.jpg Traceback (most recent call last): File "test.py", line 72, in main(0, opt,opt.img_folder) File "test.py", line 62, in main model.test() # run inference File "/content/drive/MyDrive/Deep3DFaceRecon_pytorch-baris/models/base_model.py", line 162, in test self.forward() File "/content/drive/MyDrive/Deep3DFaceRecon_pytorch-baris/models/facerecon_model.py", line 137, in forward self.facemodel.compute_for_render(output_coeff) File "/content/drive/MyDrive/Deep3DFaceRecon_pytorch-baris/models/bfm.py", line 303, in compute_for_render face_color = self.compute_color(face_texture, face_norm_roted, coef_dict['gamma']) File "/content/drive/MyDrive/Deep3DFaceRecon_pytorch-baris/models/bfm.py", line 176, in compute_color face_color = torch.cat([r, g, b], dim=-1) * face_texture RuntimeError: The size of tensor a (35709) must match the size of tensor b (53215) at non-singleton dimension 1

barisgecer commented 2 years ago

Hi, If you want to run Deep3DRecon please try to run the original repo here.

If you want to run it in an 'OSTeC-compatible' way, please import it from deep3dfacerecon.ostec_api like here and then run it like here.

Hope that helps, Baris