Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalacho-mit committed Jul 25, 2024
2 parents 55904c8 + 3a93d5b commit fd6d6c5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 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,6 +147,7 @@ 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:
Expand Down

0 comments on commit fd6d6c5

Please sign in to comment.