caviri
commited on
Commit
·
2dbef88
1
Parent(s):
b24f61e
ci: Testing HF
Browse files- app/main.py +272 -272
app/main.py
CHANGED
@@ -36,300 +36,300 @@ with gr.Blocks(theme='shivi/calm_seafoam') as demo:
|
|
36 |
columns=[1], rows=[1],
|
37 |
object_fit="contain", height="auto", interactive=False)
|
38 |
|
39 |
-
with Modal(visible=False) as modal:
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
|
309 |
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
|
318 |
-
|
319 |
-
|
320 |
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
|
327 |
-
# ---------------------------------------------------------
|
328 |
-
# Event Functions of the landing page buttons
|
329 |
-
show_modal.click(lambda: Modal(visible=True), None, modal)
|
330 |
-
show_modal.click(create_json_one_individual)
|
331 |
-
show_modal.click(create_tmp)
|
332 |
-
#submit_button.click(save_and_rest_df, inputs=[df], outputs=[df])
|
333 |
|
334 |
|
335 |
if __name__ == "__main__":
|
|
|
36 |
columns=[1], rows=[1],
|
37 |
object_fit="contain", height="auto", interactive=False)
|
38 |
|
39 |
+
# with Modal(visible=False) as modal:
|
40 |
+
# # ---------------------------------------------------------
|
41 |
+
# # Intro Text
|
42 |
+
# with gr.Row():
|
43 |
+
# with gr.Column(scale=1):
|
44 |
+
# title = gr.Markdown("# Animal Report", label="Title")
|
45 |
+
# description = gr.Markdown("Please record your observation here.", label="description")
|
46 |
|
47 |
+
# # ---------------------------------------------------------
|
48 |
+
# # Camera
|
49 |
+
# with gr.Row():
|
50 |
+
# def save_image(camera):
|
51 |
+
# add_data_to_individual("image", camera.tolist())
|
52 |
|
53 |
+
# camera = gr.Image(elem_id="image")
|
54 |
+
# camera.input(save_image, inputs=[camera])
|
55 |
+
# # ---------------------------------------------------------
|
56 |
+
# # Location
|
57 |
+
# #with gr.Row():
|
58 |
+
# with gr.Column(scale=1):
|
59 |
+
# location = gr.Textbox(visible=True, interactive=True, label="Location of Sighting")
|
60 |
+
# #display location processing
|
61 |
+
# identified_location= gr.Textbox(visible=False, interactive=False,
|
62 |
+
# label="Identified GPS Location")
|
63 |
+
# with gr.Row():
|
64 |
+
# #to submit it
|
65 |
+
# submit_location = gr.Button("Get GPS Coordinates",
|
66 |
+
# visible=True, interactive=True, scale=3)
|
67 |
+
# submit_location.click(get_location, inputs=[location], outputs=[identified_location])
|
68 |
+
# #to clear it
|
69 |
+
# clear_location = gr.ClearButton(components=[location, identified_location],
|
70 |
+
# visible=True, interactive=True, scale=1
|
71 |
+
# )
|
72 |
+
# clear_location.click()
|
73 |
|
74 |
+
# # ---------------------------------------------------------
|
75 |
+
# # ---------------------------------------------------------
|
76 |
+
# # Dead and Wounded Buttons
|
77 |
+
# gr.Markdown("## The State of the Animal", label="Title")
|
78 |
+
# gr.Markdown("Please tell us if the animal was wounded or dead.", label="description")
|
79 |
+
# with gr.Row() as block_form:
|
80 |
+
# with gr.Column(scale=1):
|
81 |
+
# butt_wounded = gr.Button("Wounded", elem_id="wounded")
|
82 |
+
# with gr.Column(scale=1):
|
83 |
+
# butt_dead = gr.Button("Dead", elem_id="dead")
|
84 |
|
85 |
+
# # ---------------------------------------------------------
|
86 |
+
# # Initiate sections
|
87 |
+
# section_dead, radio_circumstance_dead, radio_physical_dead,\
|
88 |
+
# button_collision_dead, button_deliberate_destruction_dead, button_indirect_destruction_dead, button_natural_cause_dead, \
|
89 |
+
# dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead, \
|
90 |
+
# physical_boxes_dead, \
|
91 |
+
# checkbox_beak_dead, text_beak_dead, checkbox_body_dead, text_body_dead, checkbox_feathers_dead, text_feathers_dead, checkbox_head_dead, text_head_dead, checkbox_legs_dead, text_legs_dead, \
|
92 |
+
# fe_collection_dropdown_dead, fe_recepient_dropdown_dead, fe_radio_dropdown_dead, fe_answer_dropdown_dead, \
|
93 |
+
# fe_name_recipient_dead, fe_collection_ref_dead \
|
94 |
+
# = show_section_dead(False)
|
95 |
+
# section_wounded, radio_circumstance_wounded, radio_behavior_wounded, radio_physical_wounded, \
|
96 |
+
# button_collision_wounded, button_deliberate_destruction_wounded, button_indirect_destruction_wounded, button_natural_cause_wounded, \
|
97 |
+
# dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded, \
|
98 |
+
# behavior_checkbox, behavior_text, \
|
99 |
+
# physical_boxes_wounded, \
|
100 |
+
# checkbox_beak_wounded, text_beak_wounded, checkbox_body_wounded, text_body_wounded, checkbox_feathers_wounded, text_feathers_wounded, checkbox_head_wounded, text_head_wounded, checkbox_legs_wounded, text_legs_wounded, \
|
101 |
+
# fe_collection_dropdown_wounded, fe_recepient_dropdown_wounded, fe_radio_dropdown_wounded, fe_answer_dropdown_wounded, \
|
102 |
+
# fe_name_recipient_wounded, fe_collection_ref_wounded \
|
103 |
+
# = show_section_wounded(False)
|
104 |
|
105 |
+
# # ---------------------------------------------------------
|
106 |
+
# # ---------------------------------------------------------
|
107 |
+
# # ---------------------------------------------------------
|
108 |
+
# # Dead Button Logic
|
109 |
+
# partial_show_section_dead = partial(show_section_dead, True)
|
110 |
+
# partial_hide_section_wounded = partial(show_section_wounded, False)
|
111 |
+
# butt_dead.click(partial_show_section_dead,
|
112 |
+
# inputs=None,
|
113 |
+
# outputs=[section_dead,
|
114 |
+
# radio_circumstance_dead, radio_physical_dead,
|
115 |
+
# button_collision_dead, button_deliberate_destruction_dead, button_indirect_destruction_dead, button_natural_cause_dead,
|
116 |
+
# dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead, \
|
117 |
+
# physical_boxes_dead, \
|
118 |
+
# checkbox_beak_dead, text_beak_dead, checkbox_body_dead, text_body_dead, checkbox_feathers_dead, text_feathers_dead, checkbox_head_dead, text_head_dead, checkbox_legs_dead, text_legs_dead, \
|
119 |
+
# fe_collection_dropdown_dead, fe_recepient_dropdown_dead, fe_radio_dropdown_dead, fe_answer_dropdown_dead, \
|
120 |
+
# fe_name_recipient_dead, fe_collection_ref_dead \
|
121 |
+
# ])
|
122 |
+
# butt_dead.click(partial_hide_section_wounded,
|
123 |
+
# inputs=None,
|
124 |
+
# outputs=[section_wounded,
|
125 |
+
# radio_circumstance_wounded, radio_behavior_wounded, radio_physical_wounded,
|
126 |
+
# button_collision_wounded, button_deliberate_destruction_wounded, button_indirect_destruction_wounded, button_natural_cause_wounded,
|
127 |
+
# dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded,
|
128 |
+
# behavior_checkbox, behavior_text,
|
129 |
+
# physical_boxes_wounded, \
|
130 |
+
# checkbox_beak_wounded, text_beak_wounded, checkbox_body_wounded, text_body_wounded, checkbox_feathers_wounded, text_feathers_wounded, checkbox_head_wounded, text_head_wounded, checkbox_legs_wounded, text_legs_wounded, \
|
131 |
+
# fe_collection_dropdown_wounded, fe_recepient_dropdown_wounded, fe_radio_dropdown_wounded, fe_answer_dropdown_wounded, \
|
132 |
+
# fe_name_recipient_wounded, fe_collection_ref_wounded \
|
133 |
+
# ])
|
134 |
|
135 |
+
# # ---------------------------------------------------------
|
136 |
+
# # Wounded Button Logic
|
137 |
+
# partial_show_section_wounded = partial(show_section_wounded, True)
|
138 |
+
# partial_hide_section_dead = partial(show_section_dead, False)
|
139 |
|
140 |
+
# butt_wounded.click(partial_show_section_wounded,
|
141 |
+
# inputs=None,
|
142 |
+
# outputs=[section_wounded,
|
143 |
+
# radio_circumstance_wounded, radio_behavior_wounded, radio_physical_wounded,
|
144 |
+
# button_collision_wounded, button_deliberate_destruction_wounded, button_indirect_destruction_wounded, button_natural_cause_wounded,
|
145 |
+
# dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded,
|
146 |
+
# behavior_checkbox, behavior_text,
|
147 |
+
# physical_boxes_wounded, \
|
148 |
+
# checkbox_beak_wounded, text_beak_wounded, checkbox_body_wounded, text_body_wounded, checkbox_feathers_wounded, text_feathers_wounded, checkbox_head_wounded, text_head_wounded, checkbox_legs_wounded, text_legs_wounded, \
|
149 |
+
# fe_collection_dropdown_wounded, fe_recepient_dropdown_wounded, fe_radio_dropdown_wounded, fe_answer_dropdown_wounded, \
|
150 |
+
# fe_name_recipient_wounded, fe_collection_ref_wounded \
|
151 |
+
# ])
|
152 |
+
# butt_wounded.click(partial_hide_section_dead, inputs=None, outputs=[section_dead,
|
153 |
+
# radio_circumstance_dead, radio_physical_dead,
|
154 |
+
# button_collision_dead, button_deliberate_destruction_dead, button_indirect_destruction_dead, button_natural_cause_dead,
|
155 |
+
# dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead, \
|
156 |
+
# physical_boxes_dead, \
|
157 |
+
# checkbox_beak_dead, text_beak_dead, checkbox_body_dead, text_body_dead, checkbox_feathers_dead, text_feathers_dead, checkbox_head_dead, text_head_dead, checkbox_legs_dead, text_legs_dead, \
|
158 |
+
# fe_collection_dropdown_dead, fe_recepient_dropdown_dead, fe_radio_dropdown_dead, fe_answer_dropdown_dead, \
|
159 |
+
# fe_name_recipient_dead, fe_collection_ref_dead \
|
160 |
+
# ])
|
161 |
+
# # ---------------------------------------------------------
|
162 |
+
# # ---------------------------------------------------------
|
163 |
+
# # ---------------------------------------------------------
|
164 |
+
# # ---------------------------------------------------------
|
165 |
+
# # DEAD
|
166 |
+
# # ---------------------------------------------------------
|
167 |
+
# # Radio Circumstance Dead
|
168 |
+
# radio_circumstance_dead.change(fn=show_circumstances,
|
169 |
+
# inputs=[radio_circumstance_dead],
|
170 |
+
# outputs=[button_collision_dead, button_deliberate_destruction_dead, button_indirect_destruction_dead, button_natural_cause_dead,
|
171 |
+
# dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead]
|
172 |
+
# )
|
173 |
|
174 |
+
# # Dropdowns Dead
|
175 |
+
# button_collision_dead.click(dropdown_collision,
|
176 |
+
# outputs=[dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead])
|
177 |
+
# button_deliberate_destruction_dead.click(dropdown_deliberate_destruction, outputs=[dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead])
|
178 |
+
# button_indirect_destruction_dead.click(dropdown_indirect_destruction, outputs=[dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead])
|
179 |
+
# button_natural_cause_dead.click(dropdown_natural_cause, outputs=[dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead])
|
180 |
|
181 |
+
# dropdown_dead.select(on_select, None, [dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead])
|
182 |
+
# dropdown_level2_dead.select(on_select_dropdown_level2)
|
183 |
+
# openfield_level2_dead.change(on_change_openfield_level2, inputs=[openfield_level2_dead])
|
184 |
+
# dropdown_extra_level2_dead.select(on_select_dropdown_extra_level2)
|
185 |
+
# # ---------------------------------------------------------
|
186 |
+
# # Radio Physical Dead
|
187 |
+
# radio_physical_dead.change(fn=show_physical,
|
188 |
+
# inputs=[radio_physical_dead, gr.Text("dead", visible=False)],
|
189 |
+
# outputs=[physical_boxes_dead])
|
190 |
|
191 |
+
# # Checkbox Physical Dead
|
192 |
+
# physical_boxes_dead.select(find_bounding_box,
|
193 |
+
# inputs=[physical_boxes_dead, gr.Textbox(value="dead", visible=False)],
|
194 |
+
# outputs=[checkbox_beak_dead, text_beak_dead,
|
195 |
+
# checkbox_body_dead, text_body_dead,
|
196 |
+
# checkbox_feathers_dead, text_feathers_dead,
|
197 |
+
# checkbox_head_dead, text_head_dead,
|
198 |
+
# checkbox_legs_dead, text_legs_dead
|
199 |
+
# ])
|
200 |
+
# checkbox_beak_dead.select(on_select_body_part, inputs=[checkbox_beak_dead, gr.Text("beak", visible=False)])
|
201 |
+
# checkbox_body_dead.select(on_select_body_part, inputs=[checkbox_body_dead, gr.Text("body", visible=False)])
|
202 |
+
# checkbox_feathers_dead.select(on_select_body_part, inputs=[checkbox_feathers_dead, gr.Text("feathers", visible=False)])
|
203 |
+
# checkbox_head_dead.select(on_select_body_part, inputs=[checkbox_head_dead, gr.Text("head", visible=False)])
|
204 |
+
# checkbox_legs_dead.select(on_select_body_part, inputs=[checkbox_legs_dead, gr.Text("legs", visible=False)])
|
205 |
+
# # ---------------------------------------------------------
|
206 |
+
# # ---------------------------------------------------------
|
207 |
+
# # ---------------------------------------------------------
|
208 |
+
# # ---------------------------------------------------------
|
209 |
+
# # WOUNDED
|
210 |
+
# # ---------------------------------------------------------
|
211 |
+
# # Radio Circumstance Wounded
|
212 |
+
# radio_circumstance_wounded.change(fn=show_circumstances,
|
213 |
+
# inputs=[radio_circumstance_wounded],
|
214 |
+
# outputs=[button_collision_wounded, button_deliberate_destruction_wounded, button_indirect_destruction_wounded, button_natural_cause_wounded,
|
215 |
+
# dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded]
|
216 |
+
# )
|
217 |
|
218 |
+
# # Dropdowns Circumstance Wounded
|
219 |
+
# button_collision_wounded.click(dropdown_collision,
|
220 |
+
# outputs=[dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
221 |
+
# button_deliberate_destruction_wounded.click(dropdown_deliberate_destruction, outputs=[dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
222 |
+
# button_indirect_destruction_wounded.click(dropdown_indirect_destruction, outputs=[dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
223 |
+
# button_natural_cause_wounded.click(dropdown_natural_cause, outputs=[dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
224 |
|
225 |
+
# dropdown_wounded.select(on_select, None, [dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
226 |
+
# dropdown_level2_wounded.select(on_select_dropdown_level2)
|
227 |
+
# openfield_level2_wounded.change(on_change_openfield_level2, inputs=[openfield_level2_wounded])
|
228 |
+
# dropdown_extra_level2_wounded.select(on_select_dropdown_extra_level2)
|
229 |
+
# # ---------------------------------------------------------
|
230 |
+
# # Radio Behavior Wounded
|
231 |
+
# radio_behavior_wounded.change(fn=show_behavior,
|
232 |
+
# inputs=[radio_behavior_wounded, gr.Text("wounded", visible=False)],
|
233 |
+
# outputs=[behavior_checkbox, behavior_text])
|
234 |
+
# behavior_checkbox.select(on_select_behavior,
|
235 |
+
# inputs=[behavior_checkbox])
|
236 |
+
# # ---------------------------------------------------------
|
237 |
+
# # Radio Physical Wounded
|
238 |
+
# radio_physical_wounded.change(fn=show_physical,
|
239 |
+
# inputs=[radio_physical_wounded, gr.Text("wounded", visible=False)],
|
240 |
+
# outputs=[physical_boxes_wounded])
|
241 |
|
242 |
+
# # Checkbox Physical Wounded
|
243 |
+
# physical_boxes_wounded.select(find_bounding_box,
|
244 |
+
# inputs=[physical_boxes_wounded, gr.Textbox(value="wounded", visible=False)],
|
245 |
+
# outputs=[checkbox_beak_wounded, text_beak_wounded,
|
246 |
+
# checkbox_body_wounded, text_body_wounded,
|
247 |
+
# checkbox_feathers_wounded, text_feathers_wounded,
|
248 |
+
# checkbox_head_wounded, text_head_wounded,
|
249 |
+
# checkbox_legs_wounded, text_legs_wounded
|
250 |
+
# ])
|
251 |
+
# checkbox_beak_wounded.select(on_select_body_part, inputs=[checkbox_beak_wounded, gr.Text("beak", visible=False)])
|
252 |
+
# checkbox_body_wounded.select(on_select_body_part, inputs=[checkbox_body_wounded, gr.Text("body", visible=False)])
|
253 |
+
# checkbox_feathers_wounded.select(on_select_body_part, inputs=[checkbox_feathers_wounded, gr.Text("feathers", visible=False)])
|
254 |
+
# checkbox_head_wounded.select(on_select_body_part, inputs=[checkbox_head_wounded, gr.Text("head", visible=False)])
|
255 |
+
# checkbox_legs_wounded.select(on_select_body_part, inputs=[checkbox_legs_wounded, gr.Text("legs", visible=False)])
|
256 |
|
257 |
+
# # ---------------------------------------------------------
|
258 |
+
# # Follow Up Events Wounded
|
259 |
+
# fe_collection_dropdown_wounded.select(save_fe, inputs=[fe_collection_dropdown_wounded, gr.Textbox("animal collected", visible=False)])
|
260 |
+
# fe_recepient_dropdown_wounded.select(save_fe, inputs=[fe_recepient_dropdown_wounded, gr.Textbox("recipient", visible=False)])
|
261 |
+
# fe_radio_dropdown_wounded.select(save_fe, inputs=[fe_radio_dropdown_wounded, gr.Textbox("radiography", visible=False)])
|
262 |
+
# fe_answer_dropdown_wounded.select(save_fe, inputs=[fe_answer_dropdown_wounded, gr.Textbox("given answer", visible=False)])
|
263 |
+
# fe_name_recipient_wounded.input(save_fe, inputs=[fe_name_recipient_wounded, gr.Textbox("recipient name", visible=False)])
|
264 |
+
# fe_collection_ref_wounded.input(save_fe, inputs=[fe_collection_ref_wounded, gr.Textbox("collection reference", visible=False)])
|
265 |
|
266 |
+
# # ---------------------------------------------------------
|
267 |
+
# # Follow Up Events Dead
|
268 |
+
# fe_collection_dropdown_dead.select(save_fe, inputs=[fe_collection_dropdown_dead, gr.Textbox("animal collected", visible=False)])
|
269 |
+
# fe_recepient_dropdown_dead.select(save_fe, inputs=[fe_recepient_dropdown_dead, gr.Textbox("recipient", visible=False)])
|
270 |
+
# fe_radio_dropdown_dead.select(save_fe, inputs=[fe_radio_dropdown_dead, gr.Textbox("radiography", visible=False)])
|
271 |
+
# fe_answer_dropdown_dead.select(save_fe, inputs=[fe_answer_dropdown_dead, gr.Textbox("given answer", visible=False)])
|
272 |
+
# fe_name_recipient_dead.input(save_fe, inputs=[fe_name_recipient_dead, gr.Textbox("recipient name", visible=False)])
|
273 |
+
# fe_collection_ref_dead.input(save_fe, inputs=[fe_collection_ref_dead, gr.Textbox("collection reference", visible=False)])
|
274 |
|
275 |
+
# # ---------------------------------------------------------
|
276 |
+
# # Error Box
|
277 |
+
# error_box = gr.Text(value=None, visible=False)
|
278 |
|
279 |
+
# # ---------------------------------------------------------
|
280 |
+
# # Add One Individual's Data to the Dataframe
|
281 |
+
# # And Allow clearing of all previous output
|
282 |
+
# with gr.Row():
|
283 |
+
# button_df = gr.Button("Submit Animal Report", scale = 3)
|
284 |
+
# button_clear = gr.ClearButton(scale = 1,
|
285 |
+
# components=[
|
286 |
+
# camera,
|
287 |
+
# location, identified_location,
|
288 |
+
# #dead reset
|
289 |
+
# radio_circumstance_dead, radio_physical_dead,
|
290 |
+
# button_collision_dead, button_deliberate_destruction_dead, button_indirect_destruction_dead, button_natural_cause_dead,
|
291 |
+
# dropdown_dead, dropdown_level2_dead, openfield_level2_dead, dropdown_extra_level2_dead,
|
292 |
+
# physical_boxes_dead,
|
293 |
+
# checkbox_beak_dead, text_beak_dead, checkbox_body_dead, text_body_dead, checkbox_feathers_dead, text_feathers_dead, checkbox_head_dead, text_head_dead, checkbox_legs_dead, text_legs_dead,
|
294 |
+
# fe_collection_dropdown_dead, fe_recepient_dropdown_dead, fe_radio_dropdown_dead, fe_answer_dropdown_dead,
|
295 |
+
# fe_name_recipient_dead, fe_collection_ref_dead,
|
296 |
+
# #wounded reset
|
297 |
+
# radio_circumstance_wounded, radio_behavior_wounded, radio_physical_wounded,
|
298 |
+
# button_collision_wounded, button_deliberate_destruction_wounded, button_indirect_destruction_wounded, button_natural_cause_wounded,
|
299 |
+
# dropdown_wounded, dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded,
|
300 |
+
# behavior_checkbox, behavior_text,
|
301 |
+
# physical_boxes_wounded,
|
302 |
+
# checkbox_beak_wounded, text_beak_wounded, checkbox_body_wounded, text_body_wounded, checkbox_feathers_wounded, text_feathers_wounded, checkbox_head_wounded, text_head_wounded, checkbox_legs_wounded, text_legs_wounded,
|
303 |
+
# fe_collection_dropdown_wounded, fe_recepient_dropdown_wounded, fe_radio_dropdown_wounded, fe_answer_dropdown_wounded,
|
304 |
+
# fe_name_recipient_wounded, fe_collection_ref_wounded,
|
305 |
+
# error_box
|
306 |
+
# ])
|
307 |
+
# button_close = gr.Button("Back to Display", scale = 1)
|
308 |
|
309 |
|
310 |
+
# # ---------------------------------------------------------
|
311 |
+
# # Button Click Logic
|
312 |
+
# button_clear.click()
|
313 |
+
# button_clear.click(hide_physical,
|
314 |
+
# outputs=[checkbox_beak_wounded, text_beak_wounded, checkbox_body_wounded, text_body_wounded, checkbox_feathers_wounded, text_feathers_wounded, checkbox_head_wounded, text_head_wounded, checkbox_legs_wounded, text_legs_wounded])
|
315 |
+
# button_clear.click(hide_physical,
|
316 |
+
# outputs=[checkbox_beak_dead, text_beak_dead, checkbox_body_dead, text_body_dead, checkbox_feathers_dead, text_feathers_dead, checkbox_head_dead, text_head_dead, checkbox_legs_dead, text_legs_dead])
|
317 |
|
318 |
+
# button_clear.click(reset_error_box, inputs=[error_box], outputs=[error_box])
|
319 |
+
# button_clear.click(reset_json)
|
320 |
|
321 |
+
# button_df.click(save_display_individual,
|
322 |
+
# inputs=[gallery, df, error_box],
|
323 |
+
# outputs=[gallery, df, error_box]
|
324 |
+
# )
|
325 |
+
# button_close.click(lambda: Modal(visible=False), None, modal)
|
326 |
|
327 |
+
# # ---------------------------------------------------------
|
328 |
+
# # Event Functions of the landing page buttons
|
329 |
+
# show_modal.click(lambda: Modal(visible=True), None, modal)
|
330 |
+
# show_modal.click(create_json_one_individual)
|
331 |
+
# show_modal.click(create_tmp)
|
332 |
+
# #submit_button.click(save_and_rest_df, inputs=[df], outputs=[df])
|
333 |
|
334 |
|
335 |
if __name__ == "__main__":
|