AndresCasado / pergamo

Code for PERGAMO, a two step approach to learn deformable models
http://mslab.es/projects/PERGAMO/
38 stars 4 forks source link

DatosGreen doesn't match the expected filenames #10

Closed IamShubhamGupto closed 5 months ago

IamShubhamGupto commented 1 year ago

Hello I am trying to recreate the results using DataDanGreen folder

I got the following error when running run_recons.sh

RuntimeError:  Folder "smpl" does not exist for sequence "clips". Full path tested: "data/DataDanGreen/clips/clips_smpl".
Uncomment one of the commands and edit the path

Was hoping to get some help resolving this

Thank you

AndresCasado commented 1 year ago

Hi!

You have to edit run_recons.sh and uncomment one of the example commands

Let me know if it works for you

IamShubhamGupto commented 1 year ago

Hey @AndresCasado Thank you for getting back. I did edit run_recons.sh file

python3 reconstruction_script.py --dir data/DataDanGreen/
# python3 reconstruction_script.py --dir /path/to/dataset/DatosDan/sequences
echo "Uncomment one of the commands and edit the path"

Here is the DataDanGreen directory

[sg7761@log-2 DataDanGreen]$ tree .
.
0037_rect.txt

5;40m0162.png

m
0033_tshirt.npy
g
rt.npy
0mresult_0083_512.png
m
0127_rect.txt
0224_rect.txt
5;40m0263.png
g
38;5;40m0174_tshirt.npy
m0241.png
38;5;40m0289_tshirt.npy
lt_0120_512.png
0298_512.png
0036_rect.txt
5;40m0145.png
lt_0120_512.png

