Closed vvkv closed 6 years ago
It might be necessary to rotate the texture 90 or 270 degrees for this to work. It's been a while since I looked at this code, so I can't tell off the top of my head what is needed. Using Vision it's simply a matter of passing the orientation into the request handler.
Thank you for your work on this. I am just working on incorporating orientation changes, so that the the camera feed rotates as the screen is rotated while still bounding objects. Im working with the front camera on my iPad pro and everything works perfectly in portrait mode (as it should). To allow for the landscape orientation I add "Landscape (left of home button)" and "Landscape (right of home button)" in the info.plist. I also change line 50
previewLayer.connection?.videoOrientation = .portrait
topreviewLayer.connection?.videoOrientation = .landscapeRight
and line 66videoOutput.connection(with: AVMediaType.video)?.videoOrientation = .portrait
tovideoOutput.connection(with: AVMediaType.video)?.videoOrientation = .landscapeRight
in https://github.com/hollance/YOLO-CoreML-MPSNNGraph/blob/master/TinyYOLO-CoreML/TinyYOLO-CoreML/VideoCapture.swiftWhile this gets the screen rotation working, the bounding boxes become a lot bigger than the objects being shown. How can I incorporate screen rotation while keeping the objects still tightly bounded.
Thank you