qbhf2 commited on
Commit
f4bae4d
·
verified ·
1 Parent(s): 9185355

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -22
app.py CHANGED
@@ -1,35 +1,35 @@
1
  import gradio as gr
2
  from custom_utils.setup_env import run_setup_script
3
 
4
-
5
  def update_submenu(clothing_type):
6
  """Функция для динамического обновления подменю в зависимости от типа одежды."""
7
  if clothing_type == "Top":
8
- return gr.Dropdown.update(
9
- visible=True,
10
- label="Front Collar",
11
- choices=["CircleNeckHalf", "CurvyNeckHalf", "VNeckHalf", "SquareNeckHalf",
12
- "TrapezoidNeckHalf", "CircleArcNeckHalf", "Bezier2NeckHalf"]
13
- ), gr.Dropdown.update(
14
- visible=True,
15
- label="Back Collar",
16
- choices=["CircleNeckHalf", "CurvyNeckHalf", "VNeckHalf", "SquareNeckHalf",
17
- "TrapezoidNeckHalf", "CircleArcNeckHalf", "Bezier2NeckHalf"]
18
  )
19
  elif clothing_type == "Down":
20
- return gr.Dropdown.update(
21
- visible=True,
22
- label="Waist Style",
23
- choices=["High Waist", "Low Waist", "Medium Waist"]
24
- ), None # Нет второго параметра для Down
25
  elif clothing_type == "Full body":
26
- return gr.Dropdown.update(
27
- visible=True,
28
- label="Overall Style",
29
- choices=["Slim Fit", "Loose Fit", "Regular Fit"]
30
- ), None # Нет второго параметра для Full body
31
  else:
32
- return None, None
 
 
 
 
33
 
34
  with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="sm")) as demo:
35
  # Состояния для хранения выбранных значений
@@ -68,6 +68,9 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
68
  choices=[],
69
  interactive=True
70
  )
 
 
 
71
 
72
  back_dropdown = gr.Dropdown(
73
  visible=False,
 
1
  import gradio as gr
2
  from custom_utils.setup_env import run_setup_script
3
 
 
4
  def update_submenu(clothing_type):
5
  """Функция для динамического обновления подменю в зависимости от типа одежды."""
6
  if clothing_type == "Top":
7
+ return (
8
+ gr.Dropdown.update(visible=True, label="Front Collar",
9
+ choices=["CircleNeckHalf", "CurvyNeckHalf", "VNeckHalf", "SquareNeckHalf",
10
+ "TrapezoidNeckHalf", "CircleArcNeckHalf", "Bezier2NeckHalf"]),
11
+ gr.Dropdown.update(visible=True, label="Back Collar",
12
+ choices=["CircleNeckHalf", "CurvyNeckHalf", "VNeckHalf", "SquareNeckHalf",
13
+ "TrapezoidNeckHalf", "CircleArcNeckHalf", "Bezier2NeckHalf"])
 
 
 
14
  )
15
  elif clothing_type == "Down":
16
+ return (
17
+ gr.Dropdown.update(visible=True, label="Waist Style",
18
+ choices=["High Waist", "Low Waist", "Medium Waist"]),
19
+ gr.Dropdown.update(visible=False) # Явно скрываем второй Dropdown
20
+ )
21
  elif clothing_type == "Full body":
22
+ return (
23
+ gr.Dropdown.update(visible=True, label="Overall Style",
24
+ choices=["Slim Fit", "Loose Fit", "Regular Fit"]),
25
+ gr.Dropdown.update(visible=False) # Явно скрываем второй Dropdown
26
+ )
27
  else:
28
+ return (
29
+ gr.Dropdown.update(visible=False),
30
+ gr.Dropdown.update(visible=False)
31
+ )
32
+
33
 
34
  with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="sm")) as demo:
35
  # Состояния для хранения выбранных значений
 
68
  choices=[],
69
  interactive=True
70
  )
71
+
72
+ lenght = gr.Slider(1, 50, value=25, label="Cloth Lenght",
73
+ info="Choose between 1 and 50")
74
 
75
  back_dropdown = gr.Dropdown(
76
  visible=False,