Open dubesar opened 4 years ago
Hey @dubesar , I had to modify a couple of things so far to run the code:
test.py
the parameter was --stage "Stage3"
, not --stage "Refine"
test.py
, line 85 is using absolute path plt.imsave("{}/{}_{}_ref.jpg".format(save_ref,f,img1[:-6]),resize(plt.imread("/home/np9207/vton/data/{}/image/{}_0.jpg".format(opt.datamode,img1[:-6])),(128,128)))
, I changed it too. I am trying to encapsulate all the models needed to generate the final result, given a cloth and a person image, although I am having trouble to use the pose estimator and segmentation models.
Here is my steps to run this whole testing process through on Colab, the final result is not satisfying as I expected. Probably I'm doing it in a wrong way.
Model image:
cloth image:
final result:
Get repo and data
!git clone https://github.com/nile649/POLY-GAN.git
%cd POLY-GAN
!cp -r /content/drive/MyDrive/Dataset/poly-gan/pre_trained_models/ ./
!cp -r ./pre_trained_models/data ./
!unzip ./data/data.zip
show some data
from PIL import Image
im = Image.open("/content/POLY-GAN/data/test/image/000001_0.jpg")
im
change code
in test.py, line 10, change
from skimage.filters import threshold_otsu,threshold_adaptive
to
from skimage.filters import threshold_otsu,threshold_local
in line 97, also change
binary = threshold_adaptive(temp2[:,:,0], block_size, offset=0)
to
binary = threshold_local(temp2[:,:,0], block_size, offset=0)
In line 85, change
"/home/np9207/vton/data/{}/image/{}_0.jpg"
to
"./data/{}/image/{}_0.jpg"
Note: if you don't want to change threshold_adaptive, you need to install scikit-image==0.14.2 as mentioned in requirements.txt, which may take you some minutes
stage1
!python test.py --datamode test --stage Stage1 --model_image 000001_0.jpg --reference_image 000347_1.jpg
stage2
!python test.py --datamode test --stage Stage2 --model_image 000001_0.jpg --reference_image 000347_1.jpg
stage3
!pip install matplotlib==3.0.2
!!python test.py --datamode test --stage Stage3 --model_image 000001_0.jpg --reference_image 000347_1.jpg
Then you cannot find final result at results/test/Stage3. It's at ./results/test/Stage3temp_res.
Hey, there's some confusion regarding running the code. Can you create a copy of google colab for this code so that we can directly run on colab.