Skip to content

Commit acb45d7

Browse files
authored
Update index.js
1 parent 67a1b72 commit acb45d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class App extends React.Component {
125125
videoRef = React.createRef()
126126
canvasRef = React.createRef()
127127

128-
componentDidMount() {
128+
handleLoadedData = () => {
129129
const modelPromise = tf.loadGraphModel(MODEL_JSON)
130130
const labelsPromise = fetch(LABELS_URL).then(data => data.json())
131131
Promise.all([modelPromise, labelsPromise])
@@ -196,6 +196,7 @@ class App extends React.Component {
196196
ref={this.videoRef}
197197
width="1200"
198198
height="670"
199+
onLoadedData={this.handleLoadedData}
199200
/>
200201
<canvas
201202
className="size"

0 commit comments

Comments
 (0)