Models

scalacv.Models
object Models

A small registry and downloader for the model files scalacv's detectors need. It is the downloader: FaceDetect.downloadModel is a one-line alias for fetch(FaceDetect.modelSpec, into).

fetch downloads to a temp file beside the target and moves it into place only after it verifies, so an interrupted run never leaves a truncated model for the next load to trip over. It is idempotent: a target that already exists (and, if a hash or size is pinned, still matches) is returned without touching the network. URLs may be http(s):// or file://, so a model you already have on disk is just another source.

The detector model specs live next to their detectors (FaceDetect.modelSpec and FaceRecognizer.modelSpec); supply your own ModelSpec for anything else.

Attributes

Source
Models.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Models.type

Members list

Value members

Concrete methods

def fetch(spec: ModelSpec, into: Path): Either[CvError, Path]

Fetches spec into the directory into (created if absent), returning the verified file's path or a Left describing which stage failed — the directory, every URL tried, the size, or the checksum.

Fetches spec into the directory into (created if absent), returning the verified file's path or a Left describing which stage failed — the directory, every URL tried, the size, or the checksum.

Attributes

Source
Models.scala