Welcome to the weekly FiftyOne tips and tricks blog where we recap interesting questions and answers that have recently popped up on
Slack,
GitHub, Stack Overflow, and Reddit.
Wait, what’s FiftyOne?
FiftyOne is an open source machine learning toolset that enables data science teams to improve the performance of their computer vision models by helping them curate high quality datasets, evaluate models, find mistakes, visualize embeddings, and get to production faster.
Ok, let’s dive into this week’s tips and tricks!
Basic operations on your dataset using FiftyOne
Community Slack member Earl asked,
“I want to initially use the FiftyOne App to quickly look at my YOLOv5 dataset and annotations. I'd like to analyze my data and do some very basic tasks like remove duplicates, show distributions, etc. It isn't clear what I can do with the App without writing Python scripts.”
Hey Earl! You’ll need to first load your dataset into FiftyOne either through the Python SDK or the command-line interface. But loading a
YOLOv5 dataset into the App takes only a few lines of code:
Once your dataset is in FiftyOne, you can visualize it in the App, view distributions, filter on your labels, and much more.
Concatenating generated views such as patches in FiftyOne
Community Slack member Joy asked,
“I want to load the dataset object as patches directly. Is there a way to load the patch view directly in FiftyOne?”
Hi Joy! FiftyOne provides a convenient way to generate patches from your images using the to_patches() method. This method creates a PatchesView for a given SampleCollection, which allows you to view and manipulate patches in your dataset.
To concatenate generated patch views, you can first use the to_patches() method to generate a patch view of your desired SampleCollection, and then use list concatenation to combine multiple patch views. Here's an example code snippet that demonstrates how to concatenate two patch views in FiftyOne:
Here’s the snapshot of the expected output:
For more information on
patch views, please visit FiftyOne Docs.
Exporting FiftyOne datasets
Community member, Jack asked:
“I'm using .export() to export my dataset and create a custom coco json. The filenames aren't absolute. How do I export the full path for my filename? It only exports the filename.”
Hi Jack! FiftyOne provides native support for exporting datasets to disk in a variety of common formats, and it can be easily extended to export datasets in custom formats. The export() method provides additional parameters that you can use to configure the export. For example, you can use the data_path and labels_path parameters to independently customize the location of the exported media and labels, including labels-only exports:
Or you can use the export_media parameter to configure whether to copy, move, symlink, or omit the media files from the export:
Join the FiftyOne community!
Join the thousands of engineers and data scientists already using FiftyOne to solve some of the most challenging problems in computer vision today!