blanchon commited on
Commit
87608e2
·
1 Parent(s): 3df4f41

really log all

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -284,6 +284,17 @@ def infer(
284
  )
285
  )
286
 
 
 
 
 
 
 
 
 
 
 
 
287
  room_image_cropped = room_image.crop(
288
  (
289
  mask_bbox_x_min,
@@ -376,6 +387,9 @@ def infer(
376
  )["images"]
377
 
378
  final_images = []
 
 
 
379
  final_images.append(room_image)
380
  final_images.append(room_mask)
381
  final_images.append(furniture_image)
 
284
  )
285
  )
286
 
287
+ # Create a debug image showing the bounding box
288
+ bbox_debug = room_image.copy()
289
+ from PIL import ImageDraw
290
+
291
+ draw = ImageDraw.Draw(bbox_debug)
292
+ draw.rectangle(
293
+ (mask_bbox_x_min, mask_bbox_y_min, mask_bbox_x_max, mask_bbox_y_max),
294
+ outline="red",
295
+ width=3,
296
+ )
297
+
298
  room_image_cropped = room_image.crop(
299
  (
300
  mask_bbox_x_min,
 
387
  )["images"]
388
 
389
  final_images = []
390
+ final_images.append(bbox_debug)
391
+ final_images.append(room_image_padded)
392
+ final_images.append(room_image_cropped)
393
  final_images.append(room_image)
394
  final_images.append(room_mask)
395
  final_images.append(furniture_image)