NoveltyDetection
class NoveltyDetection extends DetectionJob
Traits
Properties
protected bool | $deleteWhenMissingModels | Ignore this job if the MAIA job does not exist any more. |
from DetectionJob |
protected string | $tmpDir | Temporary directory for files of this job. |
from DetectionJob |
int | $timeout | Disable the timeout of the Laravel queue worker because this job may run long. |
Methods
Create GenericImage instances for the images of this job.
Creates the specified directory if it does not exist.
Get the path to the temporary directory.
Execute a Python command and return the path to a file containing the output.
Parse the output JSON files to get the array of annotations for each image.
Create MAIA annotations from the training proposals.
Create an insert array for a MAIA annotation.
Insert one chunk of the MAIA annotations that should be created into the database.
Update the state of the MAIA job after processing the response.
Execute the job
Create the JSON file that is the input to the novelty detection script.
Apply the limit for the maximum number of annotations.
Details
in
DetectionJob at line 37
__construct(MaiaJob $job)
Create a new instance
in
DetectionJob at line 49
void
failed(Exception $exception)
The job failed to process.
in
DetectionJob at line 61
protected array
getGenericImages()
Create GenericImage instances for the images of this job.
in
DetectionJob at line 77
protected
cleanup()
Clean up temporary data produced by this job.
at line 92
protected
dispatchFailure(Exception $e)
Dispatch the job to notify the BIIGLE instance of a failure.
in
DetectionJob at line 92
protected
createTmpDir()
Create the temporary directory for this request.
in
DetectionJob at line 107
protected
ensureDirectory(string $path)
Creates the specified directory if it does not exist.
at line 100
protected string
getTmpDirPath()
Get the path to the temporary directory.
in
DetectionJob at line 133
protected string
python(string $command, string $log = 'log.txt')
Execute a Python command and return the path to a file containing the output.
in
DetectionJob at line 157
protected array
parseAnnotations(array $images)
Parse the output JSON files to get the array of annotations for each image.
in
DetectionJob at line 189
protected array
parseAnnotationsFile(GenericImage $image)
Parse the output JSON file of a single image.
in
DetectionJob at line 214
protected
createMaiaAnnotations(array $annotations)
Create MAIA annotations from the training proposals.
in
DetectionJob at line 236
protected array
createMaiaAnnotation(array $annotation)
Create an insert array for a MAIA annotation.
at line 131
protected
insertAnnotationChunk(array $chunk)
Insert one chunk of the MAIA annotations that should be created into the database.
at line 139
protected
updateJobState()
Update the state of the MAIA job after processing the response.
at line 28
handle()
Execute the job
at line 60
protected string
createInputJson(array $images, array $paths)
Create the JSON file that is the input to the novelty detection script.
at line 113
protected array
maybeLimitAnnotations(array $annotations, int $limit)
Apply the limit for the maximum number of annotations.