public class ObjectDetectionOutputConverter extends Object implements Function<Map<String,org.tensorflow.Tensor<?>>,List<List<ObjectDetection>>>
ObjectDetection
list.
The pre-trained Object Detection models (http://bit.ly/2osxMAY) produce 3 tensor outputs:
(1) detection_classes - containing the ids of detected objects, (2) detection_scores - confidence probabilities of the
detected object and (3) detection_boxes - the object bounding boxes withing the images.
The MASK based models provide to 2 additional tensors: (4) num_detections and (5) detection_masks.
All outputs tensors are float arrays, having:
- 1 as the first dimension
- maxObjects as the second dimension
While boxesT will have 4 as the third dimension (2 sets of (x, y) coordinates).
This can be verified by looking at scoresT.shape() etc.
The format detected classes (e.g. labels) names is defined by the 'string_int_labels_map.proto'. The input list
is available at: https://github.com/tensorflow/models/tree/master/research/object_detection/dataModifier and Type | Field and Description |
---|---|
static String |
DETECTION_BOXES
DETECTION_BOXES.
|
static String |
DETECTION_CLASSES
DETECTION_CLASSES.
|
static String |
DETECTION_MASKS
DETECTION_MASKS.
|
static String |
DETECTION_SCORES
DETECTION_SCORES.
|
static String |
NUM_DETECTIONS
NUM_DETECTIONS.
|
Constructor and Description |
---|
ObjectDetectionOutputConverter(org.springframework.core.io.Resource labelsResource,
float confidence,
List<String> modelFetch) |
Modifier and Type | Method and Description |
---|---|
List<List<ObjectDetection>> |
apply(Map<String,org.tensorflow.Tensor<?>> tensorMap) |
public static final String DETECTION_CLASSES
public static final String DETECTION_SCORES
public static final String DETECTION_BOXES
public static final String DETECTION_MASKS
public static final String NUM_DETECTIONS
Copyright © 2022. All rights reserved.