GCChen97 / PISR

MIT License
6 stars 0 forks source link

A bug found in code #1

Open Yu-fei-Han opened 1 week ago

Yu-fei-Han commented 1 week ago

Thank you for your work!

However, when testing your method on other datasets, I consistently encounter an "index out of bounds" error. To troubleshoot this, I have repeatedly checked for the source of the problem.

Ultimately, I discovered that the issue lies in the function preprocess_data in PISR/systems/pol_neus.py at line 118. The line of code should be:

y = y.view(-1,).clamp(0, self.dataset.h*2-1).long()

instead of:

y = y.view(-1,).clamp(0, 2047).long()

This adjustment restricts the index range correctly based on the dataset dimensions.

I look forward to your update.

GCChen97 commented 1 week ago

Thanks for the debugging. I used 2047 since most of the polarization images are captured using cameras with the same Sony IMX250MYR sensor. In fact, a more reasonable way is to preprocess the data in dataloader. I'll update the code later.