rrnoa commited on
Commit
13a7c45
1 Parent(s): 01a6f2b

depth map black

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,12 +31,12 @@ async def predict_depth(file: UploadFile = File(...)):
31
  print("[DEBUG] Realizando predicci贸n de profundidad...")
32
  depth = pipe(image)
33
 
34
- # Visualiza la profundidad
35
- vis = pipe.image_processor.visualize_depth(depth.prediction)
36
 
37
  # Guarda la imagen generada en un buffer
38
  img_buffer = io.BytesIO()
39
- vis[0].save(img_buffer, format="PNG")
40
  img_buffer.seek(0)
41
 
42
  # Devuelve la imagen como respuesta
 
31
  print("[DEBUG] Realizando predicci贸n de profundidad...")
32
  depth = pipe(image)
33
 
34
+ # Exporta la profundidad como una imagen 16-bit PNG
35
+ depth_16bit = pipe.image_processor.export_depth_to_16bit_png(depth.prediction)
36
 
37
  # Guarda la imagen generada en un buffer
38
  img_buffer = io.BytesIO()
39
+ depth_16bit[0].save(img_buffer, format="PNG")
40
  img_buffer.seek(0)
41
 
42
  # Devuelve la imagen como respuesta