GenerateAnnotationFeatureVectors
abstract class GenerateAnnotationFeatureVectors extends GenerateFeatureVectors
Traits
Constants
INSERT_CHUNK_SIZE |
Number of feature vector models to insert in one chunk. |
Properties
protected bool | $deleteWhenMissingModels | Ignore this job if the MAIA job does not exist any more. |
Methods
Get the bounding box of an annotation
Modify a bounding box so it adheres to the aspect ratio given by width and height.
Adjust the position and size of the box so it is contained in a box with the given dimensions.
Get the bounding box of a point annotation.
Get the bounding box of a circle annotation.
Get the bounding box of an annotation that is no point, circle or whole frame.
Generate the input for the python script.
Generator to read the output CSV row by row.
Handle the job.
Get the training proposals or annotation candidates of the job.
Insert a chunk of new feature vector models.
Details
in
GenerateFeatureVectors at line 21
array
getAnnotationBoundingBox(array $points, Shape $shape, int $pointPadding = 112, int $boxPadding = 0, int $minSize = 32)
Get the bounding box of an annotation
in
GenerateFeatureVectors at line 70
array
ensureBoxAspectRatio(array $box, int $aspectWidth, int $aspectHeight)
Modify a bounding box so it adheres to the aspect ratio given by width and height.
in
GenerateFeatureVectors at line 108
makeBoxContained(array $box, int|null $maxWidth, int|null $maxHeight)
Adjust the position and size of the box so it is contained in a box with the given dimensions.
in
GenerateFeatureVectors at line 134
protected array
getPointBoundingBox(array $points, int $padding)
Get the bounding box of a point annotation.
in
GenerateFeatureVectors at line 147
protected array
getCircleBoundingBox(array $points)
Get the bounding box of a circle annotation.
in
GenerateFeatureVectors at line 160
protected array
getPolygonBoundingBox(array $points)
Get the bounding box of an annotation that is no point, circle or whole frame.
in
GenerateFeatureVectors at line 180
protected array
makeBoxIntegers(array $box)
Round and cast box values to int.
in
GenerateFeatureVectors at line 194
protected array
generateInput(array $files, array $paths, Collection $annotations)
Generate the input for the python script.
in
GenerateFeatureVectors at line 211
protected array
generateFileInput(VolumeFile $file, Collection $annotations)
No description
in
GenerateFeatureVectors at line 246
protected
python(string $inputPath, string $outputPath)
Run the Python command.
in
GenerateFeatureVectors at line 262
protected Generator
readOutputCsv(string $path)
Generator to read the output CSV row by row.
at line 36
__construct(MaiaJob $job)
Create a new isntance.
at line 47
void
handle()
Handle the job.
at line 96
abstract protected Collection
getAnnotations()
Get the training proposals or annotation candidates of the job.
at line 101
abstract protected void
insertFeatureVectorModelChunk(array $chunk)
Insert a chunk of new feature vector models.