TonyXuQAQ / RNGDetPlusPlus

Official repo of paper RNGDet++: Road Network Graph Detection by Transformer with Instance Segmentation and Multi-scale Features Enhancement
GNU General Public License v3.0
81 stars 12 forks source link

Training Label Calculation #14

Closed codeastra2 closed 1 year ago

codeastra2 commented 1 year ago

Hi, Thanks so much for your work ! I had few understanding question regarding the training code since i am trying to re-implement it.

In general if you could describe the generation of the above 2 labels it would be of great help to me, thanks!

TonyXuQAQ commented 1 year ago

Hi,

Thanks for your question. My general suggestion is to wait for the training code of our work, which is expected to release two or three months later since the paper is still under review.

  1. You could refer to section III.E and Fig. 7 of paper RNGDet for detailed rules for label generation. We do not consider angles, but use the ground truth road network to generate $V^*$.
  2. Yes. Generated ground truth vertices have $p_i$ as 1. In each step, we predict 10 vertices in the next step, and we match the prediction with ground truth vertices in the next step (refer to DETR for loss calculation). Those predicted vertices matched with some GT vertices are treated as valid, while others are invalid.
  3. We use all 10 vertices for loss calculation during training. And filter out vertices with low valid probability during inference.

We will open-source the training code soon. You can find the answers to your question there. Please be patient and thanks for your understanding.

codeastra2 commented 1 year ago

Thanks a lot for your reply!

I am actually doing my master thesis at DLR Germany and I would like to build upon your great work, hence I cannot wait for 2/3 months. It would be great if you could continue to answer my queries.

TonyXuQAQ commented 1 year ago

Thanks for your questions.

  1. Correct. You do not need to consider initial candidate vertices during the generation of $V^*$. BFS should suffice.
  2. Correct. For example, at one step, there are two ground truth vertices ($V^*={v_1,v_2}$) in the next step, then we will match 10 predicted vertices with those 2 ground truth vertices by the Hungarian algorithm. Then, 2 predicted vertices matched with ground truth vertices are treated as valid vertices (i.e., $y=1$), while the other 8 unmatched predicted vertices are invalid (i.e., $y=0$).
  3. BFS is used. The agent is not utilized during the sampling period for better efficiency.
  4. If the distance between the current vertex and some intersection points is smaller than a threshold, we move to this intersection point, and switch to intersection mode. Thanks
TonyXuQAQ commented 1 year ago

The sampling and training codes are released. Please refer to the implementation code for details. This issue is closed.