-
-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cancel video loading after destroying (#883)
- Loading branch information
0 parents
commit a00c6ab
Showing
481 changed files
with
474,642 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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 @@ | ||
artplayer.org |
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 @@ | ||
google.com, pub-8579453810848662, DIRECT, f08c47fec0942fa0 |
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,10 @@ | ||
# MediaPipe JavaScript Solutions | ||
|
||
MediaPipe offers out of the box solutions to use our ML technology with live and streaming media. | ||
|
||
Visit us as [mediapipe.dev]() | ||
|
||
See live demos of our JavaScript solutions at [code.mediapipe.dev/codepen]() | ||
|
||
For more information on each of the solutions and how to use them, visit https://google.github.io/mediapipe/getting_started/javascript. | ||
|
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,111 @@ | ||
/** | ||
* @fileoverview Declarations for the face tracking API. | ||
*/ | ||
|
||
/** | ||
* Version number of this package. | ||
*/ | ||
export const VERSION: string; | ||
|
||
/** | ||
* We support several ways to get image inputs. | ||
*/ | ||
export type InputImage = HTMLVideoElement | HTMLImageElement | HTMLCanvasElement; | ||
|
||
/** | ||
* Legal inputs. | ||
*/ | ||
export interface InputMap { | ||
image: InputImage; | ||
} | ||
|
||
/** | ||
* GpuBuffers should all be compatible with Canvas' `drawImage` | ||
*/ | ||
type GpuBuffer = HTMLCanvasElement | HTMLImageElement | ImageBitmap; | ||
|
||
/** | ||
* Possible results from SelfieSegmentation. | ||
*/ | ||
export interface Results { | ||
image: GpuBuffer; | ||
segmentationMask: GpuBuffer; | ||
} | ||
|
||
/** | ||
* Configurable options for SelfieSegmentation. | ||
*/ | ||
export interface Options { | ||
selfieMode?: boolean; | ||
modelSelection?: number; | ||
} | ||
|
||
/** | ||
* Listener for any results from SelfieSegmentation. | ||
*/ | ||
export type ResultsListener = (results: Results) => (Promise<void>|void); | ||
|
||
/** | ||
* Contains all of the setup options to drive the face solution. | ||
*/ | ||
export interface SelfieSegmentationConfig { | ||
locateFile?: (path: string, prefix?: string) => string; | ||
} | ||
|
||
/** | ||
* Declares the interface of SelfieSegmentation. | ||
*/ | ||
declare interface SelfieSegmentationInterface { | ||
close(): Promise<void>; | ||
onResults(listener: ResultsListener): void; | ||
initialize(): Promise<void>; | ||
reset(): void; | ||
send(inputs: InputMap): Promise<void>; | ||
setOptions(options: Options): void; | ||
} | ||
|
||
/** | ||
* Encapsulates the entire SelfieSegmentation solution. All that is needed from the | ||
* developer is the source of the image data. The user will call `send` | ||
* repeatedly and if a face is detected, then the user can receive callbacks | ||
* with this metadata. | ||
*/ | ||
export declare class SelfieSegmentation implements SelfieSegmentationInterface { | ||
constructor(config?: SelfieSegmentationConfig); | ||
|
||
/** | ||
* Shuts down the object. Call before creating a new instance. | ||
*/ | ||
close(): Promise<void>; | ||
|
||
/** | ||
* Registers a single callback that will carry any results that occur | ||
* after calling Send(). | ||
*/ | ||
onResults(listener: ResultsListener): void; | ||
|
||
/** | ||
* Initializes the solution. This includes loading ML models and mediapipe | ||
* configurations, as well as setting up potential listeners for metadata. If | ||
* `initialize` is not called manually, then it will be called the first time | ||
* the developer calls `send`. | ||
*/ | ||
initialize(): Promise<void>; | ||
|
||
/** | ||
* Tells the graph to restart before the next frame is sent. | ||
*/ | ||
reset(): void; | ||
|
||
/** | ||
* Processes a single frame of data, which depends on the options sent to the | ||
* constructor. | ||
*/ | ||
send(inputs: InputMap): Promise<void>; | ||
|
||
/** | ||
* Adjusts options in the solution. This may trigger a graph reload the next | ||
* time the graph tries to run. | ||
*/ | ||
setOptions(options: Options): 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,27 @@ | ||
{ | ||
"name": "@mediapipe/selfie_segmentation", | ||
"version": "0.1.1675465747", | ||
"description": "Mediapipe Selfie Segmentation Solution", | ||
"main": "selfie_segmentation.js", | ||
"module": "selfie_segmentation.js", | ||
"jsdelivr": "selfie_segmentation.js", | ||
"unpkg": "selfie_segmentation.js", | ||
"types": "index.d.ts", | ||
"author": "[email protected]", | ||
"license": "Apache-2.0", | ||
"homepage": "https://google.github.io/mediapipe/solutions/selfie_segmentation", | ||
"keywords": [ "AR", "ML", "Augmented" ], | ||
"devDependencies": { | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"dependencies": { | ||
}, | ||
"browser": { | ||
"node-fetch": false, | ||
"util": false, | ||
"crypto": false | ||
}, | ||
"sideEffects" : [] | ||
} |
Binary file not shown.
93 changes: 93 additions & 0 deletions
93
assets/@mediapipe/selfie_segmentation/selfie_segmentation.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file added
BIN
+244 KB
assets/@mediapipe/selfie_segmentation/selfie_segmentation_landscape.tflite
Binary file not shown.
Empty file added
0
assets/@mediapipe/selfie_segmentation/selfie_segmentation_solution_simd_wasm_bin.data
Empty file.
21 changes: 21 additions & 0 deletions
21
assets/@mediapipe/selfie_segmentation/selfie_segmentation_solution_simd_wasm_bin.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+5.43 MB
assets/@mediapipe/selfie_segmentation/selfie_segmentation_solution_simd_wasm_bin.wasm
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
assets/@mediapipe/selfie_segmentation/selfie_segmentation_solution_wasm_bin.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+5.33 MB
assets/@mediapipe/selfie_segmentation/selfie_segmentation_solution_wasm_bin.wasm
Binary file not shown.
Oops, something went wrong.