()
| 41 | const onReady = React.useCallback( |
| 42 | (images) => { |
| 43 | const loop = async () => { |
| 44 | const nextImageTensor = images.next().value; |
| 45 | const predictions = await model.classify(nextImageTensor); |
| 46 | setPredictions(predictions); |
| 47 | raf.current = requestAnimationFrame(loop); |
| 48 | }; |
| 49 | loop(); |
| 50 | }, |
| 51 | [setPredictions] |