Updated Blocks Sample TensorFlow Object Detection Op Mode (markdown)

FTC Engineering
2020-10-20 14:26:23 -04:00
parent c2fe4aacc1
commit 7f37206a5a

@ -13,11 +13,11 @@ Your new Op Mode should appear in the editing pane of the Blocks Development Too
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/blocksMyExample.png]]<br/>Your newly created Op Mode will have the ConceptTensorFlowObjectDetection blocks included.<p> <p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/blocksMyExample.png]]<br/>Your newly created Op Mode will have the ConceptTensorFlowObjectDetection blocks included.<p>
### Initializing the System ### Initializing the System
Let's take a look at the initial blocks in the Op Mode. The first block in the op mode (excluding the comment block) initializes the Vuforia library on the Android Robot Controller. This is needed because the TensorFlow Lite library will receive image data from the Vuforia library. In this example, the enableCameraMonitoring option is set to false. This means that there will not be a Vuforia preview window on the Robot Controller screen. Let's take a look at the initial blocks in the Op Mode. The first block in the op mode (excluding the comment blocks) initializes the Vuforia library on the Android Robot Controller. This is needed because the TensorFlow Lite library will receive image data from the Vuforia library. In this example, the enableCameraMonitoring option is set to false. This means that there will not be a Vuforia preview window on the Robot Controller screen. Also, in the screenshot below, the Vuforia system will use an externally connected webcam named "Webcam 1" (which should match the camera name in your robot's configuration file).
Note that you can initialize both the Vuforia and the TensorFlow libraries in the same op mode. This is useful, for example, if you would like to use the TensorFlow library to determine the arrangement of the minerals and then use the Vuforia library to help autonomously navigate on the game field to remove the Gold Mineral from its starting position. Note that you can initialize both the Vuforia and the TensorFlow libraries in the same op mode. This is useful, for example, if you would like to use the TensorFlow library to determine the ring stack and then use the Vuforia library to help the robot autonomously navigate on the game field to navigate to the appropriate target zone from its starting position.
<p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/tensorflow/images/blocksInit.png" width="500"><br/>Initialize the Vuforia and TensorFlow libraries.<p> <p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/blocksInit.png]]<br/>Initialize the Vuforia and TensorFlow libraries.<p>
The Op Mode then initializes the TensorFlow library and it enables a camera monitoring window so that the user can see on the Robot Controller activity an image with TensorFlow data (including bounding boxes for detected objects) overlayed. The Op Mode then initializes the TensorFlow library and it enables a camera monitoring window so that the user can see on the Robot Controller activity an image with TensorFlow data (including bounding boxes for detected objects) overlayed.