
Install Dependencies
-
Install Ultralytics using
pip install ultralytics. In order to learn about more ways to install Ultralytics, you can check out the official docs. -
Then, you need to install the
feat/ultralyticsbranch from W&B, which currently houses the out-of-the-box integration for Ultralytics.
Note: The Ultralytcs integration will be soon available as a fully supported feature on Weights & Biases once this pull request is merged.
Using Ultralytics with Weights & Biases
In order to use the W&B integration with Ultralytics, we need to import the wandb.yolov8.add_wandb_callback function.
Now, let us download a few images to test the integration on. You can use your own images, videos or camera sources. For more information on inference sources, you can check out the official docs.
Next, we initialize a W&B run using wandb.init.
Next, we initialize the YOLO model of our choice, and invoke the add_wandb_callback function on it before performing inference with the model. This would ensure that when we perform inference, it would automatically log the images overlayed with our interactive overlays for computer vision tasks along with additional insights in a wandb.Table.
Next, you can check out the following notebook to learn how to perform experiment tracking and visualize validation predictions during training using Weights & Biases in the following notebook:
In order to learn more about using Weights & Biases with Ultralytics, you can also read the report: Supercharging Ultralytics with Weights & Biases