We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5955254 commit c1ca660Copy full SHA for c1ca660
paddlex/inference/utils/io/readers.py
@@ -267,7 +267,9 @@ def __init__(self, flags=None):
267
268
def read_file(self, in_path):
269
"""read image file from path by OpenCV"""
270
- return cv2.imread(in_path, flags=self.flags)
+ with open(in_path, "rb") as f:
271
+ img_array = np.frombuffer(f.read(), np.uint8)
272
+ return cv2.imdecode(img_array, flags=self.flags)
273
274
275
class PILImageReaderBackend(_ImageReaderBackend):
0 commit comments