summaryrefslogtreecommitdiff
path: root/cli/app/search
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-02-11 22:30:27 +0100
committerJules Laplace <julescarbon@gmail.com>2020-02-11 22:30:27 +0100
commit74166e2d4028d77d4e47a87a5141af547e84fec8 (patch)
tree7524f10fb207f41b8f9960bb6d5436769fabbb97 /cli/app/search
parent2a76774525ab90399c4c6f0f02042ae66ed1d285 (diff)
adding mse loss terms
Diffstat (limited to 'cli/app/search')
-rw-r--r--cli/app/search/search_dense.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/app/search/search_dense.py b/cli/app/search/search_dense.py
index 94b7bc5..7fbc364 100644
--- a/cli/app/search/search_dense.py
+++ b/cli/app/search/search_dense.py
@@ -451,6 +451,10 @@ def find_dense_embedding_for_images(params, opt_tag="inverse_" + timestamp(), op
sess.close()
def mse_loss_crop(img_a, img_b, y, x, height, width):
+ y = int(y)
+ x = int(x)
+ height = int(height)
+ width = int(width)
img_a = tf.image.crop_to_bounding_box(img_a, y, x, height, width)
img_b = tf.image.crop_to_bounding_box(img_b, y, x, height, width)
return tf.reduce_mean(tf.square((img_a - img_b) / 2.0))