goryhon commited on
Commit
7eb1675
·
verified ·
1 Parent(s): 259efb1

Update web-demos/hugging_face/inpainter/base_inpainter.py

Browse files
web-demos/hugging_face/inpainter/base_inpainter.py CHANGED
@@ -1,7 +1,7 @@
1
  # -*- coding: utf-8 -*-
2
  import os
3
  import sys
4
- import cv2
5
  import numpy as np
6
  import scipy.ndimage
7
  from PIL import Image
@@ -206,8 +206,8 @@ class ProInpainter:
206
  size = (int(ratio*size[0])//2*2, int(ratio*size[1])//2*2)
207
 
208
  # set propainter size limit to 720 to reduce memory usage
209
- if max(size[0], size[1]) > 720:
210
- scale = 720.0 / max(size[0], size[1])
211
  # The ouput size should be divided by 2 so that it can encoded by libx264
212
  size = (int(scale*size[0])//2*2, int(scale*size[1])//2*2)
213
 
 
1
  # -*- coding: utf-8 -*-
2
  import os
3
  import sys
4
+ import cv2а
5
  import numpy as np
6
  import scipy.ndimage
7
  from PIL import Image
 
206
  size = (int(ratio*size[0])//2*2, int(ratio*size[1])//2*2)
207
 
208
  # set propainter size limit to 720 to reduce memory usage
209
+ if max(size[0], size[1]) > 1280:
210
+ scale = 1220.0 / max(size[0], size[1])
211
  # The ouput size should be divided by 2 so that it can encoded by libx264
212
  size = (int(scale*size[0])//2*2, int(scale*size[1])//2*2)
213