Showing
1 changed file
with
5 additions
and
2 deletions
... | @@ -172,8 +172,11 @@ | ... | @@ -172,8 +172,11 @@ |
172 | 172 | ||
173 | let model, webcam, labelContainer, maxPredictions; | 173 | let model, webcam, labelContainer, maxPredictions; |
174 | 174 | ||
175 | + //predic이전 값을 기억해주는 전역변수. -999로 초기화. | ||
176 | + var last_result_predict=-999; | ||
177 | + | ||
175 | // Load the image model and setup the webcam | 178 | // Load the image model and setup the webcam |
176 | - async function init() { | 179 | + window.onload = async function init() { |
177 | const modelURL = URL + "model.json"; | 180 | const modelURL = URL + "model.json"; |
178 | const metadataURL = URL + "metadata.json"; | 181 | const metadataURL = URL + "metadata.json"; |
179 | 182 | ||
... | @@ -186,7 +189,7 @@ | ... | @@ -186,7 +189,7 @@ |
186 | 189 | ||
187 | // Convenience function to setup a webcam | 190 | // Convenience function to setup a webcam |
188 | const flip = true; // whether to flip the webcam | 191 | const flip = true; // whether to flip the webcam |
189 | - webcam = new tmImage.Webcam(200, 200, flip); // width, height, flip | 192 | + webcam = new tmImage.Webcam(550, 550, flip); // width, height, flip |
190 | await webcam.setup(); // request access to the webcam | 193 | await webcam.setup(); // request access to the webcam |
191 | await webcam.play(); | 194 | await webcam.play(); |
192 | window.requestAnimationFrame(loop); | 195 | window.requestAnimationFrame(loop); | ... | ... |
-
Please register or login to post a comment