@shawn it might help to know your exact goal here. With what you shared, I feel like you could accomplish the same thing using:
from ultralytics import YOLO
model = YOLO("path/to/model.pt")
result = model.predict("path/to/source", save_crop=True)
or
yolo predict \
model=path/to/model.pt \
source=path/to/source \
save_crop
You can also accomplish the same using an exported ONNX model.