Crop
Crops a video or labeled frames using pre-computed bounding boxes.
Run litpose create_bbox (and optionally litpose smooth_bbox) first.
Cropped videos are saved to:
<model_dir>/
└── cropped_videos/
└── cropped_<video_filename>.mp4
Cropped images and a remapped labels CSV are saved to:
<model_dir>/
└── cropped_images/
└── a/b/c/<image_name>.png
<model_dir>/
└── image_preds/
└── <csv_file_name>/
└── cropped_<csv_file_name>.csv
When --bbox_dir is omitted, bbox files are read from the default
locations written by litpose create_bbox. Pass --bbox_dir to use
bboxes from a different source (e.g. output of litpose smooth_bbox or
bboxes produced by an external tool).
For an end-to-end usage example of the Cropzoom workflow, see the user guide: Cropzoom pipeline.
usage: litpose crop <model_dir> <input_path:video|csv>... [--bbox_dir=BBOX_DIR]
Positional Arguments
- model_dir
path to a model directory
- input_path
one or more video files, CSV files, or directories (directories are expanded to their contained *.mp4 files)
Named Arguments
- --bbox_dir
directory containing bbox CSV files to use for cropping. For videos, looks for <bbox_dir>/<video_stem>_bbox.csv; for CSV inputs, looks for <bbox_dir>/bbox.csv. Defaults to the location written by litpose create_bbox.