silburt / DeepMoon

Convolutional neural network code for extracting Lunar craters from Digital Elevation Maps (DEMs).
MIT License
120 stars 47 forks source link

`pytest test_get_unique_craters.py` returns no detections in (my environment for) Python 3 #9

Closed cczhu closed 6 years ago

cczhu commented 6 years ago

I ran pytest test_get_unique_craters.py in my Python 2 and Python 3 virtualenvs, and in the Python 3 one it template_match_t2c returned N_match == 0 under the test_extract test. Not obvious why this is happening on a quick inspection of the function.

silburt commented 6 years ago

Yes, I was investigating this yesterday and figured out the problem during my own testing. Turns out in python 3:

zip(*index_r)

returns an object and not a list by default. So Changing: coords_r = np.asarray(zip(*index_r)) to coords_r = np.asarray(list(zip(*index_r))) fixed the problem for me. @cczhu could you pull from master (I just merged fixed changes) and try again and confirm that you get good results now?

cczhu commented 6 years ago

@silburt Works now, thanks for the update!