haodongli commited on
Commit
f562867
1 Parent(s): fe3664d

add resizing

Browse files
Files changed (1) hide show
  1. infer.py +3 -3
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]) < 256:
41
- # resize for a minimum size of 256
42
- scale = 256 / 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))
 
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))