BaseModel._predict_once
in end add:
if isinstance(x, torch.Tensor):
# import pdb
# pdb.set_trace()
x = x.transpose(2, 1)
return x
from ultralytics import YOLO
model = YOLO("${path}/yolo11n.pt")
success = model.export(format="onnx", simplify=True) # export the model to onnx format
trtexec --onnx=${path}/yolo11n.onnx --saveEngine=${path}/yolo11n.engine
make dir build && cd build
cmake ..
make
./yolo11_det -d ${path}/yolo11n.engine ../images g