Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
|
|
3 |
from datasets import load_dataset
|
4 |
import numpy as np
|
5 |
|
|
|
6 |
gender_labels = ['man', 'non-binary', 'woman', 'no_gender_specified', ]
|
7 |
|
8 |
ethnicity_labels = ['African-American', 'American_Indian', 'Black', 'Caucasian', 'East_Asian',
|
@@ -21,7 +22,7 @@ def get_nearest_64(gender, ethnicity, model, no):
|
|
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 |
-
return image, list(zip(neighbor_images, neighbor_captions))
|
25 |
|
26 |
with gr.Blocks() as demo:
|
27 |
with gr.Row():
|
|
|
3 |
from datasets import load_dataset
|
4 |
import numpy as np
|
5 |
|
6 |
+
|
7 |
gender_labels = ['man', 'non-binary', 'woman', 'no_gender_specified', ]
|
8 |
|
9 |
ethnicity_labels = ['African-American', 'American_Indian', 'Black', 'Caucasian', 'East_Asian',
|
|
|
22 |
neighbors = ds.select(index[ix][1:])
|
23 |
neighbor_images = neighbors["image"]
|
24 |
neighbor_captions = [caption.split("/")[-1] for caption in neighbors["image_path"]]
|
25 |
+
return image.resize(32,32), list(zip([i.resize(32,32) for i in neighbor_images], neighbor_captions))
|
26 |
|
27 |
with gr.Blocks() as demo:
|
28 |
with gr.Row():
|