File size: 1,097 Bytes
355f278
 
 
 
 
 
21dae66
355f278
 
21dae66
355f278
 
21dae66
355f278
 
 
 
21dae66
355f278
21dae66
 
 
355f278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ebc6ea2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import gradio as gr

from physical.physical_checkbox import process_body_parts

from dotenv import load_dotenv
import os

load_dotenv()
PATH = os.getcwd() + "/"
PATH_ASSETS = os.getenv("PATH_ASSETS")
PATH_ICONS = PATH + PATH_ASSETS + "icons/"


def reset_individual(individual):
    individual = {}
    return individual


def reset_error_box(error_icon, error_box):
    error_icon = gr.Image(
        PATH_ICONS + "supprimer.png", height=80, width=80, visible=False
    )
    error_box = gr.Text(value=None, visible=False)
    return error_icon, error_box


def hide_physical(mode):
    (
        checkbox_beak,
        text_beak,
        checkbox_body,
        text_body,
        checkbox_feathers,
        text_feathers,
        checkbox_head,
        text_head,
        checkbox_legs,
        text_legs,
    ) = process_body_parts("wounded", mode, "None")
    return (
        checkbox_beak,
        text_beak,
        checkbox_body,
        text_body,
        checkbox_feathers,
        text_feathers,
        checkbox_head,
        text_head,
        checkbox_legs,
        text_legs,
    )