Skip to content

Commit

Permalink
no nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
mayarajan3 committed Jun 25, 2024
1 parent f835ac8 commit f9930be
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions extensions/src/teachableMachine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ export default class teachableMachine extends extension({
const { model, modelType } = this.predictionState[modelUrl];
switch (modelType) {
case this.ModelType.IMAGE:
if (frame) {
const imageBitmap = await createImageBitmap(frame);
return await model.predict(imageBitmap);
}
return null;
if (!frame) return null;
const imageBitmap = await createImageBitmap(frame);
return await model.predict(imageBitmap);
case this.ModelType.POSE:
const { pose, posenetOutput } = await model.estimatePose(frame);
return await model.predict(posenetOutput);
Expand Down

0 comments on commit f9930be

Please sign in to comment.