switchablenorms / DeepFashion_Try_On

Official code for "Towards Photo-Realistic Virtual Try-On by Adaptively Generating↔Preserving Image Content",CVPR‘20 https://arxiv.org/abs/2003.05863
825 stars 252 forks source link

Preprocess data? #36

Closed Jen-Vu closed 3 years ago

Jen-Vu commented 4 years ago

Very nice work! Thanks for sharing. Could you please explain how you pre-process data (e.g. how you derived the data_colormask, data_mask, data_edge, data_pose etc.)? Many thanks!

MotiBaadror commented 4 years ago

Hi @Jen-Vu , Did you find anything related to the solution you are looking for?

MotiBaadror commented 4 years ago

Hi @Jen-Vu , If you are testing the model on custom data or given data you don't need data_colormask,data_mask, just create these 2 folders otherwise one assert failure error might appear. data_pose are the openpose coco model results. data_edge are mask for the cloth ( data_color in this case )

Jen-Vu commented 4 years ago

@MotiBaadror - thank you! Have you been able to run and test this ACGPN model with custom data?

MotiBaadror commented 4 years ago

Hi @Jen-Vu , You can find the steps here

Yijia-Chen commented 4 years ago

@Jen-Vu What tools do you use to preprocess test_img and test_color to get test_label (person segmentation) and test_edge (cloth mask)?

josearangos commented 3 years ago

@MotiBaadror Thanks for share you ideas

Hi, I want to share the code with i generated the mask for the clothes

import numpy as np
import cv2
from matplotlib import pyplot as plt

PATH_IMG ="5.jpg"
image = cv2.imread(PATH_IMG)
mask = np.zeros(image.shape[:2], dtype="uint8")
rect = (1, 1, mask.shape[1], mask.shape[0])
fgModel = np.zeros((1, 65), dtype="float")
bgModel = np.zeros((1, 65), dtype="float")
start = time.time()
(mask, bgModel, fgModel) = cv2.grabCut(image, mask, rect, bgModel,
                                       fgModel, iterCount=10, mode=cv2.GC_INIT_WITH_RECT)
outputMask = np.where((mask == cv2.GC_BGD) | (mask == cv2.GC_PR_BGD),0, 1)
outputMask = (outputMask * 255).astype("uint8")

plt.imshow(image)
plt.title('my picture')
plt.show()

image

plt.imshow(outputMask, cmap="gray")

image

LZQhardworker commented 3 years ago

We have a colab inference link, you may check the process there.