manu02 commited on
Commit
f2e5a69
·
verified ·
1 Parent(s): be34d06

Update app.py

Browse files

Modifed cosine min and max values to 0.0 and 1.0 to properly show the true similariy, not the relative one. This reduces showing not similar patches as similar when the max cosine value is too low.

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -269,7 +269,7 @@ def render_with_cosmap(
269
  if cos_map is None:
270
  disp = np.full((rows, cols), 0.5, dtype=np.float32)
271
  else:
272
- vmin, vmax = float(cos_map.min()), float(cos_map.max())
273
  rng = vmax - vmin if vmax > vmin else 1e-8
274
  disp = (cos_map - vmin) / rng
275
 
 
269
  if cos_map is None:
270
  disp = np.full((rows, cols), 0.5, dtype=np.float32)
271
  else:
272
+ vmin, vmax = 0.0, 1.0 #float(cos_map.min()), float(cos_map.max())
273
  rng = vmax - vmin if vmax > vmin else 1e-8
274
  disp = (cos_map - vmin) / rng
275