Updated Blocks Sample TensorFlow Object Detection Op Mode (markdown)
@ -61,7 +61,19 @@ If the list is empty (i.e., if no objects were detected) the op mode sends a tel
|
||||
If the list is not empty, then the op mode iterates through the list and calls a function "displayInfo" to display information via telemetry about each detected object.
|
||||
|
||||
### Modifying the Sample Op Mode to display Target Zone
|
||||
Let's modify the sample Blocks Op Mode so it will indicate which target zone the robot should drive to. Using the Blocks editor, modify the conditional clause for an empty list (i.e., no targets detected) so that a telemetry message indicating that zone A should be targeted by the robot (see screenshot below).
|
||||
|
||||
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/targetZoneA.png]]<br/>If the list is empty indicate target zone A.<p>
|
||||
|
||||
Also, use the Blocks editor to modify the function "displayInfo" to check the labels of the recognized object. If the label reads "Single" then send a telemetry message to indicate target zone B. If the label reads "Quad" then send a telemetry message to indicate target zone C. If the label is neither "Single" or "Quad" send a telemetry message indicating that the target zone is unknown.
|
||||
|
||||
Note that in this example, since the op mode iterates through the list of recognized objects, the target zone that is displayed on the driver station will be determined by the label of the last recognized object in the list.
|
||||
|
||||
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/otherTargetZones.png]]<br/>Check the recognized object's label to see which target zone to go after.<p>
|
||||
|
||||
Save the op mode and re-run it. The op mode should display the target zone based on the label of the last recognized object in its list of recognized objects. Note that if you test this op mode with multiple ring stacks, the order of the detected objects can change with each iteration of your op mode.
|
||||
|
||||
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/modifiedBlocksExample.png]]<br/>The modified op mode should indicate target zone based on label of last recognized object in its list.<p>
|
||||
### Important Note Regarding Image Orientation
|
||||
The system interprets images based on the phone's orientation (Portrait or Landscape) at the time that the TensorFlow object detector was created and initialized. In our example, if you execute the TensorFlowObjectDetection.initialize block while the phone is in Portrait mode, then the images will be processed in Portrait mode.
|
||||
|
||||
|
Reference in New Issue
Block a user