-
Notifications
You must be signed in to change notification settings - Fork 149
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
Showing
22 changed files
with
441 additions
and
70 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,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@handtracking.io/yoha](./yoha.md) > [ITfjsWasmBackendConfig](./yoha.itfjswasmbackendconfig.md) | ||
|
||
## ITfjsWasmBackendConfig interface | ||
|
||
Configuration that is specific to the tfjs wasm backend. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface ITfjsWasmBackendConfig | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [wasmPaths](./yoha.itfjswasmbackendconfig.wasmpaths.md) | string | See https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-wasm\#using-bundlers | | ||
|
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) > [@handtracking.io/yoha](./yoha.md) > [ITfjsWasmBackendConfig](./yoha.itfjswasmbackendconfig.md) > [wasmPaths](./yoha.itfjswasmbackendconfig.wasmpaths.md) | ||
|
||
## ITfjsWasmBackendConfig.wasmPaths property | ||
|
||
See https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-wasm\#using-bundlers | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
wasmPaths: string; | ||
``` |
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
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) > [@handtracking.io/yoha](./yoha.md) > [IYohaTfjsModelBlobs](./yoha.iyohatfjsmodelblobs.md) > [modelType](./yoha.iyohatfjsmodelblobs.modeltype.md) | ||
|
||
## IYohaTfjsModelBlobs.modelType property | ||
|
||
This field adds some type safety to protect against mismatching blobs/backends. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
modelType: 'tfjs'; | ||
``` |
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
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) > [@handtracking.io/yoha](./yoha.md) > [StartTfjsWasmEngine](./yoha.starttfjswasmengine.md) | ||
|
||
## StartTfjsWasmEngine() function | ||
|
||
Starts an analysis loop on a track source (e.g. a `<video>` element) using the tfjs wasm backend. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function StartTfjsWasmEngine(engineConfig: IEngineConfig, backendConfig: ITfjsWasmBackendConfig, trackSource: ITrackSource, yohaModels: IYohaTfjsModelBlobs, resCb: ITrackResultCb): Promise<IStopEngineCb>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| engineConfig | [IEngineConfig](./yoha.iengineconfig.md) | Engine configuration. | | ||
| backendConfig | [ITfjsWasmBackendConfig](./yoha.itfjswasmbackendconfig.md) | Backend configuration. | | ||
| trackSource | [ITrackSource](./yoha.itracksource.md) | The element to be analyzed. | | ||
| yohaModels | [IYohaTfjsModelBlobs](./yoha.iyohatfjsmodelblobs.md) | File blobs of the AI models required for the engine to run. | | ||
| resCb | [ITrackResultCb](./yoha.itrackresultcb.md) | Callback that is called with hand tracking results. The callback may be called with high frequency. | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<[IStopEngineCb](./yoha.istopenginecb.md)<!-- -->> | ||
|
||
Promise that resolves with a callback that can be used to stop the analysis. | ||
|
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
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
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
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
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
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,45 @@ | ||
import { | ||
IEngineConfig, | ||
ITrackResultCb, | ||
IStopEngineCb, | ||
} from './base'; | ||
|
||
import {ITrackSource} from '../track_source'; | ||
|
||
import { | ||
IYohaTfjsModelBlobs, | ||
ITfjsWasmBackendConfig, | ||
TfjsBackendType, | ||
} from '../model/tfjs'; | ||
|
||
import {StartTfjsEngine} from './tfjs_base'; | ||
|
||
/** | ||
* @public | ||
* Starts an analysis loop on a track source (e.g. a `<video>` element) using the tfjs wasm | ||
* backend. | ||
* | ||
* @param engineConfig - Engine configuration. | ||
* @param backendConfig - Backend configuration. | ||
* @param trackSource - The element to be analyzed. | ||
* @param resCb - Callback that is called with hand tracking results. The callback may be called | ||
* with high frequency. | ||
* @param yohaModels - File blobs of the AI models required for the engine to run. | ||
* | ||
* @returns Promise that resolves with a callback that can be used to stop the analysis. | ||
*/ | ||
export async function StartTfjsWasmEngine( | ||
engineConfig: IEngineConfig, | ||
backendConfig: ITfjsWasmBackendConfig, | ||
trackSource: ITrackSource, | ||
yohaModels: IYohaTfjsModelBlobs, | ||
resCb: ITrackResultCb, | ||
) : Promise<IStopEngineCb> { | ||
return StartTfjsEngine( | ||
engineConfig, | ||
{...backendConfig, backendType: TfjsBackendType.WASM}, | ||
yohaModels, | ||
trackSource, | ||
resCb | ||
); | ||
} |
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,42 @@ | ||
import { | ||
IEngineConfig, | ||
ITrackResultCb, | ||
IStopEngineCb, | ||
} from './base'; | ||
|
||
import {ITrackSource} from '../track_source'; | ||
|
||
import { | ||
TfjsBackendType, | ||
IYohaTfjsModelBlobs, | ||
} from '../model/tfjs'; | ||
|
||
import {StartTfjsEngine} from './tfjs_base'; | ||
|
||
/** | ||
* @public | ||
* Starts an analysis loop on a track source (e.g. a `<video>` element) using the tfjs webgl | ||
* backend. | ||
* | ||
* @param engineConfig - Engine configuration. | ||
* @param trackSource - The element to be analyzed. | ||
* @param resCb - Callback that is called with hand tracking results. The callback may be called | ||
* with high frequency. | ||
* @param yohaModels - File blobs of the AI models required for the engine to run. | ||
* | ||
* @returns Promise that resolves with a callback that can be used to stop the analysis. | ||
*/ | ||
export async function StartTfjsWebglEngine( | ||
engineConfig: IEngineConfig, | ||
trackSource: ITrackSource, | ||
yohaModels: IYohaTfjsModelBlobs, | ||
resCb: ITrackResultCb, | ||
) : Promise<IStopEngineCb> { | ||
return StartTfjsEngine( | ||
engineConfig, | ||
{backendType: TfjsBackendType.WEBGL}, | ||
yohaModels, | ||
trackSource, | ||
resCb | ||
); | ||
} |
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
Oops, something went wrong.