Ear-segmentation-ai

CLI Reference

The Ear Segmentation AI command-line interface provides easy access to all features.

Installation

After installing the package, the earsegmentationai command will be available:

earsegmentationai --help

Commands

version

Display version information.

earsegmentationai version

Output:

Ear Segmentation AI v2.0.0
Python: 3.8.0
PyTorch: 1.13.0
Device: cuda (NVIDIA GeForce RTX 3080)
Model: earsegmentation_model_v1_46.pth

process-image

Process static images for ear segmentation.

earsegmentationai process-image [OPTIONS] PATH

Arguments:

Options:

Examples:

# Process single image
earsegmentationai process-image image.jpg --save-viz

# Process directory with GPU
earsegmentationai process-image ./images --device cuda:0 --save-mask --save-viz

# Custom threshold
earsegmentationai process-image image.jpg --threshold 0.7 --output results/

process-camera

Real-time camera/webcam processing.

earsegmentationai process-camera [OPTIONS]

Options:

Examples:

# Basic webcam processing
earsegmentationai process-camera

# Save video with GPU processing
earsegmentationai process-camera --device cuda:0 --save-video output.mp4

# Process alternate frames for performance
earsegmentationai process-camera --skip-frames 1

process-video

Process video files.

earsegmentationai process-video [OPTIONS] PATH

Arguments:

Options:

Examples:

# Basic video processing
earsegmentationai process-video input.mp4 -o output.mp4

# Process with preview
earsegmentationai process-video input.mp4 --display

# Save individual masks
earsegmentationai process-video input.mp4 --save-masks masks/

benchmark

Run performance benchmarks.

earsegmentationai benchmark [OPTIONS] PATH

Arguments:

Options:

Examples:

# CPU benchmark
earsegmentationai benchmark test.jpg

# GPU benchmark with more iterations
earsegmentationai benchmark test.jpg --device cuda:0 --iterations 1000

download-model

Download the ear segmentation model.

earsegmentationai download-model [OPTIONS]

Options:

Examples:

# Download model
earsegmentationai download-model

# Force re-download
earsegmentationai download-model --force

Global Options

These options work with all commands:

Configuration

Set defaults using environment variables:

export EARSEGMENTATIONAI_DEVICE="cuda:0"
export EARSEGMENTATIONAI_THRESHOLD="0.6"
export EARSEGMENTATIONAI_MODEL_DIR="/custom/models/"

Or using a config file at ~/.earsegmentationai/config.yaml:

processing:
  device: cuda:0
  threshold: 0.6
  batch_size: 4

video:
  fps: 30
  skip_frames: 1

paths:
  model_dir: /custom/models/
  cache_dir: /custom/cache/

Exit Codes

Keyboard Shortcuts

During camera/video preview: