Create bbox

Computes per-frame bounding boxes from detector predictions and saves them as CSV files. Run litpose predict first to generate the predictions.

For video inputs, bbox files are saved to:

<model_dir>/
└── video_preds/
    └── <video_stem>_bbox.csv

For labeled-frames inputs (CSV), bbox files are saved to:

<model_dir>/
└── image_preds/
    └── <csv_file_name>/
        └── bbox.csv

The bounding boxes produced here can optionally be smoothed with litpose smooth_bbox before passing them to litpose crop.

For an end-to-end usage example, see the user guide: Cropzoom pipeline.

usage: litpose create_bbox <model_dir> <input_path:video|csv>... [--crop_ratio=CROP_RATIO | --crop_size=CROP_SIZE] [--anchor_keypoints=x,y,z]

Positional Arguments

model_dir

path to a detector model directory

input_path

one or more video files, CSV files, or directories (directories are expanded to their contained *.mp4 files)

Named Arguments

--crop_ratio

size the bounding box this many times larger than the animal keypoint span (default 2.0 when neither –crop_ratio nor –crop_size is given). Mutually exclusive with –crop_size.

--crop_size

fixed square bounding box side length in pixels, centred on the per-frame mean of the anchor keypoints. Mutually exclusive with –crop_ratio.

--anchor_keypoints

comma-separated list of anchor keypoint names; defaults to all keypoints

Default: ''