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 --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 is 2.

Default: 2.0

--anchor_keypoints

Comma-separated list of anchor keypoint names, defaults to all keypoints

Default: ''