Created
November 14, 2018 20:48
-
-
Save Marina-Miranovich/0e86f661d7627fdda0e8124f55b63147 to your computer and use it in GitHub Desktop.
code_snippet_7 for "Playing Mortal Kombat with TensorFlow.js. Transfer learning and data augmentation" translation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const video = document.getElementById('cam'); | |
const Layer = 'global_average_pooling2d_1'; | |
const mobilenetInfer = m => (p): tf.Tensor<tf.Rank> => m.infer(p, Layer); | |
const canvas = document.getElementById('canvas'); | |
const scale = document.getElementById('crop'); | |
const ImageSize = { | |
Width: 100, | |
Height: 56 | |
}; | |
navigator.mediaDevices | |
.getUserMedia({ | |
video: true, | |
audio: false | |
}) | |
.then(stream => { | |
video.srcObject = stream; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment