rockerritesh commited on
Commit
2969c17
·
verified ·
1 Parent(s): ed61ca7

Add app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -50,7 +50,7 @@ def analyze_image(img: Image.Image):
50
 
51
  top_idx = np.argsort(np.abs(feat))[-30:][::-1]
52
  colors = cm.RdYlGn((feat[top_idx] - feat[top_idx].min()) /
53
- (feat[top_idx].ptp() + 1e-8))
54
  axes[0].barh(range(30), feat[top_idx], color=colors)
55
  axes[0].set_yticks(range(30))
56
  axes[0].set_yticklabels([f"dim {i}" for i in top_idx], fontsize=7)
 
50
 
51
  top_idx = np.argsort(np.abs(feat))[-30:][::-1]
52
  colors = cm.RdYlGn((feat[top_idx] - feat[top_idx].min()) /
53
+ (feat[top_idx].max() - feat[top_idx].min() + 1e-8))
54
  axes[0].barh(range(30), feat[top_idx], color=colors)
55
  axes[0].set_yticks(range(30))
56
  axes[0].set_yticklabels([f"dim {i}" for i in top_idx], fontsize=7)