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

Can you provide a test example?the code does not work for my own data #2

Closed
jeffreyking23 opened this issue Sep 1, 2020 · 14 comments

Comments

@jeffreyking23
Copy link

The testing code does not work on my own data, hope you to provide one example.

@bharat-b7
Copy link
Owner

I've added a sample scan. Could you try to run the demo section from the README.

@jeffreyking23
Copy link
Author

thank you so much

@MoyGcc
Copy link

MoyGcc commented Sep 26, 2020

Hi all,

can you get the python test_IPNet.py assets/scan.obj experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar out_dir -m IPNet run?
I always encountered an error:

"File "/home/chen/IPNet/utils/implicit_waterproofing.py", line 9, in
from .libs.libmesh import check_mesh_contains
ModuleNotFoundError: No module named 'utils.libs' "

Is there anything I missed? All prerequisites were built. And there does not exist such a folder named "libs"

Thanks for the answer in advance!

@bharat-b7
Copy link
Owner

Hi, the folder was missing from git. I have added this, let me know if it still doesn't work.

@bharat-b7 bharat-b7 reopened this Sep 27, 2020
@JanaldoChen
Copy link

When I run smpl_registration/fit_SMPLD.py, I met this problem:
Traceback (most recent call last):
File "test.py", line 1, in
from smpl_registration.fit_SMPLD import fit_SMPLD
File "/apdcephfs/private_janaldochen/Janaldo_workspace/IPNet/smpl_registration/fit_SMPLD.py", line 21, in
from lib.th_SMPL import th_batch_SMPL
File "/apdcephfs/private_janaldochen/Janaldo_workspace/IPNet/lib/th_SMPL.py", line 12, in
from lib.body_objectives import torch_pose_obj_data
File "/apdcephfs/private_janaldochen/Janaldo_workspace/IPNet/lib/body_objectives.py", line 15, in
from psbody.smpl import load_model
ModuleNotFoundError: No module named 'psbody.smpl'

@bharat-b7
Copy link
Owner

Hi, you don't need the function. You can comment out the import. I've updated the code on git.

@MoyGcc
Copy link

MoyGcc commented Sep 27, 2020

Hi, the folder was missing from git. I have added this, let me know if it still doesn't work.

Thank you for the quick response! Now I get the following error:

