Apply computer vision algorithms to perform a variety of tasks on input images and video using Vision.

Posts under Vision tag

200 Posts

Post

Replies

Boosts

Views

Activity

Vision Pro & Vision SDK
I'm exploring my Vision Pro and finding it unclear whether I can even achieve things like body pose detection etc. https://developer.apple.com/videos/play/wwdc2023/111241/ It's clear that I can apply it to self provided images, but how about to the data coming from visionOS SDKs? All I can find is this mesh data from ARKit, https://developer.apple.com/documentation/arkit/arkit_in_visionos - am I missing something or do we not yet have good APIs for this? Appreciate any guidance! Thanks.
2
0
1.9k
Feb ’24
Is the Apple Neural Scene Analyzer (ANSA) backbone available to devs
Hello, My understanding of the paper below is that iOS ships with a MobileNetv3-based ML model backbone, which then uses different heads for specific tasks in iOS. I understand that this backbone is accessible for various uses through the Vision framework, but I was wondering if it is also accessible for on-device fine-tuning for other purposes. Just as an example, if I want to have a model to detect some unique object in a photo, can I use the built in backbone or do I have to include my own in the app. Thanks very much for any advice and apologies if I didn't understand something correctly. Source: https://machinelearning.apple.com/research/on-device-scene-analysis
1
0
1.1k
Feb ’24
When I enter immersive view, the window keeps getting pushed back.
I'm using RealityKit to give an immersive view of 360 pictures. However, I'm seeing a problem where the window disappears when I enter immersive mode and returns when I rotate my head. Interestingly, putting ".glassBackground()" to the back of the window cures the issue, however I prefer not to use it in the UI's backdrop. How can I deal with this? here is link of Gif:- https://firebasestorage.googleapis.com/v0/b/affirmation-604e2.appspot.com/o/Simulator%20Screen%20Recording%20-%20Apple%20Vision%20Pro%20-%202024-01-30%20at%2011.33.39.gif?alt=media&token=3fab9019-4902-4564-9312-30d49b15ea48
0
0
818
Jan ’24
Is this type of offset even possible with Vision OS?
Hey, I'm working on a UI that a designer created. But he added an object behind the glass, with an offset, pretty much like the cloud in this video: https://dribbble.com/shots/23039991-Weather-Widget-Apple-Vision-Pro-visionOS I tried a couple of methods, but I always ended up clipping my object. So, here's the question: Is there a way to have some object behind the glass panel, but with a slight offset on the x and y?
1
0
617
Jan ’24
Is it possible to create a compass in VisionOS?
I am attempting to create a simple compass for Apple Vision Pro. The method I am familiar with involves using: locationManager.startUpdatingHeading() locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) However, this does not function on visionOS as 'CLHeading is unavailable in visionOS'. Is there any way to develop this simple compass on visionOS?
1
0
810
Jan ’24
Vision Framework - Text Recognition - Cannot recognize some umlaut diacritics
I am using Vision Framework to recognize text in my app. However, some umlaut diacritics are recognized incorrectly, for example: Grudziński (The incorrect result is: Grudzinski). I already changed language to DE (because my app needs to support DE text) and tried to use VNRecognizeTextRequest#customWord with usesLanguageCorrection but the result still is incorrect. Does Apple provide any APIs to solve this problem? This issue also happens when I open the Gallery on my phone, copy text from images, and paste it to another place.
0
0
569
Jan ’24
VNDetectHumanBodyPose3DRequest Gives Inconsistent Results
I'm currently building an iOS app that requires the ability to detect a person's height with a live video stream. The new VNDetectHumanBodyPose3DRequest is exactly what I need but the observations I'm getting back are very inconsistent and unreliable. When I say inconsistent, I mean the values never seem to settle and they can fluctuate anywhere from 5 '4" to 10'1" (I'm about 6'0"). In terms of unreliable, I have once seen a value that closely matches my height but I rarely see any values that are close enough (within an inch) of the ground truth. In terms of my code, I'm not doing any fancy. I'm first opening a LiDAR stream on my iPhone Pro 14: guard let videoDevice = AVCaptureDevice.default(.builtInLiDARDepthCamera, for: .video, position: .back) else { return } guard let videoDeviceInput = try? AVCaptureDeviceInput(device: videoDevice) else { return } guard captureSession.canAddInput(videoDeviceInput) else { return } captureSession.addInput(videoDeviceInput) I'm then creating an output synchronizer so I can get both image and depth data at the same time: videoDataOutput = AVCaptureVideoDataOutput() captureSession.addOutput(videoDataOutput) depthDataOutput = AVCaptureDepthDataOutput() depthDataOutput.isFilteringEnabled = true captureSession.addOutput(depthDataOutput) outputVideoSync = AVCaptureDataOutputSynchronizer(dataOutputs: [depthDataOutput, videoDataOutput]) Finally, my delegate function that handles the synchronizer is roughly: fileprivate func perform3DPoseRequest(cmSampleBuffer: CMSampleBuffer, depthData: AVDepthData) { let imageRequestHandler = VNImageRequestHandler(cmSampleBuffer: cmSampleBuffer, depthData: depthData, orientation: .up) let request = VNDetectHumanBodyPose3DRequest() do { // Perform the body pose request. try imageRequestHandler.perform([request]) if let observation = request.results?.first { if (observation.heightEstimation == .measured) { print("Body height (ft) \(formatter.string(fromMeters: Double(observation.bodyHeight))) (m): \(observation.bodyHeight)") ... I'd appreciate any help determining how to get accurate results from the observation's bodyHeight. Thanks!
0
1
568
Jan ’24
Expected Global Sales Start Date for Vision Pro
Currently in South Korea, due to my personal experiences with what seems like warranty but isn't, and the operation of a ruthless Genius Bar, I feel compelled to purchase the officially released Vision Pro. I'd like to discuss with other developers here about their thoughts on the release schedule. The product launched in the USA in February, but I'm curious about the months following for the secondary and tertiary launch countries. Naturally, we'll know the launch is imminent when local staff are summoned to the headquarters for training. However, the urgency for localized services, development, and personal purchase is growing on my mind.
0
0
543
Dec ’23
Issues with VNDetectHumanBodyPose3DRequest iOS 17/Xcode 15
I seem to be having some trouble running the example app from the WWDC 2023 session on 3D Body Pose Detection (this one). I'm getting an issue about the request revision being incompatible, I tried searching the API documentation for any configuration that has been changed or introduced but to no avail. I also couldn't find much online for it. Is this a known issue? Or am I doing something wrong? Error in question: Unable to perform the request: Error Domain=com.apple.Vision Code=16 "VNDetectHumanBodyPose3DRequest does not support VNDetectHumanBodyPose3DRequestRevision1" UserInfo={NSLocalizedDescription=VNDetectHumanBodyPose3DRequest does not support VNDetectHumanBodyPose3DRequestRevision1}. Code Snippet: guard let assetURL = fileURL else { return } let request = VNDetectHumanBodyPose3DRequest() self.fileURL = assetURL let requestHandler = VNImageRequestHandler(url: assetURL) do { try requestHandler.perform([request]) if let returnedObservation = request.results?.first { Task { @MainActor in self.humanObservation = returnedObservation } } } catch { print("Unable to perform the request: \(error).") } Thank you for any and all advice!
1
0
538
Dec ’23
VNRecognizedText returns wrong bounding box
I am trying to parse text from an image, split it into words and store the words in a String array. Additionally I want to store the bounding box of each recognized word. My code works but for some reason the bounding boxes of words that are not separated by a space but by an apostrophe come out wrong. Here is the complete code of my VNRecognizeTextRequestHander: let request = VNRecognizeTextRequest { request, error in guard let observations = request.results as? [VNRecognizedTextObservation] else { return } // split recognized text into words and store each word with corresponding observation let wordObservations = observations.flatMap { observation in observation.topCandidates(1).first?.string.unicodeScalars .split(whereSeparator: { CharacterSet.letters.inverted.contains($0) }) .map { (observation, $0) } ?? [] } // store recognized words as strings recognizedWords = wordObservations.map { (observation, word) in String(word) } // calculate bounding box for each word recognizedWordRects = wordObservations.map { (observation, word) in guard let candidate = observation.topCandidates(1).first else { return .zero } let stringRange = word.startIndex..<word.endIndex guard let rect = try? candidate.boundingBox(for: stringRange)?.boundingBox else { return .zero } let bottomLeftOriginRect = VNImageRectForNormalizedRect(rect, Int(captureRect.width), Int(captureRect.height)) // adjust coordinate system to start in top left corner let topLeftOriginRect = CGRect(origin: CGPoint(x: bottomLeftOriginRect.minX, y: captureRect.height - bottomLeftOriginRect.height - bottomLeftOriginRect.minY), size: bottomLeftOriginRect.size) print("BoundingBox for word '\(String(word))': \(topLeftOriginRect)") return topLeftOriginRect } } And here's an example for what's happening. When I'm processing the following image: the code above produces the following output: BoundingBox for word 'In': (23.00069557577264, 5.718113962610181, 45.89460636656961, 32.78087073878238) BoundingBox for word 'un': (71.19064286904202, 6.289275587192936, 189.16024359557852, 34.392966621800475) BoundingBox for word 'intervista': (71.19064286904202, 6.289275587192936, 189.16024359557852, 34.392966621800475) BoundingBox for word 'del': (262.64622870703477, 8.558512219726875, 54.733978711037985, 32.79967358237818) Notice how the bounding boxes of the words 'un' and 'intervista' are exactly the same. This happens consistently for words that are separated by an apostrophe. Why is that? Thank you for any help Elias
0
0
499
Dec ’23
(Legal-)Restrictions publishing Coin Counter (computer vision)
Hello, I am currently developping an app that counts coins using Computer vision to determine the total value in the picture. However I notice there are no apps in the app store that do anything similar which makes me wonder if there are any restrictions on publishing these types of apps from either apple or governments? I would like to know if it will be possible to launch my app in the European Union once it is finished. Thanks in advance, Guus
0
0
519
Nov ’23
Object recognition and tracking on visionOS
Hello! I would like to develop a visionOS application that tracks a single object in a user's environment. Skimming through the documentation I found out that this feature is currently unsupported in ARKit (we can only recognize images). But it seems it should be doable by combining CoreML and Vision frameworks. So I have a few questions: Is it the best approach or is there a simpler solution? What is the best way to train a CoreML model without access to the device? Will videos recorded by iPhone 15 be enough? Thank you in advance for all the answers.
1
0
848
Nov ’23
iOS Xcode - ABPKPersonIDTracker not supported on this device
I am trying to use Vision framework in iOS but getting below error in logs. Not able to find any resources in Developer Forums. Any help would be appreciated! ABPKPersonIDTracker not supported on this device Failed to initialize ABPK Person ID Tracker public func runHumanBodyPose3DRequest() { let request = VNDetectHumanBodyPose3DRequest() let requestHandler = VNImageRequestHandler(url: filePath!) do { try requestHandler.perform([request]) if let returnedObservation = request.results?.first { self.humanObservation = returnedObservation print(humanObservation) } } catch let error{ print(error.localizedDescription) } }
3
0
1.2k
Nov ’23
Vision Pro & Vision SDK
I'm exploring my Vision Pro and finding it unclear whether I can even achieve things like body pose detection etc. https://developer.apple.com/videos/play/wwdc2023/111241/ It's clear that I can apply it to self provided images, but how about to the data coming from visionOS SDKs? All I can find is this mesh data from ARKit, https://developer.apple.com/documentation/arkit/arkit_in_visionos - am I missing something or do we not yet have good APIs for this? Appreciate any guidance! Thanks.
Replies
2
Boosts
0
Views
1.9k
Activity
Feb ’24
atal error: Your app was given a scene with session role UISceneSessionRole
When trying to run my app with .windowStyle(.volumetric) for vision OS, this error is returning: Fatal error: Your app was given a scene with session role UISceneSessionRole(_rawValue: UIWindowSceneSessionRoleApplication) but no scenes declared in your App body match this scroll.
Replies
2
Boosts
1
Views
1.6k
Activity
Feb ’24
Is the Apple Neural Scene Analyzer (ANSA) backbone available to devs
Hello, My understanding of the paper below is that iOS ships with a MobileNetv3-based ML model backbone, which then uses different heads for specific tasks in iOS. I understand that this backbone is accessible for various uses through the Vision framework, but I was wondering if it is also accessible for on-device fine-tuning for other purposes. Just as an example, if I want to have a model to detect some unique object in a photo, can I use the built in backbone or do I have to include my own in the app. Thanks very much for any advice and apologies if I didn't understand something correctly. Source: https://machinelearning.apple.com/research/on-device-scene-analysis
Replies
1
Boosts
0
Views
1.1k
Activity
Feb ’24
When I enter immersive view, the window keeps getting pushed back.
I'm using RealityKit to give an immersive view of 360 pictures. However, I'm seeing a problem where the window disappears when I enter immersive mode and returns when I rotate my head. Interestingly, putting ".glassBackground()" to the back of the window cures the issue, however I prefer not to use it in the UI's backdrop. How can I deal with this? here is link of Gif:- https://firebasestorage.googleapis.com/v0/b/affirmation-604e2.appspot.com/o/Simulator%20Screen%20Recording%20-%20Apple%20Vision%20Pro%20-%202024-01-30%20at%2011.33.39.gif?alt=media&token=3fab9019-4902-4564-9312-30d49b15ea48
Replies
0
Boosts
0
Views
818
Activity
Jan ’24
Is this type of offset even possible with Vision OS?
Hey, I'm working on a UI that a designer created. But he added an object behind the glass, with an offset, pretty much like the cloud in this video: https://dribbble.com/shots/23039991-Weather-Widget-Apple-Vision-Pro-visionOS I tried a couple of methods, but I always ended up clipping my object. So, here's the question: Is there a way to have some object behind the glass panel, but with a slight offset on the x and y?
Replies
1
Boosts
0
Views
617
Activity
Jan ’24
Is it possible to create a compass in VisionOS?
I am attempting to create a simple compass for Apple Vision Pro. The method I am familiar with involves using: locationManager.startUpdatingHeading() locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) However, this does not function on visionOS as 'CLHeading is unavailable in visionOS'. Is there any way to develop this simple compass on visionOS?
Replies
1
Boosts
0
Views
810
Activity
Jan ’24
Vision Framework - Text Recognition - Cannot recognize some umlaut diacritics
I am using Vision Framework to recognize text in my app. However, some umlaut diacritics are recognized incorrectly, for example: Grudziński (The incorrect result is: Grudzinski). I already changed language to DE (because my app needs to support DE text) and tried to use VNRecognizeTextRequest#customWord with usesLanguageCorrection but the result still is incorrect. Does Apple provide any APIs to solve this problem? This issue also happens when I open the Gallery on my phone, copy text from images, and paste it to another place.
Replies
0
Boosts
0
Views
569
Activity
Jan ’24
VNDetectHumanBodyPose3DRequest Gives Inconsistent Results
I'm currently building an iOS app that requires the ability to detect a person's height with a live video stream. The new VNDetectHumanBodyPose3DRequest is exactly what I need but the observations I'm getting back are very inconsistent and unreliable. When I say inconsistent, I mean the values never seem to settle and they can fluctuate anywhere from 5 '4" to 10'1" (I'm about 6'0"). In terms of unreliable, I have once seen a value that closely matches my height but I rarely see any values that are close enough (within an inch) of the ground truth. In terms of my code, I'm not doing any fancy. I'm first opening a LiDAR stream on my iPhone Pro 14: guard let videoDevice = AVCaptureDevice.default(.builtInLiDARDepthCamera, for: .video, position: .back) else { return } guard let videoDeviceInput = try? AVCaptureDeviceInput(device: videoDevice) else { return } guard captureSession.canAddInput(videoDeviceInput) else { return } captureSession.addInput(videoDeviceInput) I'm then creating an output synchronizer so I can get both image and depth data at the same time: videoDataOutput = AVCaptureVideoDataOutput() captureSession.addOutput(videoDataOutput) depthDataOutput = AVCaptureDepthDataOutput() depthDataOutput.isFilteringEnabled = true captureSession.addOutput(depthDataOutput) outputVideoSync = AVCaptureDataOutputSynchronizer(dataOutputs: [depthDataOutput, videoDataOutput]) Finally, my delegate function that handles the synchronizer is roughly: fileprivate func perform3DPoseRequest(cmSampleBuffer: CMSampleBuffer, depthData: AVDepthData) { let imageRequestHandler = VNImageRequestHandler(cmSampleBuffer: cmSampleBuffer, depthData: depthData, orientation: .up) let request = VNDetectHumanBodyPose3DRequest() do { // Perform the body pose request. try imageRequestHandler.perform([request]) if let observation = request.results?.first { if (observation.heightEstimation == .measured) { print("Body height (ft) \(formatter.string(fromMeters: Double(observation.bodyHeight))) (m): \(observation.bodyHeight)") ... I'd appreciate any help determining how to get accurate results from the observation's bodyHeight. Thanks!
Replies
0
Boosts
1
Views
568
Activity
Jan ’24
A place that sells vision pro
I'm going to the U.S. to buy a vision pro, does anyone have any information about where they sell it? Will it be sold in Hawaii by any chance? For now, I'm thinking about New York.
Replies
0
Boosts
0
Views
552
Activity
Jan ’24
Expected Global Sales Start Date for Vision Pro
Currently in South Korea, due to my personal experiences with what seems like warranty but isn't, and the operation of a ruthless Genius Bar, I feel compelled to purchase the officially released Vision Pro. I'd like to discuss with other developers here about their thoughts on the release schedule. The product launched in the USA in February, but I'm curious about the months following for the secondary and tertiary launch countries. Naturally, we'll know the launch is imminent when local staff are summoned to the headquarters for training. However, the urgency for localized services, development, and personal purchase is growing on my mind.
Replies
0
Boosts
0
Views
543
Activity
Dec ’23
Issues with VNDetectHumanBodyPose3DRequest iOS 17/Xcode 15
I seem to be having some trouble running the example app from the WWDC 2023 session on 3D Body Pose Detection (this one). I'm getting an issue about the request revision being incompatible, I tried searching the API documentation for any configuration that has been changed or introduced but to no avail. I also couldn't find much online for it. Is this a known issue? Or am I doing something wrong? Error in question: Unable to perform the request: Error Domain=com.apple.Vision Code=16 "VNDetectHumanBodyPose3DRequest does not support VNDetectHumanBodyPose3DRequestRevision1" UserInfo={NSLocalizedDescription=VNDetectHumanBodyPose3DRequest does not support VNDetectHumanBodyPose3DRequestRevision1}. Code Snippet: guard let assetURL = fileURL else { return } let request = VNDetectHumanBodyPose3DRequest() self.fileURL = assetURL let requestHandler = VNImageRequestHandler(url: assetURL) do { try requestHandler.perform([request]) if let returnedObservation = request.results?.first { Task { @MainActor in self.humanObservation = returnedObservation } } } catch { print("Unable to perform the request: \(error).") } Thank you for any and all advice!
Replies
1
Boosts
0
Views
538
Activity
Dec ’23
failed to find newest available Simulator runtime
Env Intel Core i7 macOS :14.0 Xcode 15 Beta 8 simulator:visionOS 1.0 beta 3(21N5233e) simulator: ios 17.0.1 ,ios 17.0 beta 8 Step Xcode create a new Vision Demo, it can't build. [macosx] error: Failed to find newest available Simulator runtime Command RealityAssetsCompile failed with a nonzero exit code
Replies
1
Boosts
0
Views
1k
Activity
Dec ’23
VNRecognizedText returns wrong bounding box
I am trying to parse text from an image, split it into words and store the words in a String array. Additionally I want to store the bounding box of each recognized word. My code works but for some reason the bounding boxes of words that are not separated by a space but by an apostrophe come out wrong. Here is the complete code of my VNRecognizeTextRequestHander: let request = VNRecognizeTextRequest { request, error in guard let observations = request.results as? [VNRecognizedTextObservation] else { return } // split recognized text into words and store each word with corresponding observation let wordObservations = observations.flatMap { observation in observation.topCandidates(1).first?.string.unicodeScalars .split(whereSeparator: { CharacterSet.letters.inverted.contains($0) }) .map { (observation, $0) } ?? [] } // store recognized words as strings recognizedWords = wordObservations.map { (observation, word) in String(word) } // calculate bounding box for each word recognizedWordRects = wordObservations.map { (observation, word) in guard let candidate = observation.topCandidates(1).first else { return .zero } let stringRange = word.startIndex..<word.endIndex guard let rect = try? candidate.boundingBox(for: stringRange)?.boundingBox else { return .zero } let bottomLeftOriginRect = VNImageRectForNormalizedRect(rect, Int(captureRect.width), Int(captureRect.height)) // adjust coordinate system to start in top left corner let topLeftOriginRect = CGRect(origin: CGPoint(x: bottomLeftOriginRect.minX, y: captureRect.height - bottomLeftOriginRect.height - bottomLeftOriginRect.minY), size: bottomLeftOriginRect.size) print("BoundingBox for word '\(String(word))': \(topLeftOriginRect)") return topLeftOriginRect } } And here's an example for what's happening. When I'm processing the following image: the code above produces the following output: BoundingBox for word 'In': (23.00069557577264, 5.718113962610181, 45.89460636656961, 32.78087073878238) BoundingBox for word 'un': (71.19064286904202, 6.289275587192936, 189.16024359557852, 34.392966621800475) BoundingBox for word 'intervista': (71.19064286904202, 6.289275587192936, 189.16024359557852, 34.392966621800475) BoundingBox for word 'del': (262.64622870703477, 8.558512219726875, 54.733978711037985, 32.79967358237818) Notice how the bounding boxes of the words 'un' and 'intervista' are exactly the same. This happens consistently for words that are separated by an apostrophe. Why is that? Thank you for any help Elias
Replies
0
Boosts
0
Views
499
Activity
Dec ’23
Explore 3D body pose and person segmentation in Vision
What is the accuracy and resolution of the angles measured using Vision?
Replies
0
Boosts
0
Views
404
Activity
Dec ’23
(Legal-)Restrictions publishing Coin Counter (computer vision)
Hello, I am currently developping an app that counts coins using Computer vision to determine the total value in the picture. However I notice there are no apps in the app store that do anything similar which makes me wonder if there are any restrictions on publishing these types of apps from either apple or governments? I would like to know if it will be possible to launch my app in the European Union once it is finished. Thanks in advance, Guus
Replies
0
Boosts
0
Views
519
Activity
Nov ’23
Finger Circumference and Length Hand Landmarks
Is there a way to determine finger joint/root circumference, finger length, tip of finger to wrist crease, hand breadth and wrist breadth with Vision hand pose? Or alternative method? Any insight is appreciated.
Replies
0
Boosts
0
Views
716
Activity
Nov ’23
How to use vision in visionOS?
In visionOS, how can I use vision in machine learning to recognize hand gestures? After all, currently visionOS does not provide any image frame data.
Replies
1
Boosts
1
Views
816
Activity
Nov ’23
Object recognition and tracking on visionOS
Hello! I would like to develop a visionOS application that tracks a single object in a user's environment. Skimming through the documentation I found out that this feature is currently unsupported in ARKit (we can only recognize images). But it seems it should be doable by combining CoreML and Vision frameworks. So I have a few questions: Is it the best approach or is there a simpler solution? What is the best way to train a CoreML model without access to the device? Will videos recorded by iPhone 15 be enough? Thank you in advance for all the answers.
Replies
1
Boosts
0
Views
848
Activity
Nov ’23
iOS Xcode - ABPKPersonIDTracker not supported on this device
I am trying to use Vision framework in iOS but getting below error in logs. Not able to find any resources in Developer Forums. Any help would be appreciated! ABPKPersonIDTracker not supported on this device Failed to initialize ABPK Person ID Tracker public func runHumanBodyPose3DRequest() { let request = VNDetectHumanBodyPose3DRequest() let requestHandler = VNImageRequestHandler(url: filePath!) do { try requestHandler.perform([request]) if let returnedObservation = request.results?.first { self.humanObservation = returnedObservation print(humanObservation) } } catch let error{ print(error.localizedDescription) } }
Replies
3
Boosts
0
Views
1.2k
Activity
Nov ’23
Action Classifier basing on VNDetectHumanBodyPose3DRequest data
Hi, I am developing a fitness app that detects technique mistakes during workout. Can we use 3D data from VNDetectHumanBodyPose3DRequest with ML model?
Replies
1
Boosts
0
Views
691
Activity
Oct ’23