Documentation
¶
Overview ¶
Package avatar provides types and utilities for local avatar bundles.
An avatar bundle is an on-disk directory containing a metadata.json file and one or more idle clips. The bundle format is shared across all local render engines (liveportrait-joyvasa, echomimic, etc.).
Bundle structure:
~/.omniavatar/avatars/<name>/
metadata.json # bundle metadata (name, fps, resolution)
idle/
idle.mp4 # neutral, mouth-closed clip (MVP: one clip)
references/ # optional still frames for image-driven engines
front-neutral.png
Index ¶
Constants ¶
const BundlesDirEnvVar = "OMNIAVATAR_BUNDLES_DIR"
BundlesDirEnvVar is the environment variable to override the bundles directory.
const DefaultBundlesDir = "~/.omniavatar/avatars"
DefaultBundlesDir is the default location for avatar bundles. Can be overridden via OMNIAVATAR_BUNDLES_DIR environment variable.
Variables ¶
var ( ErrBundleNotFound = errors.New("avatar bundle not found") ErrMetadataNotFound = errors.New("metadata.json not found in bundle") ErrNoIdleClips = errors.New("no idle clips found in bundle") ErrInvalidMetadata = errors.New("invalid metadata.json") )
Errors returned by bundle operations.
Functions ¶
func BundlesDir ¶ added in v0.4.0
func BundlesDir() string
BundlesDir returns the directory where avatar bundles are stored. Uses OMNIAVATAR_BUNDLES_DIR if set, otherwise DefaultBundlesDir.
Types ¶
type Bundle ¶ added in v0.4.0
type Bundle struct {
// Path is the absolute path to the bundle directory.
Path string
// Metadata is the parsed metadata.json.
Metadata Metadata
// IdleClips is the list of idle clip paths (relative to bundle).
IdleClips []string
// References is the list of reference image paths (relative to bundle).
References []string
}
Bundle represents a loaded avatar bundle.
func (*Bundle) PrimaryIdleClip ¶ added in v0.4.0
PrimaryIdleClip returns the path to the primary idle clip.
func (*Bundle) PrimaryReference ¶ added in v0.4.0
PrimaryReference returns the path to the primary reference image, if any.
type Metadata ¶ added in v0.4.0
type Metadata struct {
// Name is the bundle identifier (matches the directory name).
Name string `json:"name"`
// Description is an optional human-readable description.
Description string `json:"description,omitempty"`
// FPS is the frame rate of the idle clips. Default: 25.
FPS int `json:"fps,omitempty"`
// Resolution is the output dimensions. Default: 512x512.
Resolution Resolution `json:"resolution,omitempty"`
// Created is the creation date (informational).
Created string `json:"created,omitempty"`
// CaptureGuidance is a reference to capture instructions.
CaptureGuidance string `json:"capture_guidance,omitempty"`
}
Metadata contains the avatar bundle's metadata.json contents.
type Resolution ¶ added in v0.4.0
Resolution specifies the dimensions of the avatar output.