Update app.py
Browse filesModifed 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.
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 |
|