minar09 / cp-vton-plus

Official implementation for "CP-VTON+: Clothing Shape and Texture Preserving Image-Based Virtual Try-On", CVPRW 2020
https://minar09.github.io/cpvtonplus/
MIT License
356 stars 122 forks source link

Test with other types of clothing #65

Open JaquesM opened 3 years ago

JaquesM commented 3 years ago

Hi, I trained this code with a database that contains only pants, but the code treated the pants as if they were shirts...

Were in the code should I change to train properly the network to try pants?

ericguillaume commented 3 years ago

Hi @JaquesM good question !

You should update the parse_head and parse_cloth segmentation variable in cp_dataset.py. By the way, I would love to know what dataset you are using for pants ? and how big it is ?

Don't hesitate to ask me if you need more help !

JaquesM commented 3 years ago

Thats in my cp_dataset file:

`parse_array = np.array(im_parse)

parse_shape = (parse_array > 0).astype(np.float32) parse_head = (parse_array == 1).astype(np.float32) + \ (parse_array == 2).astype(np.float32) + \ (parse_array == 4).astype(np.float32) + \ (parse_array == 13).astype(np.float32)

parse_cloth = (parse_array == 5).astype(np.float32) + \ (parse_array == 6).astype(np.float32) + \ (parse_array == 7).astype(np.float32)`

To what values should I change it?

About the dataset, I got it by scraping a lot of cloth stores online and filtering them. I have about 20 thousando images with their clothes.

Thanks

ericguillaume commented 3 years ago

Good,

Have you organised your dataset by pair of images first ? And resized all the images to the same size. Those are required steps. I will post the code change when I have free time as I don't want to mistake you.

Do you think you could share with me your dataset, I would really enjoy running it on pants myself and you have more images than I do, but mine could help you improve your quality ! you can email me at if you are interested

Cheers

ericguillaume commented 3 years ago

I would go ahead and replace it with:

`parse_array = np.array(im_parse)

parse_shape = (parse_array > 0).astype(np.float32) parse_head = (parse_array == 5).astype(np.float32) + (parse_array == 18).astype(np.float32) + (parse_array == 19).astype(np.float32)

parse_cloth = (parse_array == 6).astype(np.float32) + (parse_array == 9).astype(np.float32) + (parse_array == 12).astype(np.float32)`

I have no way to easily test it at the moment, but that basically how I would go with it. Have you already run the algorithm with tops only ?

masfour7 commented 3 years ago

Hey @ericguillaume , Thanks for your work and your advice. May I ask why the parse_head needs to be changed? And why change it to this specific value?

ericguillaume commented 3 years ago

Hello @masfour7 , interesting question !,

The parse_head needs to be changed as it indicates parts of the image the algorithm shouldn't change, it improves resulting images quality but also stabilise the learning.

If you wishes I may have some interesting screenshots to offer more perspective on this, you can reach me at guillaumeric.info@gmail.com if you want to see them.

By the way, I would love to know what dataset you are using for changing several types of garments at the same time ?

Please ping me if you need further explanations.

khader-zatari commented 2 years ago

Hi, I trained this code with a database that contains only pants, but the code treated the pants as if they were shirts...

Were in the code should I change to train properly the network to try pants?

Hi Have you trained the model? if yes, could you please share the data set that you have used, and if you have the pre-trained model, can you share it with us? and if you have a repo for your could can you share it too?

thanks,

omaraga12 commented 2 years ago

Anyone of you got good results trying with pants?