hansemannn / titanium-coreml

Use the CoreML framework with the Titanium SDK
Other
16 stars 4 forks source link
appcelerator coreml ios11 javascript native titanium

iOS 11+ CoreML in Titanium

Use the native iOS 11+ "CoreML" framework in Axway Titanium.

Requirements

API's

createRealtimeRecognitionView(args)

Methods

Events

isSupported() (Boolean)

Example

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

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.