Documentation
¶
Overview ¶
Package config provides TOML configuration loading for MiFace.
The configuration file supports the following structure:
[camera] device_id = 0 width = 1280 height = 720 fps = 30 [tracking] enable_face = true enable_hands = true enable_pose = true smoothing_factor = 0.5 [vmc] enabled = true address = "127.0.0.1" port = 39539
Example usage:
cfg, err := config.Load("config.toml")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Camera device: %d\n", cfg.Camera.DeviceID)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CameraConfig ¶
type CameraConfig struct {
// DeviceID is the camera device index (default: 0).
DeviceID int `toml:"device_id"`
// Width is the capture width in pixels (default: 1280).
Width int `toml:"width"`
// Height is the capture height in pixels (default: 720).
Height int `toml:"height"`
// FPS is the target frame rate (default: 30).
FPS int `toml:"fps"`
}
CameraConfig holds webcam capture settings.
type Config ¶
type Config struct {
Camera CameraConfig `toml:"camera"`
Tracking TrackingConfig `toml:"tracking"`
VMC VMCConfig `toml:"vmc"`
}
Config represents the complete configuration for MiFace.
type TrackingConfig ¶
type TrackingConfig struct {
// EnableFace enables face landmark tracking (default: true).
EnableFace bool `toml:"enable_face"`
// EnableHands enables hand landmark tracking (default: true).
EnableHands bool `toml:"enable_hands"`
// EnablePose enables pose/body tracking (default: true).
EnablePose bool `toml:"enable_pose"`
// SmoothingFactor controls Kalman filter smoothing (0.0-1.0, default: 0.5).
SmoothingFactor float64 `toml:"smoothing_factor"`
}
TrackingConfig holds face/body tracking settings.
type VMCConfig ¶
type VMCConfig struct {
// Enabled enables VMC protocol output (default: true).
Enabled bool `toml:"enabled"`
// Address is the destination IP address (default: "127.0.0.1").
Address string `toml:"address"`
// Port is the destination UDP port (default: 39539).
Port int `toml:"port"`
}
VMCConfig holds VMC (Virtual Motion Capture) protocol sender settings. VMC uses the OSC protocol for communication.
Click to show internal directories.
Click to hide internal directories.