-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code #86
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"""
def l1_loss_weight(network_output, gt):
image = gt.detach().cpu().numpy().transpose((1, 2, 0))
rgb_raw_gray = np.dot(image[..., :3], [0.2989, 0.5870, 0.1140])
sobelx = cv2.Sobel(rgb_raw_gray, cv2.CV_64F, 1, 0, ksize=5)
sobely = cv2.Sobel(rgb_raw_gray, cv2.CV_64F, 0, 1, ksize=5)
sobel_merge = np.sqrt(sobelx * sobelx + sobely * sobely) + 1e-10
sobel_merge = np.exp(sobel_merge)
sobel_merge /= np.max(sobel_merge)
sobel_merge = torch.from_numpy(sobel_merge)[None, ...].to(gt.device)
def l2_loss(network_output, gt):
return ((network_output - gt) ** 2).mean()
"""
Have these two functions( l1_loss_weight and l2_loss)not been called in the code?
The text was updated successfully, but these errors were encountered: