cuiaiyu / dressing-in-order

(ICCV'21) Official code of "Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing" by Aiyu Cui, Daniel McKee and Svetlana Lazebnik
https://cuiaiyu.github.io/dressing-in-order
Other
513 stars 127 forks source link

Excuse me, where can i find the "pretrained_models/flownet.pt" ? In demo.ipynb #23

Closed little-misfit closed 2 years ago

little-misfit commented 2 years ago

i can find the other three weights, but i can't find the "flownet.pt". I also go to the github of GFLA, there is no flownet.pt. So can you tell me where/how can i get this weights? thanks

cuiaiyu commented 2 years ago

Hi, for demo, please put latest_net_Flow.pth for opt.flownet_path (or you can specify opt.flownet_path='' as well, because it will load the saved checkpoints later anyway.)

For training, please put the pre-trained flownet for opt.flownet_path. If you don't want to train the flownet by yourself, you can also extract the flownet weight from GFLA by:

  1. Download weights of Pose-Guided Person Image Generation (the weights trained on fashion dataset.)
  2. Then extract the flownet weights from the latest_net_G.pth (the weight of the full GFLA model) by something like
    import torch
    weights = torch.load("latest_net_G.pth")
    flownet_weights = {w.replace("flow_net.",""): weights[w] for w in weights if w.startswith("flow_net")}
    torch.save(flownet_weights, "flownet.pth")

    Note GFLA is trained on 256x256 images.

little-misfit commented 2 years ago

Thanks for your answer o( ̄▽ ̄)ブ

XuJ1E commented 2 years ago

Thanks for your answer, and I also can't find the flownet.opt file, so if there is the url for flownet.opt will be better

XuJ1E commented 2 years ago

Thanks for your answer, and I also can't find the flownet.opt file, so if there is the url for flownet.opt will be better

There is no need to replay my question, and I have already got it, and also thank you very much about your idea

Rakibuz commented 2 years ago

First of all, there was a issue regarding "flownet.pt" not fund, I resolved it by using opt.flownet_path='' but unfortunately now this issue arrised. What can I do ?

load vgg ckpt from torchvision dict. [init] init pre-trained model vgg. initialize network with orthogonal initialize network with orthogonal initialize network with kaiming initialize network with orthogonal [init] frozen net netVGG. [init] frozen net netFlow. [init] frozen net netE_attr. [init] frozen net netE_attr. not exsits checkpoints/DIOR_64/latest_net_E_attr.pth not exsits checkpoints/DIOR_64/latest_net_G.pth not exsits checkpoints/DIOR_64/latest_net_VGG.pth not exsits checkpoints/DIOR_64/latest_net_Flow.pth ---------- Networks initialized ------------- [Network E_attr] Total number of parameters : 1.191 M [Network G] Total number of parameters : 16.501 M [Network VGG] Total number of parameters : 0.113 M [Network Flow] Total number of parameters : 6.608 M



FileNotFoundError Traceback (most recent call last) in () 30 # create model 31 model = DIORModel(opt) ---> 32 model.setup(opt)

1 frames /content/drive/MyDrive/Virtual Fitting Room/dressing-in-order-main/models/base_model.py in _init_tensorboard(self, opt) 146 if os.path.exists(self.tb_dir): 147 shutil.rmtree(self.tb_dir) --> 148 os.mkdir(self.tb_dir) 149 self.image_dir = os.path.join(self.tb_dir, "images") 150 os.makedirs(self.image_dir, exist_ok=True)

FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/DIOR_64/test'