Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Handpose/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Handpose extends EventEmitter {
modelType: this.config?.modelType ?? "full", // use full version of the model by default
solutionPath: "https://cdn.jsdelivr.net/npm/@mediapipe/hands", // fetch model from mediapipe server
};

await tf.ready();
this.model = await handPoseDetection.createDetector(pipeline, modelConfig);

this.modelReady = true;
Expand Down
1 change: 1 addition & 0 deletions src/NeuralNetwork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class DiyNeuralNetwork {
* @param {*} callback
*/
init(callback) {
tf.setBackend("webgl");
// check if the a static model should be built based on the inputs and output properties
if (this.options.noTraining === true) {
this.createLayersNoTraining();
Expand Down
3 changes: 1 addition & 2 deletions src/PoseDetection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ class PoseDetection extends EventEmitter {
bodyPoseDetection.movenet.modelType.MULTIPOSE_LIGHTNING;
}
// Load the detector model
await tf.setBackend("webgl");
await tf.ready();
this.model = await bodyPoseDetection.createDetector(pipeline, modelConfig);
this.modelReady = true;

if (this.video) {
this.predict();
}
Expand Down