"/home/chen/.local/lib/python3.6/site-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order, subok=True)
Not loading weights, it is assumed that the provided network has correct weights.
Loading weights from, experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar
/home/chen/.local/lib/python3.6/site-packages/torch/nn/functional.py:3384: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
warnings.warn("Default grid_sample and affine_grid behavior has changed "
Traceback (most recent call last):
File "test_IPNet.py", line 111, in
main(args)
File "test_IPNet.py", line 66, in main
full, body, parts = gen.generate_meshs_all_parts(data)
File "/home/chen/IPNet/models/generator.py", line 141, in generate_meshs_all_parts
logits = self.model(points, inputs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/IPNet/models/local_model_body_full.py", line 126, in forward
net_full = self.actvn(self.part_0(full))
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 257, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 4.01 GiB (GPU 0; 11.91 GiB total capacity; 7.29 GiB already allocated; 2.33 GiB free; 7.33 GiB reserved in total by PyTorch)"

@MoyGcc
Copy link

MoyGcc commented Sep 27, 2020

Besides, you appended the path to smplpytorch in the file smpl_layer.py which is not included in the git.

ModuleNotFoundError: No module named 'smplpytorch'

@bharat-b7
Copy link
Owner

Besides, you appended the path to smplpytorch in the file smpl_layer.py which is not included in the git.

ModuleNotFoundError: No module named 'smplpytorch'

I have added these files. The files originally come from https://github.com/gulvarol/smplpytorch and have been modified to work with SMPL+D (original repo only had SMPL).

@bharat-b7
Copy link
Owner

Hi, the folder was missing from git. I have added this, let me know if it still doesn't work.

Thank you for the quick response! Now I get the following error:

"/home/chen/.local/lib/python3.6/site-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order, subok=True)
Not loading weights, it is assumed that the provided network has correct weights.
Loading weights from, experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar
/home/chen/.local/lib/python3.6/site-packages/torch/nn/functional.py:3384: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
warnings.warn("Default grid_sample and affine_grid behavior has changed "
Traceback (most recent call last):
File "test_IPNet.py", line 111, in
main(args)
File "test_IPNet.py", line 66, in main
full, body, parts = gen.generate_meshs_all_parts(data)
File "/home/chen/IPNet/models/generator.py", line 141, in generate_meshs_all_parts
logits = self.model(points, inputs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/IPNet/models/local_model_body_full.py", line 126, in forward
net_full = self.actvn(self.part_0(full))
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 257, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 4.01 GiB (GPU 0; 11.91 GiB total capacity; 7.29 GiB already allocated; 2.33 GiB free; 7.33 GiB reserved in total by PyTorch)"

This looks like a memory issue. Try reducing the batch size.

@MoyGcc
Copy link

MoyGcc commented Sep 29, 2020

Hi, the folder was missing from git. I have added this, let me know if it still doesn't work.

Thank you for the quick response! Now I get the following error:
"/home/chen/.local/lib/python3.6/site-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order, subok=True)
Not loading weights, it is assumed that the provided network has correct weights.
Loading weights from, experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar
/home/chen/.local/lib/python3.6/site-packages/torch/nn/functional.py:3384: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
warnings.warn("Default grid_sample and affine_grid behavior has changed "
Traceback (most recent call last):
File "test_IPNet.py", line 111, in
main(args)
File "test_IPNet.py", line 66, in main
full, body, parts = gen.generate_meshs_all_parts(data)
File "/home/chen/IPNet/models/generator.py", line 141, in generate_meshs_all_parts
logits = self.model(points, inputs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/IPNet/models/local_model_body_full.py", line 126, in forward
net_full = self.actvn(self.part_0(full))
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chen/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 257, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 4.01 GiB (GPU 0; 11.91 GiB total capacity; 7.29 GiB already allocated; 2.33 GiB free; 7.33 GiB reserved in total by PyTorch)"

This looks like a memory issue. Try reducing the batch size.

Yes, I tried to lower the batch_points and now it works. Thank you for the kind reply.

I uploaded the results in this drive folder. Are these results expected? There are some issues for both the naked SMPL body and the clothed SMPL body.
https://drive.google.com/drive/folders/1Jrs1WNWigySp7lk-rLDjvefEvadstlkE?usp=sharing

@Pepsipep18
Copy link

Hi all!
I'v got the 'Test on single scan/PC: python test_IPNet.py assets/scan.obj experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar out_dir -m IPNet' run, and got 4 output like body.ply, cent npy, full.ply and parts.npy.
but when I tried to run the second line, 'Fit SMPLD to IPNet predictions: python smpl_registration/fit_SMPL_IPNet.py out_dir/body.ply out_dir/full.ply out_dir/parts.npy out_dir/cent.npy out_dir/', I met the error:

Using BLB SMPL from the project: LearningRegistration
Traceback (most recent call last):
File "smpl_registration/fit_SMPL_IPNet.py", line 382, in
scale_file=[args.scale_file], gender=args.gender)
File "smpl_registration/fit_SMPL_IPNet.py", line 212, in fit_SMPL
smpl_faces = sp.get_faces()
File "/home/zhengwen/work/IPNet/lib/smpl_paths.py", line 111, in get_faces
return np.load(fname)
File "/home/zhengwen/anaconda3/envs/py3.6/lib/python3.6/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: '/BS/RVH/work/data/template/faces.npy'
where could I find the file 'faces.npy'?
Thanks for the answer in advance!

@MoyGcc
Copy link

MoyGcc commented Oct 6, 2020

Hi all!
I'v got the 'Test on single scan/PC: python test_IPNet.py assets/scan.obj experiments/IPNet_p5000_01_exp_id01/checkpoints/checkpoint_epoch_249.tar out_dir -m IPNet' run, and got 4 output like body.ply, cent npy, full.ply and parts.npy.
but when I tried to run the second line, 'Fit SMPLD to IPNet predictions: python smpl_registration/fit_SMPL_IPNet.py out_dir/body.ply out_dir/full.ply out_dir/parts.npy out_dir/cent.npy out_dir/', I met the error:

Using BLB SMPL from the project: LearningRegistration
Traceback (most recent call last):
File "smpl_registration/fit_SMPL_IPNet.py", line 382, in
scale_file=[args.scale_file], gender=args.gender)
File "smpl_registration/fit_SMPL_IPNet.py", line 212, in fit_SMPL
smpl_faces = sp.get_faces()
File "/home/zhengwen/work/IPNet/lib/smpl_paths.py", line 111, in get_faces
return np.load(fname)
File "/home/zhengwen/anaconda3/envs/py3.6/lib/python3.6/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: '/BS/RVH/work/data/template/faces.npy'
where could I find the file 'faces.npy'?
Thanks for the answer in advance!

Hey,

you should download the SMPL model from https://ps.is.mpg.de/ and extract the model faces manually into such .npy file. Hope this can help you.

@JosephKKim
Copy link

Is there anyone who knows where <body_shape.obj> is for normalizing the scan??
I guess it is not provided in assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants