TrackObject
class TrackObject extends Job implements ShouldQueue
Attempts to track an obect in a video. The object is initially defined by a video annotation. The annotation will be updated with the positions determined with the object tracking method.
Traits
Properties
| int | $tries | The number of times the job may be attempted. |
|
| protected int | $annotationId | The annotation ID that defines the initial object to track. |
|
| protected int | $userId | The user ID who initialized the tracking request. |
Methods
Return the cache key to store the number of concurrent jobs for each user.
Execute the job.
Execute the object tracking method and get the resulting annotation key frames.
Get the path to to input file for the object tracking script.
Create the JSON file that is the input for the object tracking script.
Delete a file if it exists.
Get the path to to output file for the object tracking script.
Execute a Python script.
Get the coordinates and dimensions of the start window for the object tracking script.
Get the points of a keyframe depending on the annotation shape.
Decrement the count of object tracking jobs.
Details
at line 55
static string
getRateLimitCacheKey(int $userId)
Return the cache key to store the number of concurrent jobs for each user.
at line 66
__construct(VideoAnnotation $annotation, User $user)
Create a new instance.
at line 77
void
handle()
Execute the job.
at line 123
protected array
getTrackingKeyframes(VideoAnnotation $annotation)
Execute the object tracking method and get the resulting annotation key frames.
at line 157
protected string
getInputJsonPath(VideoAnnotation $annotation)
Get the path to to input file for the object tracking script.
at line 170
protected string
createInputJson(VideoAnnotation $annotation, string $videoPath)
Create the JSON file that is the input for the object tracking script.
at line 190
protected
maybeDeleteFile(string $path)
Delete a file if it exists.
at line 204
protected string
getOutputJsonPath(int $annotationId)
Get the path to to output file for the object tracking script.
at line 216
protected string
python(string $command)
Execute a Python script.
at line 239
protected array
getStartWindow(VideoAnnotation $annotation)
Get the coordinates and dimensions of the start window for the object tracking script.
at line 282
protected array
getPointsFromKeyframe(VideoAnnotation $annotation, array $keyframe)
Get the points of a keyframe depending on the annotation shape.
at line 296
protected
decrementCacheValue()
Decrement the count of object tracking jobs.