Command Line#

This is a reference for all the --help message from all of OpenPifPaf’s command line interfaces (CLIs).

predict#

%%bash
python3 -m openpifpaf.predict --help
usage: python3 -m openpifpaf.predict [options] images

Predict poses for given images.

positional arguments:
  images                input images (default: None)

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --glob GLOB           glob expression for input images (for many images)
                        (default: None)
  -o [IMAGE_OUTPUT], --image-output [IMAGE_OUTPUT]
                        Whether to output an image, with the option to specify
                        the output path or directory (default: None)
  --json-output [JSON_OUTPUT]
                        Whether to output a json file, with the option to
                        specify the output path or directory (default: None)
  --disable-cuda        disable CUDA (default: False)

decoder configuration:
  --decoder DECODER [DECODER ...]
                        Decoders to be considered: ['posesimilarity',
                        'trackingpose', 'cifcaf', 'cifdet', 'cifcafdense'].
                        (default: None)
  --seed-threshold SEED_THRESHOLD
                        minimum threshold for seeds (default: 0.2)
  --instance-threshold INSTANCE_THRESHOLD
                        filter instances by score (default is 0.0 with
                        --force-complete-pose and 0.15 otherwise) (default:
                        None)
  --decoder-workers DECODER_WORKERS
                        number of workers for pose decoding (default: None)
  --profile-decoder [PROFILE_DECODER]
                        specify out .prof file or nothing for default file
                        name (default: None)

CifCaf decoders:
  --cif-th CIF_TH       cif threshold (default: 0.3)
  --caf-th CAF_TH       caf threshold (default: 0.3)

Decoder for tracking:
  --tr-single-pose-threshold TR_SINGLE_POSE_THRESHOLD
                        Single-pose threshold for tracking. (default: 0.3)
  --tr-multi-pose-threshold TR_MULTI_POSE_THRESHOLD
                        multi-pose threshold for tracking. (default: 0.2)
  --tr-multi-pose-n TR_MULTI_POSE_N
                        multi-pose n for tracking. (default: 3)
  --tr-minimum-threshold TR_MINIMUM_THRESHOLD
                        minimum-pose threshold for tracking. (default: 0.1)

PoseSimilarity:
  --posesimilarity-distance {crafted,euclidean,euclidean4,oks}
  --posesimilarity-oks-inflate POSESIMILARITY_OKS_INFLATE

trackingpose decoder:
  --trackingpose-track-recovery
  --trackingpose-single-seed

CifCaf decoder:
  --force-complete-pose
  --force-complete-caf-th FORCE_COMPLETE_CAF_TH
                        CAF threshold for force complete. Set to -1 to
                        deactivate. (default: 0.001)
  --nms-before-force-complete
                        run an additional NMS before completing poses
                        (default: False)
  --keypoint-threshold KEYPOINT_THRESHOLD
                        filter keypoints by score (default: 0.15)
  --keypoint-threshold-rel KEYPOINT_THRESHOLD_REL
                        filter keypoint connections by relative score
                        (default: 0.5)
  --greedy              greedy decoding (default: False)
  --connection-method {max,blend}
                        connection method to use, max is faster (default:
                        blend)
  --cifcaf-block-joints
                        block joints (default: False)
  --no-reverse-match
  --ablation-cifseeds-nms
  --ablation-cifseeds-no-rescore
  --ablation-caf-no-rescore
  --ablation-independent-kp

CifCafDense decoder:
  --dense-connections [DENSE_CONNECTIONS]

logger:
  -q, --quiet           only show warning messages or above (default: False)
  --debug               print debug messages (default: False)
  --log-stats           enable stats logging (default: False)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

Predictor:
  --batch-size BATCH_SIZE
                        processing batch size (default: 1)
  --loader-workers LOADER_WORKERS
                        number of workers for data loading (default: None)
  --long-edge LONG_EDGE
                        rescale the long side of the image (aspect ratio
                        maintained) (default: None)
  --precise-rescaling   use more exact image rescaling (requires scipy)
                        (default: True)

show:
  --save-all [SAVE_ALL]
                        every plot is saved (optional to specify directory)
                        (default: None)
  --show                show every plot, i.e., call matplotlib show()
                        (default: False)
  --image-width IMAGE_WIDTH
                        image width for matplotlib (in inches) (default: None)
  --image-height IMAGE_HEIGHT
                        image height for matplotlib (in inches) (default:
                        None)
  --image-dpi-factor IMAGE_DPI_FACTOR
                        increase dpi of output image by this factor (default:
                        2.0)
  --image-min-dpi IMAGE_MIN_DPI
                        minimum dpi of image output (default: 50.0)
  --show-file-extension SHOW_FILE_EXTENSION
                        default file extension (default: jpeg)
  --textbox-alpha TEXTBOX_ALPHA
                        transparency of annotation text box (default: 0.5)
  --text-color TEXT_COLOR
                        annotation text color (default: white)
  --font-size FONT_SIZE
                        annotation font size (default: 8)
  --monocolor-connections
                        use a single color per instance (default: False)
  --line-width LINE_WIDTH
                        skeleton line width (default: None)
  --skeleton-solid-threshold SKELETON_SOLID_THRESHOLD
                        set to 0.0 to draw all connections as solid lines
                        (default: 0.5)
  --show-box            show annotation bounding boxes (default: False)
  --white-overlay [WHITE_OVERLAY]
                        increase contrast to annotations by making image
                        whiter (default: False)
  --show-joint-scales   show boxes representing joint sizes (default: False)
  --show-joint-confidences
                        print per-joint confidences on skeleton annotations
                        (default: False)
  --show-decoding-order
  --show-frontier-order
  --show-only-decoded-connections
                        to debug which connections were used for decoding
                        (default: False)
  --video-fps VIDEO_FPS
                        output video frame rate (frames per second) (default:
                        10)
  --video-dpi VIDEO_DPI
                        output video resolution (dots per inch) (default: 100)

visualizer:
  --debug-indices DEBUG_INDICES [DEBUG_INDICES ...]
                        Indices of fields to create debug plots for of the
                        form headname:fieldindex, e.g. cif:5. Optionally,
                        specify the visualization type, e.g. cif:5:hr for the
                        high resolution plot only. Use comma separation to
                        specify multiple head names, field indices or
                        visualization types, e.g. cif:5,6:confidence,hr to
                        visualize CIF fields 5 and 6 but only show confidence
                        and hr. (default: [])

video#

%%bash
python3 -m openpifpaf.video --help
usage: python3 -m openpifpaf.video [options]

Video demo application.

Use --scale=0.2 to reduce the input image size to 20%.
Use --json-output for headless processing.

Example commands:
    python3 -m pifpaf.video --source=0  # default webcam
    python3 -m pifpaf.video --source=1  # another webcam

    # streaming source
    python3 -m pifpaf.video --source=http://127.0.0.1:8080/video

    # file system source (any valid OpenCV source)
    python3 -m pifpaf.video --source=docs/coco/000000081988.jpg

Trouble shooting:
* MacOSX: try to prefix the command with "MPLBACKEND=MACOSX".

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --source SOURCE       OpenCV source url. Integer for webcams. Or ipwebcam
                        urls (rtsp/rtmp). Use "screen" for screen grabs.
                        (default: 0)
  --video-output [VIDEO_OUTPUT]
                        video output file or "virtualcam" (default: None)
  --json-output [JSON_OUTPUT]
                        json output file (default: None)
  --separate-debug-ax
  --disable-cuda        disable CUDA (default: False)

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

decoder configuration:
  --decoder DECODER [DECODER ...]
                        Decoders to be considered: ['posesimilarity',
                        'cifcafdense', 'cifdet', 'cifcaf', 'trackingpose'].
                        (default: None)
  --seed-threshold SEED_THRESHOLD
                        minimum threshold for seeds (default: 0.2)
  --instance-threshold INSTANCE_THRESHOLD
                        filter instances by score (default is 0.0 with
                        --force-complete-pose and 0.15 otherwise) (default:
                        None)
  --decoder-workers DECODER_WORKERS
                        number of workers for pose decoding (default: None)
  --profile-decoder [PROFILE_DECODER]
                        specify out .prof file or nothing for default file
                        name (default: None)

CifCaf decoders:
  --cif-th CIF_TH       cif threshold (default: 0.3)
  --caf-th CAF_TH       caf threshold (default: 0.3)

Decoder for tracking:
  --tr-single-pose-threshold TR_SINGLE_POSE_THRESHOLD
                        Single-pose threshold for tracking. (default: 0.3)
  --tr-multi-pose-threshold TR_MULTI_POSE_THRESHOLD
                        multi-pose threshold for tracking. (default: 0.2)
  --tr-multi-pose-n TR_MULTI_POSE_N
                        multi-pose n for tracking. (default: 3)
  --tr-minimum-threshold TR_MINIMUM_THRESHOLD
                        minimum-pose threshold for tracking. (default: 0.1)

PoseSimilarity:
  --posesimilarity-distance {crafted,euclidean,euclidean4,oks}
  --posesimilarity-oks-inflate POSESIMILARITY_OKS_INFLATE

CifCafDense decoder:
  --dense-connections [DENSE_CONNECTIONS]

CifCaf decoder:
  --force-complete-pose
  --force-complete-caf-th FORCE_COMPLETE_CAF_TH
                        CAF threshold for force complete. Set to -1 to
                        deactivate. (default: 0.001)
  --nms-before-force-complete
                        run an additional NMS before completing poses
                        (default: False)
  --keypoint-threshold KEYPOINT_THRESHOLD
                        filter keypoints by score (default: 0.15)
  --keypoint-threshold-rel KEYPOINT_THRESHOLD_REL
                        filter keypoint connections by relative score
                        (default: 0.5)
  --greedy              greedy decoding (default: False)
  --connection-method {max,blend}
                        connection method to use, max is faster (default:
                        blend)
  --cifcaf-block-joints
                        block joints (default: False)
  --no-reverse-match
  --ablation-cifseeds-nms
  --ablation-cifseeds-no-rescore
  --ablation-caf-no-rescore
  --ablation-independent-kp

trackingpose decoder:
  --trackingpose-track-recovery
  --trackingpose-single-seed

logger:
  -q, --quiet           only show warning messages or above (default: False)
  --debug               print debug messages (default: False)
  --log-stats           enable stats logging (default: False)

Predictor:
  --batch-size BATCH_SIZE
                        processing batch size (default: 1)
  --loader-workers LOADER_WORKERS
                        number of workers for data loading (default: None)
  --long-edge LONG_EDGE
                        rescale the long side of the image (aspect ratio
                        maintained) (default: None)
  --precise-rescaling   use more exact image rescaling (requires scipy)
                        (default: True)

show:
  --save-all [SAVE_ALL]
                        every plot is saved (optional to specify directory)
                        (default: None)
  --show                show every plot, i.e., call matplotlib show()
                        (default: False)
  --image-width IMAGE_WIDTH
                        image width for matplotlib (in inches) (default: None)
  --image-height IMAGE_HEIGHT
                        image height for matplotlib (in inches) (default:
                        None)
  --image-dpi-factor IMAGE_DPI_FACTOR
                        increase dpi of output image by this factor (default:
                        2.0)
  --image-min-dpi IMAGE_MIN_DPI
                        minimum dpi of image output (default: 50.0)
  --show-file-extension SHOW_FILE_EXTENSION
                        default file extension (default: jpeg)
  --textbox-alpha TEXTBOX_ALPHA
                        transparency of annotation text box (default: 0.5)
  --text-color TEXT_COLOR
                        annotation text color (default: white)
  --font-size FONT_SIZE
                        annotation font size (default: 8)
  --monocolor-connections
                        use a single color per instance (default: False)
  --line-width LINE_WIDTH
                        skeleton line width (default: None)
  --skeleton-solid-threshold SKELETON_SOLID_THRESHOLD
                        set to 0.0 to draw all connections as solid lines
                        (default: 0.5)
  --show-box            show annotation bounding boxes (default: False)
  --white-overlay [WHITE_OVERLAY]
                        increase contrast to annotations by making image
                        whiter (default: False)
  --show-joint-scales   show boxes representing joint sizes (default: False)
  --show-joint-confidences
                        print per-joint confidences on skeleton annotations
                        (default: False)
  --show-decoding-order
  --show-frontier-order
  --show-only-decoded-connections
                        to debug which connections were used for decoding
                        (default: False)
  --video-fps VIDEO_FPS
                        output video frame rate (frames per second) (default:
                        10)
  --video-dpi VIDEO_DPI
                        output video resolution (dots per inch) (default: 100)

Stream:
  --horizontal-flip     mirror input image (default: False)
  --scale SCALE         input image scale factor (default: 1.0)
  --start-frame START_FRAME
                        start frame (default: None)
  --start-msec START_MSEC
                        start millisecond (default: None)
  --crop CROP CROP CROP CROP
                        left top right bottom (default: None)
  --rotate {left,right,180}
                        rotate (default: None)
  --max-frames MAX_FRAMES
                        max frames (default: None)

visualizer:
  --debug-indices DEBUG_INDICES [DEBUG_INDICES ...]
                        Indices of fields to create debug plots for of the
                        form headname:fieldindex, e.g. cif:5. Optionally,
                        specify the visualization type, e.g. cif:5:hr for the
                        high resolution plot only. Use comma separation to
                        specify multiple head names, field indices or
                        visualization types, e.g. cif:5,6:confidence,hr to
                        visualize CIF fields 5 and 6 but only show confidence
                        and hr. (default: [])

train#

%%bash
python3 -m openpifpaf.train --help
usage: python3 -m openpifpaf.train [options]

Train a pifpaf network.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -o OUTPUT, --output OUTPUT
                        output file (default: None)
  --disable-cuda        disable CUDA (default: False)
  --ddp                 [experimental] DistributedDataParallel (default:
                        False)
  --local_rank LOCAL_RANK
                        [experimental] for torch.distributed.launch (default:
                        None)
  --no-sync-batchnorm   [experimental] in ddp, to not use syncbatchnorm
                        (default: True)
  --resume-training RESUME_TRAINING
                        resume training from optimization checkpoint (default:
                        None)

logger:
  -q, --quiet           only show warning messages or above (default: False)
  --debug               print debug messages (default: False)
  --log-stats           enable stats logging (default: False)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

losses:
  --lambdas LAMBDAS [LAMBDAS ...]
                        prefactor for head losses by head (default: None)
  --component-lambdas COMPONENT_LAMBDAS [COMPONENT_LAMBDAS ...]
                        prefactor for head losses by component (default: None)
  --auto-tune-mtl       [experimental] use Kendall's prescription for
                        adjusting the multitask weight (default: False)
  --auto-tune-mtl-variance
                        [experimental] use Variance prescription for adjusting
                        the multitask weight (default: False)
  --task-sparsity-weight TASK_SPARSITY_WEIGHT
                        [experimental] (default: 0.0)

Composite Loss by Components:
  --loss-prescale LOSS_PRESCALE
  --regression-loss {smoothl1,l1,laplace}
                        type of regression loss (default: laplace)
  --bce-total-soft-clamp BCE_TOTAL_SOFT_CLAMP
                        per feature clamp value applied to the total (default:
                        None)

Composite Loss:
  --soft-clamp SOFT_CLAMP
                        soft clamp (default: 5.0)

Bce Loss:
  --r-smooth R_SMOOTH   r_{smooth} for SmoothL1 regressions (default: 0.0)

Laplace Loss:
  --laplace-soft-clamp LAPLACE_SOFT_CLAMP
                        soft clamp for Laplace (default: 5.0)

Bce Loss:
  --background-weight BACKGROUND_WEIGHT
                        BCE weight where ground truth is background (default:
                        1.0)
  --focal-alpha FOCAL_ALPHA
                        scale parameter of focal loss (default: 0.5)
  --focal-gamma FOCAL_GAMMA
                        use focal loss with the given gamma (default: 1.0)
  --focal-detach
  --no-focal-clamp
  --bce-min BCE_MIN     gradient clipped below (default: 0.0)
  --bce-soft-clamp BCE_SOFT_CLAMP
                        soft clamp for BCE (default: 5.0)
  --bce-background-clamp BCE_BACKGROUND_CLAMP
                        background clamp for BCE (default: -15.0)

Scale Loss:
  --b-scale B_SCALE     Laplace width b for scale loss (default: 1.0)
  --scale-log
  --scale-soft-clamp SCALE_SOFT_CLAMP
                        soft clamp for scale (default: 5.0)

trainer:
  --epochs EPOCHS       number of epochs to train (default: None)
  --train-batches TRAIN_BATCHES
                        number of train batches (default: None)
  --val-batches VAL_BATCHES
                        number of val batches (default: None)
  --clip-grad-norm CLIP_GRAD_NORM
                        clip grad norm: specify largest change for single
                        param (default: 0.0)
  --clip-grad-value CLIP_GRAD_VALUE
                        clip grad value: specify largest change for single
                        param (default: 0.0)
  --log-interval LOG_INTERVAL
                        log loss every n steps (default: 11)
  --val-interval VAL_INTERVAL
                        validation run every n epochs (default: 1)
  --stride-apply STRIDE_APPLY
                        apply and reset gradients every n batches (default: 1)
  --fix-batch-norm [FIX_BATCH_NORM]
                        fix batch norm running statistics (optionally specify
                        epoch) (default: False)
  --ema EMA             ema decay constant (default: 0.01)
  --profile PROFILE     enables profiling. specify path for chrome tracing
                        file (default: None)

