Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,6 +59,19 @@ def find_fn(lvl_1,lvl_2,fetch_url,config="TEST",split="test",offset=0,length=10)
|
|
59 |
if lvl_2 == "":
|
60 |
img_list.append(out_json[lvl_1])
|
61 |
return img_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
with gr.Blocks() as app:
|
63 |
with gr.Row():
|
64 |
data_set_url=gr.Textbox(label="Dataset (repo/name)")
|
@@ -69,8 +82,11 @@ with gr.Blocks() as app:
|
|
69 |
#config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
70 |
view_data=gr.Button(label="View")
|
71 |
with gr.Row():
|
72 |
-
lvl_1=gr.
|
73 |
-
lvl_2=gr.
|
|
|
|
|
|
|
74 |
|
75 |
find_btn=gr.Button("Search")
|
76 |
with gr.Row():
|
@@ -80,7 +96,12 @@ with gr.Blocks() as app:
|
|
80 |
out_find = gr.JSON()
|
81 |
out_gal = gr.Gallery()
|
82 |
|
|
|
|
|
83 |
view_data.click(query2,[data_set_url,config_set,split_set],[out_find])
|
|
|
|
|
|
|
84 |
find_btn.click(find_fn,[lvl_1,lvl_2,data_set_url,config_set,split_set],[out_find])
|
85 |
fetch_btn.click(query1,data_set_url,out_json)
|
86 |
app.launch()
|
|
|
59 |
if lvl_2 == "":
|
60 |
img_list.append(out_json[lvl_1])
|
61 |
return img_list
|
62 |
+
|
63 |
+
|
64 |
+
def upd_drop(inp1,fetch_url,config="TEST",split="test",offset=0,length=10):
|
65 |
+
|
66 |
+
#def upd_drop(inp1,inp2,inp3,inp4,inp5,fetch_url,config="TEST",split="test",offset=0,length=10):
|
67 |
+
out_json=query2(fetch_url,config,split,offset=10,length=20)
|
68 |
+
|
69 |
+
for ea in out_json[inp1]:
|
70 |
+
out = [inp1]
|
71 |
+
|
72 |
+
img_list.append(out_json[ea])
|
73 |
+
return gr.update(choices=[c for c in img_list])
|
74 |
+
|
75 |
with gr.Blocks() as app:
|
76 |
with gr.Row():
|
77 |
data_set_url=gr.Textbox(label="Dataset (repo/name)")
|
|
|
82 |
#config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
83 |
view_data=gr.Button(label="View")
|
84 |
with gr.Row():
|
85 |
+
lvl_1=gr.Dropdown("lvl_1")
|
86 |
+
lvl_2=gr.Dropdown("lvl_2")
|
87 |
+
lvl_3=gr.Dropdown("lvl_3")
|
88 |
+
lvl_4=gr.Dropdown("lvl_4")
|
89 |
+
lvl_5=gr.Dropdown("lvl_5")
|
90 |
|
91 |
find_btn=gr.Button("Search")
|
92 |
with gr.Row():
|
|
|
96 |
out_find = gr.JSON()
|
97 |
out_gal = gr.Gallery()
|
98 |
|
99 |
+
|
100 |
+
lvl_1.change(upd_drop,[lvl_1,data_set_url,config_set,split_set],lvl_2)
|
101 |
view_data.click(query2,[data_set_url,config_set,split_set],[out_find])
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
find_btn.click(find_fn,[lvl_1,lvl_2,data_set_url,config_set,split_set],[out_find])
|
106 |
fetch_btn.click(query1,data_set_url,out_json)
|
107 |
app.launch()
|