Merge pull request #42 from sdsc-ordes/chore/logos-for-aesthetics
Browse filesFiles changed (20)
- app/assets/icons/animal.pngAdded
- app/assets/icons/bird.pngAdded
- app/assets/icons/cardiogram.pngAdded
- app/assets/icons/chicken.pngAdded
- app/assets/icons/copyright.pngAdded
- app/assets/icons/effective.pngAdded
- app/assets/icons/eye.pngAdded
- app/assets/icons/flying-doves-group.pngAdded
- app/assets/icons/impact-2.pngAdded
- app/assets/icons/impact.pngAdded
- app/assets/icons/medical-app.pngAdded
- app/assets/icons/neuron.pngAdded
- app/assets/icons/pigeon.pngAdded
- app/assets/icons/pin.pngAdded
- app/assets/icons/schedule.pngAdded
- app/assets/icons/swallow.pngAdded
- app/credits.pyAdded+52
- app/dead.py+17-4
- app/main.py+52-15
- app/wounded.py+19-4
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152credits_text = """# Credits
## Scientific Expertise
- Isabelle Wethli (Institute for Fish and Wildlife Health, University of Bern)- Dr. Mirjam Pewsner (Institute for Fish and Wildlife Health, University of Bern)- Dr. Saskia Keller (Institute for Fish and Wildlife Health, University of Bern)
## Front End Development
- Carlos Viviar Rios (Swiss Data Science Center)- Laure Vancauwenberghe (Swiss Data Science Center)
### Icons
copyright: <a href="https://www.flaticon.com/free-icons/copyright" title="copyright icons">Copyright icons created by Freepik - Flaticon</a>
flying-doves-group: <a href="https://www.flaticon.com/free-icons/animal" title="animal icons">Animal icons created by Freepik - Flaticon</a>
Pigeon: <a href="https://www.flaticon.com/free-icons/bird" title="bird icons">Bird icons created by Freepik - Flaticon</a>
Bird: <a href="https://www.flaticon.com/free-icons/bird" title="bird icons">Bird icons created by PLANBSTUDIO - Flaticon</a>
Medical app: <a href="https://www.flaticon.com/free-icons/health" title="health icons">Health icons created by Smashicons - Flaticon</a>
Pin: <a href="https://www.flaticon.com/free-icons/google-maps" title="google maps icons">Google maps icons created by Creatype - Flaticon</a>
Cardiograms: <a href="https://www.flaticon.com/free-icons/medical" title="medical icons">Medical icons created by Freepik - Flaticon</a>
Swallow: <a href="https://www.flaticon.com/free-icons/swallow" title="swallow icons">Swallow icons created by Freepik - Flaticon</a>
Chicken: <a href="https://www.flaticon.com/free-icons/chicken" title="chicken icons">Chicken icons created by Freepik - Flaticon</a>
eye: <a href="https://www.flaticon.com/free-icons/healthcare-and-medical" title="healthcare and medical icons">Healthcare and medical icons created by juicy_fish - Flaticon</a>
neuron: <a href="https://www.flaticon.com/free-icons/neuron" title="neuron icons">Neuron icons created by manshagraphics - Flaticon</a>
impact: <a href="https://www.flaticon.com/free-icons/consequence" title="consequence icons">Consequence icons created by Awicon - Flaticon</a>
schedule: <a href="https://www.flaticon.com/free-icons/follow-up" title="follow up icons">Follow up icons created by iconsitee - Flaticon</a>
Effective: <a href="https://www.flaticon.com/free-icons/cog" title="cog icons">Cog icons created by monkik - Flaticon</a>
"""4 unmodified lines56789101 unmodified line121314151617181920212223242526272829304 unmodified linesfrom follow_up.followup_events import create_followup_dropdowns, create_followup_openfrom validation_submission.add_json import add_data_to_individualdef show_section_dead(visible, individual):if visible==True:individual = add_data_to_individual("wounded_state", "No", individual)1 unmodified linewith gr.Column(visible=visible, elem_id="dead") as section_dead:gr.Markdown("# Dead Animal")gr.Markdown("## Do you know what conditions caused this?", label="description")radio_cause = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_circumstances(visible=False)gr.Markdown("## Are there physical changes on the bird?" , label="description")radio_physical = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():physical_boxes = create_bird_anatomy(False, "dead")with gr.Column():checkbox_beak, text_beak, checkbox_body, text_body, checkbox_feathers, text_feathers, checkbox_head, text_head, checkbox_legs, text_legs = process_body_parts("dead", "None")gr.Markdown("## Follow-Up Events", label="Title")gr.Markdown("Please tell us what you did with the animal.", label="description")with gr.Row():fe_collection_dropdown, fe_recepient_dropdown, fe_radio_dropdown, fe_answer_dropdown = create_followup_dropdowns(visible, "dead")4 unmodified lines5678910111213141516171 unmodified line192021222324252627282930313233343536373839404142434 unmodified linesfrom follow_up.followup_events import create_followup_dropdowns, create_followup_openfrom validation_submission.add_json import add_data_to_individualfrom dotenv import load_dotenvimport osload_dotenv()PATH = os.getcwd() + "/"PATH_ASSETS = os.getenv('PATH_ASSETS')PATH_ICONS = PATH + PATH_ASSETS + "icons/"def show_section_dead(visible, individual):if visible==True:individual = add_data_to_individual("wounded_state", "No", individual)1 unmodified linewith gr.Column(visible=visible, elem_id="dead") as section_dead:gr.Markdown("# Dead Animal")gr.Button("Do you know what conditions caused this?",icon=PATH_ICONS + "eye.png",variant= "primary")# gr.Markdown("## Do you know what conditions caused this?", label="description")radio_cause = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_circumstances(visible=False)gr.Button("Are there physical changes on the bird?",icon=PATH_ICONS + "cardiogram.png",variant= "primary")radio_physical = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():physical_boxes = create_bird_anatomy(False, "dead")with gr.Column():checkbox_beak, text_beak, checkbox_body, text_body, checkbox_feathers, text_feathers, checkbox_head, text_head, checkbox_legs, text_legs = process_body_parts("dead", "None")gr.Button("Follow-Up Events",icon=PATH_ICONS + "schedule.png",variant= "primary")gr.Markdown("Please tell us what you did with the animal.", label="description")with gr.Row():fe_collection_dropdown, fe_recepient_dropdown, fe_radio_dropdown, fe_answer_dropdown = create_followup_dropdowns(visible, "dead")
19 unmodified lines2021222324253 unmodified lines2930313233343536373839404 unmodified lines4546474849505152538 unmodified lines6263646566676820 unmodified lines8990919293949532 unmodified lines128129130131132133134135211 unmodified lines34734834935035135235335416 unmodified lines37137237337437537637719 unmodified lines39739839940040140240319 unmodified linesfrom geolocalisation.js_geolocation import js_geocode, display_location# with gr.Blocks(theme=theme, css=css) as demo:with gr.Blocks(theme='shivi/calm_seafoam') as demo:individual = gr.State({})3 unmodified lines# ---------------------------------------------------------# Intro Textwith gr.Row():with gr.Column(scale=1):title = gr.Markdown("# Welcome to Digiwild", label="Title")description = gr.Markdown("Please record your wildlife observations here !", label="description")with gr.Row():show_modal = gr.Button("Add an Animal", scale=3)submit_button = gr.Button("Submit All Animals", scale=1)df = gr.Dataframe(headers=["Identifier", "Location", "Wounded", "Dead"], visible=False, interactive=False)gallery = gr.Gallery(label="Gallery of Records", elem_id="gallery",4 unmodified lines# ---------------------------------------------------------# Intro Textwith gr.Row():with gr.Column(scale=1):title = gr.Markdown("# Animal Report", label="Title")description = gr.Markdown("Please record your observation here.", label="description")# ---------------------------------------------------------# Camera8 unmodified lines# Location#with gr.Row():with gr.Column(scale=1):gr.Markdown("### Location")gr.Markdown("#### Location (Using address)")location = gr.Textbox(visible=True, interactive=True, label="Location of Sighting")#display location processing20 unmodified lines# Introducing text_box for Speciesgr.Markdown("### General details")with gr.Row():specie = gr.Textbox(label="Species (if known)",32 unmodified lines# ---------------------------------------------------------# ---------------------------------------------------------# Dead and Wounded Buttonsgr.Markdown("## The State of the Animal", label="Title")gr.Markdown("Please tell us if the animal was wounded / sick or dead.", label="description")with gr.Row() as block_form:with gr.Column(scale=1):butt_wounded = gr.Button("Wounded / Sick", elem_id="wounded")211 unmodified lines# Add One Individual's Data to the Dataframe# And Allow clearing of all previous outputwith gr.Row():button_df = gr.Button("Submit Animal Report", scale = 3)button_clear = gr.ClearButton(scale = 1,components=[camera,location, identified_location,16 unmodified linesfe_name_recipient_wounded, fe_collection_ref_wounded,error_box])button_close = gr.Button("Back to Display", scale = 1)# ---------------------------------------------------------19 unmodified linesshow_modal.click(create_json_one_individual)show_modal.click(create_tmp)#submit_button.click(save_and_rest_df, inputs=[df], outputs=[df])if __name__ == "__main__":demo.launch(server_name="0.0.0.0", server_port=7860)19 unmodified lines202122232425262728293031323 unmodified lines363738394041424344454647484950515253544 unmodified lines59606162636465666768697071728 unmodified lines8182838485868720 unmodified lines10810911011111211311432 unmodified lines147148149150151152153154155156157158159160161162211 unmodified lines37437537637737837938038138238316 unmodified lines40040140240340440540640719 unmodified lines42742842943043143243343443543643743843944019 unmodified linesfrom geolocalisation.js_geolocation import js_geocode, display_locationfrom dotenv import load_dotenvimport osload_dotenv()PATH = os.getcwd() + "/"PATH_ASSETS = os.getenv('PATH_ASSETS')PATH_ICONS = PATH + PATH_ASSETS + "icons/"# with gr.Blocks(theme=theme, css=css) as demo:with gr.Blocks(theme='shivi/calm_seafoam') as demo:individual = gr.State({})3 unmodified lines# ---------------------------------------------------------# Intro Textwith gr.Row():with gr.Row():gr.Image(PATH_ICONS+"swallow.png", scale =0.1,interactive=False,show_fullscreen_button = False, show_share_button=False,show_download_button=False, show_label=False)with gr.Column(scale=1):title = gr.Markdown("# Welcome to Digiwild", label="Title")description = gr.Markdown("Please record your wildlife observations here !", label="description")with gr.Row():show_modal = gr.Button("Add an Animal", icon = PATH_ICONS+"chicken.png", scale=3)submit_button = gr.Button("Submit All Animals", icon = PATH_ICONS+ "flying-doves-group.png", scale=1)show_creds = gr.Button("Credits", icon=PATH_ICONS+"copyright.png", scale=0.5)df = gr.Dataframe(headers=["Identifier", "Location", "Wounded", "Dead"], visible=False, interactive=False)gallery = gr.Gallery(label="Gallery of Records", elem_id="gallery",4 unmodified lines# ---------------------------------------------------------# Intro Textwith gr.Row():with gr.Row():gr.Image(PATH_ICONS+"pigeon.png", scale =0.1,interactive=False,show_fullscreen_button = False, show_share_button=False,show_download_button=False, show_label=False)with gr.Column(scale=1):title = gr.Markdown("# Animal Report", label="Title")description = gr.Markdown("Please record your observation here.", label="description")# ---------------------------------------------------------# Camera8 unmodified lines# Location#with gr.Row():with gr.Column(scale=1):gr.Button("Location", icon=PATH_ICONS+"pin.png", variant="primary")gr.Markdown("#### Location (Using address)")location = gr.Textbox(visible=True, interactive=True, label="Location of Sighting")#display location processing20 unmodified lines# Introducing text_box for Speciesgr.Button("General Details", icon=PATH_ICONS+"bird.png", variant="primary")with gr.Row():specie = gr.Textbox(label="Species (if known)",32 unmodified lines# ---------------------------------------------------------# ---------------------------------------------------------# Dead and Wounded Buttonswith gr.Row():gr.Image(PATH_ICONS+"medical-app.png", scale =0.1,interactive=False,show_fullscreen_button = False, show_share_button=False,show_download_button=False, show_label=False)with gr.Column():gr.Markdown("## The State of the Animal", label="Title")gr.Markdown("Please tell us if the animal was wounded / sick or dead.", label="description")gr.Markdown("Please fill out as many fields as you can, based on what you can see.", label="description")gr.Markdown("Do not touch the animal unless absolutely necessary.", label="description")with gr.Row() as block_form:with gr.Column(scale=1):butt_wounded = gr.Button("Wounded / Sick", elem_id="wounded")211 unmodified lines# Add One Individual's Data to the Dataframe# And Allow clearing of all previous outputwith gr.Row():button_df = gr.Button("Submit Animal Report", icon=PATH_ICONS+"effective.png",variant="primary", scale = 3)button_clear = gr.ClearButton(variant="primary",scale = 1,components=[camera,location, identified_location,16 unmodified linesfe_name_recipient_wounded, fe_collection_ref_wounded,error_box])button_close = gr.Button("Back to Display", variant="primary", scale = 1)show_creds_v2 = gr.Button("Credits", icon=PATH_ICONS+"copyright.png", scale=0.5)# ---------------------------------------------------------19 unmodified linesshow_modal.click(create_json_one_individual)show_modal.click(create_tmp)#submit_button.click(save_and_rest_df, inputs=[df], outputs=[df])# ---------------------------------------------------------from credits import credits_textwith Modal(visible=False) as modal_creds:gr.Markdown(credits_text)show_creds.click(lambda: Modal(visible=True), None, modal_creds)show_creds_v2.click(lambda: Modal(visible=True), None, modal_creds)if __name__ == "__main__":demo.launch(server_name="0.0.0.0", server_port=7860)
5 unmodified lines678910112 unmodified lines141516171819202122232425262728291 unmodified line313233343536375 unmodified linesfrom follow_up.followup_events import create_followup_dropdowns, create_followup_openfrom validation_submission.add_json import add_data_to_individualdef show_section_wounded(visible, individual):if visible==True:individual = add_data_to_individual("wounded_state", "Yes", individual)2 unmodified lineswith gr.Column(visible=visible, elem_id="wounded") as wounded_section:gr.Markdown("# Wounded / Sick Animal")gr.Markdown("## Do you know what conditions caused this?", label="description")radio_cause = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_circumstances(visible=False)gr.Markdown("## Is the bird displaying behavioural changes?" , label="description")radio_behaviour = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():behavior_checkbox, behavior_text = create_behavior_checkbox("wounded", False)gr.Markdown("## Are there physical changes on the bird?" , label="description")radio_physical = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():physical_boxes = create_bird_anatomy(False, "wounded")1 unmodified linecheckbox_beak, text_beak, checkbox_body, text_body, checkbox_feathers, text_feathers, checkbox_head, text_head, checkbox_legs, text_legs = process_body_parts("wounded", "None")gr.Markdown("## Follow-Up Events", label="Title")gr.Markdown("Please tell us what you did with the animal.", label="description")with gr.Row():fe_collection_dropdown, fe_recepient_dropdown, fe_radio_dropdown, fe_answer_dropdown = create_followup_dropdowns(visible, "wounded")5 unmodified lines67891011121314151617182 unmodified lines212223242526272829303132333435363738394041421 unmodified line4445464748495051525 unmodified linesfrom follow_up.followup_events import create_followup_dropdowns, create_followup_openfrom validation_submission.add_json import add_data_to_individualfrom dotenv import load_dotenvimport osload_dotenv()PATH = os.getcwd() + "/"PATH_ASSETS = os.getenv('PATH_ASSETS')PATH_ICONS = PATH + PATH_ASSETS + "icons/"def show_section_wounded(visible, individual):if visible==True:individual = add_data_to_individual("wounded_state", "Yes", individual)2 unmodified lineswith gr.Column(visible=visible, elem_id="wounded") as wounded_section:gr.Markdown("# Wounded / Sick Animal")gr.Button("Do you know what conditions caused this?",icon=PATH_ICONS + "eye.png",variant= "primary")radio_cause = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_circumstances(visible=False)gr.Button("Is the bird displaying behavioural changes?",icon=PATH_ICONS + "neuron.png",variant= "primary")radio_behaviour = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():behavior_checkbox, behavior_text = create_behavior_checkbox("wounded", False)gr.Button("Are there physical changes on the bird?",icon=PATH_ICONS + "cardiogram.png",variant= "primary")radio_physical = gr.Radio(["Yes", "No"], value=None, show_label=False, interactive=True)with gr.Row():physical_boxes = create_bird_anatomy(False, "wounded")1 unmodified linecheckbox_beak, text_beak, checkbox_body, text_body, checkbox_feathers, text_feathers, checkbox_head, text_head, checkbox_legs, text_legs = process_body_parts("wounded", "None")gr.Button("Follow-Up Events",icon=PATH_ICONS + "schedule.png",variant= "primary")gr.Markdown("Please tell us what you did with the animal.", label="description")with gr.Row():fe_collection_dropdown, fe_recepient_dropdown, fe_radio_dropdown, fe_answer_dropdown = create_followup_dropdowns(visible, "wounded")
app/assets/icons/animal.pngAdded
app/assets/icons/bird.pngAdded
app/assets/icons/cardiogram.pngAdded
app/assets/icons/chicken.pngAdded
app/assets/icons/copyright.pngAdded
app/assets/icons/effective.pngAdded
app/assets/icons/eye.pngAdded
app/assets/icons/flying-doves-group.pngAdded
app/assets/icons/impact-2.pngAdded
app/assets/icons/impact.pngAdded
app/assets/icons/medical-app.pngAdded
app/assets/icons/neuron.pngAdded
app/assets/icons/pigeon.pngAdded
app/assets/icons/pin.pngAdded
app/assets/icons/schedule.pngAdded
app/assets/icons/swallow.pngAdded
app/credits.pyAdded+52
app/dead.py+17-4
app/main.py+52-15
app/wounded.py+19-4