encoders:
  --cif-side-length CIF_SIDE_LENGTH
                        side length of the CIF field (default: 4)
  --caf-min-size CAF_MIN_SIZE
                        min side length of the CAF field (default: 3)
  --caf-fixed-size      fixed caf size (default: False)
  --caf-aspect-ratio CAF_ASPECT_RATIO
                        CAF width relative to its length (default: 0.0)
  --encoder-no-suppress-selfhidden
                        [experimental] (default: True)
  --encoder-suppress-invisible
                        [experimental] (default: False)
  --encoder-suppress-collision
                        [experimental] (default: False)

optimizer:
  --momentum MOMENTUM   SGD momentum, beta1 in Adam/AdamW/AMSGrad (default:
                        0.9)
  --beta2 BETA2         beta2 for Adam/AdamW/AMSGrad (default: 0.999)
  --adam-eps ADAM_EPS   eps value for Adam/AdamW/AMSGrad (default: 1e-06)
  --no-nesterov         do not use Nesterov momentum for SGD update (default:
                        True)
  --weight-decay WEIGHT_DECAY
                        SGD/Adam/AdamW/AMSGrad weight decay (default: 0.0)
  --adam                use Adam optimizer (default: False)
  --adamw               use AdamW optimizer (default: False)
  --amsgrad             use AMSGrad option wth Adam or AdamW optimizer
                        (default: False)

learning rate scheduler:
  --lr LR               learning rate (default: 0.001)
  --lr-decay-type LR_DECAY_TYPE
                        type of decay ("step" or "linear") (default: step)
  --lr-decay LR_DECAY [LR_DECAY ...]
                        epochs at which to decay the learning rate (default:
                        [])
  --lr-decay-factor LR_DECAY_FACTOR
                        learning rate decay factor (default: 0.1)
  --lr-decay-epochs LR_DECAY_EPOCHS
                        learning rate decay duration in epochs (default: 1.0)
  --lr-warm-up-type LR_WARM_UP_TYPE
                        type of warm-up ("exp" or "linear") (default: exp)
  --lr-warm-up-start-epoch LR_WARM_UP_START_EPOCH
                        starting epoch for warm-up (default: 0)
  --lr-warm-up-epochs LR_WARM_UP_EPOCHS
                        number of epochs at the beginning with lower learning
                        rate (default: 1)
  --lr-warm-up-factor LR_WARM_UP_FACTOR
                        learning pre-factor during warm-up (default: 0.001)
  --lr-warm-restarts LR_WARM_RESTARTS [LR_WARM_RESTARTS ...]
                        list of epochs to do a warm restart (default: [])
  --lr-warm-restart-duration LR_WARM_RESTART_DURATION
                        duration of a warm restart (default: 0.5)

generic data module parameters:
  --dataset DATASET
  --loader-workers LOADER_WORKERS
                        number of workers for data loading (default: None)
  --batch-size BATCH_SIZE
                        batch size (default: 1)
  --dataset-weights DATASET_WEIGHTS [DATASET_WEIGHTS ...]
                        n-1 weights for the datasets (default: None)

data module Animal:
  --animal-train-annotations ANIMAL_TRAIN_ANNOTATIONS
  --animal-val-annotations ANIMAL_VAL_ANNOTATIONS
  --animal-train-image-dir ANIMAL_TRAIN_IMAGE_DIR
  --animal-val-image-dir ANIMAL_VAL_IMAGE_DIR
  --animal-square-edge ANIMAL_SQUARE_EDGE
                        square edge of input images (default: 513)
  --animal-extended-scale
                        augment with an extended scale range (default: False)
  --animal-orientation-invariant ANIMAL_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --animal-blur ANIMAL_BLUR
                        augment with blur (default: 0.0)
  --animal-no-augmentation
                        do not apply data augmentation (default: True)
  --animal-rescale-images ANIMAL_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --animal-upsample ANIMAL_UPSAMPLE
                        head upsample stride (default: 1)
  --animal-min-kp-anns ANIMAL_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --animal-bmin ANIMAL_BMIN
                        b minimum in pixels (default: 1)
  --animal-eval-test2017
  --animal-eval-testdev2017
  --animal-no-eval-annotation-filter
  --animal-eval-long-edge ANIMAL_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 0)
  --animal-eval-extended-scale
  --animal-eval-orientation-invariant ANIMAL_EVAL_ORIENTATION_INVARIANT

data module Apollo:
  --apollo-train-annotations APOLLO_TRAIN_ANNOTATIONS
  --apollo-val-annotations APOLLO_VAL_ANNOTATIONS
  --apollo-train-image-dir APOLLO_TRAIN_IMAGE_DIR
  --apollo-val-image-dir APOLLO_VAL_IMAGE_DIR
  --apollo-square-edge APOLLO_SQUARE_EDGE
                        square edge of input images (default: 513)
  --apollo-extended-scale
                        augment with an extended scale range (default: False)
  --apollo-orientation-invariant APOLLO_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --apollo-blur APOLLO_BLUR
                        augment with blur (default: 0.0)
  --apollo-no-augmentation
                        do not apply data augmentation (default: True)
  --apollo-rescale-images APOLLO_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --apollo-upsample APOLLO_UPSAMPLE
                        head upsample stride (default: 1)
  --apollo-min-kp-anns APOLLO_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --apollo-bmin APOLLO_BMIN
                        b minimum in pixels (default: 1)
  --apollo-apply-local-centrality-weights
                        Weigh the CIF and CAF head during training. (default:
                        False)
  --apollo-no-eval-annotation-filter
  --apollo-eval-long-edge APOLLO_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 0)
  --apollo-eval-extended-scale
  --apollo-eval-orientation-invariant APOLLO_EVAL_ORIENTATION_INVARIANT
  --apollo-use-24-kps   The ApolloCar3D dataset can be trained with 24 or 66
                        kps. If you want to train a model with 24 kps activate
                        this flag. Change the annotations path to the json
                        files with 24 kps. (default: False)

data module Cifar10:
  --cifar10-root-dir CIFAR10_ROOT_DIR
  --cifar10-download

data module CocoDet:
  --cocodet-train-annotations COCODET_TRAIN_ANNOTATIONS
  --cocodet-val-annotations COCODET_VAL_ANNOTATIONS
  --cocodet-train-image-dir COCODET_TRAIN_IMAGE_DIR
  --cocodet-val-image-dir COCODET_VAL_IMAGE_DIR
  --cocodet-square-edge COCODET_SQUARE_EDGE
                        square edge of input images (default: 513)
  --cocodet-extended-scale
                        augment with an extended scale range (default: False)
  --cocodet-orientation-invariant COCODET_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --cocodet-blur COCODET_BLUR
                        augment with blur (default: 0.0)
  --cocodet-no-augmentation
                        do not apply data augmentation (default: True)
  --cocodet-rescale-images COCODET_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --cocodet-upsample COCODET_UPSAMPLE
                        head upsample stride (default: 1)

data module CocoKp:
  --cocokp-train-annotations COCOKP_TRAIN_ANNOTATIONS
                        train annotations (default: data-
                        mscoco/annotations/person_keypoints_train2017.json)
  --cocokp-val-annotations COCOKP_VAL_ANNOTATIONS
                        val annotations (default: data-
                        mscoco/annotations/person_keypoints_val2017.json)
  --cocokp-train-image-dir COCOKP_TRAIN_IMAGE_DIR
                        train image dir (default: data-
                        mscoco/images/train2017/)
  --cocokp-val-image-dir COCOKP_VAL_IMAGE_DIR
                        val image dir (default: data-mscoco/images/val2017/)
  --cocokp-square-edge COCOKP_SQUARE_EDGE
                        square edge of input images (default: 385)
  --cocokp-with-dense   train with dense connections (default: False)
  --cocokp-extended-scale
                        augment with an extended scale range (default: False)
  --cocokp-orientation-invariant COCOKP_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --cocokp-blur COCOKP_BLUR
                        augment with blur (default: 0.0)
  --cocokp-no-augmentation
                        do not apply data augmentation (default: True)
  --cocokp-rescale-images COCOKP_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --cocokp-upsample COCOKP_UPSAMPLE
                        head upsample stride (default: 1)
  --cocokp-min-kp-anns COCOKP_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --cocokp-bmin COCOKP_BMIN
                        bmin (default: 0.1)
  --cocokp-eval-test2017
  --cocokp-eval-testdev2017
  --coco-no-eval-annotation-filter
  --coco-eval-long-edge COCO_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 641)
  --coco-eval-extended-scale
  --coco-eval-orientation-invariant COCO_EVAL_ORIENTATION_INVARIANT

