This commit is contained in:
Nicolas Mowen 2025-04-15 06:50:22 -06:00
parent 6645b158a3
commit 0ce2f6d411
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@ class PixelFormatEnum(str, Enum):
class InputTensorEnum(str, Enum): class InputTensorEnum(str, Enum):
nchw = "nchw" nchw = "nchw"
nhwc = "nhwc" nhwc = "nhwc"
hwnc = "hwnc"
class InputDTypeEnum(str, Enum): class InputDTypeEnum(str, Enum):

View File

@ -1,7 +1,7 @@
"""Object detection utilities.""" """Object detection utilities."""
import threading
import queue import queue
import threading
from numpy import ndarray from numpy import ndarray
@ -71,3 +71,5 @@ def tensor_transform(desired_shape: InputTensorEnum):
return None return None
elif desired_shape == InputTensorEnum.nchw: elif desired_shape == InputTensorEnum.nchw:
return (0, 3, 1, 2) return (0, 3, 1, 2)
elif desired_shape == InputTensorEnum.hwnc:
return (1, 2, 0, 3)