|
@@ -515,6 +515,10 @@ def compute_arc_loss(feature_logits, proposals, gt_, pos_matched_idxs):
|
|
|
gs_heatmaps = []
|
|
gs_heatmaps = []
|
|
|
# print(f'point_matched_idxs:{point_matched_idxs}')
|
|
# print(f'point_matched_idxs:{point_matched_idxs}')
|
|
|
for proposals_per_image, gt_kp_in_image, midx in zip(proposals, gt_, pos_matched_idxs):
|
|
for proposals_per_image, gt_kp_in_image, midx in zip(proposals, gt_, pos_matched_idxs):
|
|
|
|
|
+ # [
|
|
|
|
|
+ # (Tensor(38, 4), Tensor(1, 57, 2), Tensor(38, 1)),
|
|
|
|
|
+ # (Tensor(65, 4), Tensor(1, 74, 2), Tensor(65, 1))
|
|
|
|
|
+ # ]
|
|
|
print(f'proposals_per_image:{proposals_per_image.shape}')
|
|
print(f'proposals_per_image:{proposals_per_image.shape}')
|
|
|
kp = gt_kp_in_image[midx]
|
|
kp = gt_kp_in_image[midx]
|
|
|
# print(f'gt_kp_in_image:{gt_kp_in_image}')
|
|
# print(f'gt_kp_in_image:{gt_kp_in_image}')
|
|
@@ -529,11 +533,14 @@ def compute_arc_loss(feature_logits, proposals, gt_, pos_matched_idxs):
|
|
|
line_logits = feature_logits[:, 0]
|
|
line_logits = feature_logits[:, 0]
|
|
|
print(f'single_point_logits:{line_logits.shape}')
|
|
print(f'single_point_logits:{line_logits.shape}')
|
|
|
|
|
|
|
|
- line_loss = F.cross_entropy(line_logits, gs_heatmaps)
|
|
|
|
|
|
|
+ line_loss = F.binary_cross_entropy_with_logits(line_logits, gs_heatmaps)
|
|
|
|
|
+ # line_loss = F.cross_entropy(line_logits, gs_heatmaps)
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
|
line_loss=100
|
|
line_loss=100
|
|
|
|
|
|
|
|
|
|
+ print("d")
|
|
|
|
|
+
|
|
|
return line_loss
|
|
return line_loss
|
|
|
|
|
|
|
|
def arc_points_to_heatmap(keypoints, rois, heatmap_size):
|
|
def arc_points_to_heatmap(keypoints, rois, heatmap_size):
|