Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def get_index(gender, ethnicity, model, no):
|
|
20 |
|
21 |
def get_nearest_64(gender, ethnicity, model, no):
|
22 |
ix = get_index(gender, ethnicity, model, no)
|
23 |
-
return ds.select([index[ix][0]])["image"], ds.select(index[ix][1:])["image"]
|
24 |
|
25 |
with gr.Blocks() as demo:
|
26 |
gender = gr.Radio(gender_labels, label="Gender label")
|
@@ -29,7 +29,7 @@ with gr.Blocks() as demo:
|
|
29 |
no = gr.Radio(nos, label="Image number")
|
30 |
|
31 |
button = gr.Button(value="Get nearest neighbors")
|
32 |
-
button.click(get_nearest_64, inputs=[gender, ethnicity, model, no], outputs=[gr.Image(), gr.Gallery()
|
33 |
demo.launch()
|
34 |
# demo = gr.Interface(fn=query_db, inputs="text", outputs=[gr.Image(), gr.Gallery().style(grid=[8])])
|
35 |
# demo.launch(debug=True)
|
|
|
20 |
|
21 |
def get_nearest_64(gender, ethnicity, model, no):
|
22 |
ix = get_index(gender, ethnicity, model, no)
|
23 |
+
return ds.select([index[ix][0]])["image"], ds.select(index[ix][1:5])["image"]
|
24 |
|
25 |
with gr.Blocks() as demo:
|
26 |
gender = gr.Radio(gender_labels, label="Gender label")
|
|
|
29 |
no = gr.Radio(nos, label="Image number")
|
30 |
|
31 |
button = gr.Button(value="Get nearest neighbors")
|
32 |
+
button.click(get_nearest_64, inputs=[gender, ethnicity, model, no], outputs=[gr.Image(), gr.Gallery()])
|
33 |
demo.launch()
|
34 |
# demo = gr.Interface(fn=query_db, inputs="text", outputs=[gr.Image(), gr.Gallery().style(grid=[8])])
|
35 |
# demo.launch(debug=True)
|