Using the FiftyOne App¶
The FiftyOne App is a powerful graphical user interface that enables you to visualize, browse, and interact directly with your FiftyOne Datasets.
The basic FiftyOne workflow is to open a Python shell and load a
From there you can launch the FiftyOne App and interact with it
programmatically via a session.
Creating a session¶
1 2 3
import fiftyone as fo session = fo.launch_app()
fo.launch_app() will launch the
App asynchronously and return control to your Python process. The App will
then remain open until you close it or the process exits.
If you are using the App in a non-interactive script, you should use
session.wait() to block
execution until you close it manually:
# Launch the App session = fo.launch_app(...) # (Perform any additional operations here) # Blocks execution until the App is closed session.wait()
Updating a session’s dataset¶
1 2 3 4
import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("cifar10") session.dataset = dataset
Updating a session’s view¶
For example, the command below loads a
DatasetView in the App that shows the
first 10 samples in the dataset sorted alphabetically by ground truth label:
session.view = dataset.sort_by("ground_truth.label")[:10]
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.
1 2 3 4 5 6
# On remote machine import fiftyone as fo dataset = fo.Dataset(name="my_dataset") session = fo.launch_app(dataset=dataset, remote=True)
You can manipulate the
session object as usual to programmatically interact
with the remote App instance that you’ll connect to next.
On the local machine, you can launch an App instance connected to a remote
session via the CLI. Alternatively, you can manually setup port forwarding on
your local machine via
ssh and connect to the App via Python.
Using the FiftyOne App¶
The App exposes powerful dataset exploration functionality directly in its user interface.
Any labels, tags, and scalar fields can be overlaid on the samples in the App by toggling the corresponding display options on the lefthand side of the App.
Viewing a sample¶
Double-click a sample to open an expanded view of the sample. This modal also
contains information about the fields of the
Sample and allows you to access
the raw JSON description of the sample.
Using the view bar¶
The view bar makes all of the powerful searching, sorting, and filtering
operations provided by DatasetViews available directly in
the App. Any changes to the current view that you make in the view bar are
reflected in the
DatasetView exposed by the
Session.view property of the
Session object associated with the App.
Scalars tabs in the App let you
visualize different aspects and statistics about your dataset.
Samples is the
default tab, which lets you visualize and select your image samples. The
Labels tab shows a distribution of labels of the currently loaded
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
Accessing selected samples¶
As previously explained, the
Session object created when you launch the App
lets you interact with the App from your Python process.
One common workflow is to select samples visually in the App and then access the data for the selected samples in Python. To perform this workflow, first select some samples in the App:
Next, access the
Session.selected property of
your session to retrieve the IDs of the currently selected samples in the App:
# Print the IDs of the currently selected samples print(session.selected) # Create a view containing only the selected samples selected_view = dataset.select(session.selected)
['5ef0eef405059ebb0ddfa6cc', '5ef0eef405059ebb0ddfa7c4', '5ef0eef405059ebb0ddfa86e', '5ef0eef405059ebb0ddfa93c']