ayanc / fdscs

45 stars 8 forks source link

Train and test using other cost computation method #5

Closed fshamsafar closed 4 years ago

fshamsafar commented 4 years ago

Hi,

I wish to train the network on only one cost volume computation method (different from Census and SAD). Could you please give some overall hints that which part of the code (functions or variables) I should modify?

Thanks in advance.

ayanc commented 4 years ago

The cost volume construction code is in the slib module. Specifically, you will need to re-write the slib.census function (which currently computes the census transform for the Y channel, and just directly stores the U and V channels), and the slib.hamming function (which currently computes the hamming distance for the Y census transform, and SAD for U, V).

You may also need to modify the way these functions are called (based on what kind of computation method you're using): in data.py & pdata.py (for training), and pproc.py (for testing). And of course, if your cost volume ends up having a different shape (e.g., fewer number of costs), you would need to update the network architecture (e.g., no of in_channels for the first layer).