/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ import * as tf from '@tensorflow/tfjs-core'; import { TensorsToDetectionsConfig } from './interfaces/config_interfaces'; import { AnchorTensor, Detection } from './interfaces/shape_interfaces'; /** * Convert result Tensors from object detection models into Detection boxes. * * @param detectionTensors List of Tensors of type Float32. The list of tensors * can have 2 or 3 tensors. First tensor is the predicted raw * boxes/keypoints. The size of the values must be * (num_boxes * num_predicted_values). Second tensor is the score tensor. * The size of the valuse must be (num_boxes * num_classes). It's optional * to pass in a third tensor for anchors (e.g. for SSD models) depend on the * outputs of the detection model. The size of anchor tensor must be * (num_boxes * 4). * @param anchor A tensor for anchors. The size of anchor tensor must be * (num_boxes * 4). * @param config */ export declare function tensorsToDetections(detectionTensors: [tf.Tensor1D, tf.Tensor2D], anchor: AnchorTensor, config: TensorsToDetectionsConfig): Promise; export declare function convertToDetections(detectionBoxes: tf.Tensor2D, detectionScore: tf.Tensor1D, config: TensorsToDetectionsConfig): Promise;