You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to understand your eval code. In class RTDETRPostProcessor in RTDETR_PYTORCH\src\zoo\rtdetr\rtdetr_postprocessor.py, I see these lines:
if self.use_focal_loss:
scores = F.sigmoid(logits)
scores, index = torch.topk(scores.flatten(1), self.num_top_queries, axis=-1)
labels = index % self.num_classes
index = index // self.num_classes
boxes = bbox_pred.gather(dim=1, index=index.unsqueeze(-1).repeat(1, 1, bbox_pred.shape[-1]))
scores = F.sigmoid(logits) has the shape of (b, queries, cls) but you take the top prediction: torch.topk(scores.flatten(1), self.num_top_queries, axis=-1). As I understand, you change the cls score from different queries into a dim (b, queries*cls) then you just take the topk highest cls scores. However, there would be the case that some cls in the same original queries (the score's shape (b, queries, cls)) would be taken.
Can you explain more about this?
The text was updated successfully, but these errors were encountered:
Hi, I'm trying to understand your eval code. In class
RTDETRPostProcessor
inRTDETR_PYTORCH\src\zoo\rtdetr\rtdetr_postprocessor.py
, I see these lines:scores = F.sigmoid(logits)
has the shape of(b, queries, cls)
but you take the top prediction:torch.topk(scores.flatten(1), self.num_top_queries, axis=-1)
. As I understand, you change the cls score from different queries into a dim(b, queries*cls)
then you just take the topk highest cls scores. However, there would be the case that some cls in the same original queries (the score's shape(b, queries, cls)
) would be taken.Can you explain more about this?
The text was updated successfully, but these errors were encountered: