Spaces:
Sleeping
Sleeping
Upload inference.py
Browse files- inference.py +5 -2
inference.py
CHANGED
|
@@ -88,8 +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(tr, (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
|
| 92 |
-
br = cv2.resize(br, (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
# close opened images to free handles
|
| 95 |
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(tr.astype(np.uint8), (new_width, original_height), interpolation=cv2.INTER_LANCZOS4)
|
| 92 |
+
br = cv2.resize(br.astype(np.uint8), (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()
|