|
|
@@ -830,7 +830,7 @@ class RoIHeads(nn.Module):
|
|
|
|
|
|
result: List[Dict[str, torch.Tensor]] = []
|
|
|
losses = {}
|
|
|
-
|
|
|
+ # _, C, H, W = features['0'].shape # å¿½ç¥ batch_sizeï¼å 为æä»¬åªå
³å¿ C, H, W
|
|
|
if self.training:
|
|
|
if labels is None:
|
|
|
raise ValueError("labels cannot be None")
|
|
|
@@ -862,6 +862,10 @@ class RoIHeads(nn.Module):
|
|
|
line_proposals = [p["boxes"] for p in result]
|
|
|
print(f'line_proposals:{len(line_proposals)}')
|
|
|
|
|
|
+ # if line_proposals is None or len(line_proposals) == 0:
|
|
|
+ # # è¿å空ç¹å¾æè
è·³è¿è¯¥é¨å计ç®
|
|
|
+ # return torch.empty(0, C, H, W).to(features['0'].device)
|
|
|
+
|
|
|
if self.training:
|
|
|
# during training, only focus on positive boxes
|
|
|
num_images = len(proposals)
|