├── .editorconfig
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── .husky
├── .gitignore
└── pre-commit
├── .npsrc
├── .nxignore
├── .prettierignore
├── .prettierrc
├── .travis.yml
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── apps
├── demo-angular
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── nativescript.config.ts
│ ├── package.json
│ ├── project.json
│ ├── references.d.ts
│ ├── src
│ │ ├── app-routing.module.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── app.scss
│ │ ├── home.component.html
│ │ ├── home.component.ts
│ │ ├── main.ts
│ │ ├── plugin-demos
│ │ │ ├── .gitkeep
│ │ │ ├── mlkit-barcode-scanning.component.html
│ │ │ ├── mlkit-barcode-scanning.component.ts
│ │ │ ├── mlkit-barcode-scanning.module.ts
│ │ │ ├── mlkit-core.component.html
│ │ │ ├── mlkit-core.component.ts
│ │ │ ├── mlkit-core.module.ts
│ │ │ ├── mlkit-custom-object-detection.component.html
│ │ │ ├── mlkit-custom-object-detection.component.ts
│ │ │ ├── mlkit-custom-object-detection.module.ts
│ │ │ ├── mlkit-digital-ink-recognition.component.html
│ │ │ ├── mlkit-digital-ink-recognition.component.ts
│ │ │ ├── mlkit-digital-ink-recognition.module.ts
│ │ │ ├── mlkit-face-detection.component.html
│ │ │ ├── mlkit-face-detection.component.ts
│ │ │ ├── mlkit-face-detection.module.ts
│ │ │ ├── mlkit-image-labeling.component.html
│ │ │ ├── mlkit-image-labeling.component.ts
│ │ │ ├── mlkit-image-labeling.module.ts
│ │ │ ├── mlkit-object-detection.component.html
│ │ │ ├── mlkit-object-detection.component.ts
│ │ │ ├── mlkit-object-detection.module.ts
│ │ │ ├── mlkit-pose-detection.component.html
│ │ │ ├── mlkit-pose-detection.component.ts
│ │ │ ├── mlkit-pose-detection.module.ts
│ │ │ ├── mlkit-selfie-segmentation.component.html
│ │ │ ├── mlkit-selfie-segmentation.component.ts
│ │ │ ├── mlkit-selfie-segmentation.module.ts
│ │ │ ├── mlkit-text-recognition.component.html
│ │ │ ├── mlkit-text-recognition.component.ts
│ │ │ └── mlkit-text-recognition.module.ts
│ │ └── polyfills.ts
│ ├── tsconfig.json
│ └── webpack.config.js
└── demo
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── nativescript.config.ts
│ ├── package.json
│ ├── project.json
│ ├── references.d.ts
│ ├── src
│ ├── app-root.xml
│ ├── app.scss
│ ├── app.ts
│ ├── main-page.ts
│ ├── main-page.xml
│ ├── main-view-model.ts
│ └── plugin-demos
│ │ ├── .gitkeep
│ │ ├── mlkit-barcode-scanning.ts
│ │ ├── mlkit-barcode-scanning.xml
│ │ ├── mlkit-core.ts
│ │ ├── mlkit-core.xml
│ │ ├── mlkit-custom-object-detection.ts
│ │ ├── mlkit-custom-object-detection.xml
│ │ ├── mlkit-digital-ink-recognition.ts
│ │ ├── mlkit-digital-ink-recognition.xml
│ │ ├── mlkit-face-detection.ts
│ │ ├── mlkit-face-detection.xml
│ │ ├── mlkit-image-labeling.ts
│ │ ├── mlkit-image-labeling.xml
│ │ ├── mlkit-object-detection.ts
│ │ ├── mlkit-object-detection.xml
│ │ ├── mlkit-pose-detection.ts
│ │ ├── mlkit-pose-detection.xml
│ │ ├── mlkit-selfie-segmentation.ts
│ │ ├── mlkit-selfie-segmentation.xml
│ │ ├── mlkit-text-recognition.ts
│ │ └── mlkit-text-recognition.xml
│ ├── tsconfig.json
│ └── webpack.config.js
├── jest.config.ts
├── migrations.json
├── nx.json
├── package.json
├── packages
├── .gitkeep
├── mlkit-barcode-scanning
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-core
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── angular
│ │ ├── .eslintrc.json
│ │ ├── index.ts
│ │ ├── mlkit-view-directive.ts
│ │ ├── ng-package.json
│ │ ├── package.json
│ │ ├── tsconfig.angular.json
│ │ └── tsconfig.json
│ ├── common.ts
│ ├── index.android.ts
│ ├── index.d.ts
│ ├── index.ios.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ ├── Info.plist
│ │ │ ├── Podfile
│ │ │ └── src
│ │ │ ├── TNSBarcodeScanner.swift
│ │ │ ├── TNSFaceDetection.swift
│ │ │ ├── TNSImageLabeling.swift
│ │ │ ├── TNSML.swift
│ │ │ ├── TNSMLKitHelper.swift
│ │ │ ├── TNSMLKitParsers.swift
│ │ │ ├── TNSObjectDetection.swift
│ │ │ ├── TNSPoseDetection.swift
│ │ │ └── TNSTextRecognition.swift
│ ├── project.json
│ ├── references.d.ts
│ ├── tsconfig.json
│ ├── typings
│ │ ├── android.d.ts
│ │ ├── objc!MLImage.d.ts
│ │ ├── objc!MLKitBarcodeScanning.d.ts
│ │ ├── objc!MLKitCommon.d.ts
│ │ ├── objc!MLKitDigitalInkRecognition.d.ts
│ │ ├── objc!MLKitFaceDetection.d.ts
│ │ ├── objc!MLKitImageLabeling.d.ts
│ │ ├── objc!MLKitImageLabelingCommon.d.ts
│ │ ├── objc!MLKitObjectDetection.d.ts
│ │ ├── objc!MLKitObjectDetectionCommon.d.ts
│ │ ├── objc!MLKitObjectDetectionCustom.d.ts
│ │ ├── objc!MLKitPoseDetection.d.ts
│ │ ├── objc!MLKitPoseDetectionAccurate.d.ts
│ │ ├── objc!MLKitPoseDetectionCommon.d.ts
│ │ ├── objc!MLKitSegmentationCommon.d.ts
│ │ ├── objc!MLKitSegmentationSelfie.d.ts
│ │ ├── objc!MLKitTextRecognition.d.ts
│ │ ├── objc!MLKitTextRecognitionCommon.d.ts
│ │ ├── objc!MLKitVision.d.ts
│ │ └── objc!nsswiftsupport.d.ts
│ └── vue
│ │ └── index.ts
├── mlkit-custom-object-detection
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-digital-ink-recognition
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-face-detection
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-image-labeling
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-object-detection
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-pose-detection
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── mlkit-selfie-segmentation
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ │ ├── android
│ │ │ └── include.gradle
│ │ └── ios
│ │ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
└── mlkit-text-recognition
│ ├── .eslintrc.json
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── index.ts
│ ├── package.json
│ ├── platforms
│ ├── android
│ │ └── include.gradle
│ └── ios
│ │ └── Podfile
│ ├── project.json
│ ├── references.d.ts
│ └── tsconfig.json
├── references.d.ts
├── tools
├── assets
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── app.gradle
│ │ │ └── src
│ │ │ │ └── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-nodpi
│ │ │ │ └── splash_screen.xml
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── values-v21
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ └── iOS
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── icon-1024.png
│ │ │ │ ├── icon-20.png
│ │ │ │ ├── icon-20@2x.png
│ │ │ │ ├── icon-20@3x.png
│ │ │ │ ├── icon-29.png
│ │ │ │ ├── icon-29@2x.png
│ │ │ │ ├── icon-29@3x.png
│ │ │ │ ├── icon-40.png
│ │ │ │ ├── icon-40@2x.png
│ │ │ │ ├── icon-40@3x.png
│ │ │ │ ├── icon-60@2x.png
│ │ │ │ ├── icon-60@3x.png
│ │ │ │ ├── icon-76.png
│ │ │ │ ├── icon-76@2x.png
│ │ │ │ └── icon-83.5@2x.png
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ ├── LaunchScreen-AspectFill@2x.png
│ │ │ │ └── LaunchScreen-AspectFill@3x.png
│ │ │ └── LaunchScreen.Center.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ │ └── LaunchScreen-Center@3x.png
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ ├── Podfile
│ │ │ ├── build.xcconfig
│ │ │ ├── icon.png
│ │ │ ├── icon@2x.png
│ │ │ ├── imagenet.tflite
│ │ │ └── imagenet_large.tflite
│ ├── README.md
│ └── publishing
│ │ └── .npmignore
├── demo
│ ├── index.ts
│ ├── mlkit-barcode-scanning
│ │ └── index.ts
│ ├── mlkit-core
│ │ └── index.ts
│ ├── mlkit-custom-object-detection
│ │ └── index.ts
│ ├── mlkit-digital-ink-recognition
│ │ └── index.ts
│ ├── mlkit-face-detection
│ │ └── index.ts
│ ├── mlkit-image-labeling
│ │ └── index.ts
│ ├── mlkit-object-detection
│ │ └── index.ts
│ ├── mlkit-pose-detection
│ │ └── index.ts
│ ├── mlkit-selfie-segmentation
│ │ └── index.ts
│ ├── mlkit-text-recognition
│ │ └── index.ts
│ ├── references.d.ts
│ ├── tsconfig.json
│ └── utils
│ │ ├── demo-base.ts
│ │ └── index.ts
├── images
│ └── 00859323005830.png
├── package-settings.json
├── schematics
│ └── .gitkeep
├── scripts
│ └── build-finish.ts
├── tsconfig.tools.json
└── workspace-scripts.js
└── tsconfig.base.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "ignorePatterns": ["**/*"],
4 | "plugins": ["@nx"],
5 | "overrides": [
6 | {
7 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8 | "rules": {
9 | "@nx/enforce-module-boundaries": [
10 | "error",
11 | {
12 | "enforceBuildableLibDependency": true,
13 | "allow": [],
14 | "depConstraints": [
15 | {
16 | "sourceTag": "*",
17 | "onlyDependOnLibsWithTags": ["*"]
18 | }
19 | ]
20 | }
21 | ]
22 | }
23 | },
24 | {
25 | "files": ["*.ts", "*.tsx"],
26 | "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
27 | "rules": {
28 | "@typescript-eslint/no-extra-semi": "error",
29 | "no-extra-semi": "off"
30 | }
31 | },
32 | {
33 | "files": ["*.js", "*.jsx"],
34 | "extends": ["plugin:@nx/javascript"],
35 | "rules": {
36 | "@typescript-eslint/no-extra-semi": "error",
37 | "no-extra-semi": "off"
38 | }
39 | },
40 | {
41 | "files": ["references.d.ts"],
42 | "rules": {
43 | "@typescript-eslint/triple-slash-reference": "off"
44 | }
45 | }
46 | ]
47 | }
48 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | node_modules
10 | package-lock.json
11 | yarn.lock
12 |
13 | # IDEs and editors
14 | /.idea
15 | .project
16 | .classpath
17 | .c9/
18 | *.launch
19 | .settings/
20 | *.sublime-workspace
21 |
22 | # IDE - VSCode
23 | .vscode/*
24 | !.vscode/settings.json
25 | !.vscode/tasks.json
26 | !.vscode/launch.json
27 | !.vscode/extensions.json
28 |
29 | # misc
30 | /.sass-cache
31 | /connect.lock
32 | /coverage
33 | /libpeerconnection.log
34 | npm-debug.log
35 | yarn-error.log
36 | testem.log
37 | /typings
38 |
39 | # System Files
40 | .DS_Store
41 | Thumbs.db
42 |
43 | *.tgz
44 | packages/**/angular/dist
45 |
46 | .nx/cache
47 | .nx/workspace-data
48 |
--------------------------------------------------------------------------------
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx lint-staged --allow-empty
5 |
--------------------------------------------------------------------------------
/.npsrc:
--------------------------------------------------------------------------------
1 | {
2 | "config": "./tools/workspace-scripts.js"
3 | }
--------------------------------------------------------------------------------
/.nxignore:
--------------------------------------------------------------------------------
1 | apps/**/*_off
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Add files here to ignore them from prettier formatting
2 |
3 | /dist
4 | /coverage
5 | native-src
6 |
7 | /.nx/cache
8 | /.nx/workspace-data
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": false,
3 | "printWidth": 800,
4 | "tabWidth": 2,
5 | "singleQuote": true
6 | }
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "node"
4 | script:
5 | - npm run setup
6 | - npm start @nativescript.build-all
7 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "NativescriptExtend.fileAssociations": [
3 | {
4 | "systemId": "c:\\Users\\sweet\\Documents\\PacktCourses_books\\NATIVESCRIPT\\contributions\\mlkit\\schema\\tns.xsd",
5 | "pattern": "**/**/*.xml"
6 | },
7 | {
8 | "systemId": "http://www.w3.org/2001/XMLSchema.xsd",
9 | "pattern": "c:\\Users\\sweet\\Documents\\PacktCourses_books\\NATIVESCRIPT\\contributions\\mlkit\\schema\\tns.xsd"
10 | }
11 | ],
12 | "files.exclude": {
13 | "schema": true
14 | },
15 | "NativescriptExtend.format.enabled": true,
16 | "NativescriptExtend.validation.enabled": true
17 | }
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | - [@nativescript/mlkit-barcode-scanning](packages/mlkit-barcode-scanning/README.md)
2 | - [@nativescript/mlkit-core](packages/mlkit-core/README.md)
3 | - [@nativescript/mlkit-custom-object-detection](packages/mlkit-custom-object-detection/README.md)
4 | - [@nativescript/mlkit-digital-ink-recognition](packages/mlkit-digital-ink-recognition/README.md)
5 | - [@nativescript/mlkit-face-detection](packages/mlkit-face-detection/README.md)
6 | - [@nativescript/mlkit-image-labeling](packages/mlkit-image-labeling/README.md)
7 | - [@nativescript/mlkit-object-detection](packages/mlkit-object-detection/README.md)
8 | - [@nativescript/mlkit-pose-detection](packages/mlkit-pose-detection/README.md)
9 | - [@nativescript/mlkit-selfie-segmentation](packages/mlkit-selfie-segmentation/README.md)
10 | - [@nativescript/mlkit-text-recognition](packages/mlkit-text-recognition/README.md)
11 |
12 | # How to use?
13 |
14 | This workspace manages the suite of plugins listed above.
15 |
16 | In general, when in doubt with what to do, just `npm start`.
17 |
18 | ## How to add a new package to workspace?
19 |
20 | ```
21 | npm run add
22 | ```
23 |
24 | At the prompt, enter the name of the new package.
25 |
26 | - This adds a plugin harness in `packages` with the necessary boilerplate to just start developing
27 | - Updates all demo app flavors to support demoing the new package
28 | - Adds shared code in `tools/demo` where you can write demo code **once** and share across all demo flavors
29 | - Updates build tooling to support the new package
30 | - Updates the `npm start` interactive display
31 | - Updates the README here to list the new package
32 |
33 | ## How to add Angular compatibility to a package
34 |
35 | ```
36 | npm run add-angular
37 | ```
38 |
39 | At the prompt, enter the name of the package to add an `angular` folder to it with the necessary boilerplate to provide Angular support to the package.
40 |
41 | ## How to focus on just 1 package to develop in isolation
42 |
43 | ```
44 | npm start
45 | ```
46 |
47 | - Choose the focus commands for the package you wish to focus on and hit enter.
48 | - All the demo app's will be updated to isolate that 1 package and for supported IDE's (currently VS Code), the source code will also become isolated in the workspace.
49 |
50 | Note: *good to always clean the demo you plan to run after focusing. (You can clean any demo from `npm start` as well)*
51 |
52 | ## How to publish packages?
53 |
54 | ```
55 | npm run publish-packages
56 | ```
57 |
58 | - You will be prompted for the package names to publish. Leaving blank and hitting enter will publish them all.
59 | - You will then be prompted for the version to use. Leaving blank will auto bump the patch version (it also handles prerelease types like alpha, beta, rc, etc. - It even auto tags the corresponding prelease type on npm).
60 | - You will then be given a brief sanity check 🧠😊
61 |
62 |
Made with ❤️
63 |
--------------------------------------------------------------------------------
/apps/demo-angular/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/apps/demo-angular/.gitignore:
--------------------------------------------------------------------------------
1 | hooks
2 | platforms
3 | !webpack.config.js
--------------------------------------------------------------------------------
/apps/demo-angular/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'org.nativescript.plugindemoangular',
5 | appResourcesPath: '../../tools/assets/App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none',
9 | },
10 | appPath: 'src',
11 | cli: {
12 | packageManager: 'npm'
13 | }
14 | } as NativeScriptConfig;
15 |
--------------------------------------------------------------------------------
/apps/demo-angular/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "./src/main.ts",
3 | "dependencies": {
4 | "@nativescript/core": "file:../../node_modules/@nativescript/core",
5 | "@nativescript/mlkit-text-recognition": "file:../../dist/packages/mlkit-text-recognition",
6 | "@nativescript/mlkit-core": "file:../../dist/packages/mlkit-core",
7 | "@nativescript/mlkit-barcode-scanning": "file:../../dist/packages/mlkit-barcode-scanning",
8 | "@nativescript/mlkit-face-detection": "file:../../dist/packages/mlkit-face-detection",
9 | "@nativescript/mlkit-image-labeling": "file:../../dist/packages/mlkit-image-labeling",
10 | "@nativescript/mlkit-object-detection": "file:../../dist/packages/mlkit-object-detection",
11 | "@nativescript/mlkit-digital-ink-recognition": "file:../../dist/packages/mlkit-digital-ink-recognition",
12 | "@nativescript/mlkit-pose-detection": "file:../../dist/packages/mlkit-pose-detection",
13 | "@nativescript/mlkit-selfie-segmentation": "file:../../dist/packages/mlkit-selfie-segmentation",
14 | "@nativescript/mlkit-custom-object-detection": "file:../../dist/packages/mlkit-custom-object-detection"
15 | },
16 | "devDependencies": {
17 | "@nativescript/android": "~8.8.0",
18 | "@nativescript/ios": "~8.8.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/apps/demo-angular/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo-angular",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "apps/demo-angular/src",
5 | "projectType": "application",
6 | "prefix": "demo",
7 | "targets": {
8 | "build": {
9 | "executor": "@nativescript/nx:build",
10 | "options": {
11 | "noHmr": true,
12 | "production": true,
13 | "uglify": true,
14 | "release": true,
15 | "forDevice": true,
16 | "tsConfig": "apps/demo-angular/tsconfig.json"
17 | },
18 | "dependsOn": [
19 | {
20 | "target": "build.all",
21 | "dependencies": true
22 | }
23 | ]
24 | },
25 | "clean": {
26 | "executor": "@nativescript/nx:clean",
27 | "options": {}
28 | },
29 | "lint": {
30 | "executor": "@nx/eslint:lint"
31 | },
32 | "debug": {
33 | "executor": "@nativescript/nx:debug",
34 | "options": {
35 | "noHmr": true,
36 | "uglify": false,
37 | "release": false,
38 | "forDevice": false,
39 | "prepare": false
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/apps/demo-angular/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes } from '@angular/router';
3 | import { NativeScriptRouterModule } from '@nativescript/angular';
4 |
5 | import { HomeComponent } from './home.component';
6 |
7 | const routes: Routes = [
8 | { path: '', redirectTo: '/home', pathMatch: 'full' },
9 | { path: 'home', component: HomeComponent },
10 | { path: 'mlkit-barcode-scanning', loadChildren: () => import('./plugin-demos/mlkit-barcode-scanning.module').then((m) => m.MlkitBarcodeScanningModule) },
11 | { path: 'mlkit-core', loadChildren: () => import('./plugin-demos/mlkit-core.module').then((m) => m.MlkitCoreModule) },
12 | { path: 'mlkit-custom-object-detection', loadChildren: () => import('./plugin-demos/mlkit-custom-object-detection.module').then((m) => m.MlkitCustomObjectDetectionModule) },
13 | { path: 'mlkit-digital-ink-recognition', loadChildren: () => import('./plugin-demos/mlkit-digital-ink-recognition.module').then((m) => m.MlkitDigitalInkRecognitionModule) },
14 | { path: 'mlkit-face-detection', loadChildren: () => import('./plugin-demos/mlkit-face-detection.module').then((m) => m.MlkitFaceDetectionModule) },
15 | { path: 'mlkit-image-labeling', loadChildren: () => import('./plugin-demos/mlkit-image-labeling.module').then((m) => m.MlkitImageLabelingModule) },
16 | { path: 'mlkit-object-detection', loadChildren: () => import('./plugin-demos/mlkit-object-detection.module').then((m) => m.MlkitObjectDetectionModule) },
17 | { path: 'mlkit-pose-detection', loadChildren: () => import('./plugin-demos/mlkit-pose-detection.module').then((m) => m.MlkitPoseDetectionModule) },
18 | { path: 'mlkit-selfie-segmentation', loadChildren: () => import('./plugin-demos/mlkit-selfie-segmentation.module').then((m) => m.MlkitSelfieSegmentationModule) },
19 | { path: 'mlkit-text-recognition', loadChildren: () => import('./plugin-demos/mlkit-text-recognition.module').then((m) => m.MlkitTextRecognitionModule) },
20 | ];
21 |
22 | @NgModule({
23 | imports: [NativeScriptRouterModule.forRoot(routes)],
24 | exports: [NativeScriptRouterModule],
25 | })
26 | export class AppRoutingModule {}
27 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'demo-app',
5 | template: `
6 |
7 | `,
8 | })
9 | export class AppComponent {}
10 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptModule } from '@nativescript/angular';
3 |
4 | import { AppComponent } from './app.component';
5 | import { AppRoutingModule } from './app-routing.module';
6 | import { HomeComponent } from './home.component';
7 | import { MLKitModule } from '@nativescript/mlkit-core/angular';
8 |
9 | @NgModule({
10 | schemas: [NO_ERRORS_SCHEMA],
11 | declarations: [AppComponent, HomeComponent],
12 | bootstrap: [AppComponent],
13 | imports: [NativeScriptModule, AppRoutingModule, MLKitModule],
14 | })
15 | export class AppModule {}
16 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/app.scss:
--------------------------------------------------------------------------------
1 | @import 'nativescript-theme-core/scss/light';
2 | @import 'nativescript-theme-core/scss/index';
3 |
4 | button, label, stack-layout {
5 | horizontal-align: center;
6 | }
7 |
8 | button {
9 | font-size: 16;
10 | }
11 |
12 | .title {
13 | font-size: 30;
14 | margin: 20;
15 | }
16 |
17 | .message {
18 | font-size: 20;
19 | color: #284848;
20 | text-align: center;
21 | margin: 0 20;
22 | }
23 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterExtensions } from '@nativescript/angular';
3 |
4 | @Component({
5 | selector: 'demo-home',
6 | templateUrl: 'home.component.html',
7 | })
8 | export class HomeComponent {
9 | demos = [
10 | {
11 | name: 'mlkit-barcode-scanning',
12 | },
13 | {
14 | name: 'mlkit-core',
15 | },
16 | {
17 | name: 'mlkit-custom-object-detection',
18 | },
19 | {
20 | name: 'mlkit-digital-ink-recognition',
21 | },
22 | {
23 | name: 'mlkit-face-detection',
24 | },
25 | {
26 | name: 'mlkit-image-labeling',
27 | },
28 | {
29 | name: 'mlkit-object-detection',
30 | },
31 | {
32 | name: 'mlkit-pose-detection',
33 | },
34 | {
35 | name: 'mlkit-selfie-segmentation',
36 | },
37 | {
38 | name: 'mlkit-text-recognition',
39 | },
40 | ];
41 | }
42 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/main.ts:
--------------------------------------------------------------------------------
1 | import { runNativeScriptAngularApp, platformNativeScript } from '@nativescript/angular';
2 | import { AppModule } from './app.module';
3 |
4 | runNativeScriptAngularApp({
5 | appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
6 | });
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/apps/demo-angular/src/plugin-demos/.gitkeep
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-barcode-scanning.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-barcode-scanning.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitBarcodeScanning } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-barcode-scanning',
6 | templateUrl: 'mlkit-barcode-scanning.component.html',
7 | })
8 | export class MlkitBarcodeScanningComponent {
9 |
10 | demoShared: DemoSharedMlkitBarcodeScanning;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitBarcodeScanning();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-barcode-scanning.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitBarcodeScanningComponent } from './mlkit-barcode-scanning.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitBarcodeScanningComponent }])],
7 | declarations: [MlkitBarcodeScanningComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitBarcodeScanningModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-core.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-core.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitCore } from '@demo/shared';
3 | import { Dialogs, ImageSource } from '@nativescript/core';
4 | import { DetectionEvent, DetectionType, detectWithStillImage, MLKitView } from '@nativescript/mlkit-core';
5 |
6 | @Component({
7 | selector: 'demo-mlkit-core',
8 | templateUrl: 'mlkit-core.component.html',
9 | })
10 | export class MlkitCoreComponent {
11 |
12 | camera: MLKitView;
13 | detectorType = DetectionType.All;
14 | isPaused = true;
15 | torchOn = true;
16 | demoShared: DemoSharedMlkitCore;
17 |
18 | constructor(private _ngZone: NgZone) { }
19 |
20 | ngOnInit() {
21 | this.demoShared = new DemoSharedMlkitCore();
22 | }
23 | onLoaded(args) {
24 | this.camera = args.object;
25 | }
26 |
27 | onDetection(event: DetectionEvent) {
28 | console.log('onDetection', event.data, event.type);
29 | }
30 |
31 | toggleCamera(args) {
32 | this.camera.toggleCamera();
33 | }
34 |
35 | requestPermission(args) {
36 | this.camera.requestCameraPermission();
37 | }
38 |
39 | changeType(args) {
40 | Dialogs.action('Change Detector Type', 'Cancel', [
41 | 'all',
42 | 'barcode',
43 | 'digitalInk (unsupport atm)',
44 | 'face',
45 | 'image',
46 | 'object',
47 | 'pose',
48 | 'text',
49 | 'none'
50 | ]).then(value => {
51 | if (value === 'Cancel') { return }
52 | if (value.indexOf('digitalInk') > -1) {
53 | Dialogs.alert('digitalInk is currently unsupported');
54 | this.detectorType = DetectionType.None;
55 | } else {
56 | this.detectorType = value as any;
57 | }
58 | })
59 | }
60 |
61 | togglePause(args) {
62 | this.camera.pause = !this.camera.pause;
63 | this.isPaused = this.camera.pause;
64 | }
65 |
66 | toggleTorch(args) {
67 | this.camera.torchOn = !this.camera.torchOn;
68 | this.torchOn = this.camera.torchOn;
69 | }
70 |
71 | async processStill(args) {
72 | try {
73 | const src = await ImageSource.fromUrl('https://www.jqueryscript.net/images/jQuery-Plugin-To-Generate-International-Article-Number-Barcode-EAN13.jpg');
74 | const result = await detectWithStillImage(src, {
75 | detectorType: DetectionType.Barcode
76 | });
77 | console.log('processStill', result.barcode[0]);
78 | } catch (e) {
79 | console.log(e);
80 | }
81 | }
82 |
83 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-core.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitCoreComponent } from './mlkit-core.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitCoreComponent }])],
7 | declarations: [MlkitCoreComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitCoreModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-custom-object-detection.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-custom-object-detection.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitCustomObjectDetection } from '@demo/shared';
3 | import {} from '@nativescript/mlkit-custom-object-detection';
4 |
5 | @Component({
6 | selector: 'demo-mlkit-custom-object-detection',
7 | templateUrl: 'mlkit-custom-object-detection.component.html',
8 | })
9 | export class MlkitCustomObjectDetectionComponent {
10 | demoShared: DemoSharedMlkitCustomObjectDetection;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitCustomObjectDetection();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-custom-object-detection.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitCustomObjectDetectionComponent } from './mlkit-custom-object-detection.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitCustomObjectDetectionComponent }])],
7 | declarations: [MlkitCustomObjectDetectionComponent],
8 | schemas: [NO_ERRORS_SCHEMA],
9 | })
10 | export class MlkitCustomObjectDetectionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-digital-ink-recognition.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-digital-ink-recognition.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitDigitalInkRecognition } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-digital-ink-recognition',
6 | templateUrl: 'mlkit-digital-ink-recognition.component.html',
7 | })
8 | export class MlkitDigitalInkRecognitionComponent {
9 |
10 | demoShared: DemoSharedMlkitDigitalInkRecognition;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitDigitalInkRecognition();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-digital-ink-recognition.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitDigitalInkRecognitionComponent } from './mlkit-digital-ink-recognition.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitDigitalInkRecognitionComponent }])],
7 | declarations: [MlkitDigitalInkRecognitionComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitDigitalInkRecognitionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-face-detection.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-face-detection.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitFaceDetection } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-face-detection',
6 | templateUrl: 'mlkit-face-detection.component.html',
7 | })
8 | export class MlkitFaceDetectionComponent {
9 |
10 | demoShared: DemoSharedMlkitFaceDetection;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitFaceDetection();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-face-detection.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitFaceDetectionComponent } from './mlkit-face-detection.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitFaceDetectionComponent }])],
7 | declarations: [MlkitFaceDetectionComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitFaceDetectionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-image-labeling.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-image-labeling.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitImageLabeling } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-image-labeling',
6 | templateUrl: 'mlkit-image-labeling.component.html',
7 | })
8 | export class MlkitImageLabelingComponent {
9 |
10 | demoShared: DemoSharedMlkitImageLabeling;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitImageLabeling();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-image-labeling.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitImageLabelingComponent } from './mlkit-image-labeling.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitImageLabelingComponent }])],
7 | declarations: [MlkitImageLabelingComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitImageLabelingModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-object-detection.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-object-detection.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitObjectDetection } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-object-detection',
6 | templateUrl: 'mlkit-object-detection.component.html',
7 | })
8 | export class MlkitObjectDetectionComponent {
9 |
10 | demoShared: DemoSharedMlkitObjectDetection;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitObjectDetection();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-object-detection.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitObjectDetectionComponent } from './mlkit-object-detection.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitObjectDetectionComponent }])],
7 | declarations: [MlkitObjectDetectionComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitObjectDetectionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-pose-detection.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-pose-detection.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitPoseDetection } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-pose-detection',
6 | templateUrl: 'mlkit-pose-detection.component.html',
7 | })
8 | export class MlkitPoseDetectionComponent {
9 |
10 | demoShared: DemoSharedMlkitPoseDetection;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitPoseDetection();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-pose-detection.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitPoseDetectionComponent } from './mlkit-pose-detection.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitPoseDetectionComponent }])],
7 | declarations: [MlkitPoseDetectionComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitPoseDetectionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-selfie-segmentation.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-selfie-segmentation.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitSelfieSegmentation } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-selfie-segmentation',
6 | templateUrl: 'mlkit-selfie-segmentation.component.html',
7 | })
8 | export class MlkitSelfieSegmentationComponent {
9 |
10 | demoShared: DemoSharedMlkitSelfieSegmentation;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitSelfieSegmentation();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-selfie-segmentation.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitSelfieSegmentationComponent } from './mlkit-selfie-segmentation.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitSelfieSegmentationComponent }])],
7 | declarations: [MlkitSelfieSegmentationComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitSelfieSegmentationModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-text-recognition.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-text-recognition.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { DemoSharedMlkitTextRecognition } from '@demo/shared';
3 |
4 | @Component({
5 | selector: 'demo-mlkit-text-recognition',
6 | templateUrl: 'mlkit-text-recognition.component.html',
7 | })
8 | export class MlkitTextRecognitionComponent {
9 |
10 | demoShared: DemoSharedMlkitTextRecognition;
11 |
12 | constructor(private _ngZone: NgZone) {}
13 |
14 | ngOnInit() {
15 | this.demoShared = new DemoSharedMlkitTextRecognition();
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/apps/demo-angular/src/plugin-demos/mlkit-text-recognition.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3 | import { MlkitTextRecognitionComponent } from './mlkit-text-recognition.component';
4 |
5 | @NgModule({
6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: MlkitTextRecognitionComponent }])],
7 | declarations: [MlkitTextRecognitionComponent],
8 | schemas: [ NO_ERRORS_SCHEMA]
9 | })
10 | export class MlkitTextRecognitionModule {}
11 |
--------------------------------------------------------------------------------
/apps/demo-angular/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * NativeScript Polyfills
3 | */
4 |
5 | // Install @nativescript/core polyfills (XHR, setTimeout, requestAnimationFrame)
6 | import '@nativescript/core/globals';
7 | // Install @nativescript/angular specific polyfills
8 | import '@nativescript/angular/polyfills';
9 |
10 | /**
11 | * Zone.js and patches
12 | */
13 | // Add pre-zone.js patches needed for the NativeScript platform
14 | import '@nativescript/zone-js/dist/pre-zone-polyfills';
15 |
16 | // Zone JS is required by default for Angular itself
17 | import 'zone.js';
18 |
19 | // Add NativeScript specific Zone JS patches
20 | import '@nativescript/zone-js';
21 |
--------------------------------------------------------------------------------
/apps/demo-angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "paths": {
5 | "~/*": ["src/*"],
6 | "@demo/shared": ["tools/demo/index.ts"],
7 | "@nativescript/mlkit-text-recognition": ["packages/mlkit-text-recognition/index.ts"],
8 | "@nativescript/mlkit-core": ["packages/mlkit-core/index.d.ts"],
9 | "@nativescript/mlkit-core/angular": ["packages/mlkit-core/angular/index.ts"],
10 | "@nativescript/mlkit-custom-object-detection": ["../../packages/mlkit-custom-object-detection/index.d.ts"],
11 | "@nativescript/mlkit-barcode-scanning": ["packages/mlkit-barcode-scanning/index.ts"],
12 | "@nativescript/mlkit-face-detection": ["packages/mlkit-face-detection/index.ts"],
13 | "@nativescript/mlkit-image-labeling": ["packages/mlkit-image-labeling/index.ts"],
14 | "@nativescript/mlkit-object-detection": ["packages/mlkit-object-detection/index.ts"],
15 | "@nativescript/mlkit-digital-ink-recognition": ["packages/mlkit-digital-ink-recognition/index.ts"],
16 | "@nativescript/mlkit-pose-detection": ["packages/mlkit-pose-detection/index.ts"],
17 | "@nativescript/mlkit-selfie-segmentation": ["packages/mlkit-selfie-segmentation/index.ts"],
18 | "@nativescript/*": ["../../dist/packages/*"]
19 | }
20 | },
21 | "files": ["./references.d.ts", "./src/main.ts", "./src/polyfills.ts"],
22 | "include": ["../../packages/**/references.d.ts"]
23 | }
24 |
--------------------------------------------------------------------------------
/apps/demo-angular/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('@nativescript/webpack');
2 | const { resolve } = require('path');
3 |
4 | module.exports = (env) => {
5 |
6 | webpack.init(env);
7 | webpack.useConfig('angular');
8 |
9 | webpack.chainWebpack((config) => {
10 | // shared demo code
11 | config.resolve.alias.set('@demo/shared', resolve(__dirname, '..', '..', 'tools', 'demo'));
12 | });
13 |
14 | // Example if you need to share images across demo apps:
15 | // webpack.Utils.addCopyRule({
16 | // from: '../../../tools/images',
17 | // to: 'images',
18 | // context: webpack.Utils.project.getProjectFilePath('node_modules')
19 | // });
20 |
21 | return webpack.resolveConfig();
22 | };
23 |
--------------------------------------------------------------------------------
/apps/demo/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/apps/demo/.gitignore:
--------------------------------------------------------------------------------
1 | # NativeScript
2 | hooks/
3 | node_modules/
4 | platforms/
5 |
6 | # NativeScript Template
7 | *.js.map
8 | *.js
9 | !webpack.config.js
10 |
11 | # Logs
12 | logs
13 | *.log
14 | npm-debug.log*
15 | yarn-debug.log*
16 | yarn-error.log*
17 |
18 | # General
19 | .DS_Store
20 | .AppleDouble
21 | .LSOverride
22 | .idea
23 | .cloud
24 | .project
25 | tmp/
26 | typings/
27 |
28 | # misc
29 | npm-debug.log
30 |
31 | # app
32 | !*.d.ts
33 | !src/assets/fontawesome.min.css
34 | /report/
35 | .nsbuildinfo
36 | /temp/
37 | /src/tns_modules/
38 |
39 | # app uses platform specific scss which can inadvertently get renamed which will cause problems
40 | app/app.scss
41 |
42 | package-lock.json
43 |
--------------------------------------------------------------------------------
/apps/demo/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'org.nativescript.plugindemo',
5 | appResourcesPath: '../../tools/assets/App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none',
9 | },
10 | appPath: 'src',
11 | cli: {
12 | packageManager: 'npm'
13 | }
14 | } as NativeScriptConfig;
15 |
--------------------------------------------------------------------------------
/apps/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "./src/app.ts",
3 | "description": "NativeScript Application",
4 | "license": "SEE LICENSE IN ",
5 | "repository": "",
6 | "dependencies": {
7 | "@nativescript/core": "file:../../node_modules/@nativescript/core",
8 | "@nativescript/mlkit-barcode-scanning": "file:../../packages/mlkit-barcode-scanning",
9 | "@nativescript/mlkit-core": "file:../../packages/mlkit-core",
10 | "@nativescript/mlkit-digital-ink-recognition": "file:../../packages/mlkit-digital-ink-recognition",
11 | "@nativescript/mlkit-face-detection": "file:../../packages/mlkit-face-detection",
12 | "@nativescript/mlkit-image-labeling": "file:../../packages/mlkit-image-labeling",
13 | "@nativescript/mlkit-object-detection": "file:../../packages/mlkit-object-detection",
14 | "@nativescript/mlkit-pose-detection": "file:../../packages/mlkit-pose-detection",
15 | "@nativescript/mlkit-selfie-segmentation": "file:../../packages/mlkit-selfie-segmentation",
16 | "@nativescript/mlkit-text-recognition": "file:../../packages/mlkit-text-recognition",
17 | "@nativescript/mlkit-custom-object-detection": "file:../../packages/mlkit-custom-object-detection"
18 | },
19 | "devDependencies": {
20 | "@nativescript/android": "~8.8.0",
21 | "@nativescript/ios": "~8.8.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/demo/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "apps/demo/src",
5 | "projectType": "application",
6 | "prefix": "demo",
7 | "targets": {
8 | "build": {
9 | "executor": "@nativescript/nx:build",
10 | "options": {
11 | "noHmr": true,
12 | "production": true,
13 | "uglify": true,
14 | "release": true,
15 | "forDevice": true,
16 | "tsConfig": "apps/demo/tsconfig.json"
17 | },
18 | "dependsOn": [
19 | {
20 | "target": "build.all",
21 | "dependencies": true
22 | }
23 | ]
24 | },
25 | "clean": {
26 | "executor": "@nativescript/nx:clean",
27 | "options": {}
28 | },
29 | "lint": {
30 | "executor": "@nx/eslint:lint"
31 | },
32 | "debug": {
33 | "executor": "@nativescript/nx:debug",
34 | "options": {
35 | "noHmr": true,
36 | "uglify": false,
37 | "release": false,
38 | "forDevice": false,
39 | "prepare": false
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/apps/demo/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/apps/demo/src/app-root.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/apps/demo/src/app.scss:
--------------------------------------------------------------------------------
1 | @import 'nativescript-theme-core/scss/light';
2 | @import 'nativescript-theme-core/scss/index';
--------------------------------------------------------------------------------
/apps/demo/src/app.ts:
--------------------------------------------------------------------------------
1 | import { Application } from '@nativescript/core';
2 |
3 | Application.run({ moduleName: 'app-root' });
4 |
--------------------------------------------------------------------------------
/apps/demo/src/main-page.ts:
--------------------------------------------------------------------------------
1 | import { EventData, Page } from '@nativescript/core';
2 | import { MainViewModel } from "./main-view-model";
3 |
4 | export function navigatingTo(args: EventData) {
5 | const page = args.object;
6 | page.bindingContext = new MainViewModel();
7 | }
8 |
--------------------------------------------------------------------------------
/apps/demo/src/main-page.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/apps/demo/src/main-view-model.ts:
--------------------------------------------------------------------------------
1 | import { Observable, Frame } from '@nativescript/core';
2 |
3 | export class MainViewModel extends Observable {
4 |
5 | viewDemo(args) {
6 | Frame.topmost().navigate({
7 | moduleName: `plugin-demos/${args.object.text}`,
8 | });
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/apps/demo/src/plugin-demos/.gitkeep
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-barcode-scanning.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitBarcodeScanning } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-barcode-scanning';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitBarcodeScanning {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-barcode-scanning.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-core.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-custom-object-detection.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitCustomObjectDetection } from '@demo/shared';
3 | import {} from '@nativescript/mlkit-custom-object-detection';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitCustomObjectDetection {}
11 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-custom-object-detection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-digital-ink-recognition.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitDigitalInkRecognition } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-digital-ink-recognition';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitDigitalInkRecognition {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-digital-ink-recognition.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-face-detection.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitFaceDetection } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-face-detection';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitFaceDetection {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-face-detection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-image-labeling.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitImageLabeling } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-image-labeling';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitImageLabeling {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-image-labeling.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-object-detection.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitObjectDetection } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-object-detection';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitObjectDetection {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-object-detection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-pose-detection.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitPoseDetection } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-pose-detection';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitPoseDetection {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-pose-detection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-selfie-segmentation.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitSelfieSegmentation } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-selfie-segmentation';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitSelfieSegmentation {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-selfie-segmentation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-text-recognition.ts:
--------------------------------------------------------------------------------
1 | import { Observable, EventData, Page } from '@nativescript/core';
2 | import { DemoSharedMlkitTextRecognition } from '@demo/shared';
3 | import { } from '@nativescript/mlkit-text-recognition';
4 |
5 | export function navigatingTo(args: EventData) {
6 | const page = args.object;
7 | page.bindingContext = new DemoModel();
8 | }
9 |
10 | export class DemoModel extends DemoSharedMlkitTextRecognition {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/apps/demo/src/plugin-demos/mlkit-text-recognition.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDirs": [".", "../.."],
5 | "baseUrl": ".",
6 | "paths": {
7 | "~/*": ["src/*"],
8 | "@demo/shared": ["../../tools/demo/index.ts"],
9 | "@nativescript/mlkit-text-recognition": ["../../packages/mlkit-text-recognition/index.ts"],
10 | "@nativescript/mlkit-core": ["../../packages/mlkit-core/index.d.ts"],
11 | "@nativescript/mlkit-core/angular": ["../../packages/mlkit-core/angular/index.ts"],
12 | "@nativescript/mlkit-custom-object-detection": ["../../packages/mlkit-custom-object-detection/index.d.ts"]
13 | "@nativescript/mlkit-barcode-scanning": ["../../packages/mlkit-barcode-scanning/index.ts"],
14 | "@nativescript/mlkit-face-detection": ["../../packages/mlkit-face-detection/index.ts"],
15 | "@nativescript/mlkit-image-labeling": ["../../packages/mlkit-image-labeling/index.ts"],
16 | "@nativescript/mlkit-object-detection": ["../../packages/mlkit-object-detection/index.ts"],
17 | "@nativescript/mlkit-digital-ink-recognition": ["../../packages/mlkit-digital-ink-recognition/index.ts"],
18 | "@nativescript/mlkit-pose-detection": ["../../packages/mlkit-pose-detection/index.ts"],
19 | "@nativescript/mlkit-selfie-segmentation": ["../../packages/mlkit-selfie-segmentation/index.ts"],
20 | "@nativescript/*": ["../../packages/*"]
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/demo/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('@nativescript/webpack');
2 | const { resolve } = require('path');
3 |
4 | module.exports = (env) => {
5 |
6 | webpack.init(env);
7 | webpack.useConfig('typescript');
8 |
9 | webpack.chainWebpack((config) => {
10 | // shared demo code
11 | config.resolve.alias.set('@demo/shared', resolve(__dirname, '..', '..', 'tools', 'demo'));
12 | });
13 |
14 | // Example if you need to share images across demo apps:
15 | webpack.Utils.addCopyRule({
16 | from: '../../../tools/images',
17 | to: 'images',
18 | context: webpack.Utils.project.getProjectFilePath('node_modules')
19 | });
20 |
21 | return webpack.resolveConfig();
22 | };
23 |
--------------------------------------------------------------------------------
/jest.config.ts:
--------------------------------------------------------------------------------
1 | const { getJestProjects } = require('@nx/jest');
2 |
3 | export default { projects: [...getJestProjects()] };
4 |
--------------------------------------------------------------------------------
/migrations.json:
--------------------------------------------------------------------------------
1 | {
2 | "migrations": [
3 | { "cli": "nx", "version": "5.3.0", "description": "Migrate tools to 5.3.0", "implementation": "./src/migrations/update-5-3-0/update-5-3-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.3.0" },
4 | { "cli": "nx", "version": "5.4.0", "description": "Migrate tools to 5.4.0", "implementation": "./src/migrations/update-5-4-0/update-5-4-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.4.0" },
5 | { "cli": "nx", "version": "5.5.0", "description": "Migrate tools to 5.5.0", "implementation": "./src/migrations/update-5-5-0/update-5-5-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.5.0" }
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/nx.json:
--------------------------------------------------------------------------------
1 | {
2 | "workspaceLayout": {
3 | "appsDir": "apps",
4 | "libsDir": "packages"
5 | },
6 | "tasksRunnerOptions": {
7 | "default": {
8 | "options": {
9 | "runtimeCacheInputs": ["node -v"]
10 | }
11 | }
12 | },
13 | "$schema": "./node_modules/nx/schemas/nx-schema.json",
14 | "namedInputs": {
15 | "default": ["{projectRoot}/**/*", "sharedGlobals"],
16 | "sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.base.json", "{workspaceRoot}/tslint.json", "{workspaceRoot}/nx.json"],
17 | "production": ["default", "!{projectRoot}/.eslintrc.json", "!{projectRoot}/src/test-setup.[jt]s"]
18 | },
19 | "targetDefaults": {
20 | "build": {
21 | "inputs": ["production", "^production"],
22 | "cache": true
23 | },
24 | "lint": {
25 | "inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
26 | "cache": true
27 | },
28 | "build.all": {
29 | "cache": true
30 | },
31 | "test": {
32 | "cache": true
33 | },
34 | "e2e": {
35 | "cache": true
36 | }
37 | },
38 | "useDaemonProcess": false,
39 | "parallel": 1,
40 | "useInferencePlugins": false,
41 | "defaultBase": "master",
42 | "release": {
43 | "releaseTagPattern": "{version}-{projectName}",
44 | "projects": ["packages/*"],
45 | "projectsRelationship": "independent",
46 | "changelog": {
47 | "workspaceChangelog": false,
48 | "projectChangelogs": {
49 | "renderOptions": {
50 | "authors": true,
51 | "commitReferences": true,
52 | "versionTitleDate": true
53 | }
54 | }
55 | }
56 | },
57 | "useLegacyCache": true
58 | }
59 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "plugins",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "postinstall": "husky install && npx ts-patch install",
7 | "setup": "npx rimraf node_modules package-lock.json dist tmp yarn.lock && yarn config set ignore-engines true && ns package-manager set npm && yarn",
8 | "start": "nps",
9 | "add": "nx g @nativescript/plugin-tools:add-package",
10 | "add-angular": "nx g @nativescript/plugin-tools:add-angular",
11 | "config": "nx g @nativescript/plugin-tools:config",
12 | "publish-packages": "nx g @nativescript/plugin-tools:publish",
13 | "sync-packages-with-demos": "nx g @nativescript/plugin-tools:sync-packages-with-demos",
14 | "remove-package": "nx g @nativescript/plugin-tools:remove-package",
15 | "add-demo": "nx g @nativescript/plugin-tools:add-demo"
16 | },
17 | "private": true,
18 | "devDependencies": {
19 | "@angular/animations": "^19.0.0",
20 | "@angular/common": "^19.0.0",
21 | "@angular/compiler": "^19.0.0",
22 | "@angular/compiler-cli": "^19.0.0",
23 | "@angular/core": "^19.0.0",
24 | "@angular/forms": "^19.0.0",
25 | "@angular/platform-browser": "^19.0.0",
26 | "@angular/platform-browser-dynamic": "^19.0.0",
27 | "@angular/router": "^19.0.0",
28 | "@nativescript/angular": "^19.0.0",
29 | "@nativescript/core": "~8.8.0",
30 | "@nativescript/plugin-tools": "5.5.1",
31 | "@nativescript/types": "~8.8.0",
32 | "@nativescript/webpack": "~5.0.5",
33 | "@ngtools/webpack": "^19.0.0",
34 | "husky": "~9.0.0",
35 | "nativescript-vue": "~2.9.0",
36 | "nativescript-vue-template-compiler": "~2.9.0",
37 | "ng-packagr": "^19.0.0",
38 | "rxjs": "~7.8.0",
39 | "typescript": "~5.6.0",
40 | "zone.js": "~0.15.0",
41 | "@angular-devkit/build-angular": "^19.0.0"
42 | },
43 | "lint-staged": {
44 | "**/*.{js,ts,scss,json,html}": [
45 | "npx prettier --write"
46 | ]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/packages/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/packages/.gitkeep
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-barcode-scanning",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Barcode Scanner module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:barcode-scanning:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:barcode-scanning:17.2.0'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/BarcodeScanning', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-barcode-scanning",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-barcode-scanning",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-barcode-scanning",
11 | "tsConfig": "packages/mlkit-barcode-scanning/tsconfig.json",
12 | "packageJson": "packages/mlkit-barcode-scanning/package.json",
13 | "main": "packages/mlkit-barcode-scanning/index.ts",
14 | "assets": [
15 | "packages/mlkit-barcode-scanning/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-barcode-scanning/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-barcode-scanning"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-barcode-scanning"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-barcode-scanning"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-barcode-scanning/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-core/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-core/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 3.0.1 (2025-02-04)
2 |
3 | ### 🩹 Fixes
4 |
5 | - check if bbox params are set ([#72](https://github.com/NativeScript/mlkit/pull/72))
6 |
7 | ### ❤️ Thank You
8 |
9 | - cjohn001 @cjohn001
10 |
11 | # 3.0.0 (2025-01-29)
12 |
13 | ### 🚀 Features
14 |
15 | - custom object detectors + fix related to automatic zooming on ios ([#71](https://github.com/NativeScript/mlkit/pull/71))
16 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
17 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
18 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
19 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
20 | - pause & torch ([a39ac7e](https://github.com/NativeScript/mlkit/commit/a39ac7e))
21 |
22 | ### 🩹 Fixes
23 |
24 | - **ios:** mlkit import ([#59](https://github.com/NativeScript/mlkit/pull/59))
25 | - **ios:** latest Image orientation ([e6c694c](https://github.com/NativeScript/mlkit/commit/e6c694c))
26 | - **core:** module guard checks ([1e851e6](https://github.com/NativeScript/mlkit/commit/1e851e6))
27 | - **core:** instance check ([a58ac63](https://github.com/NativeScript/mlkit/commit/a58ac63))
28 | - **core:** should check if undefined ([92cffcf](https://github.com/NativeScript/mlkit/commit/92cffcf))
29 | - **facedetection:** only set instance if supported ([6b5e775](https://github.com/NativeScript/mlkit/commit/6b5e775))
30 | - **core:** latestImage guard ([859f7d8](https://github.com/NativeScript/mlkit/commit/859f7d8))
31 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
32 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
33 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
34 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
35 | - ios ([9a7d9bc](https://github.com/NativeScript/mlkit/commit/9a7d9bc))
36 | - typings ([af53c19](https://github.com/NativeScript/mlkit/commit/af53c19))
37 |
38 | ### ❤️ Thank You
39 |
40 | - cjohn001 @cjohn001
41 | - Nathan Walker
42 | - Osei Fortune @triniwiz
43 | - Sean Kelly @SeanKelly369
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../.eslintrc.json"],
3 | "overrides": [
4 | {
5 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
6 | "rules": {}
7 | },
8 | {
9 | "files": ["*.ts", "*.tsx"],
10 | "rules": {
11 | "@nx/enforce-module-boundaries": [
12 | "error",
13 | {
14 | "allowCircularSelfDependency": true
15 | }
16 | ]
17 | }
18 | },
19 | {
20 | "files": ["*.js", "*.jsx"],
21 | "rules": {}
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/index.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { registerElement } from '@nativescript/angular';
3 |
4 | import { MLKitViewDirective } from './mlkit-view-directive';
5 | import { MLKitView } from '@nativescript/mlkit-core';
6 | export * from './mlkit-view-directive';
7 |
8 | @NgModule({
9 | declarations: [MLKitViewDirective],
10 | exports: [MLKitViewDirective],
11 | })
12 |
13 | // @ts-ignore
14 | export class MLKitModule { }
15 |
16 | registerElement('MLKitView', () => MLKitView);
17 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/mlkit-view-directive.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: 'MLKitView',
5 | standalone: false,
6 | })
7 | export class MLKitViewDirective {}
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3 | "lib": {
4 | "entryFile": "index.ts"
5 | },
6 | "allowedNonPeerDependencies": ["."],
7 | "dest": "../../../dist/packages/mlkit-core/angular"
8 | }
9 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-core-angular"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/tsconfig.angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../node_modules/ng-packagr/lib/ts/conf/tsconfig.ngc.json",
3 | "compilerOptions": {
4 | "types": ["node"],
5 | "baseUrl": ".",
6 | "paths": {
7 | "@nativescript/mlkit-core": ["../../../dist/packages/mlkit-core"]
8 | },
9 | "outDir": "../../../dist/out-tsc",
10 | "declarationDir": "../../../dist/out-tsc"
11 | },
12 | "files": ["index.ts"]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/mlkit-core/angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "rootDir": "."
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/index.d.ts:
--------------------------------------------------------------------------------
1 | import { MLKitViewBase, DetectionType, BarcodeFormats } from './common';
2 | import { EventData } from '@nativescript/core';
3 |
4 | export interface StillImageDetectionOptions {
5 | detectorType: DetectionType;
6 | barcodeScanning?: {
7 | barcodeFormat?: [BarcodeFormats];
8 | };
9 | faceDetection?: {
10 | faceTracking?: boolean;
11 | minimumFaceSize: ?number;
12 | detectionMode?: 'fast' | 'accurate';
13 | landmarkMode?: 'all' | 'none';
14 | contourMode?: 'all' | 'none';
15 | classificationMode?: 'all' | 'none';
16 | };
17 | imageLabeling?: {
18 | confidenceThreshold?: number;
19 | };
20 | objectDetection?: {
21 | multiple: boolean;
22 | classification: boolean;
23 | };
24 | selfieSegmentation?: {
25 | enableRawSizeMask?: boolean;
26 | smoothingRatio?: number;
27 | };
28 | }
29 |
30 | export interface DetectionEvent extends EventData {
31 | data: { [key: string]: any } | Array<{ [key: string]: any }>;
32 | type: DetectionType;
33 | }
34 |
35 |
36 | export { BarcodeFormats, barcodeFormatsProperty, CameraPosition, cameraPositionProperty, DetectionType, faceDetectionMinFaceSizeProperty, faceDetectionPerformanceModeProperty, faceDetectionTrackingEnabledProperty, imageLabelerConfidenceThresholdProperty as imageLablerConfidenceThresholdProperty, objectDetectionClassifyProperty, objectDetectionMultipleProperty } from './common';
37 | export declare class MLKitView extends MLKitViewBase {
38 | static isAvailable(): boolean;
39 | static detectionEvent: string;
40 | stopPreview(): void;
41 | toggleCamera(): void;
42 | startPreview(): void;
43 | requestCameraPermission(): Promise;
44 | hasCameraPermission(): boolean;
45 | on(event: 'detection', callback: (args: DetectionEvent) => void, thisArg?: any);
46 | // Needed when 'on' method is overriden.
47 | /**
48 | * @hidden
49 | */
50 | on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
51 | }
52 |
53 | export function detectWithStillImage(image: any, options?: StillImageDetectionOptions): Promise<{ [key: string]: any }>;
54 |
--------------------------------------------------------------------------------
/packages/mlkit-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-core",
3 | "version": "3.0.1",
4 | "description": "NativeScript MLKit Core",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "files": [
8 | "*",
9 | "angular/package.json"
10 | ],
11 | "nativescript": {
12 | "platforms": {
13 | "ios": "6.0.0",
14 | "android": "6.0.0"
15 | }
16 | },
17 | "repository": {
18 | "type": "git",
19 | "url": "https://github.com/NativeScript/mlkit.git"
20 | },
21 | "keywords": [
22 | "NativeScript",
23 | "JavaScript",
24 | "TypeScript",
25 | "iOS",
26 | "Android"
27 | ],
28 | "author": {
29 | "name": "NativeScript",
30 | "email": "oss@nativescript.org"
31 | },
32 | "bugs": {
33 | "url": "https://github.com/NativeScript/mlkit/issues"
34 | },
35 | "license": "Apache-2.0",
36 | "homepage": "https://github.com/NativeScript/mlkit",
37 | "readmeFilename": "README.md",
38 | "bootstrapper": "@nativescript/plugin-seed"
39 | }
40 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | maven { url "https://repo1.maven.org/maven2/" }
4 | maven { url "https://s01.oss.sonatype.org/content/repositories/releases/" }
5 | }
6 | }
7 |
8 | dependencies {
9 | implementation 'io.github.triniwiz:fancycamera:4.0.0-alpha.13'
10 | }
11 |
12 |
13 | android {
14 | packagingOptions {
15 | exclude 'META-INF/DEPENDENCIES'
16 | exclude 'META-INF/LICENSE'
17 | exclude 'META-INF/LICENSE.txt'
18 | exclude 'META-INF/license.txt'
19 | exclude 'META-INF/NOTICE'
20 | exclude 'META-INF/NOTICE.txt'
21 | exclude 'META-INF/notice.txt'
22 | exclude 'META-INF/ASL2.0'
23 | exclude("META-INF/*.kotlin_module")
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSCameraUsageDescription
6 | Requires access to camera.
7 |
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | pod 'SwiftyJSON', '~> 5.0'
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/src/TNSFaceDetection.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(MLKitFaceDetection)
4 | import MLKitFaceDetection
5 |
6 | struct TNSFaceDetectionResult: Codable {
7 | var leftEyeOpenProbability: Double
8 | var rightEyeOpenProbability: Double
9 | var smilingProbability: Double
10 | var bounds: TNSBounds
11 | var headEulerAngleX: Double
12 | var headEulerAngleY: Double
13 | var headEulerAngleZ: Double
14 | }
15 |
16 |
17 |
18 | class TNSFaceDetection: NSObject {
19 |
20 | static func createFaceDetectionResult(_ faces: [Face]) -> [TNSFaceDetectionResult] {
21 | var results: [TNSFaceDetectionResult] = []
22 | for face in faces {
23 |
24 | let result = TNSFaceDetectionResult(leftEyeOpenProbability: Double(face.leftEyeOpenProbability), rightEyeOpenProbability: Double(face.rightEyeOpenProbability), smilingProbability: Double(face.smilingProbability), bounds: createBounds(face.frame), headEulerAngleX: Double(face.headEulerAngleX), headEulerAngleY: Double(face.headEulerAngleY), headEulerAngleZ: Double(face.headEulerAngleZ))
25 | results.append(result)
26 | }
27 | return results
28 | }
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/src/TNSImageLabeling.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | #if canImport(MLKitImageLabeling)
3 | import MLKitImageLabeling
4 |
5 |
6 | struct TNSImageLabelingResult: Codable {
7 | var text: String?
8 | var confidence: Double?
9 | var index: Int?
10 | }
11 |
12 | class TNSImageLabeling: NSObject {
13 | static func createImageLabeling(_ labeling: [ImageLabel]) -> [TNSImageLabelingResult]{
14 | var result:[TNSImageLabelingResult] = []
15 | for label in labeling {
16 | result.append(TNSImageLabelingResult(text: label.text, confidence: Double(label.confidence), index: label.index))
17 | }
18 | return result
19 | }
20 | }
21 | #endif
22 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/src/TNSMLKitParsers.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 |
4 | import Foundation
5 | #if canImport(MLKitBarcodeScanning)
6 | import MLKitBarcodeScanning
7 |
8 | func handleBarcodeScanner(_ barcode: [Barcode]) -> [TNSBarcodeScannerResult]{
9 | var result: [TNSBarcodeScannerResult] = []
10 | for value in barcode {
11 | result.append(
12 | TNSBarcodeScanner.createBarcodeScannerResult(value)
13 | )
14 | }
15 | return result
16 | }
17 | #endif
18 |
19 |
20 |
21 | #if canImport(MLKitFaceDetection)
22 | import MLKitFaceDetection
23 | func handleFaceDetection(_ faces: [Face]) -> [TNSFaceDetectionResult]{
24 | return TNSFaceDetection.createFaceDetectionResult(faces)
25 | }
26 | #endif
27 |
28 |
29 | #if canImport(MLKitTextRecognition)
30 | import MLKitTextRecognition
31 | func handleTextRecognition(_ text: Text) -> [TNSTextRecognizerResult]{
32 | return TNSTextRecognizer.createTextRecognizer(text)
33 | }
34 | #endif
35 |
36 |
37 | #if canImport(MLKitImageLabeling)
38 | import MLKitImageLabeling
39 | func handleImageLabeling(_ labeling: [ImageLabel]) -> [TNSImageLabelingResult]{
40 | return TNSImageLabeling.createImageLabeling(labeling)
41 | }
42 | #endif
43 |
44 |
45 | #if canImport(MLKitObjectDetection)
46 | import MLKitObjectDetection
47 | func handleObjectDetection(_ objects: [Object]) -> [TNSObjectDetectionResult]{
48 | return TNSObjectDetection.createObjectDetection(objects)
49 | }
50 | #endif
51 |
52 |
53 |
54 | #if canImport(MLKitPoseDetection)
55 | import MLKitPoseDetection
56 | func handlePoseDetection(_ poses: [Pose]) -> [TNSPoseDetectionResult]{
57 | return TNSPoseDetection.createPoseDetection(poses)
58 | }
59 | #endif
60 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/src/TNSObjectDetection.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | #if canImport(MLKitObjectDetection)
3 | import MLKitObjectDetection
4 |
5 |
6 | struct TNSObjectLabeling: Codable {
7 | var text: String?
8 | var confidence: Double?
9 | var index: Int?
10 | }
11 |
12 |
13 | struct TNSObjectDetectionResult: Codable {
14 | var trackingId: Int?
15 | var bounds: TNSBounds
16 | var labels: [TNSObjectLabeling]
17 | }
18 |
19 | class TNSObjectDetection: NSObject {
20 |
21 | static func createObjectLabeling(_ labeling: [ObjectLabel]) -> [TNSObjectLabeling]{
22 | var result:[TNSObjectLabeling] = []
23 | for label in labeling {
24 | result.append(TNSObjectLabeling(text: label.text, confidence: Double(label.confidence), index: label.index))
25 | }
26 | return result
27 | }
28 |
29 | static func createObjectDetection(_ objects: [Object]) -> [TNSObjectDetectionResult]{
30 | var result:[TNSObjectDetectionResult] = []
31 | for object in objects {
32 | result.append(TNSObjectDetectionResult(trackingId: object.trackingID?.intValue, bounds: createBounds(object.frame), labels: createObjectLabeling(object.labels)))
33 | }
34 | return result
35 | }
36 | }
37 | #endif
38 |
--------------------------------------------------------------------------------
/packages/mlkit-core/platforms/ios/src/TNSTextRecognition.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | #if canImport(MLKitTextRecognition)
3 | import MLKitTextRecognition
4 |
5 |
6 | struct TNSTextElement: Codable {
7 | var text: String?
8 | var bounds: TNSBounds
9 | }
10 |
11 | struct TNSTextLine: Codable {
12 | var text: String?
13 | var bounds: TNSBounds
14 | var elements: [TNSTextElement]
15 | var points: [TNSPoint]?
16 | }
17 |
18 |
19 | struct TNSTextRecognizerResult: Codable {
20 | var text: String?
21 | var bounds: TNSBounds
22 | var lines: [TNSTextLine]
23 | var points: [TNSPoint]
24 | }
25 |
26 | class TNSTextRecognizer: NSObject {
27 | static func createTextRecognizer(_ text: Text) -> [TNSTextRecognizerResult] {
28 | var blocks: [TNSTextRecognizerResult] = []
29 | for block in text.blocks {
30 | var lines: [TNSTextLine] = []
31 | for line in block.lines {
32 | var elements: [TNSTextElement] = []
33 | for element in line.elements {
34 | elements.append(
35 | TNSTextElement(text: element.text, bounds: createBounds(element.frame))
36 | )
37 | }
38 |
39 | let points = createPoints(line.cornerPoints)
40 |
41 |
42 | lines.append(
43 | TNSTextLine(text: line.text, bounds: createBounds(line.frame), elements: elements, points: points)
44 | )
45 |
46 | }
47 |
48 | blocks.append(
49 | TNSTextRecognizerResult(text: block.text, bounds: createBounds(block.frame), lines: lines, points: createPoints(block.cornerPoints)!)
50 | )
51 |
52 | }
53 | return blocks
54 | }
55 | }
56 | #endif
57 |
--------------------------------------------------------------------------------
/packages/mlkit-core/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-core",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-core",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-core",
11 | "tsConfig": "packages/mlkit-core/tsconfig.json",
12 | "packageJson": "packages/mlkit-core/package.json",
13 | "main": "packages/mlkit-core/index.d.ts",
14 | "assets": [
15 | "packages/mlkit-core/*.md",
16 | "packages/mlkit-core/index.d.ts",
17 | "LICENSE",
18 | {
19 | "glob": "**/*",
20 | "input": "packages/mlkit-core/platforms/",
21 | "output": "./platforms/"
22 | }
23 | ]
24 | },
25 | "dependsOn": [
26 | {
27 | "target": "build.all",
28 | "dependencies": true
29 | }
30 | ]
31 | },
32 | "build.all": {
33 | "executor": "nx:run-commands",
34 | "options": {
35 | "commands": ["node tools/scripts/build-finish.ts mlkit-core"],
36 | "parallel": false
37 | },
38 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-core"],
39 | "dependsOn": [
40 | {
41 | "target": "build.all",
42 | "dependencies": true
43 | },
44 |
45 | {
46 | "target": "build",
47 | "projects": "self"
48 | }
49 | ]
50 | },
51 | "focus": {
52 | "executor": "nx:run-commands",
53 | "options": {
54 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-core"],
55 | "parallel": false
56 | }
57 | },
58 | "lint": {
59 | "executor": "@nx/eslint:lint"
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/packages/mlkit-core/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLImage.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class GMLImage extends NSObject implements MLKCompatibleImage {
3 |
4 | static alloc(): GMLImage; // inherited from NSObject
5 |
6 | static new(): GMLImage; // inherited from NSObject
7 |
8 | readonly height: number;
9 |
10 | readonly image: UIImage;
11 |
12 | readonly imageSourceType: number;
13 |
14 | orientation: UIImageOrientation;
15 |
16 | readonly pixelBuffer: any;
17 |
18 | readonly sampleBuffer: any;
19 |
20 | readonly width: number;
21 |
22 | readonly debugDescription: string; // inherited from NSObjectProtocol
23 |
24 | readonly description: string; // inherited from NSObjectProtocol
25 |
26 | readonly hash: number; // inherited from NSObjectProtocol
27 |
28 | readonly isProxy: boolean; // inherited from NSObjectProtocol
29 |
30 | readonly superclass: typeof NSObject; // inherited from NSObjectProtocol
31 |
32 | readonly // inherited from NSObjectProtocol
33 |
34 | constructor(o: { image: UIImage; });
35 |
36 | constructor(o: { pixelBuffer: any; });
37 |
38 | constructor(o: { sampleBuffer: any; });
39 |
40 | class(): typeof NSObject;
41 |
42 | conformsToProtocol(aProtocol: any /* Protocol */): boolean;
43 |
44 | initWithImage(image: UIImage): this;
45 |
46 | initWithPixelBuffer(pixelBuffer: any): this;
47 |
48 | initWithSampleBuffer(sampleBuffer: any): this;
49 |
50 | isEqual(object: any): boolean;
51 |
52 | isKindOfClass(aClass: typeof NSObject): boolean;
53 |
54 | isMemberOfClass(aClass: typeof NSObject): boolean;
55 |
56 | performSelector(aSelector: string): any;
57 |
58 | performSelectorWithObject(aSelector: string, object: any): any;
59 |
60 | performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any;
61 |
62 | respondsToSelector(aSelector: string): boolean;
63 |
64 | retainCount(): number;
65 |
66 | self(): this;
67 | }
68 |
69 | declare var GMLImageSourceTypeImage: number;
70 |
71 | declare var GMLImageSourceTypePixelBuffer: number;
72 |
73 | declare var GMLImageSourceTypeSampleBuffer: number;
74 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitCommon.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKCustomRemoteModel extends MLKRemoteModel {
3 |
4 | static alloc(): MLKCustomRemoteModel; // inherited from NSObject
5 |
6 | static new(): MLKCustomRemoteModel; // inherited from NSObject
7 |
8 | constructor(o: { remoteModelSource: MLKRemoteModelSource; });
9 |
10 | initWithRemoteModelSource(remoteModelSource: MLKRemoteModelSource): this;
11 | }
12 |
13 | declare class MLKLocalModel extends NSObject {
14 |
15 | static alloc(): MLKLocalModel; // inherited from NSObject
16 |
17 | static new(): MLKLocalModel; // inherited from NSObject
18 |
19 | readonly manifestPath: string;
20 |
21 | readonly path: string;
22 |
23 | constructor(o: { manifestPath: string; });
24 |
25 | constructor(o: { path: string; });
26 |
27 | initWithManifestPath(manifestPath: string): this;
28 |
29 | initWithPath(path: string): this;
30 | }
31 |
32 | declare class MLKModelDownloadConditions extends NSObject implements NSCopying {
33 |
34 | static alloc(): MLKModelDownloadConditions; // inherited from NSObject
35 |
36 | static new(): MLKModelDownloadConditions; // inherited from NSObject
37 |
38 | readonly allowsBackgroundDownloading: boolean;
39 |
40 | readonly allowsCellularAccess: boolean;
41 |
42 | constructor(o: { allowsCellularAccess: boolean; allowsBackgroundDownloading: boolean; });
43 |
44 | copyWithZone(zone: interop.Pointer | interop.Reference): any;
45 |
46 | initWithAllowsCellularAccessAllowsBackgroundDownloading(allowsCellularAccess: boolean, allowsBackgroundDownloading: boolean): this;
47 | }
48 |
49 | declare var MLKModelDownloadDidFailNotification: string;
50 |
51 | declare var MLKModelDownloadDidSucceedNotification: string;
52 |
53 | declare var MLKModelDownloadUserInfoKeyError: string;
54 |
55 | declare var MLKModelDownloadUserInfoKeyRemoteModel: string;
56 |
57 | declare class MLKModelManager extends NSObject {
58 |
59 | static alloc(): MLKModelManager; // inherited from NSObject
60 |
61 | static modelManager(): MLKModelManager;
62 |
63 | static new(): MLKModelManager; // inherited from NSObject
64 |
65 | deleteDownloadedModelCompletion(remoteModel: MLKRemoteModel, completion: (p1: NSError) => void): void;
66 |
67 | downloadModelConditions(remoteModel: MLKRemoteModel, conditions: MLKModelDownloadConditions): NSProgress;
68 |
69 | isModelDownloaded(remoteModel: MLKRemoteModel): boolean;
70 | }
71 |
72 | declare class MLKRemoteModel extends NSObject {
73 |
74 | static alloc(): MLKRemoteModel; // inherited from NSObject
75 |
76 | static new(): MLKRemoteModel; // inherited from NSObject
77 |
78 | readonly name: string;
79 | }
80 |
81 | declare class MLKRemoteModelSource extends NSObject {
82 |
83 | static alloc(): MLKRemoteModelSource; // inherited from NSObject
84 |
85 | static new(): MLKRemoteModelSource; // inherited from NSObject
86 | }
87 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitImageLabeling.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKImageLabelerOptions extends MLKCommonImageLabelerOptions {
3 |
4 | static alloc(): MLKImageLabelerOptions; // inherited from NSObject
5 |
6 | static new(): MLKImageLabelerOptions; // inherited from NSObject
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitImageLabelingCommon.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKCommonImageLabelerOptions extends NSObject {
3 |
4 | static alloc(): MLKCommonImageLabelerOptions; // inherited from NSObject
5 |
6 | static new(): MLKCommonImageLabelerOptions; // inherited from NSObject
7 |
8 | confidenceThreshold: number;
9 | }
10 |
11 | declare class MLKImageLabel extends NSObject {
12 |
13 | static alloc(): MLKImageLabel; // inherited from NSObject
14 |
15 | static new(): MLKImageLabel; // inherited from NSObject
16 |
17 | readonly confidence: number;
18 |
19 | readonly index: number;
20 |
21 | readonly text: string;
22 | }
23 |
24 | declare class MLKImageLabeler extends NSObject {
25 |
26 | static alloc(): MLKImageLabeler; // inherited from NSObject
27 |
28 | static imageLabelerWithOptions(options: MLKCommonImageLabelerOptions): MLKImageLabeler;
29 |
30 | static new(): MLKImageLabeler; // inherited from NSObject
31 |
32 | processImageCompletion(image: MLKCompatibleImage, completion: (p1: NSArray, p2: NSError) => void): void;
33 |
34 | resultsInImageError(image: MLKCompatibleImage): NSArray;
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitObjectDetection.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare var MLKDetectedObjectLabelFashionGood: string;
3 |
4 | declare var MLKDetectedObjectLabelFood: string;
5 |
6 | declare var MLKDetectedObjectLabelHomeGood: string;
7 |
8 | declare var MLKDetectedObjectLabelIndexFashionGood: number;
9 |
10 | declare var MLKDetectedObjectLabelIndexFood: number;
11 |
12 | declare var MLKDetectedObjectLabelIndexHomeGood: number;
13 |
14 | declare var MLKDetectedObjectLabelIndexPlace: number;
15 |
16 | declare var MLKDetectedObjectLabelIndexPlant: number;
17 |
18 | declare var MLKDetectedObjectLabelPlace: string;
19 |
20 | declare var MLKDetectedObjectLabelPlant: string;
21 |
22 | declare class MLKObjectDetectorOptions extends MLKCommonObjectDetectorOptions {
23 |
24 | static alloc(): MLKObjectDetectorOptions; // inherited from NSObject
25 |
26 | static new(): MLKObjectDetectorOptions; // inherited from NSObject
27 | }
28 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitObjectDetectionCommon.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKCommonObjectDetectorOptions extends NSObject {
3 |
4 | static alloc(): MLKCommonObjectDetectorOptions; // inherited from NSObject
5 |
6 | static new(): MLKCommonObjectDetectorOptions; // inherited from NSObject
7 |
8 | detectorMode: number;
9 |
10 | shouldEnableClassification: boolean;
11 |
12 | shouldEnableMultipleObjects: boolean;
13 | }
14 |
15 | declare class MLKObject extends NSObject {
16 |
17 | static alloc(): MLKObject; // inherited from NSObject
18 |
19 | static new(): MLKObject; // inherited from NSObject
20 |
21 | readonly frame: CGRect;
22 |
23 | readonly labels: NSArray;
24 |
25 | readonly trackingID: number;
26 | }
27 |
28 | declare class MLKObjectDetector extends NSObject {
29 |
30 | static alloc(): MLKObjectDetector; // inherited from NSObject
31 |
32 | static new(): MLKObjectDetector; // inherited from NSObject
33 |
34 | static objectDetectorWithOptions(options: MLKCommonObjectDetectorOptions): MLKObjectDetector;
35 |
36 | processImageCompletion(image: MLKCompatibleImage, completion: (p1: NSArray, p2: NSError) => void): void;
37 |
38 | resultsInImageError(image: MLKCompatibleImage): NSArray;
39 | }
40 |
41 | declare var MLKObjectDetectorModeSingleImage: number;
42 |
43 | declare var MLKObjectDetectorModeStream: number;
44 |
45 | declare class MLKObjectLabel extends NSObject {
46 |
47 | static alloc(): MLKObjectLabel; // inherited from NSObject
48 |
49 | static new(): MLKObjectLabel; // inherited from NSObject
50 |
51 | readonly confidence: number;
52 |
53 | readonly index: number;
54 |
55 | readonly text: string;
56 | }
57 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitObjectDetectionCustom.d.ts:
--------------------------------------------------------------------------------
1 | declare class MLKCustomObjectDetectorOptions extends MLKCommonObjectDetectorOptions {
2 | static alloc(): MLKCustomObjectDetectorOptions; // inherited from NSObject
3 |
4 | static new(): MLKCustomObjectDetectorOptions; // inherited from NSObject
5 |
6 | classificationConfidenceThreshold: number;
7 |
8 | maxPerObjectLabelCount: number;
9 |
10 | constructor(o: { localModel: MLKLocalModel });
11 |
12 | constructor(o: { remoteModel: MLKCustomRemoteModel });
13 |
14 | initWithLocalModel(localModel: MLKLocalModel): this;
15 |
16 | initWithRemoteModel(remoteModel: MLKCustomRemoteModel): this;
17 | }
18 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitPoseDetection.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKPoseDetectorOptions extends MLKCommonPoseDetectorOptions {
3 |
4 | static alloc(): MLKPoseDetectorOptions; // inherited from NSObject
5 |
6 | static new(): MLKPoseDetectorOptions; // inherited from NSObject
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitPoseDetectionAccurate.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKAccuratePoseDetectorOptions extends MLKCommonPoseDetectorOptions {
3 |
4 | static alloc(): MLKAccuratePoseDetectorOptions; // inherited from NSObject
5 |
6 | static new(): MLKAccuratePoseDetectorOptions; // inherited from NSObject
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitSegmentationCommon.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKCommonSegmenterOptions extends NSObject {
3 |
4 | static alloc(): MLKCommonSegmenterOptions; // inherited from NSObject
5 |
6 | static new(): MLKCommonSegmenterOptions; // inherited from NSObject
7 |
8 | segmenterMode: number;
9 |
10 | shouldEnableRawSizeMask: boolean;
11 | }
12 |
13 | declare class MLKSegmentationMask extends NSObject {
14 |
15 | static alloc(): MLKSegmentationMask; // inherited from NSObject
16 |
17 | static new(): MLKSegmentationMask; // inherited from NSObject
18 |
19 | readonly buffer: any;
20 | }
21 |
22 | declare class MLKSegmenter extends NSObject {
23 |
24 | static alloc(): MLKSegmenter; // inherited from NSObject
25 |
26 | static new(): MLKSegmenter; // inherited from NSObject
27 |
28 | static segmenterWithOptions(options: MLKCommonSegmenterOptions): MLKSegmenter;
29 |
30 | processImageCompletion(image: MLKCompatibleImage, completion: (p1: MLKSegmentationMask, p2: NSError) => void): void;
31 |
32 | resultsInImageError(image: MLKCompatibleImage): MLKSegmentationMask;
33 | }
34 |
35 | declare var MLKSegmenterModeSingleImage: number;
36 |
37 | declare var MLKSegmenterModeStream: number;
38 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitSegmentationSelfie.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKSelfieSegmenterOptions extends MLKCommonSegmenterOptions {
3 |
4 | static alloc(): MLKSelfieSegmenterOptions; // inherited from NSObject
5 |
6 | static new(): MLKSelfieSegmenterOptions; // inherited from NSObject
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitTextRecognition.d.ts:
--------------------------------------------------------------------------------
1 |
2 | declare class MLKTextRecognizerOptions extends MLKCommonTextRecognizerOptions {
3 |
4 | static alloc(): MLKTextRecognizerOptions; // inherited from NSObject
5 |
6 | static new(): MLKTextRecognizerOptions; // inherited from NSObject
7 | }
8 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitTextRecognitionCommon.d.ts:
--------------------------------------------------------------------------------
1 | declare class MLKCommonTextRecognizerOptions extends NSObject {
2 | static alloc(): MLKCommonTextRecognizerOptions; // inherited from NSObject
3 |
4 | static new(): MLKCommonTextRecognizerOptions; // inherited from NSObject
5 | }
6 |
7 | declare class MLKText extends NSObject {
8 | static alloc(): MLKText; // inherited from NSObject
9 |
10 | static new(): MLKText; // inherited from NSObject
11 |
12 | readonly blocks: NSArray;
13 |
14 | readonly text: string;
15 | }
16 |
17 | declare class MLKTextBlock extends NSObject {
18 | static alloc(): MLKTextBlock; // inherited from NSObject
19 |
20 | static new(): MLKTextBlock; // inherited from NSObject
21 |
22 | readonly cornerPoints: NSArray;
23 |
24 | readonly frame: CGRect;
25 |
26 | readonly lines: NSArray;
27 |
28 | readonly recognizedLanguages: NSArray;
29 |
30 | readonly text: string;
31 | }
32 |
33 | declare class MLKTextElement extends NSObject {
34 | static alloc(): MLKTextElement; // inherited from NSObject
35 |
36 | static new(): MLKTextElement; // inherited from NSObject
37 |
38 | readonly cornerPoints: NSArray;
39 |
40 | readonly frame: CGRect;
41 |
42 | readonly recognizedLanguages: NSArray;
43 |
44 | readonly text: string;
45 | }
46 |
47 | declare class MLKTextLine extends NSObject {
48 | static alloc(): MLKTextLine; // inherited from NSObject
49 |
50 | static new(): MLKTextLine; // inherited from NSObject
51 |
52 | readonly cornerPoints: NSArray;
53 |
54 | readonly elements: NSArray;
55 |
56 | readonly frame: CGRect;
57 |
58 | readonly recognizedLanguages: NSArray;
59 |
60 | readonly text: string;
61 | }
62 |
63 | declare class MLKTextRecognizedLanguage extends NSObject {
64 | static alloc(): MLKTextRecognizedLanguage; // inherited from NSObject
65 |
66 | static new(): MLKTextRecognizedLanguage; // inherited from NSObject
67 |
68 | readonly languageCode: string;
69 | }
70 |
71 | declare class MLKTextRecognizer extends NSObject {
72 | static alloc(): MLKTextRecognizer; // inherited from NSObject
73 |
74 | static new(): MLKTextRecognizer; // inherited from NSObject
75 |
76 | static textRecognizer(): MLKTextRecognizer;
77 |
78 | static textRecognizerWithOptions(options: MLKCommonTextRecognizerOptions): MLKTextRecognizer;
79 |
80 | processImageCompletion(image: MLKCompatibleImage, completion: (p1: MLKText, p2: NSError) => void): void;
81 |
82 | resultsInImageError(image: MLKCompatibleImage): MLKText;
83 | }
84 |
--------------------------------------------------------------------------------
/packages/mlkit-core/typings/objc!MLKitVision.d.ts:
--------------------------------------------------------------------------------
1 |
2 | interface MLKCompatibleImage extends NSObjectProtocol {
3 | }
4 | declare var MLKCompatibleImage: {
5 |
6 | prototype: MLKCompatibleImage;
7 | };
8 |
9 | declare class MLKVision3DPoint extends MLKVisionPoint {
10 |
11 | static alloc(): MLKVision3DPoint; // inherited from NSObject
12 |
13 | static new(): MLKVision3DPoint; // inherited from NSObject
14 |
15 | readonly z: number;
16 | }
17 |
18 | declare class MLKVisionImage extends NSObject implements MLKCompatibleImage {
19 |
20 | static alloc(): MLKVisionImage; // inherited from NSObject
21 |
22 | static new(): MLKVisionImage; // inherited from NSObject
23 |
24 | orientation: UIImageOrientation;
25 |
26 | readonly debugDescription: string; // inherited from NSObjectProtocol
27 |
28 | readonly description: string; // inherited from NSObjectProtocol
29 |
30 | readonly hash: number; // inherited from NSObjectProtocol
31 |
32 | readonly isProxy: boolean; // inherited from NSObjectProtocol
33 |
34 | readonly superclass: typeof NSObject; // inherited from NSObjectProtocol
35 |
36 | readonly // inherited from NSObjectProtocol
37 |
38 | constructor(o: { buffer: any; });
39 |
40 | constructor(o: { image: UIImage; });
41 |
42 | class(): typeof NSObject;
43 |
44 | conformsToProtocol(aProtocol: any /* Protocol */): boolean;
45 |
46 | initWithBuffer(sampleBuffer: any): this;
47 |
48 | initWithImage(image: UIImage): this;
49 |
50 | isEqual(object: any): boolean;
51 |
52 | isKindOfClass(aClass: typeof NSObject): boolean;
53 |
54 | isMemberOfClass(aClass: typeof NSObject): boolean;
55 |
56 | performSelector(aSelector: string): any;
57 |
58 | performSelectorWithObject(aSelector: string, object: any): any;
59 |
60 | performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any;
61 |
62 | respondsToSelector(aSelector: string): boolean;
63 |
64 | retainCount(): number;
65 |
66 | self(): this;
67 | }
68 |
69 | declare class MLKVisionPoint extends NSObject {
70 |
71 | static alloc(): MLKVisionPoint; // inherited from NSObject
72 |
73 | static new(): MLKVisionPoint; // inherited from NSObject
74 |
75 | readonly x: number;
76 |
77 | readonly y: number;
78 | }
79 |
--------------------------------------------------------------------------------
/packages/mlkit-core/vue/index.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | install(Vue) {
3 | Vue.registerElement('MLKitView', () => require('../').MLKitView);
4 | },
5 | };
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - custom object detectors + fix related to automatic zooming on ios ([#71](https://github.com/NativeScript/mlkit/pull/71))
6 |
7 | ### ❤️ Thank You
8 |
9 | - cjohn001 @cjohn001
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-custom-object-detection
2 |
3 | ```javascript
4 | npm install @nativescript/mlkit-custom-object-detection
5 | ```
6 |
7 | ## Usage
8 |
9 | // TODO
10 |
11 | ## License
12 |
13 | Apache License Version 2.0
14 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/index.ts:
--------------------------------------------------------------------------------
1 | export interface ObjectLabeling {
2 | text?: string;
3 | confidence?: number;
4 | index?: number;
5 | }
6 |
7 | export interface Origin {
8 | x: number;
9 | y: number;
10 | }
11 |
12 | export interface Size {
13 | width: number;
14 | height: number;
15 | }
16 |
17 | export interface Bounds {
18 | origin: Origin;
19 | size: Size;
20 | }
21 |
22 | export interface ObjectResult {
23 | trackingId?: number;
24 | bounds: Bounds;
25 | labels: ObjectLabeling[];
26 | }
27 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-custom-object-detection",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Custom Object Detection module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "Christoph John",
26 | "email": "cjohn@my-nutri-diary.org"
27 | },
28 | "contributors": [
29 | {
30 | "name": "NativeScript",
31 | "email": "oss@nativescript.org"
32 | }
33 | ],
34 | "bugs": {
35 | "url": "https://github.com/NativeScript/mlkit/issues"
36 | },
37 | "license": "Apache-2.0",
38 | "homepage": "https://github.com/NativeScript/mlkit",
39 | "readmeFilename": "README.md",
40 | "bootstrapper": "@nativescript/plugin-seed"
41 | }
42 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'com.google.mlkit:object-detection-custom:17.0.2'
3 | }
4 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5'
2 | pod 'GoogleMLKit/ObjectDetectionCustom', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-custom-object-detection",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-custom-object-detection",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-custom-object-detection",
11 | "tsConfig": "packages/mlkit-custom-object-detection/tsconfig.json",
12 | "packageJson": "packages/mlkit-custom-object-detection/package.json",
13 | "main": "packages/mlkit-custom-object-detection/index.d.ts",
14 | "assets": [
15 | "packages/mlkit-custom-object-detection/*.md",
16 | "packages/mlkit-custom-object-detection/index.d.ts",
17 | "LICENSE",
18 | {
19 | "glob": "**/*",
20 | "input": "packages/mlkit-custom-object-detection/platforms/",
21 | "output": "./platforms/"
22 | }
23 | ],
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "projects": "dependencies"
28 | }
29 | ]
30 | }
31 | },
32 | "build.all": {
33 | "executor": "nx:run-commands",
34 | "options": {
35 | "commands": ["node tools/scripts/build-finish.ts mlkit-custom-object-detection"],
36 | "parallel": false
37 | },
38 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-custom-object-detection"],
39 | "dependsOn": [
40 | {
41 | "target": "build.all",
42 | "projects": "dependencies"
43 | },
44 | {
45 | "target": "build",
46 | "projects": "self"
47 | }
48 | ]
49 | },
50 | "focus": {
51 | "executor": "nx:run-commands",
52 | "options": {
53 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-custom-object-detection"],
54 | "parallel": false
55 | }
56 | },
57 | "lint": {
58 | "executor": "@nx/eslint:eslint",
59 | "options": {
60 | "lintFilePatterns": ["packages/mlkit-custom-object-detection/**/*.ts"]
61 | }
62 | }
63 | },
64 | "tags": []
65 | }
66 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/mlkit-custom-object-detection/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "**/*.test.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 |
7 | ### 🩹 Fixes
8 |
9 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
10 |
11 | ### ❤️ Thank You
12 |
13 | - Nathan Walker
14 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-digital-ink-recognition
2 |
3 | ```javascript
4 | npm install @nativescript/mlkit-digital-ink-recognition
5 | ```
6 |
7 | ## Usage
8 |
9 | See [@nativescript/mlkit-core](/packages/mlkit-core/README.md) Usage
10 | ## License
11 |
12 | Apache License Version 2.0
13 |
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/packages/mlkit-digital-ink-recognition/index.ts
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-digital-ink-recognition",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Digital Ink Recognition module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 |
2 | // todo implement
3 | /*dependencies {
4 | implementation 'io.github.triniwiz:digitalInkRecognition:1.0.0-alpha0'
5 | }*/
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/DigitalInkRecognition', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-digital-ink-recognition",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-digital-ink-recognition",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-digital-ink-recognition",
11 | "tsConfig": "packages/mlkit-digital-ink-recognition/tsconfig.json",
12 | "packageJson": "packages/mlkit-digital-ink-recognition/package.json",
13 | "main": "packages/mlkit-digital-ink-recognition/index.ts",
14 | "assets": [
15 | "packages/mlkit-digital-ink-recognition/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-digital-ink-recognition/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-digital-ink-recognition"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-digital-ink-recognition"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build",
45 | "projects": "self"
46 | }
47 | ]
48 | },
49 | "focus": {
50 | "executor": "nx:run-commands",
51 | "options": {
52 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-digital-ink-recognition"],
53 | "parallel": false
54 | }
55 | },
56 | "lint": {
57 | "executor": "@nx/eslint:lint"
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-digital-ink-recognition/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-face-detection
2 |
3 | A plugin that is used with [@nativescript/mlkit-core](../mlkit-core/) to enable face detection and provide the [FaceResult](#faceresult) type for the data of the face detection event.
4 |
5 | ## Contents
6 | * [Installation](#installation)
7 | * [Use @nativescript/mlkit-face-detection](#use-nativescriptmlkit-face-detection)
8 | * [API](#api)
9 | * [FaceResult](#faceresult)
10 | * [License](#license)
11 |
12 | ## Installation
13 | Install `@nativescript/mlkit-face-detection` by running the following command:
14 |
15 | ```cli
16 | npm install @nativescript/mlkit-face-detection
17 | ```
18 |
19 | ## Use @nativescript/mlkit-face-detection
20 |
21 | For more details, read [use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [@nativescript/mlkit-core](../mlkit-core#face-detection)
22 |
23 | ## API
24 |
25 | ### FaceResult
26 |
27 | The Face Detection event data type.
28 |
29 | ```ts
30 | interface FaceResult {
31 | smilingProbability: number;
32 | leftEyeOpenProbability: number;
33 | rightEyeOpenProbability: number;
34 | trackingId: number;
35 | bounds: Bounds;
36 | headEulerAngleZ: number;
37 | headEulerAngleY: number;
38 | headEulerAngleX: number;
39 | }
40 | ```
41 |
42 | #### Bounds
43 | ```ts
44 | interface Bounds {
45 | origin: Origin;
46 | size: Size;
47 | }
48 | ```
49 | #### Origin
50 | ```ts
51 | interface Origin {
52 | x: number;
53 | y: number;
54 | }
55 | ```
56 | #### Size
57 | ```ts
58 | interface Size {
59 | width: number;
60 | height: number;
61 | }
62 | ```
63 |
64 | ## License
65 |
66 | Apache License Version 2.0
67 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/index.ts:
--------------------------------------------------------------------------------
1 | export interface Origin {
2 | x: number;
3 | y: number;
4 | }
5 |
6 | export interface Size {
7 | width: number;
8 | height: number;
9 | }
10 |
11 | export interface Bounds {
12 | origin: Origin;
13 | size: Size;
14 | }
15 |
16 | export interface FaceResult {
17 | smilingProbability: number;
18 | leftEyeOpenProbability: number;
19 | rightEyeOpenProbability: number;
20 | trackingId: number;
21 | bounds: Bounds;
22 | headEulerAngleZ: number;
23 | headEulerAngleY: number;
24 | headEulerAngleX: number;
25 | }
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-face-detection",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Face Detection module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:face-detection:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:face-detection:16.1.6'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/FaceDetection', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-face-detection",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-face-detection",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-face-detection",
11 | "tsConfig": "packages/mlkit-face-detection/tsconfig.json",
12 | "packageJson": "packages/mlkit-face-detection/package.json",
13 | "main": "packages/mlkit-face-detection/index.ts",
14 | "assets": [
15 | "packages/mlkit-face-detection/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-face-detection/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-face-detection"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-face-detection"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-face-detection"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-face-detection/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-image-labeling
2 |
3 | A plugin that is used with [@nativescript/mlkit-core](../mlkit-core/) to enable Image Labeling and provide the [ImageLabelingResult](#imagelabelingresult) type for the image labeling event data.
4 |
5 | ## Contents
6 | * [Installation](#installation)
7 | * [Use @nativescript/mlkit-image-labeling](#use-nativescriptmlkit-image-labeling)
8 | * [API](#api)
9 | * [ImageLabelingResult](#imagelabelingresult)
10 | * [License](#license)
11 |
12 | ## Installation
13 |
14 | ```cli
15 | npm install @nativescript/mlkit-image-labeling
16 | ```
17 |
18 | ## Use @nativescript/mlkit-image-labeling
19 |
20 | For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Image Labeling](../mlkit-core#image-labeling)
21 |
22 | ## API
23 |
24 | ### ImageLabelingResult
25 |
26 | The Image Labeling event data type.
27 |
28 | ```ts
29 | interface ImageLabelingResult {
30 | text?: string
31 | confidence?: number;
32 | index?: number;
33 | }
34 | ```
35 | ## License
36 |
37 | Apache License Version 2.0
38 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/index.ts:
--------------------------------------------------------------------------------
1 | export interface ImageLabelingResult {
2 | text?: string
3 | confidence?: number;
4 | index?: number;
5 | }
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-image-labeling",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Image Labeling module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:image-labeling:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:image-labeling:17.0.8'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/ImageLabeling', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-image-labeling",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-image-labeling",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-image-labeling",
11 | "tsConfig": "packages/mlkit-image-labeling/tsconfig.json",
12 | "packageJson": "packages/mlkit-image-labeling/package.json",
13 | "main": "packages/mlkit-image-labeling/index.ts",
14 | "assets": [
15 | "packages/mlkit-image-labeling/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-image-labeling/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-image-labeling"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-image-labeling"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-image-labeling"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-image-labeling/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-object-detection
2 |
3 | A plugin that is used with [@nativescript/mlkit-core](../mlkit-core/) to enable Object Detection and provide the [ObjectResult](#objectresult) type for the object detection event data.
4 |
5 | ## Contents
6 | * [Installation](#installation)
7 | * [Use @nativescript/mlkit-object-detection](#use-nativescriptmlkit-object-detection)
8 | * [ObjectResult](#objectresult)
9 | * [API](#api)
10 | * [ObjectResult]
11 |
12 | ## Installation
13 |
14 | Install `@nativescript/mlkit-object-detection` by running the following command:
15 |
16 | ```cli
17 | npm install @nativescript/mlkit-object-detection
18 | ```
19 |
20 | ## Use @nativescript/mlkit-object-detection
21 |
22 | For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Object Detection](../mlkit-core#object-detection).
23 |
24 | ## API
25 |
26 | ### ObjectResult
27 |
28 | The type of object detection event data.
29 |
30 | ```ts
31 | interface ObjectResult {
32 | trackingId?: number
33 | bounds: Bounds
34 | labels: ObjectLabeling[]
35 | }
36 | ```
37 | #### ObjectLabeling
38 |
39 | ```ts
40 | interface ObjectLabeling {
41 | text?: string
42 | confidence?: number
43 | index?: number
44 | }
45 | ```
46 | #### Bounds
47 |
48 | ```ts
49 | interface Bounds {
50 | origin: Origin;
51 | size: Size;
52 | }
53 | ```
54 | #### Origin
55 |
56 | ```ts
57 | export interface Origin {
58 | x: number;
59 | y: number;
60 | }
61 | ```
62 | #### Size
63 |
64 | ```ts
65 | interface Size {
66 | width: number;
67 | height: number;
68 | }
69 | ```
70 |
71 | ## License
72 |
73 | Apache License Version 2.0
74 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/index.ts:
--------------------------------------------------------------------------------
1 | export interface ObjectLabeling {
2 | text?: string
3 | confidence?: number
4 | index?: number
5 | }
6 |
7 |
8 | export interface Origin {
9 | x: number;
10 | y: number;
11 | }
12 |
13 | export interface Size {
14 | width: number;
15 | height: number;
16 | }
17 |
18 | export interface Bounds {
19 | origin: Origin;
20 | size: Size;
21 | }
22 |
23 |
24 | export interface ObjectResult {
25 | trackingId?: number
26 | bounds: Bounds
27 | labels: ObjectLabeling[]
28 | }
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-object-detection",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Object Detection module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:object-detection:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:object-detection:17.0.1'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/ObjectDetection', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-object-detection",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-object-detection",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-object-detection",
11 | "tsConfig": "packages/mlkit-object-detection/tsconfig.json",
12 | "packageJson": "packages/mlkit-object-detection/package.json",
13 | "main": "packages/mlkit-object-detection/index.ts",
14 | "assets": [
15 | "packages/mlkit-object-detection/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-object-detection/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-object-detection"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-object-detection"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-object-detection"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-object-detection/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-pose-detection
2 |
3 | A plugin that is used with [@nativescript/mlkit-core](../mlkit-core/) to enable Pose Detection and provide the [PoseResult](#poseresult) type for the Pose Detection event data.
4 |
5 | ## Contents
6 | * [Installation](#installation)
7 | * [Use @nativescript/mlkit-pose-detection](#use-nativescriptmlkit-pose-detection)
8 | * [API](#api)
9 | * [PoseResult](#poseresult)
10 | * [License](#license)
11 |
12 | ## Installation
13 | Install `@nativescript/mlkit-pose-detection` by running the following command:
14 |
15 | ```cli
16 | npm install @nativescript/mlkit-pose-detection
17 | ```
18 |
19 | ## Use @nativescript/mlkit-pose-detection
20 |
21 | For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Pose Detection](../mlkit-core#pose-detection).
22 |
23 | ## API
24 |
25 | ### PoseResult
26 | The Pose Detection event data type.
27 |
28 | ```ts
29 | interface PoseResult {
30 | landmarks: [PoseLandMark]
31 | }
32 | ```
33 | ### PoseLandMark
34 | ```ts
35 | interface PoseLandMark {
36 | inFrameLikelihood: number
37 | position: PoseLandMarkPosition
38 | type?: PoseType
39 | }
40 | ```
41 | ### PoseLandMarkPosition
42 | ```ts
43 | interface PoseLandMarkPosition {
44 | x: number
45 | y: number
46 | z: number
47 | }
48 | ```
49 | ### PoseType
50 | ```ts
51 | enum PoseType {
52 | LeftAnkle = "leftAnkle",
53 | LeftEar = "leftEar",
54 | LeftElbow = "leftElbow",
55 | LeftEye = "leftEye",
56 | LeftEyeInner = "leftEyeInner",
57 | LeftEyeOuter = "leftEyeOuter",
58 | LeftHeel = "leftHeel",
59 | LeftHip = "leftHip",
60 | LeftIndexFinger = "leftIndex",
61 | LeftKnee = "leftKnee",
62 | LeftPinkyFinger = "leftPinky",
63 | LeftShoulder = "leftShoulder",
64 | LeftThumb = "leftThumb",
65 | LeftToe = "leftToe",
66 | LeftWrist = "leftWrist",
67 | MouthLeft = "mouthLeft",
68 | MouthRight = "mouthRight",
69 | Nose = "nose",
70 | RightAnkle = "rightAnkle",
71 | RightEar = "rightEar",
72 | RightElbow = "rightElbow",
73 | RightEye = "rightEye",
74 | RightEyeInner = "rightEyeInner",
75 | RightEyeOuter = "rightEyeOuter",
76 | RightHeel = "rightHeel",
77 | RightHip = "rightHip",
78 | RightIndexFinger = "rightIndex",
79 | RightKnee = "rightKnee",
80 | RightPinkyFinger = "rightPinky",
81 | RightShoulder = "rightShoulder",
82 | RightThumb = "rightThumb",
83 | RightToe = "rightToe",
84 | RightWrist = "rightWrist",
85 | Unknown = "unknown"
86 | }
87 | ```
88 |
89 | ## License
90 |
91 | Apache License Version 2.0
92 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/index.ts:
--------------------------------------------------------------------------------
1 | export enum PoseType {
2 | LeftAnkle = "leftAnkle",
3 | LeftEar = "leftEar",
4 | LeftElbow = "leftElbow",
5 | LeftEye = "leftEye",
6 | LeftEyeInner = "leftEyeInner",
7 | LeftEyeOuter = "leftEyeOuter",
8 | LeftHeel = "leftHeel",
9 | LeftHip = "leftHip",
10 | LeftIndexFinger = "leftIndex",
11 | LeftKnee = "leftKnee",
12 | LeftPinkyFinger = "leftPinky",
13 | LeftShoulder = "leftShoulder",
14 | LeftThumb = "leftThumb",
15 | LeftToe = "leftToe",
16 | LeftWrist = "leftWrist",
17 | MouthLeft = "mouthLeft",
18 | MouthRight = "mouthRight",
19 | Nose = "nose",
20 | RightAnkle = "rightAnkle",
21 | RightEar = "rightEar",
22 | RightElbow = "rightElbow",
23 | RightEye = "rightEye",
24 | RightEyeInner = "rightEyeInner",
25 | RightEyeOuter = "rightEyeOuter",
26 | RightHeel = "rightHeel",
27 | RightHip = "rightHip",
28 | RightIndexFinger = "rightIndex",
29 | RightKnee = "rightKnee",
30 | RightPinkyFinger = "rightPinky",
31 | RightShoulder = "rightShoulder",
32 | RightThumb = "rightThumb",
33 | RightToe = "rightToe",
34 | RightWrist = "rightWrist",
35 | Unknown = "unknown"
36 | }
37 |
38 | export interface PoseLandMarkPosition {
39 | x: number
40 | y: number
41 | z: number
42 | }
43 |
44 | export interface PoseLandMark {
45 | inFrameLikelihood: number
46 | position: PoseLandMarkPosition
47 | type?: PoseType
48 | }
49 |
50 | export interface PoseResult {
51 | landmarks: [PoseLandMark]
52 | }
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-pose-detection",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Pose Detection module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:pose-detection:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:pose-detection:18.0.0-beta4'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 |
3 | if defined?($NSMLKitPoseDetectionAccurate)
4 | pod 'GoogleMLKit/PoseDetectionAccurate', '7.0.0'
5 | else
6 | pod 'GoogleMLKit/PoseDetection', '7.0.0'
7 | end
8 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-pose-detection",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-pose-detection",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-pose-detection",
11 | "tsConfig": "packages/mlkit-pose-detection/tsconfig.json",
12 | "packageJson": "packages/mlkit-pose-detection/package.json",
13 | "main": "packages/mlkit-pose-detection/index.ts",
14 | "assets": [
15 | "packages/mlkit-pose-detection/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-pose-detection/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-pose-detection"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-pose-detection"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-pose-detection"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-pose-detection/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 |
16 | ### ❤️ Thank You
17 |
18 | - Nathan Walker
19 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-selfie-segmentation
2 |
3 | ```javascript
4 | npm install @nativescript/mlkit-selfie-segmentation
5 | ```
6 |
7 | ## Usage
8 |
9 | See [@nativescript/mlkit-core](/packages/mlkit-core/README.md) Usage
10 | ## License
11 |
12 | Apache License Version 2.0
13 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/index.ts:
--------------------------------------------------------------------------------
1 | export interface SelfieResult {
2 | buffer: ArrayBuffer
3 | width: number
4 | height: number
5 | }
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-selfie-segmentation",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Self Segmentation module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/plugins.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/plugins/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/plugins",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:selfie-segmentation:4.0.0-alpha.13'
3 | implementation 'com.google.mlkit:segmentation-selfie:16.0.0-beta5'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/SegmentationSelfie', '7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-selfie-segmentation",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-selfie-segmentation",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-selfie-segmentation",
11 | "tsConfig": "packages/mlkit-selfie-segmentation/tsconfig.json",
12 | "packageJson": "packages/mlkit-selfie-segmentation/package.json",
13 | "main": "packages/mlkit-selfie-segmentation/index.ts",
14 | "assets": [
15 | "packages/mlkit-selfie-segmentation/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-selfie-segmentation/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-selfie-segmentation"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-selfie-segmentation"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-selfie-segmentation"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-selfie-segmentation/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 3.0.0 (2025-01-29)
2 |
3 | ### 🚀 Features
4 |
5 | - iOS SDK 5+ and Android SDK updates ([#63](https://github.com/NativeScript/mlkit/pull/63))
6 | - **core:** allow aspectRatio configuration ([10fea40](https://github.com/NativeScript/mlkit/commit/10fea40))
7 | - allow retrieval of last processed image ([f98e08d](https://github.com/NativeScript/mlkit/commit/f98e08d))
8 | - still image detection, pause & torch ([c7ee498](https://github.com/NativeScript/mlkit/commit/c7ee498))
9 |
10 | ### 🩹 Fixes
11 |
12 | - unify camera permission handling, detection background handling, detection sig, support processEveryNthFrame, onTorch handling ([98c2ebc](https://github.com/NativeScript/mlkit/commit/98c2ebc))
13 | - detection, torch & pause ([31d601d](https://github.com/NativeScript/mlkit/commit/31d601d))
14 | - android barcode detection, formats, ios detection & torch ([353ede1](https://github.com/NativeScript/mlkit/commit/353ede1))
15 | - detection event ([16642aa](https://github.com/NativeScript/mlkit/commit/16642aa))
16 |
17 | ### ❤️ Thank You
18 |
19 | - Nathan Walker
20 | - Osei Fortune @triniwiz
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/README.md:
--------------------------------------------------------------------------------
1 | # @nativescript/mlkit-text-recognition
2 |
3 | A plugin used with [@nativescript/mlkit-core](../mlkit-core) to enable Text Recognition in your app and provide [TextResult](#textresult) type for the text recognition event data.
4 |
5 | ## Contents
6 | * [Installation](#installation)
7 | * [Use @nativescript/mlkit-text-recognition](#use-nativescriptmlkit-text-recognition)
8 | * [API](#api)
9 | * [TextResult](#textresult)
10 | * [License](#license)
11 |
12 | ## Installation
13 |
14 | ```cli
15 | npm install @nativescript/mlkit-text-recognition
16 | ```
17 |
18 | ## Use @nativescript/mlkit-text-recognition
19 |
20 | For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Text Recognition](../mlkit-core#text-recognition).
21 |
22 | ## API
23 |
24 | ### TextResult
25 |
26 | The Text Recognition event data type.
27 |
28 | ```ts
29 | interface TextResult {
30 | text?: string
31 | bounds: Bounds
32 | lines: TextLine[]
33 | points: Point[]
34 | }
35 | ```
36 | ---
37 | #### Point
38 |
39 | ```ts
40 | interface Point {
41 | x: number;
42 | y: number;
43 | }
44 | ```
45 | ---
46 | #### Bounds
47 | ```ts
48 | interface Bounds {
49 | origin: Origin;
50 | size: Size;
51 | }
52 | ```
53 | #### Origin
54 | ```ts
55 | interface Origin {
56 | x: number;
57 | y: number;
58 | }
59 | ```
60 |
61 | #### Size
62 | ```ts
63 | interface Size {
64 | width: number;
65 | height: number;
66 | }
67 | ```
68 | ---
69 | #### TextLine
70 | ```ts
71 | interface TextLine {
72 | text?: string
73 | bounds: Bounds
74 | elements: TextElement[]
75 | points?: Point[]
76 | }
77 | ```
78 | #### TextElement
79 | ```ts
80 | interface TextElement {
81 | text?: string
82 | bounds: Bounds
83 | }
84 | ```
85 | ---
86 | ## License
87 |
88 | Apache License Version 2.0
89 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/index.ts:
--------------------------------------------------------------------------------
1 | export interface Point {
2 | x: number;
3 | y: number;
4 | }
5 |
6 |
7 | export interface Origin {
8 | x: number;
9 | y: number;
10 | }
11 |
12 | export interface Size {
13 | width: number;
14 | height: number;
15 | }
16 |
17 | export interface Bounds {
18 | origin: Origin;
19 | size: Size;
20 | }
21 |
22 |
23 | export interface TextElement {
24 | text?: string
25 | bounds: Bounds
26 | }
27 |
28 | export interface TextLine {
29 | text?: string
30 | bounds: Bounds
31 | elements: TextElement[]
32 | points?: Point[]
33 | }
34 |
35 |
36 | export interface TextResult {
37 | text?: string
38 | bounds: Bounds
39 | lines: TextLine[]
40 | points: Point[]
41 | }
42 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript/mlkit-text-recognition",
3 | "version": "3.0.0",
4 | "description": "NativeScript MLKit Text Recognition module",
5 | "main": "index",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "ios": "6.0.0",
10 | "android": "6.0.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/NativeScript/mlkit.git"
16 | },
17 | "keywords": [
18 | "NativeScript",
19 | "JavaScript",
20 | "TypeScript",
21 | "iOS",
22 | "Android"
23 | ],
24 | "author": {
25 | "name": "NativeScript",
26 | "email": "oss@nativescript.org"
27 | },
28 | "bugs": {
29 | "url": "https://github.com/NativeScript/mlkit/issues"
30 | },
31 | "license": "Apache-2.0",
32 | "homepage": "https://github.com/NativeScript/mlkit",
33 | "readmeFilename": "README.md",
34 | "bootstrapper": "@nativescript/plugin-seed"
35 | }
36 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/platforms/android/include.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | implementation 'io.github.triniwiz:text-recognition:4.0.0-alpha.13'
3 | implementation 'com.google.android.gms:play-services-mlkit-text-recognition:19.0.0'
4 | }
5 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '15.5.0'
2 | pod 'GoogleMLKit/TextRecognition','7.0.0'
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mlkit-text-recognition",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/mlkit-text-recognition",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "options": {
10 | "outputPath": "dist/packages/mlkit-text-recognition",
11 | "tsConfig": "packages/mlkit-text-recognition/tsconfig.json",
12 | "packageJson": "packages/mlkit-text-recognition/package.json",
13 | "main": "packages/mlkit-text-recognition/index.ts",
14 | "assets": [
15 | "packages/mlkit-text-recognition/*.md",
16 | "LICENSE",
17 | {
18 | "glob": "**/*",
19 | "input": "packages/mlkit-text-recognition/platforms/",
20 | "output": "./platforms/"
21 | }
22 | ]
23 | },
24 | "dependsOn": [
25 | {
26 | "target": "build.all",
27 | "dependencies": true
28 | }
29 | ]
30 | },
31 | "build.all": {
32 | "executor": "nx:run-commands",
33 | "options": {
34 | "commands": ["node tools/scripts/build-finish.ts mlkit-text-recognition"],
35 | "parallel": false
36 | },
37 | "outputs": ["{workspaceRoot}/dist/packages/mlkit-text-recognition"],
38 | "dependsOn": [
39 | {
40 | "target": "build.all",
41 | "dependencies": true
42 | },
43 | {
44 | "target": "build"
45 | }
46 | ]
47 | },
48 | "focus": {
49 | "executor": "nx:run-commands",
50 | "options": {
51 | "commands": ["nx g @nativescript/plugin-tools:focus-packages mlkit-text-recognition"],
52 | "parallel": false
53 | }
54 | },
55 | "lint": {
56 | "executor": "@nx/eslint:lint"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/packages/mlkit-text-recognition/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "rootDir": "."
6 | },
7 | "exclude": ["**/*.spec.ts", "angular"],
8 | "include": ["**/*.ts", "references.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | compileSdkVersion 34
10 | buildToolsVersion "34.0.0"
11 | ndkVersion "22.1.7171670"
12 | defaultConfig {
13 | minSdkVersion 21
14 | targetSdkVersion 34
15 | generatedDensities = []
16 | }
17 | aaptOptions {
18 | additionalParameters "--no-version-vectors"
19 | noCompress "tflite"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
26 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-AspectFill@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-Center@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | ITSAppUsesNonExemptEncryption
47 |
48 | NSAppTransportSecurity
49 |
50 | NSAllowsArbitraryLoads
51 |
52 | NSAllowsArbitraryLoadsForMedia
53 |
54 | NSAllowsArbitraryLoadsInWebContent
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/Podfile:
--------------------------------------------------------------------------------
1 |
2 | platform :ios, '15.5.0'
3 |
4 | post_install do |installer|
5 | installer.pods_project.targets.each do |target|
6 | target.build_configurations.each do |config|
7 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5.0'
8 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
9 | end
10 | end
11 | end
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | IPHONEOS_DEPLOYMENT_TARGET = 15.5
8 |
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/icon.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/icon@2x.png
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/imagenet.tflite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/imagenet.tflite
--------------------------------------------------------------------------------
/tools/assets/App_Resources/iOS/imagenet_large.tflite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/assets/App_Resources/iOS/imagenet_large.tflite
--------------------------------------------------------------------------------
/tools/assets/README.md:
--------------------------------------------------------------------------------
1 | Assets shared across multiple targets in the workspace to reduce filesize of the repo as well as reduce maintenance costs of duplicate assets.
2 |
3 | * `App_Resources`: All `e2e` app harnesses share the same App_Resources from here.
--------------------------------------------------------------------------------
/tools/assets/publishing/.npmignore:
--------------------------------------------------------------------------------
1 | __ivy_ngcc__
2 | *.__ivy_ngcc_bak
3 | *.tgz
--------------------------------------------------------------------------------
/tools/demo/index.ts:
--------------------------------------------------------------------------------
1 | export * from './utils';
2 | export * from './mlkit-barcode-scanning';
3 | export * from './mlkit-core';
4 | export * from './mlkit-custom-object-detection';
5 | export * from './mlkit-digital-ink-recognition';
6 | export * from './mlkit-face-detection';
7 | export * from './mlkit-image-labeling';
8 | export * from './mlkit-object-detection';
9 | export * from './mlkit-pose-detection';
10 | export * from './mlkit-selfie-segmentation';
11 | export * from './mlkit-text-recognition';
12 |
--------------------------------------------------------------------------------
/tools/demo/mlkit-barcode-scanning/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitBarcodeScanning extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-barcode-scanning!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-core/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitCore extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-core!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-custom-object-detection/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 | import {} from '@nativescript/mlkit-custom-object-detection';
3 |
4 | export class DemoSharedMlkitCustomObjectDetection extends DemoSharedBase {
5 | testIt() {
6 | console.log('test mlkit-custom-object-detection!');
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tools/demo/mlkit-digital-ink-recognition/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitDigitalInkRecognition extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-digital-ink-recognition!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-face-detection/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitFaceDetection extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-face-detection!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-image-labeling/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitImageLabeling extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-image-labeling!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-object-detection/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitObjectDetection extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-object-detection!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-pose-detection/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitPoseDetection extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-pose-detection!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-selfie-segmentation/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitSelfieSegmentation extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-selfie-segmentation!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/mlkit-text-recognition/index.ts:
--------------------------------------------------------------------------------
1 | import { DemoSharedBase } from '../utils';
2 |
3 | export class DemoSharedMlkitTextRecognition extends DemoSharedBase {
4 |
5 | testIt() {
6 | console.log('test mlkit-text-recognition!');
7 | }
8 | }
--------------------------------------------------------------------------------
/tools/demo/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/tools/demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "@nativescript/*": ["../../packages/*"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tools/demo/utils/demo-base.ts:
--------------------------------------------------------------------------------
1 | import { Observable } from '@nativescript/core';
2 |
3 | export class DemoSharedBase extends Observable {
4 | // in case you want to globally control how your shared demo code works across whole workspace
5 | }
6 |
--------------------------------------------------------------------------------
/tools/demo/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from './demo-base';
2 |
--------------------------------------------------------------------------------
/tools/images/00859323005830.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/images/00859323005830.png
--------------------------------------------------------------------------------
/tools/package-settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nativescript",
3 | "repository": {
4 | "type": "git",
5 | "url": "https://github.com/NativeScript/mlkit.git"
6 | },
7 | "keywords": ["NativeScript", "JavaScript", "TypeScript", "iOS", "Android"],
8 | "author": {
9 | "name": "NativeScript",
10 | "email": "oss@nativescript.org"
11 | },
12 | "bugs": {
13 | "url": "https://github.com/NativeScript/mlkit/issues"
14 | },
15 | "license": "Apache-2.0",
16 | "homepage": "https://github.com/NativeScript/mlkit"
17 | }
18 |
--------------------------------------------------------------------------------
/tools/schematics/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/mlkit/2447dc2ba56ca0009b2e132150744246655aa336/tools/schematics/.gitkeep
--------------------------------------------------------------------------------
/tools/scripts/build-finish.ts:
--------------------------------------------------------------------------------
1 | const ngPackage = require('ng-packagr');
2 | const path = require('path');
3 | const fs = require('fs-extra');
4 |
5 | const rootDir = path.resolve(path.join(__dirname, '..', '..'));
6 | const nxConfigPath = path.resolve(path.join(rootDir, 'nx.json'));
7 | const nxConfig = JSON.parse(fs.readFileSync(nxConfigPath));
8 | const npmScope = nxConfig.npmScope;
9 |
10 | const cmdArgs = process.argv.slice(2);
11 | const packageName = cmdArgs[0];
12 | const publish = cmdArgs[1] === 'publish';
13 |
14 | const packagePath = path.join('packages', packageName, 'package.json');
15 | const packageJson = JSON.parse(fs.readFileSync(packagePath));
16 | const npmPackageName = packageJson.name;
17 | console.log(`Building ${npmPackageName}...${publish ? 'and publishing.' : ''}`);
18 |
19 | // build angular package
20 | function buildAngular() {
21 | ngPackage
22 | .ngPackagr()
23 | .forProject(path.join('packages', packageName, 'angular', 'ng-package.json'))
24 | .withTsConfig(path.join('packages', packageName, 'angular', 'tsconfig.angular.json'))
25 | .build()
26 | .then(() => {
27 | console.log(`${npmPackageName} angular built successfully.`);
28 | finishPreparation();
29 | })
30 | .catch((error) => {
31 | console.error(error);
32 | process.exit(1);
33 | });
34 | }
35 |
36 | // copy angular ng-packagr output to dist/packages/{name}
37 | function copyAngularDist() {
38 | fs.copy(path.join('packages', packageName, 'angular', 'dist'), path.join('dist', 'packages', packageName, 'angular'))
39 | .then(() => {
40 | console.log(`${npmPackageName} angular built successfully.`);
41 | // buildNativeSrc();
42 | finishPreparation();
43 | })
44 | .catch((err) => console.error(err));
45 | }
46 |
47 | function finishPreparation() {
48 | fs.copy(path.join('tools', 'assets', 'publishing'), path.join('dist', 'packages', packageName))
49 | .then(() => console.log(`${npmPackageName} ready to publish.`))
50 | .catch((err) => console.error(err));
51 | }
52 |
53 | if (fs.existsSync(path.join(rootDir, 'packages', packageName, 'angular'))) {
54 | // package has angular specific src, build it first
55 | buildAngular();
56 | } else {
57 | finishPreparation();
58 | }
59 |
--------------------------------------------------------------------------------
/tools/tsconfig.tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc/tools",
5 | "rootDir": ".",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": ["node"]
9 | },
10 | "include": ["**/*.ts"],
11 | "exclude": [
12 | "demo"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": ".",
4 | "sourceMap": true,
5 | "declaration": true,
6 | "moduleResolution": "node",
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "noEmitHelpers": false,
10 | "target": "ES2020",
11 | "module": "ESNext",
12 | "lib": ["ESNext", "dom"],
13 | "skipLibCheck": true,
14 | "skipDefaultLibCheck": true,
15 | "baseUrl": ".",
16 | "plugins": [
17 | {
18 | "transform": "@nativescript/webpack/dist/transformers/NativeClass",
19 | "type": "raw"
20 | }
21 | ],
22 | "paths": {
23 | "@demo/shared": ["tools/demo/index.ts"],
24 | "@nativescript/*": ["packages/*"],
25 | "@nativescript/mlkit-barcode-scanning": ["packages/mlkit-barcode-scanning/index.ts"],
26 | "@nativescript/mlkit-core": ["packages/mlkit-core/index.d.ts"],
27 | "@nativescript/mlkit-core/angular": ["packages/mlkit-core/angular/index.ts"],
28 | "@nativescript/mlkit-custom-object-detection": ["packages/mlkit-custom-object-detection/index.d.ts"],
29 | "@nativescript/mlkit-digital-ink-recognition": ["packages/mlkit-digital-ink-recognition/index.ts"],
30 | "@nativescript/mlkit-face-detection": ["packages/mlkit-face-detection/index.ts"],
31 | "@nativescript/mlkit-image-labeling": ["packages/mlkit-image-labeling/index.ts"],
32 | "@nativescript/mlkit-object-detection": ["packages/mlkit-object-detection/index.ts"],
33 | "@nativescript/mlkit-pose-detection": ["packages/mlkit-pose-detection/index.ts"],
34 | "@nativescript/mlkit-selfie-segmentation": ["packages/mlkit-selfie-segmentation/index.ts"],
35 | "@nativescript/mlkit-text-recognition": ["packages/mlkit-text-recognition/index.ts"]
36 | }
37 | },
38 | "exclude": ["node_modules", "tmp"]
39 | }
40 |
--------------------------------------------------------------------------------