MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / buildObjectDetectionModel

Function buildObjectDetectionModel

simple-object-detection/train.js:130–139  ·  view source on GitHub ↗

* Builds object-detection model from MobileNet. * * @returns {[tf.Model, tf.layers.Layer[]]} * 1. The newly-built model for simple object detection. * 2. The layers that can be unfrozen during fine-tuning.

()

Source from the content-addressed store, hash-verified

128 * 2. The layers that can be unfrozen during fine-tuning.
129 */
130async function buildObjectDetectionModel() {
131 const {truncatedBase, fineTuningLayers} = await loadTruncatedBase();
132
133 // Build the new head model.
134 const newHead = buildNewHead(truncatedBase.outputs[0].shape.slice(1));
135 const newOutput = newHead.apply(truncatedBase.outputs[0]);
136 const model = tf.model({inputs: truncatedBase.inputs, outputs: newOutput});
137
138 return {model, fineTuningLayers};
139}
140
141(async function main() {
142 // Data-related settings.

Callers 1

train.jsFile · 0.85

Calls 3

loadTruncatedBaseFunction · 0.85
buildNewHeadFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected