Open furkan59 opened 1 year ago
https://colab.research.google.com/drive/1JOwOPaChoc9GzyBi5FUEYTSaP2qxJl10?usp=sharing#scrollTo=VtZDKLL8jWLr You can refer this notebook. results are not exactly same as shown in the paper, but works well.
I think the problem is how to get the exact training data of VITON-HD according to the documentation
I saved a parse map image using PIL.Image with P mode. The color of the parse map image in our dataset(VITON-HD) is just for the visualization, it has 0~19 uint values.
Should we just change this line https://github.com/Engineering-Course/CIHP_PGN/blob/master/test_pgn.py#L194C11-L194C11
cv2.imwrite('{}/{}.png'.format(parsing_dir, img_id), parsing_[0,:,:,0])
to
Image.fromarray(parsing_[0,:,:,0]).convert("P").save('{}/{}.png'.format(parsing_dir, img_id))
This one seems fine thanks https://colab.research.google.com/drive/1JOwOPaChoc9GzyBi5FUEYTSaP2qxJl10?usp=sharing#scrollTo=VtZDKLL8jWLr
but the results produced by this https://colab.research.google.com/drive/1JOwOPaChoc9GzyBi5FUEYTSaP2qxJl10?usp=sharing#scrollTo=VtZDKLL8jWLr are far from the ones in viton regardless of the color
example here
the one in viton
the one produced by the referred package, where the torso is missing and mistakenly classified into background
According to the processing part of the HR-VITON code: https://github.com/sangyun884/HR-VITON/blob/main/Preprocessing.md
Check https://github.com/Engineering-Course/CIHP_PGN for human parsing. I inferenced a parse map on 256x192 resolution, and upsample it to 1024x768. Then you can see that it has a alias artifact, so I smooth it using "torchgeometry.image.GaussianBlur((15, 15), (3, 3))". I saved a parse map image using PIL.Image with P mode. The color of the parse map image in our dataset(VITON-HD) is just for the visualization, it has 0~19 uint values.
Using repo https://github.com/Engineering-Course/CIHP_PGN
and with the human image you can use the inf_pgn.py
to generate the segmentation results with the trained models.
Before it, you must setup:
datasets/images
) inf_pgn.py
to store the result image with "P" mode: Add parsing_im = parsing_im.convert('P')
before the line 198 parsing_im.save('{}/{}_vis.png'.format(parsing_dir, img_id))
Now run the command: python3 inf_pgn.py The output image path will be in folder datasets/output This result will be use for the image-parse-v3 folder of VITON - HD dataset
hi @triminh12042002
I tries this approach but looks like that repo is using pretty old versions of tensorflow. How did you get it to work? Did you use python 2.x ?
whiterose199187 No, I'm using python 3.7 According to file requirements.pip, the repo used Tensorflow 1.5 so we need python3.7 or lower to install it. I think u should use conda to create an env with python3.7 and install the requirements package as step 1
@whiterose199187 were u able to implement viton-HD?
I have human images but how can I create image-parse images in folder "VITON-HD\data\train\image-parse-v3".