nicetoolbox.detectors.in_out.SequenceIO

class nicetoolbox.detectors.in_out.SequenceIO(sequence_context: SequenceRuntimeConfig, algorithm_names: List[str])[source]

Bases: object

IO for per-video operations.

Handles: - Video-specific folder creation - Detector output paths - Data source paths - Calibration file access

Initialize for video processing.

Parameters:
  • sequence_context – Frozen video runtime configuration

  • algorithm_names – List of all algorithm names for folder creation

Methods

get_calibration_file

Returns the calibration file path.

get_conda_path

Returns the path to the Conda installation directory.

get_data_source_folder

Returns the folder path to the original dataset source data.

get_detector_output_folder

Get detector-specific output folder.

get_inference_path

Get the file path for the inference script of a given detector.

get_output_folder

Get output folder by token.

get_venv_path

Get the file path of the virtual environment for the given detector and environment name.

Attributes

algorithm_names

out_folder

out_sub_folder

csv_folder

code_folder

nice_input_folder

calibration_file

conda_path

get_calibration_file()[source]

Returns the calibration file path.

Returns:

The path of the calibration file.

Return type:

str

get_conda_path()[source]

Returns the path to the Conda installation directory.

Returns:

The path to the Conda installation directory.

Return type:

str

get_data_source_folder(camera_name: str) Path[source]

Returns the folder path to the original dataset source data. (E.g. storing mp4/avi files)

Parameters:

camera_name (str) – Specific camera name, used for path resolut

Returns:

The path to the source data folder.

Return type:

Path

get_detector_output_folder(component: str, algorithm: str, token: str) Path[source]

Get detector-specific output folder.

Parameters:
  • component – Component name (e.g., ‘body_joints’)

  • algorithm – Algorithm name (e.g., ‘hrnetw48’)

  • token – Folder type - ‘output’, ‘visualization’, ‘additional’, ‘run_config’, ‘result’

get_inference_path(component_name, detector_name)[source]

Get the file path for the inference script of a given detector.

Parameters:

detector_name (str) – The name of the detector.

Returns:

The file path for the inference script.

Return type:

str

Raises:

FileNotFoundError – If the inference script file does not exist.

get_output_folder(token: str) Path[source]

Get output folder by token.

Parameters:

token – One of ‘output’, ‘main’, ‘csv’

get_venv_path(detector_name, env_name)[source]

Get the file path of the virtual environment for the given detector and environment name.

Parameters:
  • detector_name (str) – The name of the detector.

  • env_name (str) – The name of the environment.

Returns:

The file path of the virtual environment.

Return type:

str

Raises:

FileNotFoundError – If the virtual environment does not exist.