Announcing FiftyOne 0.19 with Spaces, In-App Embeddings Visualization, Saved Views, and More!
Tags: computervision, machinelearning, datascience, ai
Published: 2023-02-17 04:23:02

Voxel51 in conjunction with the FiftyOne community is excited to announce the general availability of [FiftyOne 0.19](https://docs.voxel51.com/release-notes.html#fiftyone-0-19-0). This release is packed with new features that make it even easier and faster to visualize your computer vision datasets and boost the performance of your machine learning models. How? Read on!

## Wait, what’s FiftyOne?

[FiftyOne](https://voxel51.com/fiftyone/) is the 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.

![FiftyOne in action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m32n9gdz7w957tng174e.gif)

- If you like what you see on GitHub, [give the project a star](https://github.com/voxel51/fiftyone).
- [Get started!](https://docs.voxel51.com/) We’ve made it easy to get up and running in a few minutes.
- Join the [FiftyOne Slack community](https://join.slack.com/t/fiftyone-users/shared_invite/zt-s6936w7b-2R5eVPJoUw008wP7miJmPQ), we’re always happy to help.

Ok, let’s dive into the release.

## tl;dr: What’s new in FiftyOne 0.19?

This release includes:

- **Spaces**: an all-new customizable framework for organizing interactive information panels within the FiftyOne App, allowing you to visualize and query your datasets in powerful new ways through a convenient interface
- **In-App embeddings visualization**: you can now interactively explore embeddings visualizations natively in the App by opening an embeddings panel with one click
- **Saved views**: you can now save views into your datasets and switch between them natively in the App
- **On-disk segmentations**: you can now store your semantic segmentation masks and heatmaps on disk, rather than in the database
- **New UI filtering options**: the App’s sidebar now contains upgraded options for filtering datasets
- **FiftyOne Teams documentation**: documentation for [FiftyOne Teams](https://docs.voxel51.com/teams/index.html#fiftyone-teams) is now publicly available!

Check out the [release notes](https://docs.voxel51.com/release-notes.html#fiftyone-0-19-0) for a full rundown of additional enhancements and bug fixes.

## Live demo & AMA on Feb. 28 @ 10 AM PT

You can see all of the new features in action in a live webinar and AMA on February 28, 2023 at 10 AM Pacific Time. I’ll be demoing all of the new features in FiftyOne 0.19, followed by an open Q&A where you can get answers to any questions you might have. [Register here.](https://voxel51.com/computer-vision-events/whats-new-in-fiftyone-0-19/?utm_source=blog)

Now, here’s a quick overview of some of the new features we packed into this release.

## Spaces

FiftyOne 0.19 debuts Spaces, a customizable framework for organizing interactive information Panels in the App.

As of FiftyOne 0.19, the following Panel types are included natively:

- [Samples Panel](https://docs.voxel51.com/user_guide/app.html#app-samples-panel): the media grid that loads by default when you launch the App
- [Histograms Panel](https://docs.voxel51.com/user_guide/app.html#app-histograms-panel): a dashboard of histograms for the fields of your dataset
- **(New!)** [Embeddings Panel](https://docs.voxel51.com/user_guide/app.html#app-embeddings-panel): a canvas for working with embeddings visualizations
- [Map Panel](https://docs.voxel51.com/user_guide/app.html#app-map-panel): visualizes the geolocation data of datasets that have a GeoLocation field
- You can also configure [custom Panels via plugins](https://docs.voxel51.com/plugins/index.html#fiftyone-plugins)!

In the screenshot below, for example, we’ve added the Embeddings and Map Panels to the default Samples Panel so we can visualize all three together seamlessly in the App.

![Viewing three panels in FiftyOne, customized through the new Spaces feature](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eva2ghp1qs6xcl8oeoki.png)

You can configure Spaces visually in the App in a variety of ways described below.

- Click the + icon in any Space to add a new Panel:

![Add a new panel in the FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/addob5jg3f9v7hu9ksee.gif)

- When you have multiple Panels open in a Space, you can use the divider buttons to split the Space either horizontally or vertically:

![Split Spaces and Panels in the FiftyOne App horizontally or vertically](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ask3e5ttnwsh7sax46f3.gif)

- You can rearrange Panels at any time by dragging their tabs between Spaces, or close a Panel by clicking on its x icon:

![Easily rearrange Panels in the FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d98a5cy7l0pb29p61fq4.gif)

You can also programmatically configure your Spaces layout from Python!

The code sample below shows an end-to-end example of loading a dataset, generating an embeddings visualization [via the FiftyOne Brain](https://docs.voxel51.com/user_guide/brain.html), and launching the App with a customized Spaces layout that includes the Samples Panel, Histograms Panel, and Embeddings Panel with the Brain result already loaded:

```
import fiftyone as fo
import fiftyone.brain as fob
import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart")
fob.compute_visualization(dataset, brain_key="img_viz")
samples_panel = fo.Panel(
    type="Samples",
    pinned=True,  # don’t allow closing
)
histograms_panel = fo.Panel(
    type="Histograms",
    state=dict(plot="Labels"),  # open label fields by default
)
# Open the visualization we generated above by default
embeddings_panel = fo.Panel(
    type="Embeddings",
    state=dict(brainResult="img_viz", colorByField="metadata.size_bytes"),
)
spaces = fo.Space(
    children=[
        fo.Space(
            children=[
                fo.Space(children=[samples_panel]),
                fo.Space(children=[histograms_panel]),
            ],
            orientation="horizontal",
        ),
        fo.Space(children=[embeddings_panel]),
    ],
    orientation="vertical",
)
session = fo.launch_app(dataset, spaces=spaces)
```

Check out [the docs](https://docs.voxel51.com/user_guide/app.html#spaces) for more information about using and configuring Spaces layouts.

## In-App embeddings visualization

New in FiftyOne 0.19 (and enabled by the Spaces feature above), when you load a dataset in the App that contains an [embeddings visualization](https://docs.voxel51.com/user_guide/brain.html#brain-embeddings-visualization), you can open the [Embeddings Panel](https://docs.voxel51.com/user_guide/app.html#embeddings-panel) to visualize and interactively explore a scatterplot of the embeddings in the App.

For example, try running the code below to download a dataset, generate two embeddings visualizations on it, and launch the App:

```
import fiftyone as fo
import fiftyone.brain as fob
import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart")
# Image embeddings
fob.compute_visualization(dataset, brain_key="img_viz")
# Object patch embeddings
fob.compute_visualization(
    dataset, patches_field="ground_truth", brain_key="gt_viz"
)
session = fo.launch_app(dataset)
```

Then click on the + icon next to the Samples tab to open the Embeddings Panel and use the two menus in the upper-left corner of the Panel to configure your plot:

- **Brain key**: the Brain key associated with the [compute_visualization()](https://docs.voxel51.com/user_guide/brain.html#visualizing-embeddings) run to display
- **Color by**: an optional sample field (or label attribute, for patches embeddings) to color the points by

From there you can lasso points in the plot to show only the corresponding samples/patches in the Samples Panel:

![FiftyOne App, In-App Embeddings Visualization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjuvw38b7fhtogruc3km.gif)

The Embeddings Panel also provides a number of additional controls:

- Press the **pan** icon in the menu (or type g) to switch to pan mode, in which you can click and drag to change your current field of view
- Press the **lasso** icon (or type s) to switch back to lasso mode
- Press the **locate** icon to reset the plot’s viewport to a tight crop of the current view’s embeddings
- Press the **x** icon (or double click anywhere in the plot) to clear the current selection

When coloring points by categorical fields (strings and integers) with fewer than 100 unique classes, you can also use the legend to toggle the visibility of each class of points:

- Single click on a legend trace to show/hide that class in the plot
- Double click on a legend trace to show/hide all other classes in the plot

![Embeddings Panel in FiftyOne - New Controls Available](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epfcesg22opt0dyy8giw.gif)

As demonstrated in the previous section, the Embeddings Panel can also be programmatically configured via Python.

Check out [the docs](https://docs.voxel51.com/user_guide/app.html#embeddings-panel) for more information about working with embeddings visualizations in the App.

## Saved views

In FiftyOne 0.19 you can use a new menu in the upper-left of the App to record the current state of the App’s view bar and filters sidebar as a **saved view** into your dataset:

![Save a dataset view in FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pehwij4n7t7lzon8rzhl.gif)

Saved views are persisted on your dataset under a name of your choice so that you can quickly load them in a future session via the UI or Python.

Saved views are a convenient way to record semantically relevant subsets of a dataset, such as:

- Samples in a particular state, e.g. with certain tag(s)
- A subset of a dataset that was used for a task, e.g. training a model
- Samples that contain content of interest, e.g. object types or image characteristics

Remember that saved views only store the rules used to extract content from the underlying dataset, not the actual content itself. You can save hundreds of views into a dataset if desired without worrying about storage space.

You can load a saved view at any time by selecting it from the saved view menu:

![Load a saved view in the FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbqo8ka6jixtmpmt7h13.gif)

You can also edit or delete saved views by clicking on their pencil icon:

![Editing a Saved View in the FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9el7u22ibqinwqw54cf.gif)

You can also programmatically create saved views [via Python](https://docs.voxel51.com/user_guide/using_views.html#saving-views):

```
import fiftyone as fo
import fiftyone.zoo as foz
from fiftyone import ViewField as F
dataset = foz.load_zoo_dataset("quickstart")
dataset.persistent = True
# Create a view
cats_view = (
    dataset
    .select_fields("ground_truth")
    .filter_labels("ground_truth", F("label") == "cat")
    .sort_by(F("ground_truth.detections").length(), reverse=True)
)
# Save the view
dataset.save_view("cats-view", cats_view)
```

And load them in future sessions (including saved views created via the App):

```
import fiftyone as fo
dataset = fo.load_dataset("quickstart")
# Retrieve a saved view
cats_view = dataset.load_saved_view("cats-view")
print(cats_view)
```

Check out [the docs](https://docs.voxel51.com/user_guide/app.html#saving-views) for more information about using saved views in the App and Python.

## On-disk segmentations

In prior FiftyOne versions, [semantic segmentations](https://docs.voxel51.com/user_guide/using_datasets.html#semantic-segmentation) and [heatmaps](https://docs.voxel51.com/user_guide/using_datasets.html#heatmaps) could only be stored as compressed bytes directly in the database.

Now in FiftyOne 0.19, you can store segmentations and heatmaps as images on disk and store (only) their paths on your FiftyOne datasets, just like you do for the primary media of each sample:

```
import cv2
import numpy as np
import fiftyone as fo
# Example segmentation mask
mask_path = "/tmp/segmentation.png"
mask = np.random.randint(10, size=(128, 128), dtype=np.uint8)
cv2.imwrite(mask_path, mask)
sample = fo.Sample(filepath="/path/to/image.png")
sample["segmentation"] = fo.Segmentation(mask_path=mask_path)
print(sample)
```

Segmentation masks can be stored in either of these formats on disk:

- 2D 8-bit or 16-bit images
- 3D 8-bit RGB images

When you load datasets with segmentation fields containing 2D masks in the App, each pixel value is rendered as a different color from the App’s color pool so that you can visually distinguish the classes. When you view RGB segmentation masks in the App, the mask colors are always used.

You can also [store semantic labels](https://docs.voxel51.com/user_guide/using_datasets.html#storing-mask-targets) for your segmentation fields on your dataset. Then, when you view the dataset in the App, label strings will appear in the App’s tooltip when you hover over pixels.

If you are working with 2D segmentation masks, specify target keys as integers:

```
import fiftyone as fo
dataset = fo.Dataset()
dataset.default_mask_targets = {1: "cat", 2: "dog"}
```

And if you are working with RGB segmentation masks, specify target keys as RGB hex strings:

```
import fiftyone as fo
dataset = fo.Dataset()
dataset.default_mask_targets = {"#499CEF": "cat", "#6D04FF": "dog"}
```

The entire FiftyOne API was upgraded to support on-disk and/or RGB segmentations:

- Evaluation via [evaluate_segmentations()](https://docs.voxel51.com/user_guide/evaluation.html#semantic-segmentations) natively supports on-disk and/or RGB segmentations
- The [apply_model()](https://docs.voxel51.com/api/fiftyone.core.collections.html#fiftyone.core.collections.SampleCollection.apply_model) method now has an optional output_dir argument specifying where to store semantic segmentation inferences as images on disk 
- There’s a new [export_segmentations()](https://docs.voxel51.com/api/fiftyone.utils.labels.html#fiftyone.utils.labels.export_segmentations) utility for conveniently exporting in-database segmentations to on-disk images
- Other new utilities like [transform_segmentations()](https://docs.voxel51.com/api/fiftyone.utils.labels.html#fiftyone.utils.labels.transform_segmentations) are now available for manipulating segmentations

Check out [the docs](https://docs.voxel51.com/user_guide/using_datasets.html#semantic-segmentation) for more information about adding on-disk segmentations to your FiftyOne datasets.

## New UI filtering options

We’re constantly improving and extending the filtering options available natively in the App to provide more powerful and intuitive ways to query datasets. In FiftyOne 0.19, we added a new selector that allows you to fine-tune your filters in the sidebar.

For example, when filtering by the label attribute of a Detections field, you can choose between the following options:

- (default): Filter to only show objects with the specified labels (omitting samples with no matching objects)
- Exclude objects with the specified labels
- Show samples that contain the specified labels (without filtering)
- Omit samples that contain the specific labels

All applicable filtering options are available from both the grid view and the [sample modal](https://docs.voxel51.com/user_guide/app.html#viewing-a-sample), and for all field types, including top-level fields and [dynamic label attributes](https://docs.voxel51.com/user_guide/using_datasets.html#dynamic-attributes)!

![New UI Filtering Options in the FiftyOne App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6un2cat43pmcz9xj9mnu.gif)

## FiftyOne Teams documentation

Exciting news! Documentation for FiftyOne Teams is now publicly available at [https://docs.voxel51.com/teams/index.html](https://docs.voxel51.com/teams).

FiftyOne Teams enables multiple users to securely collaborate on the same datasets and models, either on-premises or in the cloud, all built on top of the open source FiftyOne workflows that you’re already relying on. Look interesting? [Schedule a demo](https://voxel51.com/get-fiftyone-teams/) to get started with FiftyOne Teams yourself.

## Community contributions

Shoutout to the following community members who contributed to this release!

- [kalpit-S](https://github.com/kalpit-S) contributed [#2354 – added help link for Mapbox configuration in App](https://github.com/voxel51/fiftyone/pull/2354)
- [flakeice](https://github.com/flakeice) contributed [#2359 – fix bug when loading datasets in VOC format](https://github.com/voxel51/fiftyone/pull/2359)
- [Rustem Galiullin](https://github.com/Rusteam) contributed [#2353 – add support for custom CVAT task names](https://github.com/voxel51/fiftyone/pull/2353)
- [Rustem Galiullin](https://github.com/Rusteam) contributed [#2373 – exact frame count support](https://github.com/voxel51/fiftyone/pull/2373)
- [Oguz-hanoglu](https://github.com/oguz-hanoglu) contributed [#2297 – improved explanation of sidebar modes in the App](https://github.com/voxel51/fiftyone/pull/2297)
- [Jamie Werther](https://github.com/jwertherUM) contributed [#2427 – show only supported eval keys](https://github.com/voxel51/fiftyone/pull/2427)
- [Nikita Manovich](https://github.com/nmanovic) contributed [#2478 – Fix several CVAT links](https://github.com/voxel51/fiftyone/pull/2478)
- [Chris Hall](https://github.com/shortcipher3) contributed [#2561 – updated CVAT links](https://github.com/voxel51/fiftyone/pull/2561)

## FiftyOne community updates

The FiftyOne community continues to grow!

- 1,300+ [FiftyOne Slack](https://join.slack.com/t/fiftyone-users/shared_invite/zt-s6936w7b-2R5eVPJoUw008wP7miJmPQ) members
- 2,500+ stars on [GitHub](https://github.com/voxel51/fiftyone)
- 3,000+ [Meetup members](https://www.meetup.com/pro/computer-vision-meetups/)
- [Used by](https://github.com/voxel51/fiftyone/network/dependents?package_id=UGFja2FnZS0xNzAxODM0MjUx) 245+ repositories
- 56+ [contributors](https://github.com/voxel51/fiftyone/graphs/contributors)

## What’s next?

- If you like what you see on GitHub, [give the project a star](https://github.com/voxel51/fiftyone).
- [Get started!](https://voxel51.com/docs/fiftyone/index.html) We’ve made it easy to get up and running in a few minutes.
- Join the FiftyOne [Slack community](https://join.slack.com/t/fiftyone-users/shared_invite/zt-s6936w7b-2R5eVPJoUw008wP7miJmPQ), we’re always happy to help.