API Reference
Utilities
Standalone helpers, apply_elliptical_blur and the package logger.
apply_elliptical_blur
from stera.utils.face_blur import apply_elliptical_blur
def apply_elliptical_blur(
image: np.ndarray,
boxes: np.ndarray,
scale_factor_detections: float = 1.15,
) -> np.ndarrayElliptical large-kernel blur over each bbox. Identical compositing across all three FaceBlurrer backends, they call this same function under the hood.
| Param | Type | Notes |
|---|---|---|
image | (H, W, 3) uint8 | RGB image. Returned unchanged when boxes is empty. |
boxes | (N, 4) float | [x1, y1, x2, y2] pixel coords. |
scale_factor_detections | float = 1.15 | Multiplier on each bbox before blurring. >1 inflates for safer coverage. |
The kernel size is (H//2, W//2), applied via cv2.blur over the bbox interior, then composited back over the original through an elliptical mask. Mirrors EgoBlur's gen2 demo visualize_blur.
import numpy as np
from stera.utils.face_blur import apply_elliptical_blur
boxes = np.array([[100.0, 50.0, 200.0, 180.0]], dtype=np.float32)
blurred = apply_elliptical_blur(rgb, boxes, scale_factor_detections=1.2)setup_logging
import stera
stera.setup_logging(level: int | str = "INFO", fmt: str | None = None) -> NoneEnable console logging for the stera logger tree. Opt-in so library callers keep control of their own logging config.
stera.setup_logging() # INFO
stera.setup_logging("DEBUG") # noisierThe default format is:
%(asctime)s %(levelname)-7s %(name)s: %(message)sIdempotent, calling twice doesn't duplicate handlers.