We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent feadf06 commit 535deb2Copy full SHA for 535deb2
src/ImageClassifier/index.js
@@ -70,6 +70,9 @@ class ImageClassifier {
70
imgToPredict = inputNumOrCallback;
71
} else if (typeof inputNumOrCallback === 'object' && inputNumOrCallback.elt instanceof HTMLImageElement) {
72
imgToPredict = inputNumOrCallback.elt; // Handle p5.js image
73
+ } else if (!(this.video instanceof HTMLVideoElement)) {
74
+ // Handle unsupported input
75
+ throw new Error('No input image provided. If you want to classify a video, pass the video element in the constructor. ');
76
}
77
78
if (typeof numOrCallback === 'number') {
0 commit comments