Write Strategy
Module containing different strategies for writing predictions.
WriteStrategy
Bases: Protocol
Protocol for write strategy classes.
set_source_base(source_base)
Set the common parent directory of the prediction sources.
Called by the prediction writer callback. Strategies that write individual files may use it to preserve the sources' directory structure in the output; strategies that do not (e.g. writing to a single store) may ignore it.
Parameters:
-
source_base(Path or None) –Common parent of all prediction sources, or None if it cannot be determined.
write_batch(dirpath, predictions)
WriteStrategy subclasses must contain this function to write a batch.
Parameters:
-
dirpath(Path) –Path to directory to save predictions to.
-
predictions(list[ImageRegionData]) –Decollated predictions.