mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-05 12:36:42 -07:00
upd cv2ex
This commit is contained in:
parent
3283dce96a
commit
b0ad36de94
1 changed files with 9 additions and 0 deletions
|
@ -2,6 +2,7 @@ import cv2
|
|||
import numpy as np
|
||||
from pathlib import Path
|
||||
from core.interact import interact as io
|
||||
from core import imagelib
|
||||
import traceback
|
||||
|
||||
def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None, verbose=True):
|
||||
|
@ -29,3 +30,11 @@ def cv2_imwrite(filename, img, *args):
|
|||
stream.write( buf )
|
||||
except:
|
||||
pass
|
||||
|
||||
def cv2_resize(x, *args, **kwargs):
|
||||
h,w,c = x.shape
|
||||
x = cv2.resize(x, *args, **kwargs)
|
||||
|
||||
x = imagelib.normalize_channels(x, c)
|
||||
return x
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue