smooth_bbox

lightning_pose.utils.cropzoom.smooth_bbox(input_bbox_dir: Path, output_dir: Path, method: str = 'median', window: int = 5) None[source]

Smooth bbox CSV files in a directory and save the results to a new directory.

Reads every *_bbox.csv file in input_bbox_dir, applies a rolling smoothing operation over the x, y, h, w columns, and writes the smoothed files to output_dir alongside a metadata.json that records the smoothing parameters.

Parameters:
  • input_bbox_dir – directory containing raw *_bbox.csv files.

  • output_dir – directory where smoothed files and metadata.json will be written.

  • method – smoothing method; currently only 'median' is supported.

  • window – window size (number of frames) for the rolling operation.

Raises:

ValueError – if method is not supported or no *_bbox.csv files are found.