Testing with uint conversion
This commit is contained in:
@@ -54,7 +54,8 @@ def apply_ultralytics_16bit_tiff_patches(*, force: bool = False) -> None:
|
||||
- For other formats, falls back to Ultralytics' original implementation.
|
||||
- Always returns HWC (3 dims). For grayscale, returns (H, W, 1) or (H, W, 3) depending on requested flags.
|
||||
"""
|
||||
|
||||
# print("here")
|
||||
# return _original_imread(filename, flags)
|
||||
ext = os.path.splitext(filename)[1].lower()
|
||||
if ext in (".tif", ".tiff"):
|
||||
arr = Image(filename).get_qt_rgb()[:, :, :3]
|
||||
@@ -75,6 +76,7 @@ def apply_ultralytics_16bit_tiff_patches(*, force: bool = False) -> None:
|
||||
|
||||
# Ensure contiguous array for downstream OpenCV ops.
|
||||
# logger.info(f"Loading with monkey-patched imread: {filename}")
|
||||
arr *= (2**16 - 1).astype(np.uint16)
|
||||
return np.ascontiguousarray(arr)
|
||||
|
||||
# logger.info(f"Loading with original imread: {filename}")
|
||||
|
||||
Reference in New Issue
Block a user