fiftyone icon indicating copy to clipboard operation
fiftyone copied to clipboard

[FR] Add support for linking directly to datasets, views, and samples

Open ramanova opened this issue 2 years ago • 2 comments

Proposal Summary

While collaborating on a dataset, it's often hard to share your findings with others. I propose having a multiple links support for Fiftyone.

I acknowledge, that this could be be proposed already or even implemented on some level, but weren't able to find previous stories like this.

Motivation

  • Sharing a link to a dataset or a sample, or a specific query would be incredible useful.
  • Currently there is no other option, other than passing around the IDs of samples and using query to search.
  • This would increase usability of Fiftyone in comparison to other tools we are using, that do have support for in-app links.
  • I wasn't able to find other ways to share data, other than passing IDs of samples / frames.

What areas of FiftyOne does this feature affect?

  • [x] App: FiftyOne application
  • [x] Core: Core fiftyone Python library
  • [x] Server: FiftyOne server

Details

Some use cases: fiftyone.com//<dataset_name>?query={filter{}} fiftyone.com//<dataset_name>?sample_id= fiftyone.com//<dataset_name>?<custom_label_id>=, custom_label_id could be a 'scene_id', etc.

Willingness to contribute

The FiftyOne Community encourages new feature contributions. Would you or another member of your organization be willing to contribute an implementation of this feature?

  • [ ] Yes. I can contribute this feature independently.
  • [x] Yes. I would be willing to contribute this feature with guidance from the FiftyOne community.
  • [ ] No. I cannot contribute this feature at this time.

ramanova avatar Jun 02 '22 08:06 ramanova

Love this idea!

fiftyone>=0.16.0 introduced the first step in this direction, you can link directly to a specific dataset. For example:

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset('quickstart')
session = fo.launch_app(dataset)

The quickstart dataset can be directly linked to via http://localhost:5151/datasets/quickstart.

The next steps would be the ability to link to a specific DatasetView, or a specific Sample of a Dataset or DatasetView:

http://localhost:5151/datasets/<name>?view=<view>&sample_id=<id>

brimoor avatar Jun 02 '22 15:06 brimoor

#1737 adds a relevant feature: the ability to save a view by name. So, building on my previous comment, here's the ways a user could directly link to specific things:

# Load a saved view in the grid
http://localhost:5151/datasets/<name>?view=<name>

# Load a specific sample in the expanded modal
http://localhost:5151/datasets/<name>?sample_id=<id>

# Load a saved view *and then* a specific sample in the view in the modal
http://localhost:5151/datasets/<name>?view=<name>&sample_id=<id>

And these workflows can/should be supported via the API as well:

import fiftyone as fo
import fiftyone.zoo as foz
from fiftyone import ViewField as F

dataset = foz.load_zoo_dataset("quickstart")

view = (
    dataset
    .select_fields("ground_truth")
    .filter_labels("ground_truth", F("label") == "cat")
)

dataset.save_view("test", view)

session = fo.launch_app(dataset)

# Load a saved view in the App
# This is already possible as of #1737
session.view = dataset.load_view("test")

# Proposed syntax: load a specific sample in the expanded modal
# This would need to be implemented
sample_id = dataset.shuffle().first().id
session.open_sample(sample_id)

brimoor avatar Aug 05 '22 17:08 brimoor

Closing. We can link to datasets and saved views. Samples forthcoming. Btw, if you are collaborating on datasets, sounds like you might need FiftyOne Teams!! https://voxel51.com/fiftyone-teams/

swheaton avatar Oct 07 '23 13:10 swheaton