Shortcuts

Viewing Datasets in the FiftyOne App

The FiftyOne App is a light weight user interface that allows you to browse and interact directly with your loaded Dataset.

Sessions

The workflow when working with FiftyOne is to open interactive python (ipython) and load a Dataset. The FiftyOne App is the graphical user interface that allows you to view the Dataset as well as any DatasetView into the Dataset.

Create a session

Sessions are the python objects that contain the instance of the app:

1
2
3
import fiftyone as fo

session = fo.launch_app()
App Startup Page

Update a session dataset

Sessions can be updated to show a new Dataset by updating the session object directly:

1
2
3
4
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("cifar10")
session.dataset = dataset
Cifar10

Update a session view

Sessions can also directly display a DatasetView. For example, you can sort the DatasetView by ground truth labels and then select the first 10 Sample objects to display.:

1
session.view = dataset.view().sort_by("ground_truth")[:10]
Cifar10 Sorted

Remote sessions

If your data is stored on a remote machine, you can forward a session from the remote machine to the FiftyOne App on your local machine and seemlessly browse your remote Dataset.

Remote machine

First log into the remote machine, load a FiftyOne Dataset, and create a session with the argument remote=True. This will send the session to port 5151:

1
2
3
4
5
# Remote Machine
import fiftyone as fo

dataset = fo.Dataset(name="my_dataset")
session = fo.launch_app(dataset=dataset, remote=True)

This is the session that will be modified to change what is being displayed.

Local machine

The easiest way to port forward and load the FiftyOne App is using the CLI. Alternatively, the port forwarding and App launching steps can be run separately.

On the local machine, the FiftyOne CLI can be used to forward the port 5151 and open the FiftyOne App locally.

In a local terminal, run the command:

# Local machine
fiftyone app connect --destination username@remote_machine_ip --port 5151

Open two terminal windows on the local machine. In order to forward the port 5151 from the remote machine to the local machine, run the following command directly in one of the terminal windows and leave this command running:

# Local machine
ssh -N -L 5151:127.0.0.1:5151 username@remote_machine_ip

The port 5151 is now being forwarded from the remote machine to port 5151 of the local machine through a process running in the background. Now in the other terminal window, open the FiftyOne App locally by starting python and running the following commands:

1
2
3
4
# Local machine
import fiftyone.core.session as fos

fos.launch_app()

Using the FiftyOne App

The App has various functionality built into the user interface itself.

Toggle attribute bubbles

Any labels, tags, and scalar fields can be viewed in the App directly on the sample images by toggling the corresponding buttons on the left hand side of the App.

Cifar10 Toggle

Accessing selected samples

First select samples in the App.

Cifar10 Selected

Second, load those samples into python:

1
print(session.selected)
['5ef0eef405059ebb0ddfa6cc',
 '5ef0eef405059ebb0ddfa7c4',
 '5ef0eef405059ebb0ddfa86e']

Viewing a sample

A sample can be double clicked to view a large version of it in a sidebar. This sidebar also contains the fields of the sample.

Cifar10 Sidebar

Tabs

The four tabs, Samples, Labels, Tags, and Scalars let you visualize different aspects and statistics about your dataset. Samples is the default tab that lets you visualize and select your image samples. The Labels tab shows a distribution of labels of the currently loaded Dataset or DatasetView. Any tags that were added and their corresponding counts will show up under the Tags tab. Scalar fields, for example if you computed uniqueness on your dataset, will be displayed under the Scalars tab.

Cifar10 Scalars

Accessing selected samples

As previously explained, a session lets you modify what is seen in the App by modifying the python object in the terminal. Additionally, you can also use the App to select samples and bring those into your python terminal.

First select samples in the App.

Cifar10 Selected

Second, load those samples into python:

selected = session.selected
print(selected)
['5ef0eef405059ebb0ddfa6cc',
 '5ef0eef405059ebb0ddfa7c4',
 '5ef0eef405059ebb0ddfa86e',
 '5ef0eef405059ebb0ddfa93c']