fiftyone.operators.operations#
FiftyOne operator execution.
Classes:
|
Interface to trigger builtin operations on an execution context. |
- class fiftyone.operators.operations.Operations(ctx)#
Bases:
object
Interface to trigger builtin operations on an execution context.
- Parameters:
ctx β an
fiftyone.operators.executor.ExecutionContext
Methods:
Clone the selected samples in the App.
clone_sample_field
(field_name,Β new_field_name)Clone a sample field to a new field name.
rename_sample_field
(field_name,Β new_field_name)Rename a sample field to a new field name.
clear_sample_field
(field_name)Clear the contents of a sample field.
Delete the selected samples in the App.
Delete the selected labels in the App.
delete_sample_field
(field_name)Delete a sample field.
print_stdout
(message)Print a message to the standard output.
list_files
([path,Β list_filesystems])List files in a directory or list filesystems.
Reload the sample grid in the App.
Reload the dataset in the App.
Clear selected samples in the App.
Copy the current view in the App as JSON.
Set the view in the App from JSON present in clipboard.
clear_panel_state
([panel_id])Clear the state of the specified panel in the App.
clear_panel_data
([panel_id])Clear the data of the specified panel in the App.
set_panel_state
(state[,Β panel_id])Set the entire state of the specified panel in the App.
set_panel_data
(data[,Β panel_id])Set the entire data of the specified panel in the App.
patch_panel_state
(state[,Β panel_id])Patch the state of the specified panel in the App.
patch_panel_data
(data[,Β panel_id])Patch the state of the specified panel in the App.
reduce_panel_state
(reducer[,Β panel_id])Reduce the state of the specified panel in the App.
apply_panel_state_path
(path[,Β panel_id])Force update the state for path in the specified panel in the App.
show_panel_output
(output[,Β panel_id])Show output in the specified panel in the App.
open_panel
(name[,Β is_active,Β layout,Β force,Β ...])Open a panel with the given name and layout options in the App.
register_panel
(name,Β label[,Β help_markdown,Β ...])Registers a panel with the given name and lifecycle callbacks.
Open all available panels in the App.
close_panel
([name,Β id])Close the given panel in the App.
Close all open panels in the App.
split_panel
(name,Β layout)Split the panel with the given layout in the App.
open_dataset
(dataset_name)Open the specified dataset in the App.
Clear the view bar in the App.
Clear all filters in the App's sidebar.
Clear all selections, filters, and view stages from the App.
Refresh the colors used in the App's UI.
Show the samples that are currently selected in the App.
Convert the extended selection to selected samples in the App.
set_selected_samples
(samples)Select the specified samples in the App.
set_view
([view,Β name])Set the current view in the App.
show_samples
(samples[,Β use_extended_selection])Show specific samples, optionally using extended selection in the App.
console_log
(message)Log a message to the console.
show_output
(outputs,Β results)Show output in the App's UI.
set_progress
([label,Β progress,Β variant])Set the progress indicator in the App's UI.
test_operator
(operator,Β raw_params)Test the operator with given parameters.
set_selected_labels
(labels)Set the selected labels in the App.
Clear the selected labels in the App.
notify
(message[,Β variant])Show a notification in the App.
set_extended_selection
([selection,Β scope,Β ...])Sets the extended selection in the App.
set_spaces
([spaces,Β name])Sets the current spaces in the App.
set_active_fields
([fields])Set the active fields in the App.
Clear the active fields in the App.
track_event
(event[,Β properties])Track an event in the App.
set_panel_title
([id,Β title])Set the title of the specified panel in the App.
set_group_slice
(slice)Set the active group slice in the App.
open_sample
([id,Β group_id])Opens the specified sample or group in the App's sample modal.
Closes the App's sample modal.
Show the App's sidebar.
Hide the App's sidebar.
Toggle the visibility of the App's sidebar.
- clone_selected_samples()#
Clone the selected samples in the App.
- clone_sample_field(field_name, new_field_name)#
Clone a sample field to a new field name.
- Parameters:
field_name β the name of the field to clone
new_field_name β the name for the new field
- rename_sample_field(field_name, new_field_name)#
Rename a sample field to a new field name.
- Parameters:
field_name β the name of the field to rename
new_field_name β the new name for the field
- clear_sample_field(field_name)#
Clear the contents of a sample field.
- Parameters:
field_name β the name of the field to clear
- delete_selected_samples()#
Delete the selected samples in the App.
- delete_selected_labels()#
Delete the selected labels in the App.
- delete_sample_field(field_name)#
Delete a sample field.
- Parameters:
field_name β the name of the field to delete
- print_stdout(message)#
Print a message to the standard output.
- Parameters:
message β the message to print
- list_files(path=None, list_filesystems=False)#
List files in a directory or list filesystems.
- Parameters:
path (None) β the path to list files from, or None to list filesystems
list_filesystems (False) β whether to list filesystems instead of files
- reload_samples()#
Reload the sample grid in the App.
- reload_dataset()#
Reload the dataset in the App.
- clear_selected_samples()#
Clear selected samples in the App.
- copy_view_as_json()#
Copy the current view in the App as JSON.
- view_from_json()#
Set the view in the App from JSON present in clipboard.
- clear_panel_state(panel_id=None)#
Clear the state of the specified panel in the App.
- Parameters:
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- clear_panel_data(panel_id=None)#
Clear the data of the specified panel in the App.
- Parameters:
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- set_panel_state(state, panel_id=None)#
Set the entire state of the specified panel in the App.
- Parameters:
state β the state to set
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- set_panel_data(data, panel_id=None)#
Set the entire data of the specified panel in the App.
- Parameters:
data β the data to set
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- patch_panel_state(state, panel_id=None)#
Patch the state of the specified panel in the App.
- Parameters:
state β the state to set
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- patch_panel_data(data, panel_id=None)#
Patch the state of the specified panel in the App.
- Parameters:
data β the data to set
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- reduce_panel_state(reducer, panel_id=None)#
Reduce the state of the specified panel in the App.
- Parameters:
reducer β the reducer to apply
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- apply_panel_state_path(path, panel_id=None)#
Force update the state for path in the specified panel in the App.
- Parameters:
path (str) β the path to force update
- show_panel_output(output, panel_id=None)#
Show output in the specified panel in the App.
- Parameters:
output β the output to show
panel_id (None) β the optional ID of the panel to clear. If not provided, the
ctx.panel_id
will be used
- open_panel(name, is_active=True, layout=None, force=False, force_duplicate=False)#
Open a panel with the given name and layout options in the App.
- Parameters:
name β the name of the panel to open
is_active (True) β whether to activate the panel immediately
layout (None) β the layout orientation
("horizontal", "vertical")
, if applicableforce (False) β whether to force open the panel. Skips the check to see if a panel with the same name exists or whether the panel declares
allow_multiple=False
force_duplicate (False) β whether to force open the panel even if it is already open. Only applicable if force is
True
- register_panel(name, label, help_markdown=None, category=Categories.CUSTOM, alpha=False, beta=False, is_new=False, icon=None, light_icon=None, dark_icon=None, surfaces='grid', on_load=None, on_unload=None, on_change=None, on_change_ctx=None, on_change_dataset=None, on_change_view=None, on_change_spaces=None, on_change_current_sample=None, on_change_selected=None, on_change_selected_labels=None, on_change_extended_selection=None, on_change_group_slice=None, on_change_query_performance=None, on_change_active_fields=None, allow_duplicates=False, priority=None, _builtin=False)#
Registers a panel with the given name and lifecycle callbacks.
- Parameters:
name β the name of the panel
help_markdown (None) β help text associated with the panel in markdown format
label β the display name of the panel
icon (None) β the icon to show in the panelβs tab
light_icon (None) β the icon to show in the panelβs tab when the App is in light mode
dark_icon (None) β the icon to show in the panelβs tab when the App is in dark mode
surfaces ('grid') β surfaces in which to show the panel. Must be one of βgridβ, βmodalβ, or βgrid modalβ
alpha (False) β whether the panel is in alpha
beta (False) β whether the panel is in beta
is_new (False) β whether the panel is new
category (Categories.CUSTOM) β the category of the panel
on_load (None) β an operator to invoke when the panel is loaded
on_unload (None) β an operator to invoke when the panel is unloaded
on_change (None) β an operator to invoke when the panel state changes
on_change_ctx (None) β an operator to invoke when the panel execution context changes
on_change_dataset (None) β an operator to invoke when the current dataset changes
on_change_view (None) β an operator to invoke when the current view changes
on_change_spaces (None) β an operator to invoke when the current spaces layout changes
on_change_current_sample (None) β an operator to invoke when the current sample changes
on_change_selected (None) β an operator to invoke when the current selected samples changes
on_change_selected_labels (None) β an operator to invoke when the current selected labels changes
on_change_extended_selection (None) β an operator to invoke when the current extended selection changes
on_change_group_slice (None) β an operator to invoke when the group slice changes
on_change_query_performance (None) β an operator to invoke when the query performance changes
on_change_active_fields (None) β an operator to invoke when the active fields change
allow_duplicates (False) β whether to allow multiple instances of the panel to the opened
priority (None) β the priority of the panel, used for sort order
_builtin (False) β whether the panel is a builtin panel
- open_all_panels()#
Open all available panels in the App.
- close_panel(name=None, id=None)#
Close the given panel in the App.
- Parameters:
name (None) β the name of the panel to close
id (None) β the ID of the panel to close
- close_all_panels()#
Close all open panels in the App.
- split_panel(name, layout)#
Split the panel with the given layout in the App.
- Parameters:
name β the name of the panel to split
layout β the layout orientation
("horizontal", "vertical")
- open_dataset(dataset_name)#
Open the specified dataset in the App.
- Parameters:
dataset_name β the name of the dataset to open
- clear_view()#
Clear the view bar in the App.
- clear_sidebar_filters()#
Clear all filters in the Appβs sidebar.
- clear_all_stages()#
Clear all selections, filters, and view stages from the App.
- refresh_colors()#
Refresh the colors used in the Appβs UI.
- show_selected_samples()#
Show the samples that are currently selected in the App.
- convert_extended_selection_to_selected_samples()#
Convert the extended selection to selected samples in the App.
- set_selected_samples(samples)#
Select the specified samples in the App.
- Parameters:
samples β a list of sample IDs to select
- set_view(view=None, name=None)#
Set the current view in the App.
- Parameters:
view (None) β a
fiftyone.core.view.DatasetView
to loadname (None) β the name of a saved view to load
- show_samples(samples, use_extended_selection=False)#
Show specific samples, optionally using extended selection in the App.
- Parameters:
samples β a list of sample IDs to show
use_extended_selection (False) β whether to use the extended selection feature
- console_log(message)#
Log a message to the console.
- Parameters:
message β the message to log
- show_output(outputs, results)#
Show output in the Appβs UI.
- Parameters:
outputs β outputs to show
results β results to display
- set_progress(label=None, progress=None, variant=None)#
Set the progress indicator in the Appβs UI.
- Parameters:
label (None) β a label for the progress indicator
progress (None) β a progress value to set
variant (None) β the type of indicator
("linear", "circular")
- test_operator(operator, raw_params)#
Test the operator with given parameters.
- Parameters:
operator β the operator to test
raw_params β raw parameters for the operator
- set_selected_labels(labels)#
Set the selected labels in the App.
- Parameters:
labels β the labels to select
- clear_selected_labels()#
Clear the selected labels in the App.
- notify(message, variant='info')#
Show a notification in the App.
Variants are βinfoβ, βsuccessβ, βwarningβ, and βerrorβ.
- Parameters:
message β the message to show
variant ("info") β the type of notification
- set_extended_selection(selection=None, scope=None, clear=False, reset=False)#
Sets the extended selection in the App.
- Parameters:
selection (None) β the selection to set
scope (None) β the scope of the selection
clear (None) β whether to clear the selection
reset (None) β whether to reset the selection
- set_spaces(spaces=None, name=None)#
Sets the current spaces in the App.
- Parameters:
spaces (None) β a
fiftyone.core.odm.workspace.Space
to loadname (None) β the name of the workspace to load
- set_active_fields(fields=None)#
Set the active fields in the App.
- Parameters:
fields (None) β the possibly-empty list of fields or
embedded.fields
to set
- clear_active_fields()#
Clear the active fields in the App.
- track_event(event, properties=None)#
Track an event in the App.
- Parameters:
event β the event to track
properties (None) β the properties to track
- set_panel_title(id=None, title=None)#
Set the title of the specified panel in the App.
- Parameters:
id (None) β the ID of the panel to set the title
title (None) β the title to set
- set_group_slice(slice)#
Set the active group slice in the App.
- Parameters:
slice β the group slice to activate
- open_sample(id=None, group_id=None)#
Opens the specified sample or group in the Appβs sample modal.
- Parameters:
id (None) β a sample ID to open in the modal
group_id (None) β a group ID to open in the modal
- close_sample()#
Closes the Appβs sample modal.
- show_sidebar()#
Show the Appβs sidebar.
- hide_sidebar()#
Hide the Appβs sidebar.
- toggle_sidebar()#
Toggle the visibility of the Appβs sidebar.