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
151 stars 18 forks source link

Does this code correspond to the paper? #16

Closed QK51643729 closed 5 months ago

QK51643729 commented 5 months ago

As I can see in Figure2 , the input to the NMS is the two graphs extracted from the model, but in the code dataset.py I see that the NMS input comes from the ground truth. can you explain it?

htcr commented 5 months ago

Hi, the code does corresponds to the paper. As mentioned in the paper, during training, the model uses "teacher forcing", which adds noise to ground-truth to emulate the predicted vertices. You can find that in inference.py, the model first generates vertices from its predicted mask with NMS, then predicts topology based on those, no ground-truth involved during inference.

QK51643729 commented 5 months ago

Ok, thank you for your timely reply. I don't know much about teacher force. Is it feasible to add noise to GT as training data?

htcr commented 5 months ago

It seems feasible according to our experiments. Rule of thumb is to emulate the predicted distribution well