FiftyOne Computer Vision Tips and Tricks – Nov 24, 2023
Nov 24, 2023
5 min read
Welcome to our 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.
As an open source community, the FiftyOne community is open to all. This means everyone is welcome to ask questions, and everyone is welcome to answer them. Continue reading to see the latest questions asked and answers provided!

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!

Retrieving the filepaths of samples that are not part of a view

Community Slack member Mareeta asked:
Is there a way to get the filepaths of all the samples in a dataset that are not part of a view?
Yes! Tweak to taste the following:

Clustering images based on similarity

Community Slack member Mareeta asked:
Is there a function that allows for the clustering of images based on their similarity?
Yes! The FiftyOne Brain’s compute_visualization() method enables you to generate low-dimensional representations of the samples and/or individual objects in your datasets. There are four basic ways to generate embeddings using the embeddings and model parameters:
  • Provide nothing, in which case a default general purpose model is used to embed your data
  • Provide a Model instance or the name of any model from the Model Zoo that supports embeddings
  • Provide your own precomputed embeddings in array form
Provide the name of a VectorField or ArrayField of your dataset in which precomputed embeddings are stored
Here's an example that uses this FiftyOne Brain method with KMeans from sklearn to cluster your images based on similarity:
Pick a few extra tips and tricks in this blog exploring embeddings in FiftyOne.

Filtering with dynamic attributes

Community Slack member Ran asked:
I have samples with "detections" (bounding boxes) in my dataset. These detections also have "attributes". How can I filter by certain attribute value(s)?
Best bet is to use FiftyOne’s dynamic attributes. Any field(s) of your FiftyOne datasets that contain DynamicEmbeddedDocument values can have arbitrary custom attributes added to their instances. To see what attributes you already have that are available to declare, use:
Then follow it up with add_sample_field()to declare any of them you wish:

Computing pairwise IoUs between predicted and ground truth objects

Community Slack member Nahid asked:
In my image dataset, I have people and vehicle annotations in YOLOv5 format. Is there a way in FiftyOne to discover images where there is no overlap of these objects (and some distance between them)?
Yes! You could do this using FiftyOne’s compute_ious function which computes the pairwise IoUs between the predicted and ground truth objects. For example with two classes:

Converting CVAT coordinates into FiftyOne compatible ones

Community Slack member Queenie asked:
I have an image with a width and height of 720 and 1280:
The position of a bounding box in the image is set in CVAT to:
The corresponding coordinates in FiftyOne are:
What is the most efficient way to convert CVAT coordinates into FiftyOne compatible ones?
Because you are importing directly from CVAT into FiftyOne, the easiest way to accomplish this is to use FiftyOne’s native CVAT integration. FiftyOne provides an API to create tasks and jobs, upload data, define label schemas, and download annotations using CVAT, all programmatically in Python.
With the import_annotations() utility, you can import individual task(s) or an entire project into a FiftyOne dataset. The conversion of coordinates between CVAT and FiftyOne will be taken care of as part of the import. You can find a code example here.

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!
Loading related posts...