MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / loadTruncatedMobileNet

Function loadTruncatedMobileNet

webcam-transfer-learning/index.js:39–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37// Loads mobilenet and returns a model that returns the internal activation
38// we'll use as input to our classifier model.
39async function loadTruncatedMobileNet() {
40 const mobilenet = await tf.loadLayersModel(
41 'https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json');
42
43 // Return a model that outputs an internal activation.
44 const layer = mobilenet.getLayer('conv_pw_13_relu');
45 return tf.model({inputs: mobilenet.inputs, outputs: layer.output});
46}
47
48// When the UI buttons are pressed, read a frame from the webcam and associate
49// it with the class label given by the button. up, down, left, right are

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected