|
|
@@ -1312,13 +1312,14 @@ class RoIHeads(nn.Module):
|
|
|
|
|
|
if self.has_ins and self.detect_ins:
|
|
|
print(f'roi_heads forward has_circle()!!!!')
|
|
|
- # print(f'labels:{labels}')
|
|
|
- ins_proposals = [p["boxes"] for p in result]
|
|
|
+ print(f'labels:{labels}')
|
|
|
+ # for p in result:
|
|
|
+ # print(f'p["boxes"]:{p["boxes"]}')
|
|
|
+ # print(f'p["labels"]:{p["labels"]}')
|
|
|
+ ins_proposals = [p["boxes"][p["labels"] == 4] for p in result]
|
|
|
+ # print(f'ins_proposals11:{ins_proposals}')
|
|
|
print(f'boxes_proposals:{len(ins_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
|
|
|
@@ -1349,6 +1350,7 @@ class RoIHeads(nn.Module):
|
|
|
ins_pos_matched_idxs.append(
|
|
|
matched_idxs[img_id][idxs]
|
|
|
)
|
|
|
+ print(f'ins_proposals in train:{ins_proposals}')
|
|
|
else:
|
|
|
if targets is not None:
|
|
|
|
|
|
@@ -1380,7 +1382,7 @@ class RoIHeads(nn.Module):
|
|
|
ins_pos_matched_idxs.append(
|
|
|
matched_idxs[img_id][idxs]
|
|
|
)
|
|
|
-
|
|
|
+ print(f'ins_proposals in val:{ins_proposals}')
|
|
|
else:
|
|
|
pos_matched_idxs = None
|
|
|
|
|
|
@@ -1391,15 +1393,12 @@ class RoIHeads(nn.Module):
|
|
|
print(f"self.val{ins_proposals_valid}")
|
|
|
if ins_proposals_valid:
|
|
|
|
|
|
-
|
|
|
-
|
|
|
print(f'features from backbone:{features['0'].shape}')
|
|
|
+ print(f'ins_proposals in ins_forward1:{ins_proposals}')
|
|
|
feature_logits = self.ins_forward1(features, image_shapes, ins_proposals)
|
|
|
# ins_masks, ins_scores, circle_points = ins_inference(feature_logits,
|
|
|
# ins_proposals, th=0)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
arc_equation = self.arc_equation_head(feature_logits) # [proposal和,7]
|
|
|
|
|
|
loss_ins = None
|