Gal4way / TPD

This is the official repository for the paper "Texture-Preserving Diffusion Models for High-Fidelity Virtual Try-On". CVPR 2024
114 stars 21 forks source link

Low resolution results #12

Closed sahir2k closed 3 months ago

sahir2k commented 3 months ago

The images look very low resolution .

image

and when the parameters are increased to

--H 768 \
--W 1024 \

it throws

DDIM Sampler:   0%|                                   | 0/100 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/TPD/scripts/inference_single.py", line 544, in <module>
    main()
  File "/home/TPD/scripts/inference_single.py", line 422, in main
    z_result_first_stage, _ = sampler.sample(S=opt.ddim_steps,
  File "/home/conda/tpd/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/TPD/ldm/models/diffusion/ddim.py", line 99, in sample
    samples, intermediates = self.ddim_sampling(conditioning, size,
  File "/home/conda/tpd/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/TPD/ldm/models/diffusion/ddim.py", line 152, in ddim_sampling
    outs = self.p_sample_ddim(img, cond, ts, index=index, use_original_steps=ddim_use_original_steps,
  File "/home/conda/tpd/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/TPD/ldm/models/diffusion/ddim.py", line 177, in p_sample_ddim
    x=torch.cat([x,kwargs['inpaint_image'],kwargs['inpaint_mask'],kwargs['posemap'],kwargs['densepose']],dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 96 but got size 64 for tensor number 1 in the list.
Gal4way commented 3 months ago

The reason is that the current code generates images with a fixed resolution. You need to modify the code in dataloader.py and other related code to make sure it generates images with your resolution. For example:

image