muelea / shapy

CVPR 2022 - Official code repository for the paper: Accurate 3D Body Shape Regression using Metric and Semantic Attributes.
https://shapy.is.tue.mpg.de/
319 stars 47 forks source link

A2S with ModelAgency data #40

Open jongunee opened 9 months ago

jongunee commented 9 months ago

Hi

Thanks for this exciting project. I am trying to run A2S using ModelAgence data.

I downloaded the ModelAgencydata, but it seemed impossible to use it for testing right away, so I checked the file modeldata_for_a2s_mal.pt and the file modeldata_for_a2s_mal.pt in the path of /shapy/samples/attributes. And I pre-processed the data.

When I followed your demo code below:

cd attributes

# a) female attributes to gender-specific betas
python demo.py --demo_output_folder ../samples/a2s_fit/00_a2s_ff --exp-cfg configs/a2s_variations_polynomial/00_a2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-female_smplx-female-10betas/poynomial/00_a2s.yaml/ ds_gender=female model_gender=female num_shape_comps=10

# b) female attributes + height to gender-specific betas
python demo.py --demo_output_folder ../samples/a2s_fit/01b_ah2s_ff --exp-cfg configs/a2s_variations_polynomial/01b_ah2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-female_smplx-female-10betas/poynomial/01b_ah2s.yaml/ ds_gender=female model_gender=female num_shape_comps=10

# c) female attributes + height + chest + waist + hips to gender-specific betas
python demo.py --demo_output_folder ../samples/a2s_fit/04b_ahcwh2s_ff --exp-cfg configs/a2s_variations_polynomial/04b_ahcwh2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-female_smplx-female-10betas/poynomial/04b_ahcwh2s.yaml/ ds_gender=female model_gender=female num_shape_comps=10

# d) female attributes + height + chest + waist + hips to gender-neutral betas
python demo.py --demo_output_folder ../samples/a2s_fit/04b_ahcwh2s_fn --exp-cfg configs/a2s_variations_polynomial/04b_ahcwh2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-female_smplx-neutral-10betas/poynomial/04b_ahcwh2s.yaml/ ds_gender=female model_gender=neutral num_shape_comps=10

# e) male attributes + height + chest + waist + hips to gender-neutral betas
python demo.py --demo_output_folder ../samples/a2s_fit/04b_ahcwh2s_mn --exp-cfg configs/a2s_variations_polynomial/04b_ahcwh2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-male_smplx-neutral-10betas/poynomial/04b_ahcwh2s.yaml/ ds_gender=male model_gender=neutral num_shape_comps=10

# f) male attributes + height + chest + waistß + hips to gender-specific betas
python demo.py --demo_output_folder ../samples/a2s_fit/04b_ahcwh2s_mm --exp-cfg configs/a2s_variations_polynomial/04b_ahcwh2s.yaml --exp-opts output_dir=../data/trained_models/a2b/caesar-male_smplx-male-10betas/poynomial/04b_ahcwh2s.yaml/ ds_gender=male model_gender=male num_shape_comps=10

a) is worked well but the rest of the cases had very strange betas results like this:

Predicted bestas for ullamodels_Lukas_A
[-220010.45    -87673.35     34770.098     2416.1309   20770.61
  -22331.287   -12247.801  -113331.45   -108111.984   154844.66  ]

Unlike a2s, ahcwh2s seems to require additional setup or previous steps, is that right? If so, which one do I need?

jongunee commented 9 months ago

Solved!

it was because of the unit

/shapy/attributes/attributes/dataloader/demo.py

class DEMO_A2S():
    def __init__(
        self,
        #betas_folder='../samples/shapy_fit/',
        ds_gender='female',
        model_gender='neutral',
        model_type='smplx',
        rating_folder='../samples/attributes/'
    ):

        ....

        #self.db['height_gt'] = self.db['heights'].astype(np.float32) #before
        self.db['height_gt'] = self.db['heights'].astype(np.float32) / 100 #after
        self.db['chest'] = self.db['bust'].astype(np.float32) / 100
        self.db['waist'] = self.db['waist'].astype(np.float32) / 100
        self.db['hips'] = self.db['hips'].astype(np.float32) / 100

In ModelAgency dataset file, units are all "cm", so i think it was not matched.

I have another question. There are no "weights" GT data in ModelAgency file, so i cannot execute "ahwcwh2s". Is there any dataset that satisfies all conditions?

Rut-B commented 8 months ago

@jongunee I'm trying to figure out how to run the shapy model on my own RGB images, without needing any additional files like keypoints or vertices.

I would greatly appreciate it if you could provide me an explanation of how to run the code with my RGB images only - to get the measurements of the body

Thank you very much!

jongunee commented 7 months ago

Oh sorry for late reply... I completely forgot about it.

Unfortunately, what I've done is inferred using the A2S function. That means, i inferred 3d mesh using linguistic attributes like below.

"attributes": [
    2.4285714285714284,
    2.5,
    3.2857142857142856,
    2.0714285714285716,
    4.285714285714286,
    3.0,
    3.5,
    3.9285714285714284,
    3.357142857142857,
    2.857142857142857,
    1.4285714285714286,
    1.7857142857142858,
    3.0,
    1.6428571428571428,
    4.142857142857143
]

to 3d mesh output.

So i didn't use RGB images in this case. If i test your case, let you know.