1
1
// Import dependencies
2
- import React , { useRef , useEffect , useState } from "react" ;
2
+ import { useRef , useEffect , useState } from "react" ;
3
3
import Webcam from "react-webcam" ;
4
4
import * as tf from "@tensorflow/tfjs" ;
5
5
//import * as cpu from "@tensorflow/tfjs-backend-cpu";
@@ -10,8 +10,8 @@ import { drawRect } from "./utilities";
10
10
11
11
function App ( ) {
12
12
const [ isLoading , setIsLoading ] = useState ( true )
13
- const webcamRef = useRef ( null ) ;
14
- const canvasRef = useRef ( null ) ;
13
+ const webcamRef : any = useRef ( null ) ;
14
+ const canvasRef : any = useRef ( null ) ;
15
15
16
16
tf . setBackend ( "webgl" ) ;
17
17
// Main function
@@ -25,15 +25,15 @@ function App() {
25
25
} , 10 ) ;
26
26
} ;
27
27
28
- const detect = async ( net ) => {
28
+ const detect = async ( net : any ) => {
29
29
// Check data is available
30
30
if (
31
31
typeof webcamRef . current !== "undefined" &&
32
32
webcamRef . current !== null &&
33
33
webcamRef . current . video . readyState === 4
34
34
) {
35
35
// Get Video Properties
36
- const video = webcamRef . current . video ;
36
+ const video : any = webcamRef . current . video ;
37
37
const videoWidth = webcamRef . current . video . videoWidth ;
38
38
const videoHeight = webcamRef . current . video . videoHeight ;
39
39
@@ -62,7 +62,7 @@ function App() {
62
62
< >
63
63
{ isLoading && isLoading ?(
64
64
< div style = { { display :"flex" , justifyContent :"center" , background :"#252525" , alignItems :"center" , height :"100vh" } } >
65
- < p style = { { text : "14px" , color :"white" } } > Loading, please wait...</ p >
65
+ < p style = { { fontSize : 14 , color :"white" } } > Loading, please wait...</ p >
66
66
</ div >
67
67
) :(
68
68
< div className = "App" >
@@ -77,7 +77,7 @@ function App() {
77
77
left : 0 ,
78
78
right : 0 ,
79
79
textAlign : "center" ,
80
- zindex : 9 ,
80
+ zIndex : 9 ,
81
81
width : "100vw" ,
82
82
height : "100vh" ,
83
83
} }
@@ -92,7 +92,7 @@ function App() {
92
92
left : 0 ,
93
93
right : 0 ,
94
94
textAlign : "center" ,
95
- zindex : 8 ,
95
+ zIndex : 8 ,
96
96
width : "100vw" ,
97
97
height : "100vh" ,
98
98
} }
0 commit comments