flow_preprocessing.preprocessing_logic.preprocess.ZipPreprocessor

class flow_preprocessing.preprocessing_logic.preprocess.ZipPreprocessor(input_path, config, converter_factory=None)[source]

Preprocessor for ZIP files (local or remote).

Supports: - Local ZIP files - Remote ZIP files (HTTP/HTTPS URLs) - Automatic source type detection

Parameters:
__init__(input_path, config, converter_factory=None)[source]

Initialize ZIP preprocessor.

Parameters:
  • input_path (str) – Path or URL to ZIP file.

  • config (PreprocessorConfig) – Preprocessor configuration.

  • converter_factory (ConverterFactory | None) – Optional converter factory (for DI/testing).

Raises:

ValueError – If input_path is invalid or a URL fails validation.

Return type:

None

Methods

__init__(input_path, config[, converter_factory])

Initialize ZIP preprocessor.

create_xmlconverter()

Create XmlConverter for ZIP source using factory.

preprocess()

Preprocess ZIP file.

segment_images()

Segment images in the dataset using YOLO or kraken.

Attributes

config

Get configuration.

converter

Get or create the XmlConverter (lazy initialization).

dataset

Get the current dataset.

state

Get current processor state.