s.npz
3.png
0m
89_tshirt.npy
[0m
lt_0120_512.png
5;40m0057.png
5;40m0152.png

g
38;5;40m0034_tshirt.npy
38;5;40m0103_tshirt.npy
m0170.png
lt_0122_512.png
5;40m0044.png
5;40m0078.png
0142_rect.txt
38;5;40m0035_tshirt.npy
m0102.png
38;5;40m0152_tshirt.npy
lt_0120_512.png
png

8;5;40m0147.png
m
lt_0166_512.png

8;5;40m0036.png
5;40m0117.png
5;40m0216.png
_rect.txt

38;5;40m0034_tshirt.npy
38;5;40m0122_tshirt.npy
m0189.png
38;5;40m0277_tshirt.npy
[0m
[0m

m0101.png_110.pkl
;5;40mbody_frame0225.obj
e0293.obj
[0m

;5;40mbody_frame0174.obj
hed_frame0049.obj
_frame0115.obj
ame0181.obj
;5;40mbody_frame0142.obj
;40mpushed_frame0030.obj
mpushed_frame0096.obj
;5;40mbody_frame0198.obj
;5;40mbody_frame0189.obj
e0060.obj
;5;40mbody_frame0144.obj
e0212.obj
.obj
j
 pushed_frame0050.obj

ushed_frame0191.obj
obj
;40m0159.obj

obj
;40m0156.obj

9.obj
;5;40m0155.obj
obj
;40m0155.obj
obj
;40m0155.obj
obj
;40m0154.obj
obj
;40m0159.obj
obj
;40m0153.obj
[0m
AndresCasado commented 1 year ago

Ok, sorry, I thought you hadn't edited it.

The input is in the reconstruction_input.zip. Check the output of tree:

.
├── dan-301
│   ├── dan-301
│   │   ├── 0001.png
│   │   ├── 0001_rect.txt
│   │   ├── 0002.png
│   │   ├── 0002_rect.txt
│   │   ├── 0003.png
│   │   ├── 0003_rect.txt
│   │   ├── ...
│   │   ├── ...
│   │   ├── ...
│   │   ├── ...
│   │   ├── ...
│   ├── dan-301_expose
│   │   ├── 0001.png_109
│   │   │   ├── 0001.png_109_params.npz
│   │   │   ├── 0001.png_109.ply
│   │   │   ├── hd_imgs.png
│   │   │   ├── hd_orig_overlay.png
│   │   │   └── hd_overlay.png
│   │   ├── 0002.png_129
│   │   │   ├── 0002.png_129_params.npz
│   │   │   ├── 0002.png_129.ply
│   │   │   ├── hd_imgs.png
│   │   │   ├── hd_orig_overlay.png
│   │   │   └── hd_overlay.png
│   │   ├── ...
│   │   │   ├── ...
│   │   │   ├── ...
│   │   │   ├── ...
│   │   │   ├── ...
│   │   │   └── ...
│   ├── dan-301_parsing
│   │   ├── 0001.png
│   │   ├── 0001_tshirt.npy
│   │   ├── 0002.png
│   │   ├── 0002_tshirt.npy
│   │   ├── 0003.png
│   │   ├── 0003_tshirt.npy
│   │   ├── ...
│   │   ├── 0260.png
│   │   └── 0260_tshirt.npy
│   ├── dan-301_pifu
│   │   ├── result_0001_512.png
│   │   ├── result_0002_512.png
│   │   ├── ...
│   │   └── result_0260_512.png
│   └── dan-301_smpl
│       ├── 0001.png_109.obj
│       ├── 0001.png_109.pkl
│       ├── 0002.png_129.obj
│       ├── 0002.png_129.pkl
│       ├── ...
│       ├── 0260.png_191.obj
│       └── 0260.png_191.pkl
├── dan-302
│   ├── ...
│   └── ...
├── dan-303
│   ├── ...
│   └── ...
├── ...
│   ├── ...
│   └── ...
IamShubhamGupto commented 1 year ago

Ah I see, let me rerun pointing to the reconstruction_input folder. Ill update here soon.

IamShubhamGupto commented 1 year ago

@AndresCasado

I seem to have a new error 😅 in case you have faced this before, let me know how to proceed

(pergamo) Singularity> ./run_recons.sh 
Tshirt template: ./data/tshirt_4424verts.obj. Exists? True
The md5 is not the same, but ok
All sequences are correct
Traceback (most recent call last):                                                                                                             | 0/260 [00:00<?, ?it/s]
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 649, in <module>
    main()
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 645, in main
    run_sequence_loading_data(processed_sequence_information)
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 427, in run_sequence_loading_data
    for info_dict in info_dicts:
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 539, in process_sequence
    'smpl_params': smpl_params[frame],
KeyError: 1
IamShubhamGupto commented 1 year ago

@AndresCasado Hey, since I was not able to figure out the above error, I believe my dataset setup has gone wrong. I have placed reconstruction_input as in in a folder called DataDanGreen

The command in the run_recon.sh file is

python3 reconstruction_script.py --dir data/DataDanGreen/reconstruction_input/

Let me know if I got anything wrong.

Thanks

IamShubhamGupto commented 1 year ago

On adding some print statements, I see my smpl_params variable is empty

(pergamo) Singularity> ./run_recons.sh 
Tshirt template: ./data/tshirt_4424verts.obj. Exists? True
The md5 is not the same, but ok
All sequences are correct
Saving SMPL-converted poses paths:   0%|                                                                                                       | 0/520 [00:00<?, ?it/s]
Saving silhouettes paths:   0%|                                                                                                                | 0/520 [00:00<?, ?it/s]
hiving Pifu normals paths:   0%|                                                                                                               | 0/260 [00:00<?, ?it/s]
smpl_params = {}
<class 'dict'>
hello?
Traceback (most recent call last):
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 654, in <module>
    main()
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 650, in main
    run_sequence_loading_data(processed_sequence_information)
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 427, in run_sequence_loading_data
    for info_dict in info_dicts:
  File "/scratch/sg7761/deep-learning/pergamo/reconstruction_script.py", line 544, in process_sequence
    'smpl_params': smpl_params[frame],
KeyError: 1
Uncomment one of the commands and edit the path

So on debugging more, I find that the smpl_params expects the pattern of type body_**.pkl with the code here

# region SMPL-converted poses
    smpl_params_folder = os.path.join(base_directory, sequence_name, sequence_name + '_smpl')
    smpl_pattern = re.compile(r'body_.*?(\d+).*\..*_\d+\.pkl')
    smpl_params = {}
    for file in tqdm.tqdm(os.listdir(smpl_params_folder), desc="Saving SMPL-converted poses paths"):
        match = smpl_pattern.match(file)
        if match:
            frame = int(match[1])
            smpl_path_to_load = os.path.join(smpl_params_folder, file)
            smpl_params[frame] = smpl_path_to_load
    # endregion

Since none of the files match this pattern, it is always empty.

For reference, I am using this dataset https://urjc-my.sharepoint.com/personal/andres_casado_urjc_es/_layouts/15/onedrive.aspx?ga=1&id=%2Fpersonal%2Fandres%5Fcasado%5Furjc%5Fes%2FDocuments%2FPERGAMO%5Fpublic%2FDataDanGreen

IamShubhamGupto commented 1 year ago

Worked fine when using DatosDanCompressed.zip

AndresCasado commented 1 year ago

Sorry I did not get back earlier. I have checked the folder and, as you stated, it doesn't load the pkl files because they do not match the body_.*.pkl regular expression. I'll keep this issue open because it needs to be fixed, and I'll try to solve it when I can.

Thanks for reporting it!

IamShubhamGupto commented 1 year ago

@AndresCasado Happy to help!!

Liu-xiaoyu11 commented 5 months ago

Hello I am trying to recreate the results using DataDanGreen folder

I got the following error when running run_recons.sh

RuntimeError:  Folder "smpl" does not exist for sequence "clips". Full path tested: "data/DataDanGreen/clips/clips_smpl".
Uncomment one of the commands and edit the path

Was hoping to get some help resolving this

Thank you

@IamShubhamGupto Hello, I apologize for the interruption. I noticed that you have also been working on replicating this code and would like to ask if you have encountered any of the issues I've recently posted about. I look forward to your response.

IamShubhamGupto commented 5 months ago

Hey @Liu-xiaoyu11, unfortunately I have not ran the setup on windows so I don't have enough information