File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ class ImageClassifier {
248
248
"image" ,
249
249
"No input image provided. If you want to classify a video, use classifyStart."
250
250
) ;
251
- return callCallback ( this . classifyInternal ( image , number ) , callback ) ;
251
+ return callCallback ( this . classifyInternal ( image , number || this . topk ) , callback ) ;
252
252
}
253
253
254
254
/**
@@ -269,10 +269,9 @@ class ImageClassifier {
269
269
// Function to classify a single frame
270
270
const classifyFrame = async ( ) => {
271
271
await mediaReady ( image , true ) ;
272
- await this . classifyInternal ( image , number ) ;
273
272
// call the callback function
274
- callCallback ( this . classifyInternal ( image , number ) , callback ) ;
275
-
273
+ await callCallback ( this . classifyInternal ( image , number || this . topk ) , callback ) ;
274
+
276
275
// call recursively for continuous classification
277
276
if ( ! this . signalStop ) {
278
277
requestAnimationFrame ( classifyFrame ) ;
You can’t perform that action at this time.
0 commit comments