When you are working with computer vision models, you may want to save your detections to CSV or JSON for further processing. This is especially useful in testing and debugging scripts, or applications where you want to log all results from your model to a plain text file.
Using the supervision Python package, you can
Save YOLOv8 Predictions to CSV
predictions in a few lines of code. In this guide, we will show how to plot and visualize model predictions.
We will:
1. Install supervision
2. Load a model and save predictions with the supervision Sink API
Without further ado, let's get started!
First, install the supervision pip package:
Once you have installed supervision, you are ready to load your data and start writing logic to save detections.
First, we need to load our computer vision model. Then, we can load detections into the supervision Detections() API. With our detections in the Detections() API, we can use the
CSV
sink to save our data.
You can save data using the following code:
supervision provides an extensive range of functionalities for working with computer vision models. With supervision, you can:
1. Process and filter detections and segmentation masks from a range of popular models (YOLOv5, Ultralytics YOLOv8, MMDetection, and more).
2. Process and filter classifications.
3. Compute confusion matrices.
And more! To learn about the full range of functionality in supervision, check out the supervision documentation.