DetectionJob
abstract class DetectionJob implements ShouldQueue
Traits
Properties
| protected string | $tmpDir | Temporary directory for files of this job. |
Methods
Create GenericImage instances for the images of this job.
Clean up temporary data produced by this job.
Create the temporary directory for this request.
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.
Apply the limit for the maximum number of annotations.
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.
Details
at line 31
__construct(MaiaJob $job)
Create a new instance
at line 43
void
failed(Exception $exception)
The job failed to process.
at line 55
protected array
getGenericImages()
Create GenericImage instances for the images of this job.
at line 71
protected
cleanup()
Clean up temporary data produced by this job.
at line 82
abstract protected
dispatchFailure(Exception $e)
Dispatch the job to notify the BIIGLE instance of a failure.
at line 87
protected
createTmpDir()
Create the temporary directory for this request.
at line 102
protected
ensureDirectory(string $path)
Creates the specified directory if it does not exist.
at line 114
protected string
getTmpDirPath()
Get the path to the temporary directory.
at line 128
protected string
python(string $command, string $log = 'log.txt', $env = '')
Execute a Python command and return the path to a file containing the output.
at line 152
protected array
parseAnnotations(array $images)
Parse the output JSON files to get the array of annotations for each image.
at line 184
protected array
parseAnnotationsFile(GenericImage $image)
Parse the output JSON file of a single image.
at line 209
protected
createMaiaAnnotations(array $annotations)
Create MAIA annotations from the training proposals.
at line 234
protected array
createMaiaAnnotation(array $annotation)
Create an insert array for a MAIA annotation.
at line 257
protected array
maybeLimitAnnotations(array $annotations, int $limit)
Apply the limit for the maximum number of annotations.
at line 277
abstract protected
insertAnnotationChunk(array $chunk)
Insert one chunk of the MAIA annotations that should be created into the database.
at line 282
abstract protected
updateJobState()
Update the state of the MAIA job after processing the response.