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 | $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 84
__construct(Volume $volume, User $user, string $jobId)
Job used for converting Point annotations to Polygons
at line 105
void
handle()
Execute the job.
at line 133
array
generateInputFile(mixed $chunk)
Generate the input File containing data for the execution of the job
at line 181
void
generateImageInputFile(array $paths, array $images)
Generate the input file containing image id and path data
at line 199
protected void
python()
Run the python script for Point to Polygon conversion
at line 230
void
uploadConvertedAnnotations()
Upload the converted annotations to the DB
at line 280
protected void
insertAnnotationChunk(array $annotations, array $annotationLabels)
Insert annotation in the DB
at line 308
void
cleanupJob()
Cleanup the existing job from the Volumes attribute
at line 321
void
cleanupFiles()
Cleanup the files that the job might have created
at line 331
void
failed(Throwable|null $exception)
Cleanup the Job if failed
at line 344
protected void
maybeDownloadCheckpoint(mixed $from, mixed $to)
Download the checkpoint if not present
at line 363
protected
processNewAnnotations(array $a)
Generate annotation chunks for new annotations
at line 381
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 414
protected SplFileObject
getCsvFile(string $file)
Open A CSV file.