Spaces:
Runtime error
Runtime error
Anonymous Authors
commited on
Commit
·
6e20d7a
1
Parent(s):
c303e42
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def get_nearest_64(gender, ethnicity, model, no):
|
|
18 |
df = ds.remove_columns(["image","image_path"]).to_pandas()
|
19 |
ix = df.loc[(df['ethnicity'] == ethnicity) & (df['gender'] == gender) & (df['no'] == no) & (df['model'] == model)].index[0]
|
20 |
image = ds.select([index[ix][0]])["image"][0]
|
21 |
-
neighbors = ds.select(index[ix][1:
|
22 |
neighbor_images = neighbors["image"]
|
23 |
neighbor_captions = [caption.split("/")[-1] for caption in neighbors["image_path"]]
|
24 |
neighbor_captions = [' '.join(caption.split("_")[4:-3]) for caption in neighbor_captions]
|
|
|
18 |
df = ds.remove_columns(["image","image_path"]).to_pandas()
|
19 |
ix = df.loc[(df['ethnicity'] == ethnicity) & (df['gender'] == gender) & (df['no'] == no) & (df['model'] == model)].index[0]
|
20 |
image = ds.select([index[ix][0]])["image"][0]
|
21 |
+
neighbors = ds.select(index[ix][1:25])
|
22 |
neighbor_images = neighbors["image"]
|
23 |
neighbor_captions = [caption.split("/")[-1] for caption in neighbors["image_path"]]
|
24 |
neighbor_captions = [' '.join(caption.split("_")[4:-3]) for caption in neighbor_captions]
|