Closed BartvanMarrewijk closed 3 years ago
Hi @studentWUR,
Thanks for your questions. For the first question, you're right. The correct transpose should be (2,0,1) (i.e., from numpy image: H x W x C to torch image: C x H x W). Sorry that I didn't notice this mistake. The leaf_gan_model.py has been updated with correct transpose. Please check it.
For the second question, we follow the training procedure of the original CycleGAN repository (link) which had no data augmentation. If you want improvement, you can add your own data augmentation in your code :)
If you find any mistakes, please feel free to let me know!
Hi @huuquan1994,
Thank you for updating it.
For the second question, thank you for the confirmation. Somehow I still see that one out of +-5 images is mirrored. In the example above the upper right corner and the lower left corner is mirrored. I could not find out why this occurred, do you have any ideas?
Hi @studentWUR,
I found that the original CycleGAN implementation has the transforms.RandomHorizontalFlip()
(as well as in our LeafGAN)
Since the CycleGAN paper didn't describe their data augmentation technique, I assumed that they didn't use augmentation.
Turned out it actually has that option with the flag no_flip = False
in the base_dataset.py (I just found out this thanks to your question :) )
By default, this value is False
, and this results in a randomly horizontal flip. To disable, please set the no_flip
flag to True
I hope this helps!
In the
leaf_gan_model.py
functionget_masking
a transpose of 2,1,0 is used to convert the mask to Cx .. x .. shape, which changes any input from HxWxC to CxWxH. I wonder if this transpose is correct and why not a tranpose of 2,0,1 is used. To convert a HxWxC array to CxHxW. Using the code below, it seems that is a mismatch between the heatmap and the orientation when using a tranpose of 2,1,0.Another question are there any augmentations, like flipping used? I could not find them in the dataloader, but is seems that is occurs a few times.
` def get_masking(self, tensor, threshold): with torch.enable_grad():
probs, idx = self.netLFLSeg.forward(tensor)
`
This results in the following image. The mask is horizontal