boxPredictionLayer.js 737 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tf = require("@tensorflow/tfjs-core");
  4. var common_1 = require("../common");
  5. function boxPredictionLayer(x, params) {
  6. return tf.tidy(function () {
  7. var batchSize = x.shape[0];
  8. var boxPredictionEncoding = tf.reshape(common_1.convLayer(x, params.box_encoding_predictor), [batchSize, -1, 1, 4]);
  9. var classPrediction = tf.reshape(common_1.convLayer(x, params.class_predictor), [batchSize, -1, 3]);
  10. return {
  11. boxPredictionEncoding: boxPredictionEncoding,
  12. classPrediction: classPrediction
  13. };
  14. });
  15. }
  16. exports.boxPredictionLayer = boxPredictionLayer;
  17. //# sourceMappingURL=boxPredictionLayer.js.map