Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FirebaseExtended/MLKit-ARCore
https://github.com/FirebaseExtended/MLKit-ARCore
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/FirebaseExtended/MLKit-ARCore
- Owner: FirebaseExtended
- License: apache-2.0
- Archived: true
- Created: 2018-11-06T16:06:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T13:57:48.000Z (about 4 years ago)
- Last Synced: 2024-04-22T04:51:34.607Z (7 months ago)
- Language: Swift
- Size: 15 MB
- Stars: 11
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-firebase - MLKit - ARCore - 증강 현실에서 물체를 감지하고 3D 레이블로 태그를 지정하는 예제 입니다. Firebase ML Kit, ARCore 및 Firebase RTDB를 사용합니다. (모바일 / iOS)
README
# MLKit-ARCore
This simple project detects objects using Firebase ML Kit and tags them in with 3D labels in Augmented Reality. Using ARCore and Firebase RTDB, it also shares the labels between phones. This serves as a multiplayer image labeling game.Based on: [CoreML-in-ARKit](https://github.com/hanleyweng/CoreML-in-ARKit)
![Demo gif](https://media.giphy.com/media/5dUxUy8VxfAfwJSD6I/giphy.gif)
[Demo Video](https://photos.app.goo.gl/RWdBvMcn2ASmkWaPA)
Language: Swift 4.0
Content Technology: SceneKit, Firebase ML Kit, ARCore, RTDB
Note: SceneKit can achieve a 60 FPS on iPhone7+ - though when it gets hot, it'll drop to 30 FPS.
## Status
![Status: Archived](https://img.shields.io/badge/Status-Archived-red)
This sample is no longer actively maintained and is left here for reference only.
## Footnotes
- SceneKit Text Labels are expensive to render. Too many polygons (too much text, smoothness, characters) - can cause crashes. In future, SpriteKit would be more efficient for text-labels.
- Whilst ARKit's FPS , is displayed - ML Kit's speed is not. However, it does appear sufficiently fast for real-time ARKit applications.
- Placement of the label is simply determined by the raycast screen centre-point to a ARKit feature-point. This could be altered for more stable placement.
## Building Blocks (Overview)
### Get ML Kit running in real time in ARKit
- What we do differently here is we're using ARKit's ARFrame as the image to be fed into ML Kit.
```
let pixbuff : CVPixelBuffer? = (sceneView.session.currentFrame?.capturedImage)
```- We also use Threading to continuously run requests to ML Kit in realtime, and without disturbing ARKit / SceneView
```
let dispatchQueueML = DispatchQueue(label: "dispatchqueueml")
...
loopMLKitUpdate() // on viewLoad
...
func loopMLKitUpdate() {
dispatchQueueML.async {
// 1. Run Update.
self.updateMLKit()
// 2. Loop this function.
self.loopMLKitUpdate()
}
}
```### Add 3D Text
- Add a Tap Gesture.
- On Tap. Get the raycast centre point, translating it to appropriate coordinates.
- Render 3D text at that location. Use the most likely object.