build_engine

build_engine(spec, **kwargs)

The engine this spec’s task asks for.

Here rather than in engine.py to keep the import one way round: detection imports EngineError from there and nothing comes back.

Parameters

Name Type Description Default
spec PlatypusSpec Any specification. Its task decides which engine is returned. required
**kwargs Passed to the engine’s constructor. {}

Returns

Name Type Description
An Engine for a semantic segmentation specification, an InstanceEngine for an
instance one, a DetectionEngine for a detection one. All three discover their
splits and refuse a missing or unlabelled one by name, because that half is
shared.

Raises

Name Type Description
EngineError For a specification whose task has no engine - which today means one built by hand rather than through from_dict, since the discriminator would not let an unknown task through.

No doctest: building an engine reads the data, so this wants a dataset on disk.