CarolineM5 commited on
Commit
2ec02af
·
verified ·
1 Parent(s): 082f234

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. inference.py +4 -4
app.py CHANGED
@@ -347,8 +347,9 @@ def build_textured_cube(pil_imgs, face_rotations=None):
347
  # récupérer tailles (on suppose que inference a déjà redimensionné left/right si besoin)
348
  front_w, front_h = pil_imgs[0].size
349
  right_w, right_h = pil_imgs[1].size
350
- back_w, back_h = pil_imgs[2].size
351
- left_w, left_h = pil_imgs[3].size
 
352
 
353
  # définir dimensions physiques du parallélépipède (en "px" puis on normalise)
354
  width_px = float(front_w) # largeur X (front width)
 
347
  # récupérer tailles (on suppose que inference a déjà redimensionné left/right si besoin)
348
  front_w, front_h = pil_imgs[0].size
349
  right_w, right_h = pil_imgs[1].size
350
+
351
+ ratio = 45/145
352
+ right_w = int(front_w * ratio)
353
 
354
  # définir dimensions physiques du parallélépipède (en "px" puis on normalise)
355
  width_px = float(front_w) # largeur X (front width)
inference.py CHANGED
@@ -88,11 +88,11 @@ def inference(fiber_imgs, ring_imgs, num_steps):
88
  bl = ring_imgs.crop((0, tile, tile, canvas_size))
89
  br = ring_imgs.crop((tile, tile, canvas_size, canvas_size))
90
 
91
- tr = cv2.resize(np.asarray(tr), (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
92
- br = cv2.resize(np.asarray(br), (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
93
 
94
- tr = PIL.Image.fromarray(tr)
95
- br = PIL.Image.fromarray(br)
96
 
97
  # close opened images to free handles
98
  fiber_imgs.close()
 
88
  bl = ring_imgs.crop((0, tile, tile, canvas_size))
89
  br = ring_imgs.crop((tile, tile, canvas_size, canvas_size))
90
 
91
+ # tr = cv2.resize(np.asarray(tr), (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
92
+ # br = cv2.resize(np.asarray(br), (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
93
 
94
+ # tr = PIL.Image.fromarray(tr)
95
+ # br = PIL.Image.fromarray(br)
96
 
97
  # close opened images to free handles
98
  fiber_imgs.close()