Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -188,8 +188,11 @@ def generate(image, mc_resolution, formats=["obj", "glb"]):
|
|
188 |
|
189 |
return mesh_path_obj.name, mesh_path_glb.name
|
190 |
|
191 |
-
def run_example(image,
|
192 |
-
|
|
|
|
|
|
|
193 |
preprocessed = preprocess(image_pil, do_remove_background, foreground_ratio)
|
194 |
mesh_name_obj, mesh_name_glb = generate(preprocessed, mc_resolution, ["obj", "glb"])
|
195 |
return preprocessed, mesh_name_obj, mesh_name_glb
|
|
|
188 |
|
189 |
return mesh_path_obj.name, mesh_path_glb.name
|
190 |
|
191 |
+
def run_example(image, do_remove_background, foreground_ratio, mc_resolution, text_prompt=None):
|
192 |
+
if text_prompt:
|
193 |
+
image_pil = generate_image_from_text(encoded_image=image, pos_prompt=text_prompt)
|
194 |
+
else:
|
195 |
+
image_pil = generate_image_from_text(encoded_image=image)
|
196 |
preprocessed = preprocess(image_pil, do_remove_background, foreground_ratio)
|
197 |
mesh_name_obj, mesh_name_glb = generate(preprocessed, mc_resolution, ["obj", "glb"])
|
198 |
return preprocessed, mesh_name_obj, mesh_name_glb
|