Cropο
Crops a video or labeled frames based on model predictions.
Requires model predictions to already have been generated using litpose predict.
Cropped videos are saved to:
<model_dir>/
βββ video_preds/
βββ <video_filename>.csv (predictions)
βββ <video_filename>_bbox.csv (bbox)
βββ remapped_<video_filename>.csv (TODO move to remap command)
βββ cropped_videos/
βββ cropped_<video_filename>.mp4 (cropped video)
Cropped images are saved to:
<model_dir>/
βββ image_preds/
βββ <csv_file_name>/
βββ predictions.csv
βββ bbox.csv (bbox)
βββ cropped_<csv_file_name>.csv (cropped labels)
βββ cropped_images/
βββ a/b/c/<image_name>.png (cropped images)
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>... [--crop_ratio=CROP_RATIO | --crop_size=CROP_SIZE] [--anchor_keypoints=x,y,z]
Positional Argumentsο
- model_dir
path to a model directory
- input_path
one or more files
Named Argumentsο
- --crop_ratio
Crop a bounding box this much larger than the animal (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:
''