File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ function Camera({ predictCanvas, predictions }: CameraProps) {
1919 // handle any webcam plugged into the computer
2020 // https://github.com/mozmorris/react-webcam#show-all-cameras-by-deviceid
2121 const handleDevices = useCallback (
22- ( mediaDevices ) => {
22+ ( mediaDevices : MediaDeviceInfo [ ] ) => {
2323 // find all the webcams
24- const videoDevices = mediaDevices . filter ( ( { kind} : MediaDeviceInfo ) => kind === "videoinput" ) ;
24+ const videoDevices = mediaDevices . filter ( ( { kind} ) => kind === "videoinput" ) ;
2525 setDevices ( videoDevices ) ;
2626 // set our initial webcam to be the first in the list
2727 if ( videoDevices . length > 0 ) {
@@ -45,8 +45,8 @@ function Camera({ predictCanvas, predictions }: CameraProps) {
4545 } , [ webcamRef ] ) ;
4646
4747 // helper for waiting in our loop when the camera is loading (getting the image)
48- const sleep : ( ms : number ) => Promise < NodeJS . Timeout > = useCallback ( ( ms ) => {
49- return new Promise ( function ( resolve , reject ) {
48+ const sleep = useCallback ( ( ms : number ) => {
49+ return new Promise < NodeJS . Timeout > ( function ( resolve , reject ) {
5050 setTimeout ( resolve , ms ) ;
5151 } ) ;
5252 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export function disposeModel() {
1919 }
2020}
2121
22- export async function predict ( data : any ) {
22+ export async function predict ( data : ImageData ) {
2323 // run the input data through the model
2424 if ( model ) {
2525 return await model . predict ( data ) ;
You can’t perform that action at this time.
0 commit comments