Zaiiida commited on
Commit
2e4f4c8
1 Parent(s): 79b27c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -73,11 +73,13 @@ def generate(image):
73
  mesh.export(mesh_path2.name)
74
  return mesh_path.name, mesh_path2.name
75
 
 
76
  def run_example(image_pil):
77
  preprocessed = preprocess(image_pil, False, 0.9)
78
- mesh_name, mesn_name2 = generate(preprocessed)
79
  return preprocessed, mesh_name, mesh_name2
80
 
 
81
  class CustomTheme(gr.themes.Base):
82
  def __init__(self):
83
  super().__init__()
@@ -91,6 +93,7 @@ class CustomTheme(gr.themes.Base):
91
  self.input_background_fill = "#191a1e"
92
  self.input_text_color = "#FFFFFF"
93
 
 
94
  css = """
95
  /* Скрываем нижний колонтитул */
96
  footer {
@@ -146,11 +149,13 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
146
  image_mode="RGBA",
147
  sources="upload",
148
  type="pil",
149
- container=False,
 
150
  )
151
- with gr.Group():
152
  do_remove_background = gr.Checkbox(
153
- label="Remove Background", value=True
 
154
  )
155
  foreground_ratio = gr.Slider(
156
  label="Foreground Ratio",
 
73
  mesh.export(mesh_path2.name)
74
  return mesh_path.name, mesh_path2.name
75
 
76
+
77
  def run_example(image_pil):
78
  preprocessed = preprocess(image_pil, False, 0.9)
79
+ mesh_name, mesh_name2 = generate(preprocessed)
80
  return preprocessed, mesh_name, mesh_name2
81
 
82
+
83
  class CustomTheme(gr.themes.Base):
84
  def __init__(self):
85
  super().__init__()
 
93
  self.input_background_fill = "#191a1e"
94
  self.input_text_color = "#FFFFFF"
95
 
96
+
97
  css = """
98
  /* Скрываем нижний колонтитул */
99
  footer {
 
149
  image_mode="RGBA",
150
  sources="upload",
151
  type="pil",
152
+ elem_id="content_image",
153
+ width=500, # Увеличение ширины входного изображения
154
  )
155
+ with gr.Column():
156
  do_remove_background = gr.Checkbox(
157
+ label="Remove Background",
158
+ value=True,
159
  )
160
  foreground_ratio = gr.Slider(
161
  label="Foreground Ratio",