sel118/LaneAF

Are labels mistakenly used in infer _culane.py?

Closed this issue · 1 comments

'match_multi_class' function is called in infer _culane.py at line 96-102, as following.

line96 : seg_out = decodeAFs(mask_out[:, :, 0], vaf_out, haf_out, fg_thresh=128, err_thresh=5)
line99: seg_out = match_multi_class(seg_out.astype(np.int64), input_seg[0, 0, :, :].detach().cpu().numpy().astype(np.int64))
xy_coords = get_lanes_culane(seg_out, test_loader.dataset.samp_factor)

But when I dive into the details of 'match_multi_class' function, it seems the labels of test imgs are used to refine the seg_out. And based on the refined segout 'match_multi_class' function, culane style lines are generated which is logically wrong in my thought. I am trying to visualize the difference of the outputs between line 96 and line 99. Could you please explain about this? Thanks in advance!

The match_multi_class function is used to map predicted lanes IDs to ground truth lane IDs. This is only so that lanes have consistent IDs across images, i.e. the left most lane would always have ID 1 and so on. This is purely for visualization purposes (so that same lanes have the same color across images in the entire dataset), and does not affect the outputs produced by the model.