extract

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package extract is an optional HTTP client for a poser (https://codeberg.org/datuch/poser-extractor) instance, used purely as a stateless landmark-extraction service (image -> 33 landmarks). It is a separate package so consumers that already have landmarks, or run their own extractor, take no net/http dependency.

poser-extractor has no authentication — the configured instance must only be reachable by trusted callers (e.g. an internal network).

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPose = errors.New("no pose detected")

ErrNoPose means poser processed the image but found no human pose in it. Distinct from a bad image: the input was valid, it just had no person.

Functions

func Supported

func Supported(mimeType string) bool

Supported reports whether poser can process this mime type.

Types

type Client

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
}

Client extracts pose landmarks from images via a poser-extractor instance.

func New

func New(baseURL string) *Client

New returns a Client for the poser instance at baseURL with a generous default timeout (MediaPipe's model can take seconds per image, more on the first inference after startup).

func (*Client) Extract

func (c *Client) Extract(ctx context.Context, r io.Reader, mimeType string) ([]pose.Landmark, error)

Extract sends the image to poser and returns its 33 pose landmarks. Error taxonomy: ErrNoPose (valid image, no human), *PermanentError (bad input, don't retry), anything else transient (network, timeout, 5xx).

type PermanentError

type PermanentError struct {
	Message string
}

PermanentError is a non-transient rejection (unreadable or unsupported image); retrying the same input will not succeed. Everything that is neither ErrNoPose nor a PermanentError (network failure, timeout, 5xx) is transient and may be retried.

func (*PermanentError) Error

func (e *PermanentError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL