mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 15:47:01 -07:00
Merger: fixes and better quality
This commit is contained in:
parent
05f32d678d
commit
b24b1e2950
4 changed files with 57 additions and 37 deletions
|
@ -4,7 +4,7 @@ from pathlib import Path
|
|||
from core.interact import interact as io
|
||||
import traceback
|
||||
|
||||
def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None):
|
||||
def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None, verbose=True):
|
||||
"""
|
||||
allows to open non-english characters path
|
||||
"""
|
||||
|
@ -17,7 +17,8 @@ def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None):
|
|||
numpyarray = np.asarray(bytes, dtype=np.uint8)
|
||||
return cv2.imdecode(numpyarray, flags)
|
||||
except:
|
||||
io.log_err(f"Exception occured in cv2_imread : {traceback.format_exc()}")
|
||||
if verbose:
|
||||
io.log_err(f"Exception occured in cv2_imread : {traceback.format_exc()}")
|
||||
return None
|
||||
|
||||
def cv2_imwrite(filename, img, *args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue