hysts HF staff commited on
Commit
69a5598
1 Parent(s): ef50d9e
Files changed (1) hide show
  1. model.py +4 -0
model.py CHANGED
@@ -542,6 +542,10 @@ class Model:
542
  control_image, _ = apply_midas(
543
  resize_image(input_image, detect_resolution))
544
  control_image = HWC3(control_image)
 
 
 
 
545
  return PIL.Image.fromarray(control_image), PIL.Image.fromarray(
546
  control_image)
547
 
 
542
  control_image, _ = apply_midas(
543
  resize_image(input_image, detect_resolution))
544
  control_image = HWC3(control_image)
545
+ image = resize_image(input_image, image_resolution)
546
+ H, W = image.shape[:2]
547
+ control_image = cv2.resize(control_image, (W, H),
548
+ interpolation=cv2.INTER_LINEAR)
549
  return PIL.Image.fromarray(control_image), PIL.Image.fromarray(
550
  control_image)
551