PtpJob
class PtpJob extends Job implements ShouldQueue
Traits
Properties
| protected string | $tmpInputFile | File where the input data for the Python script will be kept |
|
| protected string | $tmpImageInputFile | File where the image input data for the Python script will be kept |
|
| protected string | $outputFile | File where result data from the Python conversion script will be stored |
|
| static int | $imageChunkSize | Number of images to be processed per chunk |
|
| static int | $insertChunkSize | Number of annotations to be inserted per chunk |
|
| protected bool | $deleteWhenMissingModels | Ignore this job if the project or volume does not exist any more. |
|
| protected | $annotatedFileColumns | List of columns of the CSV file |
Methods
Job used for converting Point annotations to Polygons
Execute the job.
Generate the input File containing data for the execution of the job
Generate the input file containing image id and path data
Run the python script for Point to Polygon conversion
Upload the converted annotations to the DB
Insert annotation in the DB
Cleanup the existing job from the Volumes attribute
Cleanup the files that the job might have created
Download the checkpoint if not present
Generate annotation chunks for new annotations
Create a generator that iterates the lines of a CSV file containing annotation results from the PTP conversion.
Open A CSV file.
Details
at line 89
__construct(Volume $volume, User $user, string $jobId)
Job used for converting Point annotations to Polygons
at line 110
void
handle()
Execute the job.
at line 134
array
generateInputFile($chunk)
Generate the input File containing data for the execution of the job
at line 184
void
generateImageInputFile(array $paths, array $images)
Generate the input file containing image id and path data
at line 202
protected void
python()
Run the python script for Point to Polygon conversion
at line 233
void
uploadConvertedAnnotations()
Upload the converted annotations to the DB
at line 281
protected void
insertAnnotationChunk(array $annotations, array $annotationLabels)
Insert annotation in the DB
at line 309
void
cleanupJob()
Cleanup the existing job from the Volumes attribute
at line 322
void
cleanupFiles()
Cleanup the files that the job might have created
at line 332
void
failed(Throwable|null $exception)
Cleanup the Job if failed
at line 345
protected void
maybeDownloadCheckpoint($from, $to)
Download the checkpoint if not present
at line 364
protected
processNewAnnotations(array $a)
Generate annotation chunks for new annotations
at line 382
protected Generator
iterateOverCsvFile(string $file)
Create a generator that iterates the lines of a CSV file containing annotation results from the PTP conversion.
at line 418
protected SplFileObject
getCsvFile(string $file)
Open A CSV file.