Not sure who this will be useful for, but I’ve been working on integrating a Roboflow model into ARKit to detect objects based on the AR frames (rt-detr doesn’t seem to convert to coreml because of architecture as far as I can tell).
I have run into some issues with a handful of things, but the biggest issue seemed to be the orientation of the CVPixelBuffer from and ARFrame. It defaults (always is?) right oriented, so that orientation needs to be passed to the VNImageRequestHandler
(let handler = VNImageRequestHandler(cvPixelBuffer: buffer, orientation: .right)).
In turn, the coordinates of the detection need to be transposed back:
(let flippedBox = CGRect(x: 1-detectResult.boundingBox.maxY, y: 1 - detectResult.boundingBox.maxX, width: detectResult.boundingBox.height, height: detectResult.boundingBox.width)).
I’ve just made those changes locally to RFObjectDetectionModel and I get much higher confidence scores, so I’m guessing other people mind find this valuable.