Job#

class anomalib.pipelines.components.base.job.Job#

Bases: ABC

A job is an atomic unit of work that can be run in parallel with other jobs.

abstract static collect(results)#

Gather the results returned from run.

This can be used to combine the results from multiple runs or to save/process individual job results.

Parameters:

results (list) – List of results returned from run.

Returns:

Collated results.

Return type:

(GATHERED_RESULTS)

abstract run(task_id=None)#

A job is a single unit of work that can be run in parallel with other jobs.

task_id is optional and is only passed when the job is run in parallel.

Return type:

Any

abstract static save(results)#

Save the gathered results.

This can be used to save the results in a file or a database.

Parameters:

results (Any) – The gathered result returned from gather_results.

Return type:

None