YuliangXiu / ICON

[CVPR'22] ICON: Implicit Clothed humans Obtained from Normals
https://icon.is.tue.mpg.de
Other
1.6k stars 218 forks source link

Error when extracting clothes using garment crawler #225

Closed Zevrap-81 closed 1 year ago

Zevrap-81 commented 1 year ago

Hey, Firstly i want to appreciate, great work!

I wanted to extract the garment by following the instructions in garment extraction. But i am getting the NoneType error. I am using the built-in examples of segmentation.

Here is the detailed error ``` (base) root@ea8a3c897c90:/home# python -m apps.infer -cfg ./configs/pifu.yaml -gpu 0 -in_dir ./examples/segmentation -out_dir ./results -seg_dir ./examples/segmentation NOTE! Installing ujson may make loading annotations faster. PIFU: w/ Global Image Encoder: True Image Features used by MLP: ['image', 'normal_F', 'normal_B'] Dim of Image Features (global): 12 Dim of Geometry Features (PIFu): 1 (z-value) Dim of MLP's first layer: 13 Resume MLP weights from ./data/ckpt/pifu.ckpt Resume normal model from ./data/ckpt/normal.ckpt Using pixie as HPS Estimator Dataset Size: 2 Body Fitting --- normal: 0.057 | silhouette: 0.032 | Total: 0.089: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:11<00:00, 9.09it/s] Cloth Refinement --- cloth:0.13740 | stiffness:0.02705 | rigid:0.00006 | laplacian:0.05698 | Total: 0.22150: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 150/150 [00:04<00:00, 33.64it/s] 003883: 0%| | 0/2 [00:45 clothing_obj = extract_cloth(recon_obj, seg, K, R, t, smpl_obj) File "/home/lib/common/cloth_extraction.py", line 121, in extract_cloth recon_labels = smpl_to_recon_labels(recon, smpl) File "/home/lib/common/cloth_extraction.py", line 69, in smpl_to_recon_labels classifier.fit(smpl.vertices, y) File "/opt/conda/lib/python3.8/site-packages/sklearn/neighbors/_classification.py", line 179, in fit return self._fit(X, y) File "/opt/conda/lib/python3.8/site-packages/sklearn/neighbors/_base.py", line 381, in _fit check_classification_targets(y) File "/opt/conda/lib/python3.8/site-packages/sklearn/utils/multiclass.py", line 180, in check_classification_targets y_type = type_of_target(y) File "/opt/conda/lib/python3.8/site-packages/sklearn/utils/multiclass.py", line 306, in type_of_target if (len(np.unique(y)) > 2) or (y.ndim >= 2 and len(y[0]) > 1): File "<__array_function__ internals>", line 180, in unique File "/opt/conda/lib/python3.8/site-packages/numpy/lib/arraysetops.py", line 272, in unique ret = _unique1d(ar, return_index, return_inverse, return_counts) File "/opt/conda/lib/python3.8/site-packages/numpy/lib/arraysetops.py", line 333, in _unique1d ar.sort() TypeError: '<' not supported between instances of 'NoneType' and 'str' ```

I think the problem lies in the 'smpl_vert_segmentation.json' file. please help

YuliangXiu commented 1 year ago

Use SMPL-based HPS instead, such as PyMAF/BEV/HybrIK.

Zevrap-81 commented 1 year ago

Thanks it worked.

One more thing, how do i get these segmentation boundaries for my own images? Can i use sam for it? also are these pixel coordinates?

YuliangXiu commented 1 year ago

I think you can use SAM, as long as you can convert the mask into the json format, see garment-extraction.md.

msverma101 commented 1 year ago

but the question is how did you convert the mask into json format?