Updated Blocks Sample TensorFlow Object Detection Op Mode (markdown)
@ -13,13 +13,13 @@ 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>
|
||||
|
||||
### 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 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).
|
||||
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. 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).
|
||||
|
||||
<p align="center">[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/blocksInit.png]]<br/>Initialize the Vuforia and TensorFlow libraries.<p>
|
||||
|
||||
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.
|
||||
In the screenshot shown above, the sample Op Mode disables the camera monitoring window on the Robot Controller. If you are using a REV Robotics Control Hub as your Robot Controller (which lacks a touch screen) you normally want to disable the camera monitoring window and use the Camera Stream function instead (described later on in this tutorial) to view the output of the webcam. If you are using an Android phone as your Robot Controller, however, you can enable the camera monitoring window so you can see the camera output on the Robot Controller's touch screen.
|
||||
|
||||
Also note that this sample Op Mode disables the camera monitoring window on the Robot Controller. If you are using a REV Robotics Control Hub as your Robot Controller (which lacks a touch screen) you normally want to disable the camera monitoring window and use the Camera Stream function instead (described later on in this tutorial) to view the output of the webcam.
|
||||
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.
|
||||
|
||||
Note that in this example the ObjectTracker parameter is set to true for this block, so an _object tracker_ will be used, in addition to the TensorFlow interpreter, to keep track of the locations of detected objects. The object tracker _interpolates_ object recognitions so that results are smoother than they would be if the system were to solely rely on the TensorFlow interpreter.
|
||||
|
||||
|
Reference in New Issue
Block a user