(self, pred, target)
| 109 | self.iou_loss = IoULoss() |
| 110 | |
| 111 | def forward(self, pred, target): |
| 112 | win_y, win_x = 64, 64 |
| 113 | iou_loss = 0. |
| 114 | for anchor_y in range(0, target.shape[0], win_y): |
| 115 | for anchor_x in range(0, target.shape[1], win_y): |
| 116 | patch_pred = pred[:, :, anchor_y:anchor_y+win_y, anchor_x:anchor_x+win_x] |
| 117 | patch_target = target[:, :, anchor_y:anchor_y+win_y, anchor_x:anchor_x+win_x] |
| 118 | patch_iou_loss = self.iou_loss(patch_pred, patch_target) |
| 119 | iou_loss += patch_iou_loss |
| 120 | return iou_loss |
| 121 | |
| 122 | |
| 123 | class ThrReg_loss(torch.nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected