Spaces:
Running
Running
Add app.py
Browse files
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].
|
| 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)
|