Closed BIT-MJY closed 1 year ago
Hello @EdwardLeeLPZ ,
Thanks for your great work! I have one question about the
predict_instance_segmentation
function in instance.py. Could you please tell me why you useoutput['instance_flow'][b, 1:2].detach(),
rather than the first predicted instance flow [b, 0:1] to generate the instance inget_instance_segmentation_and_centers
?
Hello @BIT-MJY ,
Your question is critical. To better understand the different outputs used for post-processing, please refer to this figure:
The get_instance_segmentation_and_centers
function is used for giving an initial instance segmentation of the first valid prediction frame (t=0). It is implemented in the following manner:
torch.softmax(output['segmentation'], dim=2)[b, 0:1, vehicles_id].detach()
as the centers of instances at the past moment (t=-1) (Line 44 - 55);output['instance_flow'][b, 1:2].detach()
to find the corresponding position in the past frame (t=-1) to which all pixels at the moment t=0 are pointing (Line 59- 72);foreground_masks[b, 1:2].detach()
at moment t=0 to avoid background pixels being assigned as instances (Line 103).It is worth noting that this step only assigns IDs to the current instances (t=0), and the centers of the past frame (t=-1) are only used as assistance, not part of the final valid prediction outputs (t=0, 1, 2, ...).
I hope I have answered your question clearly, if not, feel free to raise your question further.
@EdwardLeeLPZ Thank you so much for the detailed reply! I currently totally understand the pipeline after you explained. I also noticed that the predicted results have two more additional frames, which is defined by
self.num_waypoints = self.cfg.N_FUTURE_FRAMES + 2
in stconv.py. Thanks again and I will close this issue since it is solved.
Hello @EdwardLeeLPZ ,
Thanks for your great work! I have one question about the
predict_instance_segmentation
function in instance.py. Could you please tell me why you useoutput['instance_flow'][b, 1:2].detach(),
rather than the first predicted instance flow [b, 0:1] to generate the instance inget_instance_segmentation_and_centers
?