Skip to content

TfDetector

Moscowsky Anton edited this page Dec 3, 2020 · 2 revisions

TensorFlow Attribute

This attribute uses the API of the [TensorFlow] (https://www.tensorflow.org/) library to find an object using the method of convolutional neural networks. To use this attribute, you need to install Tensorflow for use in C++ applications. ** However, it is recommended to use the DnnAttribute attribute instead of this attribute, which also allows using convolutional neural networks, including those trained using Tensorflow **

1. Modes

1.1. Detect

Returns areas with objects, recognized by CNN, and having a probability not lower than Probability.

1.2. Check)

Not implemented

1.3. Extract

Not implemented

2. XML-description

2.1. Common parameters

  • Name (string, must be set) attribute unique name
  • Type (string, must be "Tensorflow") attribute type
  • Weight (double, default: 1) attribute weight
  • Probability (double, default: 0.75) acceptable detection accuracy, used in Detect mode.
  • Contour (bool, default: true) not used in this attribute

1.2. Special parameters

  • graph (string, must be provided) File path frozen_inference_graph.pb file of CNN. Working ones can be downloaded from here and from here. If the path starts with '/', then it is considered global, if not, then local from the location of the object base.
  • labels (string, must be provided) Path to the labels file (usually .pbtxt extensions). For the networks above, the labels can be downloaded from here. If the path starts with '/', then it is considered global, if not, then local from the location of the object base. ** In this version, labels are not used, but they are needed to determine the id of objects of interest. **
  • obj_id (int, must be provided) Object identifier for recognition, if -1 then all network objects are returned.

1.3. Example

<Attribute Name="Cup" Type="TensorFlow" obj_id="47" graph="ssd_mobilenet_v1_coco_2018_01_28/frozen_inference_graph.pb" labels="ssd_mobilenet_v1_coco_2018_01_28/mscoco_label_map.pbtxt"/>
Clone this wiki locally