2gunsu / monocon-pytorch

Unofficial Pytorch Implementation for MonoCon(AAAI, 2022)
Apache License 2.0
86 stars 10 forks source link

fix target becomes to None after random crop #6

Closed Rickyyy-zh closed 2 years ago

Rickyyy-zh commented 2 years ago

Hi, I found a problem when calculating L1 loss and saw your TODO in l1_loss.py.

# TODO Handling an exception so that it can be handled even when the target data is empty

for a clean dataset, the main reason why target becomes to None is going through random crop augmention, so I simplely add a if ( ) in RandomCrop3D. When crop region is empty of target, just return original data and give up this augmention.

2gunsu commented 2 years ago

Hello. Thank you very much for your valuable suggestion. 😊 We will review what you said as soon as possible.