cvg / DeepLSD

Implementation of the paper "DeepLSD: Line Segment Detection and Refinement with Deep Image Gradients"
MIT License
486 stars 62 forks source link

A small bug when running evaluate_line_detection.py #15

Closed hjshxb closed 1 year ago

hjshxb commented 1 year ago

Hi, When running evaluate_line_detection.py, an IndexError occurs due to match_lines(). The my_matches array of type float, because the pytlbd.lbd_matching_multiscale() also returns descriptor distances. So would raise IndexError: arrays used as indices must be of integer (or boolean) type

To fix this issue, replace line 66 with:

pred_matches[my_matches[:, 0].astype(np.int32)] = my_matches[:, 1].astype(np.int32)

Finally, Your work has been incredibly helpful to me.

rpautrat commented 1 year ago

Thanks a lot for reporting it, I just pushed the change: https://github.com/cvg/DeepLSD/commit/6593ead5970a7145c22480f5580c91f344a9422e