Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalacho-mit committed Jul 25, 2024
2 parents f83d392 + 3a93d5b commit 659286f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extensions/src/teachableMachine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ export default class teachableMachine extends extension({
dimensions: this.DIMENSIONS
});

if (frame) {
this.lastUpdate = time;
this.isPredicting = 0;
this.predictAllBlocks(frame);
}
this.lastUpdate = time;
this.isPredicting = 0;
this.predictAllBlocks(frame);
}
}

Expand Down Expand Up @@ -149,9 +147,11 @@ export default class teachableMachine extends extension({
const { model, modelType } = this.predictionState[modelUrl];
switch (modelType) {
case this.ModelType.IMAGE:
if (!frame) return null;
const imageBitmap = await createImageBitmap(frame);
return await model.predict(imageBitmap);
case this.ModelType.POSE:
if (!frame) return null;
const { pose, posenetOutput } = await model.estimatePose(frame);
return await model.predict(posenetOutput);
case this.ModelType.AUDIO:
Expand Down

0 comments on commit 659286f

Please sign in to comment.