class BaseRun(Configurable): (source)
Known subclasses: fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
Constructor: BaseRun(config)
Base class for methods that can be run on a dataset.
Subclasses will typically declare an interface method that handles performing the actual run. The function of this base class is to declare how to validate that a run is valid and how to cleanup after a run.
Parameters | |
config | a BaseRunConfig |
Class Method | delete |
Deletes the results associated with the given run key from the collection. |
Class Method | delete |
Deletes all runs from the collection. |
Class Method | get |
Gets the BaseRunInfo for the given key on the collection. |
Class Method | has |
Determines whether BaseRunResults for the given key are cached on the collection. |
Class Method | list |
Returns the list of run keys on the given collection. |
Class Method | load |
Loads the BaseRunResults for the given key on the collection. |
Class Method | load |
Loads the fiftyone.core.view.DatasetView on which the specified run was performed. |
Class Method | run |
The BaseRunInfo class associated with this class. |
Class Method | save |
Saves the run information on the collection. |
Class Method | save |
Saves the run results on the collection. |
Class Method | update |
Updates the BaseRunConfig for the given run on the collection. |
Class Method | update |
Replaces the key for the given run with a new key. |
Method | cleanup |
Cleans up the results of the run with the given key from the collection. |
Method | ensure |
Ensures that any necessary packages to execute this run are installed. |
Method | ensure |
Ensures that any necessary packages to use existing results for this run are installed. |
Method | get |
Gets the fields that were involved in the given run. |
Method | register |
Registers a run of this method under the given key on the given collection. |
Method | rename |
Performs any necessary operations required to rename this run's key. |
Method | validate |
Validates that the collection can accept this run. |
Class Method | _get |
Undocumented |
Class Method | _get |
Undocumented |
Class Method | _get |
Undocumented |
Class Method | _patch |
A function that can patch any ReferenceField issues with a dataset's runs. |
Class Method | _results |
The fiftyone.core.dataset.Dataset field that stores the results cache for these runs. |
Class Method | _run |
A string to use when referring to these runs in log messages. |
Class Method | _runs |
The fiftyone.core.odm.dataset.DatasetDocument field in which these runs are stored. |
Method | _validate |
Undocumented |
Method | _validate |
Subclass-specific validation when a run with the given key already exists. |
Inherited from Configurable
:
Method | __init__ |
Undocumented |
Instance Variable | config |
Undocumented |
Deletes the results associated with the given run key from the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
cleanup:True | whether to execute the run's
BaseRun.cleanup method |
Deletes all runs from the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
cleanup:True | whether to execute the run's
BaseRun.cleanup methods |
Gets the BaseRunInfo
for the given key on the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
Returns | |
a BaseRunInfo |
Determines whether BaseRunResults
for the given key are
cached on the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
Returns | |
True/False |
Returns the list of run keys on the given collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
type:None | a specific run type to match, which can be:
|
method:None | a specific
fiftyone.core.runs.BaseRunConfig.method string to match |
**kwargs | optional config parameters to match |
Returns | |
a list of run keys |
def load_run_results(cls, samples, key, cache=True, load_view=True, **kwargs): (source) ¶
Loads the BaseRunResults
for the given key on the
collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
cache:True | whether to cache the results on the collection |
loadTrue | whether to load the run view in the results (True) or the full dataset (False) |
**kwargs | keyword arguments for the run's
BaseRunConfig.load_credentials method |
Returns | |
a BaseRunResults , or None if the run did not save results |
Loads the fiftyone.core.view.DatasetView
on which the
specified run was performed.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
selectFalse | whether to exclude fields involved in other runs of the same type |
Returns | |
a fiftyone.core.view.DatasetView |
fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
The BaseRunInfo
class associated with this class.
Saves the run information on the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
run | a BaseRunInfo |
overwrite:True | whether to overwrite an existing run with the same key |
cleanup:True | whether to execute an existing run's
BaseRun.cleanup method when overwriting it |
def save_run_results(cls, samples, key, run_results, overwrite=True, cache=True): (source) ¶
Saves the run results on the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
run | a BaseRunResults , or None |
overwrite:True | whether to overwrite an existing result with the same key |
cache:True | whether to cache the results on the collection |
Updates the BaseRunConfig
for the given run on the
collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
config | a BaseRunConfig |
Replaces the key for the given run with a new key.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
new | a new run key |
fiftyone.utils.eval.classification.ClassificationEvaluation
, fiftyone.utils.eval.detection.DetectionEvaluation
, fiftyone.utils.eval.regression.RegressionEvaluation
, fiftyone.utils.eval.segmentation.SegmentationEvaluation
Cleans up the results of the run with the given key from the collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
Ensures that any necessary packages to execute this run are installed.
Runs should respect fiftyone.config.requirement_error_level when handling errors.
Ensures that any necessary packages to use existing results for this run are installed.
Runs should respect fiftyone.config.requirement_error_level when handling errors.
fiftyone.utils.annotations.AnnotationBackend
, fiftyone.utils.eval.classification.ClassificationEvaluation
, fiftyone.utils.eval.detection.DetectionEvaluation
, fiftyone.utils.eval.regression.RegressionEvaluation
, fiftyone.utils.eval.segmentation.SegmentationEvaluation
Gets the fields that were involved in the given run.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
Returns | |
a list of fields |
Registers a run of this method under the given key on the given collection.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
overwrite:True | whether to allow overwriting an existing run of the same type |
cleanup:True | whether to execute an existing run's
BaseRun.cleanup method when overwriting it |
fiftyone.utils.eval.classification.ClassificationEvaluation
, fiftyone.utils.eval.detection.DetectionEvaluation
, fiftyone.utils.eval.regression.RegressionEvaluation
, fiftyone.utils.eval.segmentation.SegmentationEvaluation
Performs any necessary operations required to rename this run's key.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
new | a new run key |
Validates that the collection can accept this run.
The run may be invalid if, for example, a run of a different type has already been run under the same key and thus overwriting it would cause ambiguity on how to cleanup the results.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
overwrite:True | whether to allow overwriting an existing run of the same type |
Raises | |
ValueError | if the run is invalid |
fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
A function that can patch any ReferenceField issues with a dataset's runs.
fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
The fiftyone.core.dataset.Dataset
field that stores the
results cache for these runs.
fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
A string to use when referring to these runs in log messages.
fiftyone.core.annotation.AnnotationMethod
, fiftyone.core.brain.BrainMethod
, fiftyone.core.evaluation.EvaluationMethod
, fiftyone.core.runs.Run
The fiftyone.core.odm.dataset.DatasetDocument
field in
which these runs are stored.
fiftyone.utils.eval.classification.ClassificationEvaluation
, fiftyone.utils.eval.detection.DetectionEvaluation
, fiftyone.utils.eval.regression.RegressionEvaluation
, fiftyone.utils.eval.segmentation.SegmentationEvaluation
Subclass-specific validation when a run with the given key already exists.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
key | a run key |
existing | a BaseRunInfo |
Raises | |
ValueError | if the run is invalid |