https://github.com/hansemannn/titanium-coreml
Use the CoreML framework with the Titanium SDK
https://github.com/hansemannn/titanium-coreml
appcelerator coreml ios11 javascript native titanium
Last synced: about 1 year ago
JSON representation
Use the CoreML framework with the Titanium SDK
- Host: GitHub
- URL: https://github.com/hansemannn/titanium-coreml
- Owner: hansemannn
- License: other
- Created: 2017-07-06T03:19:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T08:13:37.000Z (over 2 years ago)
- Last Synced: 2025-03-29T01:12:03.413Z (about 1 year ago)
- Topics: appcelerator, coreml, ios11, javascript, native, titanium
- Language: Objective-C
- Homepage:
- Size: 35.2 KB
- Stars: 16
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS 11+ CoreML in Titanium
Use the native iOS 11+ "CoreML" framework in Axway Titanium.
## Requirements
- [x] Titanium SDK 6.2.0 and later
- [x] iOS 11 and later
- [x] Compiled CoreML models (`xcrun coremlcompiler compile path/to/model.mlmodel /path/to/output`)
## API's
### `createRealtimeRecognitionView(args)`
- `model` (String - _Required_)
#### Methods
- `startRecognition()`
- `stopRecognition()`
- `isRecognizing()` (Boolean)
#### Events
- `classification` (`Event.classifications`)
### `isSupported()` (Boolean)
## Example
```js
var CoreML = require('ti.coreml');
var recognitionView = CoreML.createRealtimeRecognitionView({
top: 40,
height: 300,
model: 'Inceptionv3.mlmodelc'
});
recognitionView.addEventListener('classification', function(e) {
Ti.API.info(e);
});
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
win.add(recognitionView);
var triggerButton = Ti.UI.createButton({
bottom: 40,
title: 'Start Real-Time Recognition'
});
triggerButton.addEventListener('click', function() {
recognitionView.startRecognition();
});
win.add(triggerButton);
win.open();
```
## Build
```js
cd iphone
appc ti build -p ios --build-only
```
## Legal
This module is Copyright (c) 2017-Present by Axway Appcelerator, Inc. All Rights Reserved.
Usage of this module is subject to the Terms of Service agreement with Appcelerator, Inc.