LArbys / LArCV

Liquid Argon Computer Vision
11 stars 9 forks source link

swapping channels then running forward causes score to change #27

Closed twongjirad closed 6 years ago

twongjirad commented 8 years ago

even when opencv was not used.

sigh....

vgenty commented 8 years ago

Hi Taritree I think I have a fix inplace -- in addition I think I have provided a way to provide a set of "preset" configuration button a la Janet's request (if you agree with the changes I would encourage you to point her to the most current iteration of the viewer)

A made a number of changes

vgenty commented 8 years ago

I don't have a pull request ready for you at the moment but I encourage you to checkout rgb_caffemod and test it out the interface has changed a bit.

I also forgot to mention that the switching channels has been resolved. I'm not an expert in the 12 channel image so please ensure that in caffe_copy_image that it's transposed correctly, work_mat contains 12 nonzero channels, which is different than in your branch

vgenty commented 8 years ago

I took a few minutes to verify things were going into the blob ok in the wrapper using your script, I hope I can save you the trouble of having to check this a second time! The transpose operation in ch12image.py here seems fine. I guess it goes into the caffe blob O.K. -- when I take a look at bnb_set1_ch12_supported.root entry number 6

screen shot 2016-05-08 at 10 20 56 pm

and dump using your savez line I see arr1_

and when I dump the lmdb bnb_set1_supported.db arr2_

there looks to be 1 or 2(?) tick offset just flipping the images back and forth as you probably mentioned already. The charge scale looks different as well which I also see -- sum of ADC from lmdb and sum of ADC from root file is 10^3 factor different. The output of compare_data_blob.py you can find at this pastebin between the two. The lmdb and the bnb sample is probably just different, but at least it sits in the blob o.k.

I also took a look at test.root which I think you created from bnb_set1_supported.db using convert_lmdb2image2d. The rows/colums look flipped to me in the viewer but that's no big deal.

screen shot 2016-05-08 at 11 01 14 pm

There is no tick offset between entry 6 and 0*7_00 in the lmdb and I can match the network scores in the viewer and your python test script. arr1__

So in summary transpose operation before caffe is not needed for test.root before it goes to the wrapper, but is for the bnb*supported.root. In addition, bnb*supported.root's adc values are higher. So I think i'll leave the current implementation as is, transpose before it goes to caffe. Also, sorry I snooped around your larbys directory ;). Hopefully I can put this to rest and push to master

drinkingkazu commented 6 years ago

I think this is a legacy feature so I would close this issue. But please re-open if appropriate!