ImageEmbeddingController
class ImageEmbeddingController extends Controller
Traits
Methods
Determines if the request was done by an automated script (with API token or ajax).
Redirects to the _redirect URL, to a route or else back.
Find an existing embedding that covers the requested bbox with resolution similar to the target expanded bbox.
Expand bbox to a square with at least the minimum model input size.
Calculate resolution range for matching embeddings within threshold.
Details
in
Controller at line 21
bool
isAutomatedRequest(Request $request = null)
Determines if the request was done by an automated script (with API token or ajax).
in
Controller at line 15
protected RedirectResponse
fuzzyRedirect()
Redirects to the _redirect URL, to a route or else back.
at line 40
Response
store(StoreImageEmbeddingRequest $request)
Request a SAM image embedding.
at line 107
protected array|null
findCoveringEmbedding(Image $image, mixed $disk, array|null $originalBbox, array|null $expandedBbox)
Find an existing embedding that covers the requested bbox with resolution similar to the target expanded bbox.
at line 175
protected array|null
expandBbox(Image $image, array $bbox)
Expand bbox to a square with at least the minimum model input size.
Returns null if the expanded bbox would be almost as large as the full image.
at line 229
protected array
getResolutionRange(int $width, int $height)
Calculate resolution range for matching embeddings within threshold.