NoveltyDetectionRequest
class NoveltyDetectionRequest extends JobRequest
This job is executed on a machine with GPU access.
Traits
Properties
protected int | $jobId | ID of the MAIA job. |
from JobRequest |
protected array | $jobParams | Parameters of the MAIA job. |
from JobRequest |
protected string | $volumeUrl | URL of the volume associated with the job. |
from JobRequest |
protected array | $images | Filenames of the images associated with the job, indexed by their IDs. |
from JobRequest |
protected string | $tmpDir | Temporary directory for files of this job. |
from JobRequest |
int | $timeout | Disable the timeout of the Laravel queue worker because this job may run long. |
Methods
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.
Execute the job
Create the JSON file that is the input to the novelty detection script.
Dispatch the job to store the novelty detection results.
Apply the limit for the maximum number of annotations.
Details
in
JobRequest at line 57
__construct(MaiaJob $job)
Create a new instance
in
JobRequest at line 71
void
failed(Exception $exception)
The job failed to process.
in
JobRequest at line 85
protected array
getGenericImages()
Create GenericImage instances for the images of this job.
in
JobRequest at line 98
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
JobRequest at line 116
protected
createTmpDir()
Create the temporary directory for this request.
in
JobRequest at line 131
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
JobRequest at line 153
protected
dispatch(Job $job)
Dispatch a response (success or failure) to the BIIGLE instance.
in
JobRequest at line 168
protected string
python(string $command, string $log = 'log.txt')
Execute a Python command and return the path to a file containing the output.
in
JobRequest at line 192
protected array
parseAnnotations(array $images)
Parse the output JSON files to get the array of annotations for each image.
in
JobRequest at line 224
protected array
parseAnnotationsFile(GenericImage $image)
Parse the output JSON file of a single image.
at line 26
handle()
Execute the job
at line 52
protected string
createInputJson(array $images, array $paths)
Create the JSON file that is the input to the novelty detection script.
at line 84
protected
dispatchResponse(array $annotations)
Dispatch the job to store the novelty detection results.
at line 114
protected array
maybeLimitAnnotations(array $annotations, int $limit)
Apply the limit for the maximum number of annotations.