data module CrowdPose:
  --crowdpose-train-annotations CROWDPOSE_TRAIN_ANNOTATIONS
  --crowdpose-val-annotations CROWDPOSE_VAL_ANNOTATIONS
  --crowdpose-image-dir CROWDPOSE_IMAGE_DIR
  --crowdpose-square-edge CROWDPOSE_SQUARE_EDGE
                        square edge of input images (default: 385)
  --crowdpose-extended-scale
                        augment with an extended scale range (default: False)
  --crowdpose-orientation-invariant CROWDPOSE_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --crowdpose-no-augmentation
                        do not apply data augmentation (default: True)
  --crowdpose-rescale-images CROWDPOSE_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --crowdpose-upsample CROWDPOSE_UPSAMPLE
                        head upsample stride (default: 1)
  --crowdpose-min-kp-anns CROWDPOSE_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --crowdpose-eval-test
  --crowdpose-eval-long-edge CROWDPOSE_EVAL_LONG_EDGE
  --crowdpose-eval-extended-scale
  --crowdpose-eval-orientation-invariant CROWDPOSE_EVAL_ORIENTATION_INVARIANT
  --crowdpose-index {easy,medium,hard}

data module NuScenes:
  --nuscenes-train-annotations NUSCENES_TRAIN_ANNOTATIONS
  --nuscenes-val-annotations NUSCENES_VAL_ANNOTATIONS
  --nuscenes-train-image-dir NUSCENES_TRAIN_IMAGE_DIR
  --nuscenes-val-image-dir NUSCENES_VAL_IMAGE_DIR
  --nuscenes-square-edge NUSCENES_SQUARE_EDGE
                        square edge of input images (default: 513)
  --nuscenes-extended-scale
                        augment with an extended scale range (default: False)
  --nuscenes-orientation-invariant NUSCENES_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --nuscenes-blur NUSCENES_BLUR
                        augment with blur (default: 0.0)
  --nuscenes-no-augmentation
                        do not apply data augmentation (default: True)
  --nuscenes-rescale-images NUSCENES_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --nuscenes-upsample NUSCENES_UPSAMPLE
                        head upsample stride (default: 1)

