taesungp / contrastive-unpaired-translation

Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)
https://taesung.me/ContrastiveUnpairedTranslation/
Other
2.22k stars 416 forks source link

One-sided CUT test #45

Open swissalps9 opened 4 years ago

swissalps9 commented 4 years ago

Hi, how can I do a one-sided test where it's simply A to B, without an aligned image?

When I specify --dataset_mode single like CycleGAN, I get the following error:

dataset [SingleDataset] was created
model [CUTModel] was created
creating web directory ./results/helloworld_CUT/test_latest
Traceback (most recent call last):
  File "test.py", line 56, in <module>
    model.data_dependent_initialize(data)
  File "/home/miner/CUT/models/cut_model.py", line 101, in data_dependent_initialize
    self.set_input(data)
  File "/home/miner/CUT/models/cut_model.py", line 143, in set_input
    self.real_B = input['B' if AtoB else 'A'].to(self.device)
KeyError: 'B'
JunlinHan commented 4 years ago

Emm, one simple solution is that you may create a testB with one image (one is enough).

GuyARoss commented 2 months ago

Ever figure this out? I don't understand why there isn't a simple inference script that does this task.