This commit is contained in:
Nicolas Mowen 2024-03-28 08:25:25 -06:00
parent 8494fa1cfe
commit 3f20a0d856
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,3 @@
import glob
import logging
import numpy as np
@ -39,9 +38,8 @@ class ONNXDetector(DetectionApi):
def detect_raw(self, tensor_input):
model_input_name = self.model.get_inputs()[0].name
model_input_shape = self.model.get_inputs()[0].shape
tensor_input = preprocess(tensor_input, model_input_shape, np.float32)
# ruff: noqa: F841
tensor_output = self.model.run(None, {model_input_name: tensor_input})[0]
raise Exception(

View File

@ -114,6 +114,7 @@ class ROCmDetector(DetectionApi):
detector_result = self.model.run({model_input_name: tensor_input})[0]
addr = ctypes.cast(detector_result.data_ptr(), ctypes.POINTER(ctypes.c_float))
# ruff: noqa: F841
tensor_output = np.ctypeslib.as_array(
addr, shape=detector_result.get_shape().lens()
)