train with update code on synthData
https://github.com/backtime92/CRAFT-Reimplementation/blob/fbaa63aebd61c2b290752102cdef4758891b1fb7/loss/mseloss.py#L43 https://github.com/backtime92/CRAFT-Reimplementation/blob/fbaa63aebd61c2b290752102cdef4758891b1fb7/loss/mseloss.py#L44
Due to the frequent interruption of the company github connection, it is not convenient to update the readme. Now synthData can be trained according to the updated repo. If the GPUs is enough, you can compare the effects of torch.sqrt(loss1+1e-8) and torch.sqrt(loss2+1e-8). The pixel value of the background is probably How many
Can I modify it like the code below? The end of the comment is cut off, so it is difficult to understand the meaning.
def forward(self, region_scores_label, affinity_socres_label, region_scores_pre, affinity_scores_pre, mask):
loss_fn = torch.nn.MSELoss(reduce=False, size_average=False)
assert region_scores_label.size() == region_scores_pre.size() and affinity_socres_label.size() == affinity_scores_pre.size()
loss1 = loss_fn(region_scores_pre, region_scores_label)
loss2 = loss_fn(affinity_scores_pre, affinity_socres_label)
loss1 = torch.sqrt(loss1 + 1e-8)
loss2 = torch.sqrt(loss2 + 1e-8)
loss_region = torch.mul(loss1, mask)
loss_affinity = torch.mul(loss2, mask)
char_loss = self.single_image_loss(loss_region, region_scores_label)
affi_loss = self.single_image_loss(loss_affinity, affinity_socres_label)
return char_loss + affi_loss
Hi, may I ask why you calculate the sqrt here