Giter Club home page Giter Club logo

acgpn's People

Contributors

minar09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acgpn's Issues

ModuleAttributeError: 'Pix2PixHDModel' object has no attribute 'module'

I have searched the entire repo but still couldn't find the solution for the above error.
Any solution for this ?
File "train.py", line 168, in <module> loss_dict = dict(zip(model.module.loss_names, losses)) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 772, in __getattr__ type(self).__name__, name)) torch.nn.modules.module.ModuleAttributeError: 'Pix2PixHDModel' object has no attribute 'module'

Training problem

Thanks heaps for your good working replicating ACGPN inference model. One problem I am working on is that when I train it with VITON dataset (lip segmentation inputs with 20 labels), I found:

  1. The train.py forward pass inputs are different from their original model. Is there a specific reason for this change (one input data['image']  removed)?
    image

  2. When I use lip dataset for training, I ran into this error:
    image

Based on this report: NVlabs/SPADE#57, it should be a channel mismatch problem. However, I believe all relevant channels had been mapped to LIP except channel 7 (noise channel). The thing is that there is no counterpart in LIP label for this channel (I used a coat channel but not work apparently). Any recommendation for fixing this issue?

How to test with custom image ?

Thank you very much for contributing to this amazing project.

I am trying to test the model with custom images and I have:

  • test_color
  • test_edge
  • test_img
  • test_label
  • test_pose

How can you generate the files from the folders ?:

  • test_mask
  • tes_colormask

Thanks

How to dress specific clothes for a person

Hi, I'm trying to dress one person with some specific clothes in this dataset. However, when I run test.py, the result seems every person is dressed randomly by the clothes in file img_color. How can I dress specific clothes for a person. Thank you very much!

ValueError: not enough values to unpack (expected 16, got 10)

Thank you for your great job!
However, the training script of this repository does not work.
I meet the ValueError when run python train.py.
In line 161 of the train.py,

ValueError: not enough values to unpack (expected 16, got 10)

I checked the models/pix2pixHD_model.py.
Thus, the forward function of pix2pixHD_model.py returns only 10 arguments.
Now, I confirm the Unet class of the models/networks.py does not return rx, ry, cx, and cy arguments.
After that, I add the rx, ry, cx, and cy arguments to the return function of the forward function of the Unet class.

However, I cannot find refined, rg, and cg arguments of line 161 of the train.py.

Please fix the training scripts so it works.
Thanks.

Browser implementation of ACGPN.

Thank you for the repository, is there any browser implementation of the model and if not then is it possible to make it run on the client side ? since the pipeline contains various model will it cause issue.

How to run on custom image ?

I have tried your code and it is working fine but I want to run the code on custom images , how it is possible ?

RuntimeError: CUDA error: device-side assert triggered

Traceback (most recent call last):
File "E:\Virtual try on\ACGPN-master\test.py", line 122, in
main()
File "E:\Virtual try on\ACGPN-master\test.py", line 97, in main
fake_image, warped_cloth, refined_cloth = model(Variable(data['label'].cuda()), Variable(data['edge'].cuda()), Variable(img_fore.cuda()), Variable(
File "C:\Users\SM\AppData\Roaming\Python\Python39\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\Virtual try on\ACGPN-master\models\pix2pixHD_model.py", line 492, in forward
return self.inference(label, pre_clothes_mask, img_fore, clothes_mask, clothes, all_clothes_label, real_image, pose, grid, mask_fore)
File "E:\Virtual try on\ACGPN-master\models\pix2pixHD_model.py", line 384, in inference
input_label, masked_label, all_clothes_label = self.encode_input(
File "E:\Virtual try on\ACGPN-master\models\pix2pixHD_model.py", line 233, in encode_input
1, (label_map * (1 - clothes_mask)).data.long().cuda(), 1.0)
File "C:\Users\SM\AppData\Roaming\Python\Python39\site-packages\torch\tensor.py", line 528, in rsub
return _C._VariableFunctions.rsub(self, other)
RuntimeError: CUDA error: device-side assert triggered

How can I fix this issue?

train problem

when i train, i can't find train_pairs.txt in ./Data_preprocessing directory?

For How many epochs are the model already trained.

I have started training the model on viton dataset. till now i have trained for 4 epochs it is showing 15 days more means how much epoch more is required to complete the training process.
Can training the model again on MPV dataset is useful for better results.

Errors while Testing

@minar09 Hello thank you for providing the code for testing this model

But I'm facing this error while running the test.py
Screenshot 2021-09-22 at 10 15 33 AM

can you please help me with it?

Thank you

Label error

hello again, thank you very much for the previous answer.

I am trying to run the test.py file with custom images and I am getting the following error:

File "test.py", line 126, in
main()
File "test.py", line 103, in main
mask_clothes.cuda()), Variable(data['color'].cuda()), Variable(all_clothes_label.cuda()), Variable(data['image'].cuda()), Variable(data['pose'].cuda()), Variable(data['image'].cuda()), Variable(mask_fore.cuda()))
File "/home/josearangos/anaconda3/envs/torch_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/josearangos/Documentos/Clothe_mE/repositorios/versions_DeepFashion_Try_On/ACGPN/models/pix2pixHD_model.py", line 493, in forward
return self.inference(label, pre_clothes_mask, img_fore, clothes_mask, clothes, all_clothes_label, real_image, pose, grid, mask_fore)
File "/home/josearangos/Documentos/Clothe_mE/repositorios/versions_DeepFashion_Try_On/ACGPN/models/pix2pixHD_model.py", line 388, in inference
(label.cpu().numpy() == 11).astype(np.float)).cuda()
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorCopy.cpp:70

Thank you for helping me

Code for generate mask to clothe

@minar09 Thanks for share you ideas, I admire you a lot, Receive my regards

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

Using custom parser

Hi, Great work, and thanks for sharing. can I use the PGN_tf parsing model and use the output in this model? currently, I'm using the U^2 net mode to generate the masks.
I'd appreciate it if you could guide me to test this model on custom images.

How to dress specific clothes for a person

Hi, I'm trying to dress one person with some specific clothes in this dataset. However, when I run test.py, the result seems every person is dressed randomly by the clothes in file img_color. How can I dress specific clothes for a person. Thank you very much!

Cannot create full sleeves tryon

Hi, so I saw the paper wherein they have made full sleeves Tryon given a model wearing half sleeves clothing. But, I am not able to generate that.

download (4)

Note that, it is working the other way around.

download10

What parameters do I need to change?

Using Multiple GPUs

Hi,

Can you let me know how to use mutilGPU on this code? I checked netwoeks.py, all networks are assigned to model.cuda(gpus_id[0]). By model.cuda(gpus_id), does the network works on gpus or I need to do

model = nn.DataParallel(model) as well?

index out of range

There is a small error in file data/aligned_dataset.py line 203. There should be
'name': A_path.split("/")[-1].split("\")[0]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.