sinashish commited on
Commit
8a45cbf
·
1 Parent(s): 9f46b26

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +4 -2
gradio_app.py CHANGED
@@ -152,6 +152,8 @@ def prepare_ds_renderer(
152
  gr.Info("Preparing for Rendering...")
153
  mesh_renderer = MeshRendererPyTorch3D(mesh, DEVICE, config=None)
154
  extension = f"lesion_{num_lesion}"
 
 
155
  nevi_exists = os.path.exists(bodytex.annotation_filepath(mesh_name.split("_")[0]))
156
  gen2d = Generate2DHelper(
157
  mesh_filename=mesh_filename,
@@ -175,7 +177,7 @@ def prepare_ds_renderer(
175
  device=DEVICE,
176
  dir_blended_textures=dir_blended_textures,
177
  dir_anatomy=dir_anatomy,
178
- extension=extension if num_lesion > 0 else "demo",
179
  )
180
  normal_texture = load_texture_map(
181
  mesh, mesh_name, "No Lesion", 0, device
@@ -249,7 +251,7 @@ def prepare_ds_renderer(
249
  gr.Info("Rasterization in progress...")
250
  gen2d.mesh_renderer.compute_fragments()
251
  gr.Info("Successfully rasterized.")
252
- paste_img, target = gen2d.render_image_and_target(paste_lesion=True)
253
  if paste_img is None:
254
  gr.Info(
255
  "***Not enough skin or unable to paste lesion. Skipping and Retrying."
 
152
  gr.Info("Preparing for Rendering...")
153
  mesh_renderer = MeshRendererPyTorch3D(mesh, DEVICE, config=None)
154
  extension = f"lesion_{num_lesion}"
155
+ # if texture_name != "No Lesion":
156
+ # extension = f"{texture_name.lower().split(' ')[0]}_lesion_{num_lesion}"
157
  nevi_exists = os.path.exists(bodytex.annotation_filepath(mesh_name.split("_")[0]))
158
  gen2d = Generate2DHelper(
159
  mesh_filename=mesh_filename,
 
177
  device=DEVICE,
178
  dir_blended_textures=dir_blended_textures,
179
  dir_anatomy=dir_anatomy,
180
+ extension=extension ,
181
  )
182
  normal_texture = load_texture_map(
183
  mesh, mesh_name, "No Lesion", 0, device
 
251
  gr.Info("Rasterization in progress...")
252
  gen2d.mesh_renderer.compute_fragments()
253
  gr.Info("Successfully rasterized.")
254
+ paste_img, target = gen2d.render_image_and_target(paste_lesion=False)
255
  if paste_img is None:
256
  gr.Info(
257
  "***Not enough skin or unable to paste lesion. Skipping and Retrying."