Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -67,14 +67,44 @@ def find_fn(lvl_1,lvl_2,fetch_url,config="TEST",split="test",offset=0,length=10)
|
|
67 |
return img_list
|
68 |
|
69 |
|
70 |
-
def upd_drop(lvl_1,fetch_url,config="TEST",split="test",offset=0,length=10):
|
71 |
out_json,_=query2(fetch_url,config,split,offset=10,length=20)
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
with gr.Blocks() as app:
|
80 |
with gr.Row():
|
@@ -86,11 +116,11 @@ with gr.Blocks() as app:
|
|
86 |
#config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
87 |
view_data=gr.Button(label="View")
|
88 |
with gr.Row():
|
89 |
-
lvl_1=gr.
|
90 |
-
lvl_2=gr.
|
91 |
-
lvl_3=gr.
|
92 |
-
lvl_4=gr.
|
93 |
-
lvl_5=gr.
|
94 |
|
95 |
find_btn=gr.Button("Search")
|
96 |
with gr.Row():
|
@@ -101,11 +131,11 @@ with gr.Blocks() as app:
|
|
101 |
out_gal = gr.Gallery()
|
102 |
|
103 |
|
104 |
-
|
105 |
view_data.click(query2,[data_set_url,config_set,split_set],[out_find,lvl_1])
|
106 |
|
107 |
|
108 |
|
109 |
-
find_btn.click(find_fn,[lvl_1,lvl_2,data_set_url,config_set,split_set],[out_find])
|
110 |
fetch_btn.click(query1,data_set_url,out_json)
|
111 |
app.launch()
|
|
|
67 |
return img_list
|
68 |
|
69 |
|
70 |
+
def upd_drop(lvl_1,lvl_2,lvl_3,lvl_4,lvl_5,fetch_url,config="TEST",split="test",offset=0,length=10):
|
71 |
out_json,_=query2(fetch_url,config,split,offset=10,length=20)
|
72 |
+
box_1=[]
|
73 |
+
box_2=[]
|
74 |
+
box_3=[]
|
75 |
+
box_4=[]
|
76 |
+
box_5=[]
|
77 |
+
if lvl_1 !="":
|
78 |
+
for ea in (out_json[lvl_1]):
|
79 |
+
#print (i)
|
80 |
+
print (ea)
|
81 |
+
box_1.append(ea)
|
82 |
+
out = box_1
|
83 |
+
if lvl_2 !="":
|
84 |
+
for ea in (out_json[lvl_1][lvl_2]):
|
85 |
+
#print (i)
|
86 |
+
print (ea)
|
87 |
+
box_2.append(ea)
|
88 |
+
out = box_2
|
89 |
+
if lvl_3 !="":
|
90 |
+
for ea in (out_json[lvl_1][lvl_2][lvl_3]):
|
91 |
+
#print (i)
|
92 |
+
print (ea)
|
93 |
+
box_3.append(ea)
|
94 |
+
out = box_3
|
95 |
+
if lvl_4 !="":
|
96 |
+
for ea in (out_json[lvl_1][lvl_2][lvl_3][lvl_4]):
|
97 |
+
#print (i)
|
98 |
+
print (ea)
|
99 |
+
box_4.append(ea)
|
100 |
+
out = box_4
|
101 |
+
if lvl_5 !="":
|
102 |
+
for ea in (out_json[lvl_1][lvl_2][lvl_3][lvl_4][lvl_5]):
|
103 |
+
#print (i)
|
104 |
+
print (ea)
|
105 |
+
box_5.append(ea)
|
106 |
+
out = box_5
|
107 |
+
return out
|
108 |
|
109 |
with gr.Blocks() as app:
|
110 |
with gr.Row():
|
|
|
116 |
#config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
117 |
view_data=gr.Button(label="View")
|
118 |
with gr.Row():
|
119 |
+
lvl_1=gr.Textbox("lvl_1")
|
120 |
+
lvl_2=gr.Textbox("lvl_2")
|
121 |
+
lvl_3=gr.Textbox("lvl_3")
|
122 |
+
lvl_4=gr.Textbox("lvl_4")
|
123 |
+
lvl_5=gr.Textbox("lvl_5")
|
124 |
|
125 |
find_btn=gr.Button("Search")
|
126 |
with gr.Row():
|
|
|
131 |
out_gal = gr.Gallery()
|
132 |
|
133 |
|
134 |
+
find_btn.click(upd_drop,[lvl_1,lvl_2,lvl_3,lvl_4,lvl_5,data_set_url,config_set,split_set],out_find)
|
135 |
view_data.click(query2,[data_set_url,config_set,split_set],[out_find,lvl_1])
|
136 |
|
137 |
|
138 |
|
139 |
+
#find_btn.click(find_fn,[lvl_1,lvl_2,data_set_url,config_set,split_set],[out_find])
|
140 |
fetch_btn.click(query1,data_set_url,out_json)
|
141 |
app.launch()
|