Versions in this module Expand all Collapse all v0 v0.1.0 Oct 10, 2026 Changes in this version + const EnvCacheDir + const EnvLibraryPath + var DetModel = hfModel("PaddlePaddle/PP-OCRv6_small_det_onnx", ...) + var ElementModel = releaseModel("models-v1", "icon_detect_v3.onnx", ...) + var ErrUnavailable = errors.New("textshot: OCR unavailable") + var RecModel = hfModel("PaddlePaddle/PP-OCRv6_small_rec_onnx", ...) + func DefaultCacheDir() string + func Lines(rs []TextResult) []string + func Prefetch(ctx context.Context, o Options) error + func PrefetchElements(ctx context.Context, o Options) error + type Element struct + Box image.Rectangle + ID int + Key string + Kind Kind + Score float32 + Text string + func MergeElements(interactables []Element, lines []TextResult) []Element + type Engine struct + func New(ctx context.Context, o Options) (*Engine, error) + func (e *Engine) Close() error + func (e *Engine) DetectElements(ctx context.Context, img image.Image) ([]Element, error) + func (e *Engine) DetectInteractables(ctx context.Context, img image.Image) ([]Element, error) + func (e *Engine) DetectText(ctx context.Context, img image.Image) ([]TextResult, error) + type Kind string + const KindButton + const KindIcon + const KindText + type Model struct + Name string + SHA256 string + Size int64 + URL string + func (m Model) CachePath(cacheDir string) string + type Options struct + CacheDir string + ElementMaxSideLen int + ElementMinScore float32 + LibraryPath string + Logger *slog.Logger + MaxSideLen int + MinScore float32 + Threads int + type RuntimeAsset struct + Name string + SHA256 string + Version string + func RuntimeAssetFor(goos, goarch string) (RuntimeAsset, bool) + func (a RuntimeAsset) URL() string + type TextResult struct + Box image.Rectangle + Score float32 + Text string