Transfering AI Models to Camera

The Bottlenose File utility can be used to transfer AI models into the camera. Refer to the file utility page for details on how to install the tool on your system. The camera does not have enough onboard storage to keep the AI model at shutdown. Please, upload the model every time the camera reboots or powers up.

AI Weights Transfer

  1. If you do not have a weights file yet, download one from the model repository.
  2. Start the utility if it is not running yet.
A screenshot of the Bottlenose file utility

A screenshot of the Bottlenose file utility

  1. Click the select button to connect your to Bottlenose camera
  2. Set the Transfer type to DNN Weights
Bottlenose file utility AI Weights transfer

Bottlenose file utility AI Weights transfer

  1. Select the weights file. You can also choose to drag and drop the file inside the file text area.
Bottlenose utility with a weights file been dropped for upload.

Bottlenose utility with a weights file being dropped for upload.

  1. Click Upload and wait for confirmation.
Weights transfer confirmation from Bottlenose Utility

Weights transfer confirmation from Bottlenose Utility

Click Quit or X to close the utility to start streaming from the camera with the new AI model.

Transfering with Python

To transfer your weights file with Python, refer to our code sample.

Transfering with ROS2

Start a ROS2 node with your AI model as a parameter to transfer it into the camera. The following command loads a Yolov3 model onto the camera and sets the detection threshold to 0.25.

ros2 run bottlenose_camera_driver bottlenose_camera_driver_node --ros-args \
  -p mac_address:="<MAC>" \ 
  -p ai_model:=<absolute_path>yolov3_1_416_416_3.tar \
  -p DNNConfidence:=0.25 

Troubleshooting

Should the weight transfer fail as follows:

[ERROR] [bottlenose_camera_driver]: curl_easy_perform() failed: Couldn't connect to server

Make sure your firewall is disabled, or has port 21 TCP (FTP) enabled. Even with the firewall disabled, some services may explicitly block transfers on certain ports. Please check IpTables directly as follows to make sure that no rules prevent the transfer.

sudo iptables -L
# Expected output ...
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Should the weight transfer fail as follows:

[ERROR] [bottlenose_camera_driver]: Could not retrieve file

Make sure you specify the absolute filename for the weights file as part of the-p ai_model:=... parameter. The ROS2 driver does not have any notion of the current working directory and can only operate with absolute file names.