fiftyone.operators.constants#
FiftyOne operator constants.
Classes:
Choices for target view that an operator should operate on |
Functions:
|
Returns the view target value that scopes |
|
Splits a view target value into its |
- class fiftyone.operators.constants.ViewTarget#
Bases:
objectChoices for target view that an operator should operate on
See
fiftyone.operators.types.ViewTargetProperty()for details.Attributes:
Base view from which a generated view was created
Current view in the app
Entire dataset
Empty dataset view, i.e.,
ctx.dataset.view().Selected labels in the app view, if any.
Selected samples in the app view, if any.
Custom view target specified by the caller.
Methods:
values()Returns all
ViewTargetvalues.- BASE_VIEW = 'BASE_VIEW'#
Base view from which a generated view was created
If the current view is a generated view such as
fiftyone.core.clips.ClipsView,fiftyone.core.video.FramesView, orfiftyone.core.patches.PatchesView), base view is the semantic equivalent of โentire datasetโ for these views. The base view is the view from which the generated view was created. For example,dataset.limit(51).to_frames("ground_truth").limit(10)has a base view ofdataset.limit(51).to_frames("ground_truth")
- CURRENT_VIEW = 'CURRENT_VIEW'#
Current view in the app
- DATASET = 'DATASET'#
Entire dataset
- DATASET_VIEW = 'DATASET_VIEW'#
Empty dataset view, i.e.,
ctx.dataset.view().Note: unlikely to be useful in the typical case.
- SELECTED_LABELS = 'SELECTED_LABELS'#
Selected labels in the app view, if any.
- SELECTED_SAMPLES = 'SELECTED_SAMPLES'#
Selected samples in the app view, if any.
- CUSTOM_VIEW_TARGET = 'CUSTOM_VIEW_TARGET'#
Custom view target specified by the caller.
When using this option, specify โcustom_view_targetโ in the operator parameters with a list of JSON-serialized view stages to apply.
- classmethod values()#
Returns all
ViewTargetvalues.
- fiftyone.operators.constants.scope_view_target(target, media_type)#
Returns the view target value that scopes
targetof a grouped dataset to every group slice ofmedia_type.- Parameters:
target โ a
ViewTargetvaluemedia_type โ a group slice media type
- Returns:
a view target value
- fiftyone.operators.constants.split_view_target(value)#
Splits a view target value into its
ViewTargetand the group slice media type it is scoped to.- Parameters:
value โ a view target value, as returned by
scope_view_target()or aViewTargetvalue- Returns:
a
(target, media_type)tuple, wheremedia_typeisNoneif the value is not scoped