Spaces:
Runtime error
Runtime error
Commit
•
b7b88e8
1
Parent(s):
bc08e7a
only show embeddings
Browse files- prepare.py +0 -5
- run.py +1 -4
prepare.py
CHANGED
@@ -21,11 +21,6 @@ if __name__ == "__main__":
|
|
21 |
|
22 |
# df = df[:1000]
|
23 |
|
24 |
-
# precalculate umap embeddings
|
25 |
-
df["embedding_ft_precalc"] = umap.UMAP(
|
26 |
-
n_neighbors=70, min_dist=0.5, random_state=42
|
27 |
-
).fit_transform(df["embedding_ft"].tolist()).tolist()
|
28 |
-
print("Umap for ft done")
|
29 |
|
30 |
|
31 |
df["embedding_foundation_precalc"] = umap.UMAP(
|
|
|
21 |
|
22 |
# df = df[:1000]
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
26 |
df["embedding_foundation_precalc"] = umap.UMAP(
|
run.py
CHANGED
@@ -12,18 +12,15 @@ if __name__ == "__main__":
|
|
12 |
|
13 |
|
14 |
while True:
|
|
|
15 |
dtypes = {
|
16 |
-
"nn_image": spotlight.Image,
|
17 |
"image": spotlight.Image,
|
18 |
-
"embedding_ft": spotlight.Embedding,
|
19 |
"embedding_foundation": spotlight.Embedding,
|
20 |
-
"embedding_ft_precalc": spotlight.Embedding,
|
21 |
"embedding_foundation_precalc": spotlight.Embedding,
|
22 |
}
|
23 |
view = spotlight.show(
|
24 |
df,
|
25 |
dtype=dtypes,
|
26 |
-
layout="https://spotlight.renumics.com/resources/layout_pre_post_ft_hf.json",
|
27 |
port=7860,
|
28 |
host="0.0.0.0",
|
29 |
allow_filebrowsing=False
|
|
|
12 |
|
13 |
|
14 |
while True:
|
15 |
+
df = df.drop(columns=["embedding_ft", "nn_image"])
|
16 |
dtypes = {
|
|
|
17 |
"image": spotlight.Image,
|
|
|
18 |
"embedding_foundation": spotlight.Embedding,
|
|
|
19 |
"embedding_foundation_precalc": spotlight.Embedding,
|
20 |
}
|
21 |
view = spotlight.show(
|
22 |
df,
|
23 |
dtype=dtypes,
|
|
|
24 |
port=7860,
|
25 |
host="0.0.0.0",
|
26 |
allow_filebrowsing=False
|