Spaces:
Runtime error
Runtime error
Anonymous Authors
commited on
Commit
·
af2063a
1
Parent(s):
2953de7
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ nos = [1,2,3,4,5,6,7,8,9,10]
|
|
14 |
index = np.load("indexes/knn_10752_65.npy")
|
15 |
ds = load_dataset("tti-bias/identities", split="train")
|
16 |
|
17 |
-
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]
|
|
|
14 |
index = np.load("indexes/knn_10752_65.npy")
|
15 |
ds = load_dataset("tti-bias/identities", split="train")
|
16 |
|
17 |
+
def get_nearest_64(gender="man", ethnicity="Hispanic", model="SD_14", no=1):
|
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]
|