pablo commited on
Commit
fd59cc1
·
1 Parent(s): b785abb

correct scale

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -206,6 +206,10 @@ def predict_images_3d(dict, depth, prompt="", negative_prompt="", guidance_scale
206
  output_depth_vis = (depth_out - np.min(depth_out)) / (np.max(depth_out) - np.min(depth_out)) * 255
207
  output_depth_vis = output_depth_vis.astype("uint8")
208
 
 
 
 
 
209
  #init_image
210
  #depth_image
211
  output_image = output.rgb[0]
@@ -213,8 +217,7 @@ def predict_images_3d(dict, depth, prompt="", negative_prompt="", guidance_scale
213
  mesh_depth = output_depth_vis.max() - output_depth_vis
214
  output_mesh = get_mesh(mesh_depth, output_image, keep_edges=keep_edges, skew=4)
215
 
216
- depth_image = np.array(depth_image)
217
- depth_image_mesh = depth_image.max() - depth_image
218
  input_mesh = get_mesh(depth_image_mesh,init_image, keep_edges=keep_edges, skew=4)
219
 
220
  return input_mesh, output_mesh, gr.update(visible=True)
 
206
  output_depth_vis = (depth_out - np.min(depth_out)) / (np.max(depth_out) - np.min(depth_out)) * 255
207
  output_depth_vis = output_depth_vis.astype("uint8")
208
 
209
+ input_depth = np.array(depth_image)
210
+ input_depth_vis = (input_depth - np.min(input_depth)) / (np.max(input_depth) - np.min(input_depth)) * 255
211
+ input_depth_vis = input_depth_vis.astype("uint8")
212
+
213
  #init_image
214
  #depth_image
215
  output_image = output.rgb[0]
 
217
  mesh_depth = output_depth_vis.max() - output_depth_vis
218
  output_mesh = get_mesh(mesh_depth, output_image, keep_edges=keep_edges, skew=4)
219
 
220
+ depth_image_mesh = input_depth_vis.max() - input_depth_vis
 
221
  input_mesh = get_mesh(depth_image_mesh,init_image, keep_edges=keep_edges, skew=4)
222
 
223
  return input_mesh, output_mesh, gr.update(visible=True)