data module Posetrack2018:
  --posetrack2018-train-annotations POSETRACK2018_TRAIN_ANNOTATIONS
                        train annotations (default: data-
                        posetrack2018/annotations/train/*.json)
  --posetrack2018-val-annotations POSETRACK2018_VAL_ANNOTATIONS
                        val annotations (default: data-
                        posetrack2018/annotations/val/*.json)
  --posetrack2018-eval-annotations POSETRACK2018_EVAL_ANNOTATIONS
                        eval annotations (default: data-
                        posetrack2018/annotations/val/*.json)
  --posetrack2018-data-root POSETRACK2018_DATA_ROOT
                        data root (default: data-posetrack2018)

data module Posetrack:
  --posetrack-square-edge POSETRACK_SQUARE_EDGE
                        square edge of input images (default: 385)
  --posetrack-with-dense
                        train with dense connections (default: False)
  --posetrack-no-augmentation
                        do not apply data augmentation (default: True)
  --posetrack-rescale-images POSETRACK_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --posetrack-upsample POSETRACK_UPSAMPLE
                        head upsample stride (default: 1)
  --posetrack-min-kp-anns POSETRACK_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --posetrack-bmin POSETRACK_BMIN
  --posetrack-sample-pairing POSETRACK_SAMPLE_PAIRING
                        blend two samples together (default: 0.0)
  --posetrack-image-augmentations POSETRACK_IMAGE_AUGMENTATIONS
                        autocontrast, equalize, invert, solarize (default:
                        0.0)
  --posetrack-max-shift POSETRACK_MAX_SHIFT
                        max shift (default: 30.0)
  --posetrack-eval-long-edge POSETRACK_EVAL_LONG_EDGE
  --posetrack-eval-extended-scale
  --posetrack-eval-orientation-invariant POSETRACK_EVAL_ORIENTATION_INVARIANT
  --posetrack-ablation-without-tcaf

data module Posetrack2017:
  --posetrack2017-eval-annotations POSETRACK2017_EVAL_ANNOTATIONS
                        eval annotations (default: data-
                        posetrack2017/annotations/val/*.json)
  --posetrack2017-data-root POSETRACK2017_DATA_ROOT
                        data root (default: data-posetrack2017)

data module CocoKpSt:
  --cocokpst-max-shift COCOKPST_MAX_SHIFT
                        max shift (default: 30.0)

data module wholebody:
  --wholebody-train-annotations WHOLEBODY_TRAIN_ANNOTATIONS
                        train annotations (default: data-mscoco/annotations/pe
                        rson_keypoints_train2017_wholebody_pifpaf_style.json)
  --wholebody-val-annotations WHOLEBODY_VAL_ANNOTATIONS
                        val annotations (default: data-
                        mscoco/annotations/coco_wholebody_val_v1.0.json)
  --wholebody-train-image-dir WHOLEBODY_TRAIN_IMAGE_DIR
                        train image dir (default: data-
                        mscoco/images/train2017/)
  --wholebody-val-image-dir WHOLEBODY_VAL_IMAGE_DIR
                        val image dir (default: data-mscoco/images/val2017)
  --wholebody-square-edge WHOLEBODY_SQUARE_EDGE
                        square edge of input images (default: 385)
  --wholebody-extended-scale
                        augment with an extended scale range (default: False)
  --wholebody-orientation-invariant WHOLEBODY_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --wholebody-blur WHOLEBODY_BLUR
                        augment with blur (default: 0.0)
  --wholebody-no-augmentation
                        do not apply data augmentation (default: True)
  --wholebody-rescale-images WHOLEBODY_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --wholebody-upsample WHOLEBODY_UPSAMPLE
                        head upsample stride (default: 1)
  --wholebody-min-kp-anns WHOLEBODY_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --wholebody-bmin WHOLEBODY_BMIN
                        bmin (default: 1.0)
  --wholebody-apply-local-centrality-weights
                        Weigh the CIF and CAF head during training. (default:
                        False)
  --wholebody-eval-test2017
  --wholebody-eval-testdev2017
  --wholebody-no-eval-annotation-filter
  --wholebody-eval-long-edge WHOLEBODY_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 641)
  --wholebody-eval-extended-scale
  --wholebody-eval-orientation-invariant WHOLEBODY_EVAL_ORIENTATION_INVARIANT

show:
  --save-all [SAVE_ALL]
                        every plot is saved (optional to specify directory)
                        (default: None)
  --show                show every plot, i.e., call matplotlib show()
                        (default: False)
  --image-width IMAGE_WIDTH
                        image width for matplotlib (in inches) (default: None)
  --image-height IMAGE_HEIGHT
                        image height for matplotlib (in inches) (default:
                        None)
  --image-dpi-factor IMAGE_DPI_FACTOR
                        increase dpi of output image by this factor (default:
                        2.0)
  --image-min-dpi IMAGE_MIN_DPI
                        minimum dpi of image output (default: 50.0)
  --show-file-extension SHOW_FILE_EXTENSION
                        default file extension (default: jpeg)
  --textbox-alpha TEXTBOX_ALPHA
                        transparency of annotation text box (default: 0.5)
  --text-color TEXT_COLOR
                        annotation text color (default: white)
  --font-size FONT_SIZE
                        annotation font size (default: 8)
  --monocolor-connections
                        use a single color per instance (default: False)
  --line-width LINE_WIDTH
                        skeleton line width (default: None)
  --skeleton-solid-threshold SKELETON_SOLID_THRESHOLD
                        set to 0.0 to draw all connections as solid lines
                        (default: 0.5)
  --show-box            show annotation bounding boxes (default: False)
  --white-overlay [WHITE_OVERLAY]
                        increase contrast to annotations by making image
                        whiter (default: False)
  --show-joint-scales   show boxes representing joint sizes (default: False)
  --show-joint-confidences
                        print per-joint confidences on skeleton annotations
                        (default: False)
  --show-decoding-order
  --show-frontier-order
  --show-only-decoded-connections
                        to debug which connections were used for decoding
                        (default: False)
  --video-fps VIDEO_FPS
                        output video frame rate (frames per second) (default:
                        10)
  --video-dpi VIDEO_DPI
                        output video resolution (dots per inch) (default: 100)

visualizer:
  --debug-indices DEBUG_INDICES [DEBUG_INDICES ...]
                        Indices of fields to create debug plots for of the
                        form headname:fieldindex, e.g. cif:5. Optionally,
                        specify the visualization type, e.g. cif:5:hr for the
                        high resolution plot only. Use comma separation to
                        specify multiple head names, field indices or
                        visualization types, e.g. cif:5,6:confidence,hr to
                        visualize CIF fields 5 and 6 but only show confidence
                        and hr. (default: [])

eval#

%%bash
python3 -m openpifpaf.eval --help
usage: python3 -m openpifpaf.eval [options]

Evaluation on COCO data.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --output OUTPUT       output filename without file extension (default: None)
  --skip-existing       skip if output eval file exists already (default:
                        False)
  --no-skip-epoch0      do not skip eval for epoch 0 (default: True)
  --watch [WATCH]       Watch a directory for new checkpoint files. Optionally
                        specify the number of seconds between checks.
                        (default: False)
  --disable-cuda        disable CUDA (default: False)
  --write-predictions   write a json and a zip file of the predictions
                        (default: False)
  --show-final-image    show the final image (default: False)
  --show-final-ground-truth
                        show the final image with ground truth annotations
                        (default: False)
  --n-images N_IMAGES
  --loader-warmup LOADER_WARMUP

generic data module parameters:
  --dataset DATASET
  --loader-workers LOADER_WORKERS
                        number of workers for data loading (default: None)
  --batch-size BATCH_SIZE
                        batch size (default: 1)
  --dataset-weights DATASET_WEIGHTS [DATASET_WEIGHTS ...]
                        n-1 weights for the datasets (default: None)

data module Animal:
  --animal-train-annotations ANIMAL_TRAIN_ANNOTATIONS
  --animal-val-annotations ANIMAL_VAL_ANNOTATIONS
  --animal-train-image-dir ANIMAL_TRAIN_IMAGE_DIR
  --animal-val-image-dir ANIMAL_VAL_IMAGE_DIR
  --animal-square-edge ANIMAL_SQUARE_EDGE
                        square edge of input images (default: 513)
  --animal-extended-scale
                        augment with an extended scale range (default: False)
  --animal-orientation-invariant ANIMAL_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --animal-blur ANIMAL_BLUR
                        augment with blur (default: 0.0)
  --animal-no-augmentation
                        do not apply data augmentation (default: True)
  --animal-rescale-images ANIMAL_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --animal-upsample ANIMAL_UPSAMPLE
                        head upsample stride (default: 1)
  --animal-min-kp-anns ANIMAL_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --animal-bmin ANIMAL_BMIN
                        b minimum in pixels (default: 1)
  --animal-eval-test2017
  --animal-eval-testdev2017
  --animal-no-eval-annotation-filter
  --animal-eval-long-edge ANIMAL_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 0)
  --animal-eval-extended-scale
  --animal-eval-orientation-invariant ANIMAL_EVAL_ORIENTATION_INVARIANT

data module Apollo:
  --apollo-train-annotations APOLLO_TRAIN_ANNOTATIONS
  --apollo-val-annotations APOLLO_VAL_ANNOTATIONS
  --apollo-train-image-dir APOLLO_TRAIN_IMAGE_DIR
  --apollo-val-image-dir APOLLO_VAL_IMAGE_DIR
  --apollo-square-edge APOLLO_SQUARE_EDGE
                        square edge of input images (default: 513)
  --apollo-extended-scale
                        augment with an extended scale range (default: False)
  --apollo-orientation-invariant APOLLO_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --apollo-blur APOLLO_BLUR
                        augment with blur (default: 0.0)
  --apollo-no-augmentation
                        do not apply data augmentation (default: True)
  --apollo-rescale-images APOLLO_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --apollo-upsample APOLLO_UPSAMPLE
                        head upsample stride (default: 1)
  --apollo-min-kp-anns APOLLO_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --apollo-bmin APOLLO_BMIN
                        b minimum in pixels (default: 1)
  --apollo-apply-local-centrality-weights
                        Weigh the CIF and CAF head during training. (default:
                        False)
  --apollo-no-eval-annotation-filter
  --apollo-eval-long-edge APOLLO_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 0)
  --apollo-eval-extended-scale
  --apollo-eval-orientation-invariant APOLLO_EVAL_ORIENTATION_INVARIANT
  --apollo-use-24-kps   The ApolloCar3D dataset can be trained with 24 or 66
                        kps. If you want to train a model with 24 kps activate
                        this flag. Change the annotations path to the json
                        files with 24 kps. (default: False)

data module Cifar10:
  --cifar10-root-dir CIFAR10_ROOT_DIR
  --cifar10-download

data module CocoDet:
  --cocodet-train-annotations COCODET_TRAIN_ANNOTATIONS
  --cocodet-val-annotations COCODET_VAL_ANNOTATIONS
  --cocodet-train-image-dir COCODET_TRAIN_IMAGE_DIR
  --cocodet-val-image-dir COCODET_VAL_IMAGE_DIR
  --cocodet-square-edge COCODET_SQUARE_EDGE
                        square edge of input images (default: 513)
  --cocodet-extended-scale
                        augment with an extended scale range (default: False)
  --cocodet-orientation-invariant COCODET_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --cocodet-blur COCODET_BLUR
                        augment with blur (default: 0.0)
  --cocodet-no-augmentation
                        do not apply data augmentation (default: True)
  --cocodet-rescale-images COCODET_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --cocodet-upsample COCODET_UPSAMPLE
                        head upsample stride (default: 1)

data module CocoKp:
  --cocokp-train-annotations COCOKP_TRAIN_ANNOTATIONS
                        train annotations (default: data-
                        mscoco/annotations/person_keypoints_train2017.json)
  --cocokp-val-annotations COCOKP_VAL_ANNOTATIONS
                        val annotations (default: data-
                        mscoco/annotations/person_keypoints_val2017.json)
  --cocokp-train-image-dir COCOKP_TRAIN_IMAGE_DIR
                        train image dir (default: data-
                        mscoco/images/train2017/)
  --cocokp-val-image-dir COCOKP_VAL_IMAGE_DIR
                        val image dir (default: data-mscoco/images/val2017/)
  --cocokp-square-edge COCOKP_SQUARE_EDGE
                        square edge of input images (default: 385)
  --cocokp-with-dense   train with dense connections (default: False)
  --cocokp-extended-scale
                        augment with an extended scale range (default: False)
  --cocokp-orientation-invariant COCOKP_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --cocokp-blur COCOKP_BLUR
                        augment with blur (default: 0.0)
  --cocokp-no-augmentation
                        do not apply data augmentation (default: True)
  --cocokp-rescale-images COCOKP_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --cocokp-upsample COCOKP_UPSAMPLE
                        head upsample stride (default: 1)
  --cocokp-min-kp-anns COCOKP_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --cocokp-bmin COCOKP_BMIN
                        bmin (default: 0.1)
  --cocokp-eval-test2017
  --cocokp-eval-testdev2017
  --coco-no-eval-annotation-filter
  --coco-eval-long-edge COCO_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 641)
  --coco-eval-extended-scale
  --coco-eval-orientation-invariant COCO_EVAL_ORIENTATION_INVARIANT

data module CrowdPose:
  --crowdpose-train-annotations CROWDPOSE_TRAIN_ANNOTATIONS
  --crowdpose-val-annotations CROWDPOSE_VAL_ANNOTATIONS
  --crowdpose-image-dir CROWDPOSE_IMAGE_DIR
  --crowdpose-square-edge CROWDPOSE_SQUARE_EDGE
                        square edge of input images (default: 385)
  --crowdpose-extended-scale
                        augment with an extended scale range (default: False)
  --crowdpose-orientation-invariant CROWDPOSE_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --crowdpose-no-augmentation
                        do not apply data augmentation (default: True)
  --crowdpose-rescale-images CROWDPOSE_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --crowdpose-upsample CROWDPOSE_UPSAMPLE
                        head upsample stride (default: 1)
  --crowdpose-min-kp-anns CROWDPOSE_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --crowdpose-eval-test
  --crowdpose-eval-long-edge CROWDPOSE_EVAL_LONG_EDGE
  --crowdpose-eval-extended-scale
  --crowdpose-eval-orientation-invariant CROWDPOSE_EVAL_ORIENTATION_INVARIANT
  --crowdpose-index {easy,medium,hard}

data module NuScenes:
  --nuscenes-train-annotations NUSCENES_TRAIN_ANNOTATIONS
  --nuscenes-val-annotations NUSCENES_VAL_ANNOTATIONS
  --nuscenes-train-image-dir NUSCENES_TRAIN_IMAGE_DIR
  --nuscenes-val-image-dir NUSCENES_VAL_IMAGE_DIR
  --nuscenes-square-edge NUSCENES_SQUARE_EDGE
                        square edge of input images (default: 513)
  --nuscenes-extended-scale
                        augment with an extended scale range (default: False)
  --nuscenes-orientation-invariant NUSCENES_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --nuscenes-blur NUSCENES_BLUR
                        augment with blur (default: 0.0)
  --nuscenes-no-augmentation
                        do not apply data augmentation (default: True)
  --nuscenes-rescale-images NUSCENES_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --nuscenes-upsample NUSCENES_UPSAMPLE
                        head upsample stride (default: 1)

data module Posetrack2018:
  --posetrack2018-train-annotations POSETRACK2018_TRAIN_ANNOTATIONS
                        train annotations (default: data-
                        posetrack2018/annotations/train/*.json)
  --posetrack2018-val-annotations POSETRACK2018_VAL_ANNOTATIONS
                        val annotations (default: data-
                        posetrack2018/annotations/val/*.json)
  --posetrack2018-eval-annotations POSETRACK2018_EVAL_ANNOTATIONS
                        eval annotations (default: data-
                        posetrack2018/annotations/val/*.json)
  --posetrack2018-data-root POSETRACK2018_DATA_ROOT
                        data root (default: data-posetrack2018)

data module Posetrack:
  --posetrack-square-edge POSETRACK_SQUARE_EDGE
                        square edge of input images (default: 385)
  --posetrack-with-dense
                        train with dense connections (default: False)
  --posetrack-no-augmentation
                        do not apply data augmentation (default: True)
  --posetrack-rescale-images POSETRACK_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --posetrack-upsample POSETRACK_UPSAMPLE
                        head upsample stride (default: 1)
  --posetrack-min-kp-anns POSETRACK_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --posetrack-bmin POSETRACK_BMIN
  --posetrack-sample-pairing POSETRACK_SAMPLE_PAIRING
                        blend two samples together (default: 0.0)
  --posetrack-image-augmentations POSETRACK_IMAGE_AUGMENTATIONS
                        autocontrast, equalize, invert, solarize (default:
                        0.0)
  --posetrack-max-shift POSETRACK_MAX_SHIFT
                        max shift (default: 30.0)
  --posetrack-eval-long-edge POSETRACK_EVAL_LONG_EDGE
  --posetrack-eval-extended-scale
  --posetrack-eval-orientation-invariant POSETRACK_EVAL_ORIENTATION_INVARIANT
  --posetrack-ablation-without-tcaf

data module Posetrack2017:
  --posetrack2017-eval-annotations POSETRACK2017_EVAL_ANNOTATIONS
                        eval annotations (default: data-
                        posetrack2017/annotations/val/*.json)
  --posetrack2017-data-root POSETRACK2017_DATA_ROOT
                        data root (default: data-posetrack2017)

data module CocoKpSt:
  --cocokpst-max-shift COCOKPST_MAX_SHIFT
                        max shift (default: 30.0)

data module wholebody:
  --wholebody-train-annotations WHOLEBODY_TRAIN_ANNOTATIONS
                        train annotations (default: data-mscoco/annotations/pe
                        rson_keypoints_train2017_wholebody_pifpaf_style.json)
  --wholebody-val-annotations WHOLEBODY_VAL_ANNOTATIONS
                        val annotations (default: data-
                        mscoco/annotations/coco_wholebody_val_v1.0.json)
  --wholebody-train-image-dir WHOLEBODY_TRAIN_IMAGE_DIR
                        train image dir (default: data-
                        mscoco/images/train2017/)
  --wholebody-val-image-dir WHOLEBODY_VAL_IMAGE_DIR
                        val image dir (default: data-mscoco/images/val2017)
  --wholebody-square-edge WHOLEBODY_SQUARE_EDGE
                        square edge of input images (default: 385)
  --wholebody-extended-scale
                        augment with an extended scale range (default: False)
  --wholebody-orientation-invariant WHOLEBODY_ORIENTATION_INVARIANT
                        augment with random orientations (default: 0.0)
  --wholebody-blur WHOLEBODY_BLUR
                        augment with blur (default: 0.0)
  --wholebody-no-augmentation
                        do not apply data augmentation (default: True)
  --wholebody-rescale-images WHOLEBODY_RESCALE_IMAGES
                        overall rescale factor for images (default: 1.0)
  --wholebody-upsample WHOLEBODY_UPSAMPLE
                        head upsample stride (default: 1)
  --wholebody-min-kp-anns WHOLEBODY_MIN_KP_ANNS
                        filter images with fewer keypoint annotations
                        (default: 1)
  --wholebody-bmin WHOLEBODY_BMIN
                        bmin (default: 1.0)
  --wholebody-apply-local-centrality-weights
                        Weigh the CIF and CAF head during training. (default:
                        False)
  --wholebody-eval-test2017
  --wholebody-eval-testdev2017
  --wholebody-no-eval-annotation-filter
  --wholebody-eval-long-edge WHOLEBODY_EVAL_LONG_EDGE
                        set to zero to deactivate rescaling (default: 641)
  --wholebody-eval-extended-scale
  --wholebody-eval-orientation-invariant WHOLEBODY_EVAL_ORIENTATION_INVARIANT

decoder configuration:
  --decoder DECODER [DECODER ...]
                        Decoders to be considered: ['cifcafdense',
                        'posesimilarity', 'trackingpose', 'cifcaf', 'cifdet'].
                        (default: None)
  --seed-threshold SEED_THRESHOLD
                        minimum threshold for seeds (default: 0.2)
  --instance-threshold INSTANCE_THRESHOLD
                        filter instances by score (default is 0.0 with
                        --force-complete-pose and 0.15 otherwise) (default:
                        None)
  --decoder-workers DECODER_WORKERS
                        number of workers for pose decoding (default: None)
  --profile-decoder [PROFILE_DECODER]
                        specify out .prof file or nothing for default file
                        name (default: None)

CifCaf decoders:
  --cif-th CIF_TH       cif threshold (default: 0.3)
  --caf-th CAF_TH       caf threshold (default: 0.3)

Decoder for tracking:
  --tr-single-pose-threshold TR_SINGLE_POSE_THRESHOLD
                        Single-pose threshold for tracking. (default: 0.3)
  --tr-multi-pose-threshold TR_MULTI_POSE_THRESHOLD
                        multi-pose threshold for tracking. (default: 0.2)
  --tr-multi-pose-n TR_MULTI_POSE_N
                        multi-pose n for tracking. (default: 3)
  --tr-minimum-threshold TR_MINIMUM_THRESHOLD
                        minimum-pose threshold for tracking. (default: 0.1)

CifCafDense decoder:
  --dense-connections [DENSE_CONNECTIONS]

PoseSimilarity:
  --posesimilarity-distance {crafted,euclidean,euclidean4,oks}
  --posesimilarity-oks-inflate POSESIMILARITY_OKS_INFLATE

trackingpose decoder:
  --trackingpose-track-recovery
  --trackingpose-single-seed

CifCaf decoder:
  --force-complete-pose
  --force-complete-caf-th FORCE_COMPLETE_CAF_TH
                        CAF threshold for force complete. Set to -1 to
                        deactivate. (default: 0.001)
  --nms-before-force-complete
                        run an additional NMS before completing poses
                        (default: False)
  --keypoint-threshold KEYPOINT_THRESHOLD
                        filter keypoints by score (default: 0.15)
  --keypoint-threshold-rel KEYPOINT_THRESHOLD_REL
                        filter keypoint connections by relative score
                        (default: 0.5)
  --greedy              greedy decoding (default: False)
  --connection-method {max,blend}
                        connection method to use, max is faster (default:
                        blend)
  --cifcaf-block-joints
                        block joints (default: False)
  --no-reverse-match
  --ablation-cifseeds-nms
  --ablation-cifseeds-no-rescore
  --ablation-caf-no-rescore
  --ablation-independent-kp

logger:
  -q, --quiet           only show warning messages or above (default: False)
  --debug               print debug messages (default: False)
  --log-stats           enable stats logging (default: False)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

Predictor:
  --long-edge LONG_EDGE
                        rescale the long side of the image (aspect ratio
                        maintained) (default: None)
  --precise-rescaling   use more exact image rescaling (requires scipy)
                        (default: True)

show:
  --save-all [SAVE_ALL]
                        every plot is saved (optional to specify directory)
                        (default: None)
  --show                show every plot, i.e., call matplotlib show()
                        (default: False)
  --image-width IMAGE_WIDTH
                        image width for matplotlib (in inches) (default: None)
  --image-height IMAGE_HEIGHT
                        image height for matplotlib (in inches) (default:
                        None)
  --image-dpi-factor IMAGE_DPI_FACTOR
                        increase dpi of output image by this factor (default:
                        2.0)
  --image-min-dpi IMAGE_MIN_DPI
                        minimum dpi of image output (default: 50.0)
  --show-file-extension SHOW_FILE_EXTENSION
                        default file extension (default: jpeg)
  --textbox-alpha TEXTBOX_ALPHA
                        transparency of annotation text box (default: 0.5)
  --text-color TEXT_COLOR
                        annotation text color (default: white)
  --font-size FONT_SIZE
                        annotation font size (default: 8)
  --monocolor-connections
                        use a single color per instance (default: False)
  --line-width LINE_WIDTH
                        skeleton line width (default: None)
  --skeleton-solid-threshold SKELETON_SOLID_THRESHOLD
                        set to 0.0 to draw all connections as solid lines
                        (default: 0.5)
  --show-box            show annotation bounding boxes (default: False)
  --white-overlay [WHITE_OVERLAY]
                        increase contrast to annotations by making image
                        whiter (default: False)
  --show-joint-scales   show boxes representing joint sizes (default: False)
  --show-joint-confidences
                        print per-joint confidences on skeleton annotations
                        (default: False)
  --show-decoding-order
  --show-frontier-order
  --show-only-decoded-connections
                        to debug which connections were used for decoding
                        (default: False)
  --video-fps VIDEO_FPS
                        output video frame rate (frames per second) (default:
                        10)
  --video-dpi VIDEO_DPI
                        output video resolution (dots per inch) (default: 100)

visualizer:
  --debug-indices DEBUG_INDICES [DEBUG_INDICES ...]
                        Indices of fields to create debug plots for of the
                        form headname:fieldindex, e.g. cif:5. Optionally,
                        specify the visualization type, e.g. cif:5:hr for the
                        high resolution plot only. Use comma separation to
                        specify multiple head names, field indices or
                        visualization types, e.g. cif:5,6:confidence,hr to
                        visualize CIF fields 5 and 6 but only show confidence
                        and hr. (default: [])

export_onnx#

%%bash
python3 -m openpifpaf.export_onnx --help
usage: python3 -m openpifpaf.export_onnx [-h] [--version]
                                         [--squeezenet-no-pretrain]
                                         [--shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE]
                                         [--shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS]
                                         [--shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION]
                                         [--shufflenetv2k-kernel SHUFFLENETV2K_KERNEL]
                                         [--shufflenetv2k-conv5-as-stage]
                                         [--shufflenetv2k-instance-norm | --shufflenetv2k-group-norm]
                                         [--shufflenetv2k-leaky-relu]
                                         [--mobilenetv2-no-pretrain]
                                         [--mobilenetv3-no-pretrain]
                                         [--resnet-no-pretrain]
                                         [--resnet-pool0-stride RESNET_POOL0_STRIDE]
                                         [--resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE]
                                         [--resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE]
                                         [--resnet-block5-dilation RESNET_BLOCK5_DILATION]
                                         [--resnet-remove-last-block]
                                         [--hrformer-scale-level HRFORMER_SCALE_LEVEL]
                                         [--hrformer-no-pretrain]
                                         [--clipconvnext-no-pretrain]
                                         [--convnextv2-no-pretrain]
                                         [--xcit-out-channels XCIT_OUT_CHANNELS]
                                         [--xcit-out-maxpool]
                                         [--xcit-no-pretrain]
                                         [--swin-drop-path-rate SWIN_DROP_PATH_RATE]
                                         [--swin-input-upsample]
                                         [--swin-use-fpn]
                                         [--swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS]
                                         [--swin-fpn-level SWIN_FPN_LEVEL]
                                         [--swin-no-pretrain]
                                         [--shufflenetv2-no-pretrain]
                                         [--cf4-dropout CF4_DROPOUT]
                                         [--cf4-no-inplace-ops]
                                         [--checkpoint CHECKPOINT]
                                         [--basenet BASENET]
                                         [--cross-talk CROSS_TALK]
                                         [--no-download-progress]
                                         [--head-consolidation {keep,create,filter_and_extend}]
                                         [--outfile OUTFILE] [--simplify]
                                         [--check] [--input-width INPUT_WIDTH]
                                         [--input-height INPUT_HEIGHT]

Export a checkpoint as an ONNX model.

Applies onnx utilities to improve the exported model and
also tries to simplify the model with onnx-simplifier.

https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md
https://github.com/daquexian/onnx-simplifier

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --outfile OUTFILE
  --simplify
  --check
  --input-width INPUT_WIDTH
  --input-height INPUT_HEIGHT

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

export_coreml#

%%bash
python3 -m openpifpaf.export_coreml --help
usage: python3 -m openpifpaf.export_coreml [-h] [--version]
                                           [--xcit-out-channels XCIT_OUT_CHANNELS]
                                           [--xcit-out-maxpool]
                                           [--xcit-no-pretrain]
                                           [--swin-drop-path-rate SWIN_DROP_PATH_RATE]
                                           [--swin-input-upsample]
                                           [--swin-use-fpn]
                                           [--swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS]
                                           [--swin-fpn-level SWIN_FPN_LEVEL]
                                           [--swin-no-pretrain]
                                           [--shufflenetv2-no-pretrain]
                                           [--squeezenet-no-pretrain]
                                           [--shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE]
                                           [--shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS]
                                           [--shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION]
                                           [--shufflenetv2k-kernel SHUFFLENETV2K_KERNEL]
                                           [--shufflenetv2k-conv5-as-stage]
                                           [--shufflenetv2k-instance-norm | --shufflenetv2k-group-norm]
                                           [--shufflenetv2k-leaky-relu]
                                           [--mobilenetv2-no-pretrain]
                                           [--mobilenetv3-no-pretrain]
                                           [--resnet-no-pretrain]
                                           [--resnet-pool0-stride RESNET_POOL0_STRIDE]
                                           [--resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE]
                                           [--resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE]
                                           [--resnet-block5-dilation RESNET_BLOCK5_DILATION]
                                           [--resnet-remove-last-block]
                                           [--hrformer-scale-level HRFORMER_SCALE_LEVEL]
                                           [--hrformer-no-pretrain]
                                           [--clipconvnext-no-pretrain]
                                           [--convnextv2-no-pretrain]
                                           [--cf4-dropout CF4_DROPOUT]
                                           [--cf4-no-inplace-ops]
                                           [--checkpoint CHECKPOINT]
                                           [--basenet BASENET]
                                           [--cross-talk CROSS_TALK]
                                           [--no-download-progress]
                                           [--head-consolidation {keep,create,filter_and_extend}]
                                           [--outfile OUTFILE]
                                           [--input-width INPUT_WIDTH]
                                           [--input-height INPUT_HEIGHT]
                                           [--minimum-deployment-target {iOS13,iOS14}]

Export a checkpoint as a CoreML model.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --outfile OUTFILE
  --input-width INPUT_WIDTH
  --input-height INPUT_HEIGHT
  --minimum-deployment-target {iOS13,iOS14}

XCiT:
  --xcit-out-channels XCIT_OUT_CHANNELS
                        number of output channels for optional projection
                        layer (None for no projection layer) (default: None)
  --xcit-out-maxpool    adds max-pooling to backbone output feature map
                        (default: False)
  --xcit-no-pretrain    use randomly initialized models (default: True)

SwinTransformer:
  --swin-drop-path-rate SWIN_DROP_PATH_RATE
                        drop path (stochastic depth) rate (default: 0.2)
  --swin-input-upsample
                        scales input image by a factor of 2 for higher res
                        feature maps (default: False)
  --swin-use-fpn        adds a FPN after the Swin network to obtain higher res
                        feature maps (default: False)
  --swin-fpn-out-channels SWIN_FPN_OUT_CHANNELS
                        output channels of the FPN (None to use the default
                        number of channels of the Swin network) (default:
                        None)
  --swin-fpn-level SWIN_FPN_LEVEL
                        FPN pyramid level, must be between 1 (highest
                        resolution) and 4 (lowest resolution) (default: 3)
  --swin-no-pretrain    use randomly initialized models (default: True)

ShuffleNetv2:
  --shufflenetv2-no-pretrain
                        use randomly initialized models (default: True)

SqueezeNet:
  --squeezenet-no-pretrain
                        use randomly initialized models (default: True)

shufflenetv2k:
  --shufflenetv2k-input-conv2-stride SHUFFLENETV2K_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --shufflenetv2k-input-conv2-outchannels SHUFFLENETV2K_INPUT_CONV2_OUTCHANNELS
                        out channels of the optional 2nd input convolution
                        (default: None)
  --shufflenetv2k-stage4-dilation SHUFFLENETV2K_STAGE4_DILATION
                        dilation factor of stage 4 (default: 1)
  --shufflenetv2k-kernel SHUFFLENETV2K_KERNEL
                        kernel width (default: 5)
  --shufflenetv2k-conv5-as-stage
  --shufflenetv2k-instance-norm
  --shufflenetv2k-group-norm
  --shufflenetv2k-leaky-relu

MobileNetV2:
  --mobilenetv2-no-pretrain
                        use randomly initialized models (default: True)

MobileNetV3:
  --mobilenetv3-no-pretrain
                        use randomly initialized models (default: True)

ResNet:
  --resnet-no-pretrain  use randomly initialized models (default: True)
  --resnet-pool0-stride RESNET_POOL0_STRIDE
                        stride of zero removes the pooling op (default: 0)
  --resnet-input-conv-stride RESNET_INPUT_CONV_STRIDE
                        stride of the input convolution (default: 2)
  --resnet-input-conv2-stride RESNET_INPUT_CONV2_STRIDE
                        stride of the optional 2nd input convolution (default:
                        0)
  --resnet-block5-dilation RESNET_BLOCK5_DILATION
                        use dilated convs in block5 (default: 1)
  --resnet-remove-last-block
                        create a network without the last block (default:
                        False)

HRFormer:
  --hrformer-scale-level HRFORMER_SCALE_LEVEL
                        level of the HRFormer pyramid (default: 0)
  --hrformer-no-pretrain
                        use randomly initialized models (default: True)

CLIPConvNeXt:
  --clipconvnext-no-pretrain
                        use randomly initialized models (default: True)

ConvNeXtV2:
  --convnextv2-no-pretrain
                        use randomly initialized models (default: True)

CompositeField4:
  --cf4-dropout CF4_DROPOUT
                        [experimental] zeroing probability of feature in head
                        input (default: 0.0)
  --cf4-no-inplace-ops  alternative graph without inplace ops (default: True)

network configuration:
  --checkpoint CHECKPOINT
                        Path to a local checkpoint. Or provide one of the
                        following to download a pretrained model:
                        ['shufflenetv2k30-animalpose',
                        'shufflenetv2k16-apollo-24',
                        'shufflenetv2k16-apollo-66',
                        'shufflenetv2k30-apollo-66', 'mobilenetv2',
                        'mobilenetv3small', 'mobilenetv3large', 'resnet50',
                        'shufflenetv2k16', 'shufflenetv2k16-withdense',
                        'shufflenetv2k30', 'shufflenetv2k30*', 'swin_s',
                        'swin_b', 'swin_t_input_upsample',
                        'swin_l_input_upsample', 'hrformerbasecat',
                        'clipconvnextbase', 'convnextv2base',
                        'mobilenetv3small-cocodet', 'resnet18-cocodet',
                        'resnet50-crowdpose', 'shufflenetv2k16-nuscenes',
                        'tshufflenetv2k30', 'shufflenetv2k16-wholebody',
                        'shufflenetv2k30-wholebody'] (default: None)
  --basenet BASENET     base network, one of ['mobilenetv2',
                        'mobilenetv3large', 'mobilenetv3small', 'resnet18',
                        'resnet50', 'resnet101', 'resnet152', 'resnext50',
                        'resnext101', 'shufflenetv2x1', 'shufflenetv2x2',
                        'shufflenetv2k16', 'shufflenetv2k20',
                        'shufflenetv2kx5', 'shufflenetv2k30',
                        'shufflenetv2k44', 'squeezenet', 'swin_t', 'swin_s',
                        'swin_b', 'swin_b_window_12', 'swin_l',
                        'swin_l_window_12', 'xcit_nano_12_p16',
                        'xcit_tiny_12_p16', 'xcit_tiny_24_p16',
                        'xcit_small_12_p16', 'xcit_small_24_p16',
                        'xcit_medium_24_p16', 'xcit_large_24_p16',
                        'xcit_nano_12_p8', 'xcit_tiny_12_p8',
                        'xcit_tiny_24_p8', 'xcit_small_12_p8',
                        'xcit_small_24_p8', 'xcit_medium_24_p8',
                        'xcit_large_24_p8', 'effnetv2_s', 'effnetv2_m',
                        'effnetv2_l', 'effnetv2_xl', 'effnetv2_s16_s',
                        'effnetv2_s16_m', 'effnetv2_s16_l', 'effnetv2_s16_xl',
                        'botnet', 'hrformersmall', 'hrformersmallcat',
                        'hrformerbase', 'hrformerbasecat', 'convnextv2base',
                        'clipconvnextbase', 'tshufflenetv2k16',
                        'tshufflenetv2k30', 'tresnet50', 'cifar10net']
                        (default: None)
  --cross-talk CROSS_TALK
                        [experimental] (default: 0.0)
  --no-download-progress
                        suppress model download progress bar (default: True)
  --head-consolidation {keep,create,filter_and_extend}
                        consolidation strategy for a checkpoint's head
                        networks and the heads specified by the datamodule
                        (default: filter_and_extend)

benchmark#

%%bash
python3 -m openpifpaf.benchmark --help
usage: python3 -m openpifpaf.benchmark [-h] [--version] [--output OUTPUT]
                                       [--checkpoints CHECKPOINTS [CHECKPOINTS ...]]
                                       [--iccv2019-ablation]
                                       [--v012-ablation-1] [--v012-ablation-2]
                                       [--v012-ablation-3] [--v012-ablation-4]
                                       [--debug]

Benchmark.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --output OUTPUT       output file name (default: None)
  --checkpoints CHECKPOINTS [CHECKPOINTS ...]
                        checkpoints to evaluate (default: ['resnet50',
                        'shufflenetv2k16', 'shufflenetv2k30'])
  --iccv2019-ablation
  --v012-ablation-1
  --v012-ablation-2
  --v012-ablation-3
  --v012-ablation-4

logging:
  --debug               print debug messages (default: False)

logs#

%%bash
python3 -m openpifpaf.logs --help
usage: python3 -m openpifpaf.logs [options] log_files

Configuring and visualizing log files.

positional arguments:
  log_file              path to log file(s)

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --label LABEL [LABEL ...]
                        label(s) in the same order as files (default: None)
  --eval-suffix EVAL_SUFFIX
                        suffix of evaluation files to look for (default:
                        .eval-*.stats.json)
  --first-epoch FIRST_EPOCH
                        epoch (can be float) of first data point to plot
                        (default: 1e-06)
  --no-share-y          dont share y access (default: True)
  -o OUTPUT, --output OUTPUT
                        output prefix (default is log_file + .) (default:
                        None)
  --show-mtl-sigmas

logger:
  -q, --quiet           only show warning messages or above (default: False)
  --debug               print debug messages (default: False)
  --log-stats           enable stats logging (default: False)

show:
  --save-all [SAVE_ALL]
                        every plot is saved (optional to specify directory)
                        (default: None)
  --show                show every plot, i.e., call matplotlib show()
                        (default: False)
  --image-width IMAGE_WIDTH
                        image width for matplotlib (in inches) (default: None)
  --image-height IMAGE_HEIGHT
                        image height for matplotlib (in inches) (default:
                        None)
  --image-dpi-factor IMAGE_DPI_FACTOR
                        increase dpi of output image by this factor (default:
                        2.0)
  --image-min-dpi IMAGE_MIN_DPI
                        minimum dpi of image output (default: 50.0)
  --show-file-extension SHOW_FILE_EXTENSION
                        default file extension (default: jpeg)
  --textbox-alpha TEXTBOX_ALPHA
                        transparency of annotation text box (default: 0.5)
  --text-color TEXT_COLOR
                        annotation text color (default: white)
  --font-size FONT_SIZE
                        annotation font size (default: 8)
  --monocolor-connections
                        use a single color per instance (default: False)
  --line-width LINE_WIDTH
                        skeleton line width (default: None)
  --skeleton-solid-threshold SKELETON_SOLID_THRESHOLD
                        set to 0.0 to draw all connections as solid lines
                        (default: 0.5)
  --show-box            show annotation bounding boxes (default: False)
  --white-overlay [WHITE_OVERLAY]
                        increase contrast to annotations by making image
                        whiter (default: False)
  --show-joint-scales   show boxes representing joint sizes (default: False)
  --show-joint-confidences
                        print per-joint confidences on skeleton annotations
                        (default: False)
  --show-decoding-order
  --show-frontier-order
  --show-only-decoded-connections
                        to debug which connections were used for decoding
                        (default: False)
  --video-fps VIDEO_FPS
                        output video frame rate (frames per second) (default:
                        10)
  --video-dpi VIDEO_DPI
                        output video resolution (dots per inch) (default: 100)