Create a gist now

Instantly share code, notes, and snippets.

@ry /blur_loss.py Secret
Created Jan 4, 2016

What would you like to do?
def blur_uv_loss(rgb, inferred_rgb):
uv = rgb2uv(rgb)
uv_blur0 = rgb2uv(blur(rgb, 3))
uv_blur1 = rgb2uv(blur(rgb, 5))
inferred_uv = rgb2uv(inferred_rgb)
inferred_uv_blur0 = rgb2uv(blur(inferred_rgb, 3))
inferred_uv_blur1 = rgb2uv(blur(inferred_rgb, 5))
return ( dist(inferred_uv, uv) +
dist(inferred_uv_blur0 , uv_blur0) +
dist(inferred_uv_blur1, uv_blur1) ) / 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment