From f095258e0cdda729e5d67a84ea4115921b3e7c3d Mon Sep 17 00:00:00 2001 From: Grzegorz K <2612193+grzegorzk@users.noreply.github.com> Date: Thu, 23 Mar 2023 20:34:03 +0100 Subject: [PATCH] Sync signature of cv2.imread and cv2.imwrite (#11209) Co-authored-by: Glenn Jocher --- utils/general.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/general.py b/utils/general.py index 7462046..adb9242 100644 --- a/utils/general.py +++ b/utils/general.py @@ -1119,13 +1119,13 @@ def increment_path(path, exist_ok=False, sep='', mkdir=False): imshow_ = cv2.imshow # copy to avoid recursion errors -def imread(path, flags=cv2.IMREAD_COLOR): - return cv2.imdecode(np.fromfile(path, np.uint8), flags) +def imread(filename, flags=cv2.IMREAD_COLOR): + return cv2.imdecode(np.fromfile(filename, np.uint8), flags) -def imwrite(path, im): +def imwrite(filename, img): try: - cv2.imencode(Path(path).suffix, im)[1].tofile(path) + cv2.imencode(Path(filename).suffix, img)[1].tofile(filename) return True except Exception: return False