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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -6,23 +6,23 @@ def update_submenu(clothing_type):
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 (
@@ -30,7 +30,6 @@ def update_submenu(clothing_type):
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
  # Состояния для хранения выбранных значений
36
  front_collar = gr.State()
@@ -58,6 +57,7 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
58
  clothing_type_dropdown = gr.Dropdown(
59
  label="Тип одежды",
60
  choices=["Top", "Down", "Full body"],
 
61
  interactive=True
62
  )
63
 
@@ -68,9 +68,6 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
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,
@@ -78,6 +75,11 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
78
  choices=[],
79
  interactive=True
80
  )
 
 
 
 
 
81
 
82
  # Обновление подменю при изменении типа одежды
83
  clothing_type_dropdown.change(
@@ -94,7 +96,7 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
94
  )
95
 
96
  with gr.Column(scale=3):
97
- viewer = gr.Model3D(label="3D Просмотрщик", interactive=True,height=500)
98
 
99
  with gr.Row():
100
  save_render_btn = gr.Button("Сохранить рендер")
@@ -128,5 +130,3 @@ with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="
128
  if __name__ == "__main__":
129
  run_setup_script()
130
  demo.launch()
131
-
132
-
 
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)
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)
26
  )
27
  else:
28
  return (
 
30
  gr.Dropdown.update(visible=False)
31
  )
32
 
 
33
  with gr.Blocks(title="3D Garment Generator", theme=gr.themes.Default(text_size="sm")) as demo:
34
  # Состояния для хранения выбранных значений
35
  front_collar = gr.State()
 
57
  clothing_type_dropdown = gr.Dropdown(
58
  label="Тип одежды",
59
  choices=["Top", "Down", "Full body"],
60
+ value="Top",
61
  interactive=True
62
  )
63
 
 
68
  choices=[],
69
  interactive=True
70
  )
 
 
 
71
 
72
  back_dropdown = gr.Dropdown(
73
  visible=False,
 
75
  choices=[],
76
  interactive=True
77
  )
78
+
79
+ # Общий параметр (должен быть после дропдаунов)
80
+ overall_length = gr.Slider(1, 50, value=25, label="Длина одежды",
81
+ info="Выберите значение от 1 до 50",
82
+ interactive=True)
83
 
84
  # Обновление подменю при изменении типа одежды
85
  clothing_type_dropdown.change(
 
96
  )
97
 
98
  with gr.Column(scale=3):
99
+ viewer = gr.Model3D(label="3D Просмотрщик", interactive=True, height=500)
100
 
101
  with gr.Row():
102
  save_render_btn = gr.Button("Сохранить рендер")
 
130
  if __name__ == "__main__":
131
  run_setup_script()
132
  demo.launch()