fix: fixed issue #528

This commit is contained in:
SWHL committed 2025-09-01 09:36:46 +08:00
1 parent af65796b78
commit a0bb926500
1 file changed
+5
+5
View File
@@ -4,6 +4,7 @@
import hashlib
import importlib
from pathlib import Path
from sys import platform
from typing import Tuple, Union
from urllib.parse import urlparse
@@ -44,6 +45,10 @@ def save_img(save_path: Union[str, Path], img: np.ndarray):
if not Path(save_path).parent.exists():
Path(save_path).parent.mkdir(parents=True, exist_ok=True)
if platform.startswith("win32"):
cv2.imencode(Path(save_path).suffix, img)[1].tofile(str(save_path))
return
cv2.imwrite(str(save_path), img)