Updated Blocks Sample TensorFlow Object Detection Op Mode (markdown)

FTC Engineering
2020-10-23 21:41:17 -04:00
parent 87a3993f9e
commit 4fe84ede5a

@ -52,10 +52,9 @@ If a zoom factor has been set, then the Camera Stream preview on the Driver Stat
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/magnifiedArea.png]]<br/>Camera stream preview indicating magnified area (at a distance of about 4 feet or 1.2 meters).<p> <p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/magnifiedArea.png]]<br/>Camera stream preview indicating magnified area (at a distance of about 4 feet or 1.2 meters).<p>
### Iterating and Processing List of Recognized Objects ### Iterating and Processing List of Recognized Objects
The Op Mode will then iterate until a Stop command is received and it will check with the object detector to see how many objects it recognizes in its field of view. In the screenshot below, the variable "recognitions" is set to a list of objects that were recognized using the TensorFlow technology.
The Op Mode will then check with the object detector to see how many objects it recognizes in its field of view. In the screenshot below, the variable "recognitions" is set to a list of objects that were recognized using the TensorFlow technology. The Op Mode adds a telemetry message to indicate on the Driver Station how many objects were detected in the camera's field of view. <p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/whileLoop.png]]<br/>The op mode gets a list of recognized objects with each iteration of the while loop.<p>
<p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/tensorflow/images/blocksGetRecognitions.png" width="500"><br/>Get a list of recognized objects from TensorFlow.<p>
If the number of detected objects equals three (i.e., if three Minerals are in the camera's field of view) then the Op Mode will loop through the list of recognized objects and look at the label for each recognized object. If an object has a label that indicates it's a Gold Mineral, then the "Left" coordinate value of its bounding box will be assigned to the variable "goldMineralX". Similarly, if the other two objects in the list have labels that indicate that they are Silver Minerals, then their Left coordinate values will be assigned to the variables "silverMineral1X" and "silverMineral2X". If the number of detected objects equals three (i.e., if three Minerals are in the camera's field of view) then the Op Mode will loop through the list of recognized objects and look at the label for each recognized object. If an object has a label that indicates it's a Gold Mineral, then the "Left" coordinate value of its bounding box will be assigned to the variable "goldMineralX". Similarly, if the other two objects in the list have labels that indicate that they are Silver Minerals, then their Left coordinate values will be assigned to the variables "silverMineral1X" and "silverMineral2X".