Spaces:
Running
on
Zero
Running
on
Zero
add resizing
Browse files
infer.py
CHANGED
|
@@ -37,9 +37,9 @@ def infer_pipe(pipe, test_image, task_name, seed, device, video_depth=False):
|
|
| 37 |
if max(test_image.shape[:2]) > 1024:
|
| 38 |
# resize for a maximum size of 1024
|
| 39 |
scale = 1024 / max(test_image.shape[:2])
|
| 40 |
-
elif min(test_image.shape[:2]) <
|
| 41 |
-
# resize for a minimum size of
|
| 42 |
-
scale =
|
| 43 |
else:
|
| 44 |
scale = 1.0
|
| 45 |
new_shape = (int(test_image.shape[1] * scale), int(test_image.shape[0] * scale))
|
|
|
|
| 37 |
if max(test_image.shape[:2]) > 1024:
|
| 38 |
# resize for a maximum size of 1024
|
| 39 |
scale = 1024 / max(test_image.shape[:2])
|
| 40 |
+
elif min(test_image.shape[:2]) < 384:
|
| 41 |
+
# resize for a minimum size of 384
|
| 42 |
+
scale = 384 / min(test_image.shape[:2])
|
| 43 |
else:
|
| 44 |
scale = 1.0
|
| 45 |
new_shape = (int(test_image.shape[1] * scale), int(test_image.shape[0] * scale))
|