MCPcopy
hub / github.com/cshum/imagor / Detector

Interface Detector

detector.go:26–30  ·  view source on GitHub ↗

Detector detects regions of interest in a raw pixel buffer. Implementations are free to perform any kind of detection (faces, objects, text boxes, etc.) — the only contract is the coordinate space. imagePath identifies the source image (e.g. URL path) and is used as a cache key by implementations t

Source from the content-addressed store, hash-verified

24// Returned regions must use normalised coordinates in [0.0, 1.0] relative to
25// the image width / height stored in blob.
26type Detector interface {
27 Startup(ctx context.Context) error
28 Detect(ctx context.Context, imagePath string, blob *Blob) ([]DetectorRegion, error)
29 Shutdown(ctx context.Context) error
30}
31
32// DetectorAdder is implemented by processors that accept one or more Detectors.
33// imagorface and other detector plugins use this interface to wire a detector

Callers 2

TestWithDetectorFunction · 0.85
TestWithDetectorsFunction · 0.85

Implementers 3

testDetectorimagor_test.go
stubDetectorprocessor/vipsprocessor/processor_test
failingDetectorprocessor/vipsprocessor/processor_test

Calls

no outgoing calls

Tested by

no test coverage detected