oceanprefilter

package
v0.0.0-...-290a2ef Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package oceanprefilter implements a classifier for interesting events on the open waters, as a Viam vision service

Index

Constants

View Source
const (
	// ModelName is the name of the model
	ModelName = "ocean-prefilter"
	// DefaulMaxFrequency is how often the vision service will poll the camera for a new image
	DefaultMaxFrequency = 10.0
	DefaultThreshold    = 0.25
)

Variables

View Source
var (
	// Model is the resource
	Model = resource.NewModel("viam-labs", "vision", ModelName)
)

Functions

func MakeInference

func MakeInference(input image.Image, rc RunConfig) (bool, error)

Types

type Config

type Config struct {
	CameraName      string             `json:"camera_name"`
	DetectorName    string             `json:"detector_name"`
	ChosenLabels    map[string]float64 `json:"chosen_labels"`
	MaxFrequency    float64            `json:"max_frequency_hz"`
	Threshold       float64            `json:"threshold"`
	Debug           bool               `json:"debug"`
	ExcludedRegion  []int              `json:"excluded_region"`
	TriggerOnMotion bool               `json:"trigger_on_motion"`
}

Config contains names for necessary resources (camera and vision service)

func (*Config) Validate

func (cfg *Config) Validate(path string) ([]string, error)

Validate validates the config and returns implicit dependencies, this Validate checks if the camera and detector(optional) exist for the module's vision model.

type RunConfig

type RunConfig struct {
	Threshold    float64
	ExcludedZone *image.Rectangle

	Model *inference.Ensemble
	// contains filtered or unexported fields
}

RunConfig are the settings that will be fed to the background thread that will constantly be evaluating images for events

Jump to

Keyboard shortcuts

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