Skip to content

Commit 5374cdf

Browse files
authored
Merge pull request #41 from Ombuweb/readme/mlkit-object-detection
chore(mlkit-object-detection): README update
2 parents 6501ad0 + de0489d commit 5374cdf

File tree

1 file changed

+64
-3
lines changed

1 file changed

+64
-3
lines changed
Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,73 @@
11
# @nativescript/mlkit-object-detection
22

3-
```javascript
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
417
npm install @nativescript/mlkit-object-detection
518
```
619

7-
## Usage
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+
```
870

9-
See [@nativescript/mlkit-core](/packages/mlkit-core/README.md) Usage
1071
## License
1172

1273
Apache License Version 2.0

0 commit comments

Comments
 (0)