New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new empty pages #3766
new empty pages #3766
Conversation
a4cd1f0
to
3961dfa
Compare
3961dfa
to
993511a
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #3766 +/- ##
===========================================
- Coverage 15.57% 15.52% -0.05%
===========================================
Files 645 653 +8
Lines 74120 74834 +714
Branches 990 996 +6
===========================================
+ Hits 11542 11620 +78
- Misses 62578 63214 +636
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new pages are looking awesome! Here's some suggested copy tweaks for each page:
No datasets
No datasets yet
# If the `@voxel51/utils/create_dataset` plugin is installed
[Click here](open @voxel51/utils/create_dataset) to create a new dataset, or [browse operations](open operator browser) for other options
# If the `@voxel51/utils/create_dataset` plugin is not installed
Did you know? You can create datasets in the App by installing the [@voxel51/utils](https://github.com/voxel51/fiftyone-plugins/tree/main/plugins/utils) plugin, or [browse operations](open operator browser) for other options
[Learn more](https://docs.voxel51.com/user_guide/dataset_creation/index.html) about loading data into FiftyOne
Create dataset with code
You can use Python to [load data](https://docs.voxel51.com/user_guide/dataset_creation/index.html) into FiftyOne
import fiftyone as fo
# A name for the dataset
name = "my-dataset"
# The directory containing the data to import
dataset_dir = "/path/to/data"
# The type of data being imported
dataset_type = fo.types.COCODetectionDataset
dataset = fo.Dataset.from_dir(
dataset_dir=dataset_dir,
dataset_type=dataset_type,
name=name,
)
No dataset selected
No dataset selected
You can use the selector above to open an existing dataset
# If the `@voxel51/utils/create_dataset` plugin is installed
[Click here](open @voxel51/utils/create_dataset) to create a new dataset, or [browse operations](open operator browser) for other options
# If the `@voxel51/utils/create_dataset` plugin is not installed
Did you know? You can create datasets in the App by installing the [@voxel51/utils](https://github.com/voxel51/fiftyone-plugins/tree/main/plugins/utils) plugin, or [browse operations](open operator browser) for other options
Select a dataset with code
You can use Python to load a dataset in the App
import fiftyone as fo
# Name of an existing dataset
name = "quickstart"
dataset = fo.load_dataset(name)
# Launch a new App session
session = fo.launch_app(dataset)
# If you already have an active App session
# session.dataset = dataset
Dataset with no samples
No samples yet
# If the `@voxel51/io/import_samples` plugin is installed
[Click here](open @voxel51/io/import_samples) to add samples to this dataset, or [browse operations](open operator browser) for other options
# If the `@voxel51/io/import_samples` plugin is not installed
Did you know? You can add samples to datasets in the App by installing the [@voxel51/io](https://github.com/voxel51/fiftyone-plugins/tree/main/plugins/io) plugin, or [browse operations](open operator browser) for other options
[Learn more](https://docs.voxel51.com/user_guide/dataset_creation/index.html#custom-formats) about loading data into FiftyOne
Add samples with code
You can use Python to [add samples](https://docs.voxel51.com/user_guide/dataset_creation/index.html) to this dataset
import fiftyone as fo
dataset = fo.load_dataset("$CURRENT_DATASET_NAME")
samples = []
for filepath, label in zip(filepaths, labels):
sample = fo.Sample(filepath=filepath)
sample["ground_truth"] = fo.Classification(label=label)
samples.append(sample)
dataset.add_samples(samples)
d4ff536
to
34afbfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from a copy standpoint! 🥇
34afbfd
to
e57c3de
Compare
@imanjra this is super minor, but is it easy to introduce a minimum width for the code blocks? Some of them look a bit narrow (although all code is visible, of course). I'd suggest 80 characters wide since that's our Python style 🤓 It could even be a fixed width layout where anything longer causes horizontal scrolling (which we should make every effect to avoid with our canned code snippets) |
e43978a
to
3e2127d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! 🍨
Pulled and tested with an empty dataset.
Thoughts for later: For people checking out FO UI (without the SDK) it might be worth to have a button or operator that can populate the empty dataset with random images/videos so that the user can explore the app with a click of a button
@@ -75,6 +76,8 @@ const DatasetPageQueryNode = graphql` | |||
const DatasetPage: Route<DatasetPageQuery> = ({ prepared }) => { | |||
const data = usePreloadedQuery(DatasetPageQueryNode, prepared); | |||
const isModalActive = Boolean(useRecoilValue(fos.isModalActive)); | |||
const count = useRecoilValue(fos.datasetSampleCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, so this is not based on for example filters returning 0 samples but actual sample count of a dataset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. This count should not factor in filters applied.
registerOperator(SplitPanel); | ||
registerOperator(SetSelectedLabels); | ||
registerOperator(ClearSelectedLabels); | ||
_registerBuiltInOperator(CopyViewAsJSON); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the diff it looks like some built in operators are removed..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have refactored the operator loading and move some of the loading code out of this file. I have updated registerOperator
with _registerBuiltInOperator
to bind to built-in plugin. However, I will check to make sure they are not gone from the list 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@@ -15,6 +15,7 @@ import Nav from "../../components/Nav"; | |||
import { Route } from "../../routing"; | |||
import style from "../index.module.css"; | |||
import { DatasetPageQuery } from "./__generated__/DatasetPageQuery.graphql"; | |||
import Starter from "@fiftyone/core/src/components/Starter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small import nit. It's good to be explicit about what packages the core library exports I think
import Starter from "@fiftyone/core/src/components/Starter"; | |
import { Starter } from "@fiftyone/core"; |
Good idea. We do have several core operators in https://github.com/voxel51/fiftyone-plugins which allows creating, importing samples, loading zoo datasets and much more right from the app. |
ddabc55
to
0203130
Compare
What changes are proposed in this pull request?
Add new empty pages for the cases below:
When there are no datasets in FiftyOne
When there are datasets in FiftyOne, but none is selected
When a dataset is selected, but there are no samples in the dataset
How is this patch tested? If it is not, please explain why.
See preview above
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
See above
What areas of FiftyOne does this PR affect?
fiftyone
Python library changes