goryhon commited on
Commit
6c3f381
·
verified ·
1 Parent(s): 629fb79

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

Browse files
web-demos/hugging_face/inpainter/base_inpainter.py CHANGED
@@ -202,14 +202,9 @@ class ProInpainter:
202
  del npframes
203
 
204
  size = frames[0].size
205
- # The ouput size should be divided by 2 so that it can encoded by libx264
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
 
214
  frames_len = len(frames)
215
  frames, size, out_size = resize_frames(frames, size)
 
202
  del npframes
203
 
204
  size = frames[0].size
205
+ # Принудительно сохраняем исходное разрешение, округлённое под libx264
206
+ size = (size[0] // 2 * 2, size[1] // 2 * 2)
207
+
 
 
 
 
 
208
 
209
  frames_len = len(frames)
210
  frames, size, out_size = resize_frames(frames, size)