forked from handtracking-io/yoha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
b-3-n
committed
Sep 29, 2021
0 parents
commit 0153739
Showing
84 changed files
with
11,271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MIT licensed handtracking. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) | ||
|
||
## yoha package | ||
|
||
## Functions | ||
|
||
| Function | Description | | ||
| --- | --- | | ||
| [Load(sdkUrl)](./yoha.load.md) | Fetches the JavaScript component of the hand tracking API. | | ||
|
||
## Interfaces | ||
|
||
| Interface | Description | | ||
| --- | --- | | ||
| [IEngine](./yoha.iengine.md) | Hand tracking engine. | | ||
| [IEngineConfig](./yoha.iengineconfig.md) | Engine configuration. | | ||
| [IHandLostEvent](./yoha.ihandlostevent.md) | Event emitted by the engine if a hand was previously detected but is not recognized anymore. | | ||
| [IHandTrackingApi](./yoha.ihandtrackingapi.md) | Top level API returned by the loading script. | | ||
| [ILatencyEvent](./yoha.ilatencyevent.md) | Event that informs about the time it took to analyze one frame. | | ||
| [IPoses](./yoha.iposes.md) | The detected hand poses. | | ||
| [IResultEvent](./yoha.iresultevent.md) | Event that is emitted by the engine to report the hand tracking results. | | ||
| [ISetUpCameraTrackSourceResult](./yoha.isetupcameratracksourceresult.md) | The result of a call to [IEngine.SetUpCameraTrackSource()](./yoha.iengine.setupcameratracksource.md)<!-- -->. | | ||
| [IWarmupResult](./yoha.iwarmupresult.md) | The result of a call to [IEngine.Warmup()](./yoha.iengine.warmup.md)<!-- -->. | | ||
|
||
## Variables | ||
|
||
| Variable | Description | | ||
| --- | --- | | ||
| [EventEnum](./yoha.eventenum.md) | All types of events that the hand tracking engine may emit. See also [IEvent](./yoha.ievent.md)<!-- -->. | | ||
| [MediaStreamErrorEnum](./yoha.mediastreamerrorenum.md) | Possible error types that can occur when calling navigator.mediaDevices.getUserMedia. | | ||
|
||
## Type Aliases | ||
|
||
| Type Alias | Description | | ||
| --- | --- | | ||
| [IDownloadProgressCb](./yoha.idownloadprogresscb.md) | Callback that periodically informs about the progress of a download. | | ||
| [IEvent](./yoha.ievent.md) | All events that the hand tracking engine may emit. | | ||
| [IEventCb](./yoha.ieventcb.md) | Event callback. | | ||
| [ITrackSource](./yoha.itracksource.md) | The element to be used as source for the handtracking. Usually this is an HTMLVideoElement. | | ||
| [ObjValues](./yoha.objvalues.md) | A small helper that is used to build a type consisting of all values of an object literal.<br/> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [EventEnum](./yoha.eventenum.md) | ||
|
||
## EventEnum variable | ||
|
||
All types of events that the hand tracking engine may emit. See also [IEvent](./yoha.ievent.md)<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
EventEnum: { | ||
readonly RESULT: "RESULT"; | ||
readonly LOST: "LOST"; | ||
readonly LATENCY: "LATENCY"; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IDownloadProgressCb](./yoha.idownloadprogresscb.md) | ||
|
||
## IDownloadProgressCb type | ||
|
||
Callback that periodically informs about the progress of a download. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type IDownloadProgressCb = (progress: number) => void; | ||
``` | ||
|
||
## Remarks | ||
|
||
<b>progress</b>: A number in the range \[0-1\] indicating the progress of fetching the data. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [Configure](./yoha.iengine.configure.md) | ||
|
||
## IEngine.Configure() method | ||
|
||
Configures the engine. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
Configure(config?: IEngineConfig): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| config | [IEngineConfig](./yoha.iengineconfig.md) | Engine configuration. | | ||
|
||
<b>Returns:</b> | ||
|
||
void | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [DownloadModel](./yoha.iengine.downloadmodel.md) | ||
|
||
## IEngine.DownloadModel() method | ||
|
||
Fetches the model files and reports download progress. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
DownloadModel(progressCb?: IDownloadProgressCb): Promise<void>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| progressCb | [IDownloadProgressCb](./yoha.idownloadprogresscb.md) | See [IDownloadProgressCb](./yoha.idownloadprogresscb.md)<!-- -->. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<void> | ||
|
||
A promise that resolves once the download is complete. | ||
|
||
## Remarks | ||
|
||
- This function can be optionally called before [IEngine.Start()](./yoha.iengine.start.md) and [IEngine.Warmup()](./yoha.iengine.warmup.md) to fetch the model data while also being able to observe download progress. If omitted, the first call to either [IEngine.Start()](./yoha.iengine.start.md) or [IEngine.Warmup()](./yoha.iengine.warmup.md) will download the model data which does not provide the ability to observe the download progress. | ||
|
||
- The engine relies on a machine learning model to perform the hand tracking. This model consists of learned parameters that have to be fetched before the hand tracking can start. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) | ||
|
||
## IEngine interface | ||
|
||
Hand tracking engine. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IEngine | ||
``` | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [Configure(config)](./yoha.iengine.configure.md) | Configures the engine. | | ||
| [DownloadModel(progressCb)](./yoha.iengine.downloadmodel.md) | Fetches the model files and reports download progress. | | ||
| [SetUpCameraTrackSource()](./yoha.iengine.setupcameratracksource.md) | Creates a webcam stream and sets it up as source for the handtracking. | | ||
| [SetUpCustomTrackSource(trackSource)](./yoha.iengine.setupcustomtracksource.md) | Sets up the engine to use an externally created stream as source for the handtracking. | | ||
| [Start(eventCb)](./yoha.iengine.start.md) | Starts the engine. | | ||
| [Stop()](./yoha.iengine.stop.md) | Stops the engine. | | ||
| [Warmup()](./yoha.iengine.warmup.md) | Prepares and optimizes the engine. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [SetUpCameraTrackSource](./yoha.iengine.setupcameratracksource.md) | ||
|
||
## IEngine.SetUpCameraTrackSource() method | ||
|
||
Creates a webcam stream and sets it up as source for the handtracking. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
SetUpCameraTrackSource(): Promise<ISetUpCameraTrackSourceResult>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
Promise<[ISetUpCameraTrackSourceResult](./yoha.isetupcameratracksourceresult.md)<!-- -->> | ||
|
||
## Remarks | ||
|
||
This will ask the user for camera access. | ||
|
||
The created webcam stream uses reasonable default values. For full control over the creation of the stream use [IEngine.SetUpCustomTrackSource()](./yoha.iengine.setupcustomtracksource.md) instead. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [SetUpCustomTrackSource](./yoha.iengine.setupcustomtracksource.md) | ||
|
||
## IEngine.SetUpCustomTrackSource() method | ||
|
||
Sets up the engine to use an externally created stream as source for the handtracking. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
SetUpCustomTrackSource(trackSource: ITrackSource): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| trackSource | [ITrackSource](./yoha.itracksource.md) | The element to use as source for the handtracking (usually an HTMLVideoElement). | | ||
|
||
<b>Returns:</b> | ||
|
||
void | ||
|
||
## Remarks | ||
|
||
- Use this method for full control over the webcam stream. | ||
|
||
- If there are no special requirements on the webcam stream or to get started consider using [IEngine.SetUpCameraTrackSource()](./yoha.iengine.setupcameratracksource.md) instead. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [Start](./yoha.iengine.start.md) | ||
|
||
## IEngine.Start() method | ||
|
||
Starts the engine. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
Start(eventCb: IEventCb): Promise<void>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| eventCb | [IEventCb](./yoha.ieventcb.md) | Callback that is called with various events. See [IEvent](./yoha.ievent.md) for more details. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<void> | ||
|
||
Promise that resolves after engine has started. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [Stop](./yoha.iengine.stop.md) | ||
|
||
## IEngine.Stop() method | ||
|
||
Stops the engine. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
Stop(): Promise<void>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
Promise<void> | ||
|
||
Promise that resolves once the engine has stopped. | ||
|
||
## Remarks | ||
|
||
It is possible to reuse the engine by calling [IEngine.Start()](./yoha.iengine.start.md)<!-- -->. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngine](./yoha.iengine.md) > [Warmup](./yoha.iengine.warmup.md) | ||
|
||
## IEngine.Warmup() method | ||
|
||
Prepares and optimizes the engine. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
Warmup(): Promise<IWarmupResult>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
Promise<[IWarmupResult](./yoha.iwarmupresult.md)<!-- -->> | ||
|
||
Promise that resolves once warmup is complete with estimates about the performance that the engine can provide. | ||
|
||
## Remarks | ||
|
||
- Performs some dry runs to warm up the engine and to find optimal setup. | ||
|
||
- Requires that [IEngine.Configure()](./yoha.iengine.configure.md) was called already. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngineConfig](./yoha.iengineconfig.md) > [flipX](./yoha.iengineconfig.flipx.md) | ||
|
||
## IEngineConfig.flipX property | ||
|
||
If true, mirrors the result coordinates ([IResultEvent.coordinates](./yoha.iresultevent.coordinates.md)<!-- -->) along the y axis. In other words, \[x, y\] becomes \[1 - x, y\]. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
flipX?: boolean; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngineConfig](./yoha.iengineconfig.md) | ||
|
||
## IEngineConfig interface | ||
|
||
Engine configuration. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IEngineConfig | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [flipX?](./yoha.iengineconfig.flipx.md) | boolean | <i>(Optional)</i> If true, mirrors the result coordinates ([IResultEvent.coordinates](./yoha.iresultevent.coordinates.md)<!-- -->) along the y axis. In other words, \[x, y\] becomes \[1 - x, y\]. | | ||
| [padding?](./yoha.iengineconfig.padding.md) | number | <i>(Optional)</i> Starting from the borders, removes a percentage of the analyzed track source.<!-- -->Example: A video with resolution 640x480 would yield landmark coordinates where \[0, 0\] and \[1, 1\] correspond to pixel values of \[1, 1\] and \[640, 480\] respectively.<!-- -->Setting padding to 0.05 would make \[0, 0\] and \[1, 1\] correspond to pixel values of \[640 \* 0.05, 480 \* 0.05\] and \[640 - 640 \* 0.05, 480 - 480 \* 0.05\] respectively. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEngineConfig](./yoha.iengineconfig.md) > [padding](./yoha.iengineconfig.padding.md) | ||
|
||
## IEngineConfig.padding property | ||
|
||
Starting from the borders, removes a percentage of the analyzed track source. | ||
|
||
Example: A video with resolution 640x480 would yield landmark coordinates where \[0, 0\] and \[1, 1\] correspond to pixel values of \[1, 1\] and \[640, 480\] respectively. | ||
|
||
Setting padding to 0.05 would make \[0, 0\] and \[1, 1\] correspond to pixel values of \[640 \* 0.05, 480 \* 0.05\] and \[640 - 640 \* 0.05, 480 - 480 \* 0.05\] respectively. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
padding?: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEvent](./yoha.ievent.md) | ||
|
||
## IEvent type | ||
|
||
All events that the hand tracking engine may emit. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type IEvent = IResultEvent | IHandLostEvent | ILatencyEvent; | ||
``` | ||
<b>References:</b> [IResultEvent](./yoha.iresultevent.md)<!-- -->, [IHandLostEvent](./yoha.ihandlostevent.md)<!-- -->, [ILatencyEvent](./yoha.ilatencyevent.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [yoha](./yoha.md) > [IEventCb](./yoha.ieventcb.md) | ||
|
||
## IEventCb type | ||
|
||
Event callback. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type IEventCb = (event: IEvent) => void; | ||
``` | ||
<b>References:</b> [IEvent](./yoha.ievent.md) | ||
|
Oops, something went wrong.