GenerateEmbedding
class GenerateEmbedding
Traits
SerializesModels
Queueable
Properties
| Image | $image | The image to generate an embedding of. |
|
| User | $user | The user who initiated the job. |
|
| protected bool | $deleteWhenMissingModels | Ignore this job if the image or user does not exist any more. |
|
| $tries | The number of times the job may be attempted. |
Methods
void
handle()
Handle the job.
string
string
getImageBufferForPyworker(string $path)
Get the byte string of the resized image for the Python worker.
string
sendPyworkerRequest(string $buffer)
Send the scaled-down PNG image to the Python worker and return the embedding npy file as binary blob.
Details
at line 68
void
handle()
Handle the job.
at line 88
protected string
generateEmbedding(Image $image)
Generate the embedding.
at line 101
protected string
getImageBufferForPyworker(string $path)
Get the byte string of the resized image for the Python worker.
at line 121
protected string
sendPyworkerRequest(string $buffer)
Send the scaled-down PNG image to the Python worker and return the embedding npy file as binary blob.