htcr / sam_road

Segment Anything Model for large-scale, vectorized road network extraction from aerial imagery. CVPRW 2024
https://arxiv.org/pdf/2403.16051.pdf
MIT License
135 stars 17 forks source link

return error,When extract_graph_points doesn't extract useful points, it won't print out the result #6

Closed kuaiqushangzixiba closed 4 months ago

kuaiqushangzixiba commented 5 months ago
## Extract sample points from masks
graph_points = graph_extraction.extract_graph_points(fused_keypoint_mask, fused_road_mask, config)
if graph_points.shape[0] == 0:
    return graph_points, np.zeros((0, 2), dtype=np.int32)

pred_nodes, pred_edges, itsc_mask, road_mask = infer_one_img(net, img, config)

It normally returns four values, but here it returns only two, and the program crashes

htcr commented 5 months ago

Hi, thanks for flagging. What was the exact condition you encountered this issue? Were you using a custom dataset? If you have a fix, feel free to create a pull request.

htcr commented 4 months ago

Closing, feel free to reopen if need further discussion.