Documentation
¶
Overview ¶
Package builtin is the service that allows you to access various computer vision algorithms (like detection, segmentation, tracking, etc) that usually only require a camera or image input.
Index ¶
- Constants
- Variables
- func NewBuiltIn(ctx context.Context, r robot.Robot, config config.Service, logger golog.Logger) (vision.Service, error)
- func NewTFLiteClassifier(ctx context.Context, conf *vision.VisModelConfig, logger golog.Logger) (classification.Classifier, *inf.TFLiteStruct, error)
- func NewTFLiteDetector(ctx context.Context, cfg *vision.VisModelConfig, logger golog.Logger) (objectdetection.Detector, *inf.TFLiteStruct, error)
- type TFLiteClassifierConfig
- type TFLiteDetectorConfig
- type VisOperation
Constants ¶
const ( TFLiteDetector = vision.VisModelType("tflite_detector") TFDetector = vision.VisModelType("tf_detector") ColorDetector = vision.VisModelType("color_detector") TFLiteClassifier = vision.VisModelType("tflite_classifier") TFClassifier = vision.VisModelType("tf_classifier") RCSegmenter = vision.VisModelType("radius_clustering_segmenter") DetectorSegmenter = vision.VisModelType("detector_segmenter") )
The set of allowed vision model types.
const ( VisDetection = VisOperation("detection") VisClassification = VisOperation("classification") VisSegmentation = VisOperation("segmentation") )
The set of operations supported by the vision model types.
const RadiusClusteringSegmenter = "radius_clustering"
RadiusClusteringSegmenter is the name of a segmenter that finds well separated objects on a flat plane.
Variables ¶
var LABEL_OUTPUT_MISMATCH = errors.New("Invalid Label File: Number of labels does not match number of model outputs. Labels must be separated by a newline, comma or space.")
Functions ¶
func NewBuiltIn ¶
func NewBuiltIn(ctx context.Context, r robot.Robot, config config.Service, logger golog.Logger) (vision.Service, error)
NewBuiltIn registers new detectors from the config and returns a new object detection service for the given robot.
func NewTFLiteClassifier ¶
func NewTFLiteClassifier(ctx context.Context, conf *vision.VisModelConfig, logger golog.Logger, ) (classification.Classifier, *inf.TFLiteStruct, error)
NewTFLiteClassifier creates an RDK classifier given a VisModelConfig. In other words, this function returns a function from image-->[]classifier.Classifications. It does this by making calls to an inference package and wrapping the result.
func NewTFLiteDetector ¶
func NewTFLiteDetector( ctx context.Context, cfg *vision.VisModelConfig, logger golog.Logger, ) (objectdetection.Detector, *inf.TFLiteStruct, error)
NewTFLiteDetector creates an RDK detector given a DetectorConfig. In other words, this function returns a function from image-->[]objectdetection.Detection. It does this by making calls to an inference package and wrapping the result.
Types ¶
type TFLiteClassifierConfig ¶
type TFLiteClassifierConfig struct { // this should come from the attributes part of the classifier config ModelPath string `json:"model_path"` NumThreads int `json:"num_threads"` LabelPath *string `json:"label_path"` }
TFLiteClassifierConfig specifies the fields necessary for creating a TFLite classifier.
type TFLiteDetectorConfig ¶
type TFLiteDetectorConfig struct { // this should come from the attributes part of the detector config ModelPath string `json:"model_path"` NumThreads int `json:"num_threads"` LabelPath *string `json:"label_path"` ServiceURL *string `json:"service_url"` }
TFLiteDetectorConfig specifies the fields necessary for creating a TFLite detector.
type VisOperation ¶
type VisOperation string
VisOperation defines what types of operations are allowed by the vision service.