ferrotorch/keypointrcnn_resnet50_fpn
Keypoint R-CNN with ResNet-50 + FPN backbone for COCO person keypoint detection. Re-keyed from torchvision 0.21 keypointrcnn_resnet50_fpn (KeypointRCNN_ResNet50_FPN_Weights.COCO_V1). Same FasterRCNN body as #1141 (with FPN biases) but with num_classes=2 (background + person) for the box predictor, plus an 8-conv KeypointRCNNHeads (256โ512โ...โ512) and a single-deconv KeypointRCNNPredictor outputting 17 keypoint heatmap channels.
Provenance
- Upstream factory:
torchvision.models.keypointrcnn_resnet50_fpnwithweights="COCO_V1"(torchvision 0.21). - Conversion script:
ferrotorch/scripts/pin_pretrained_weights.py. - Ferrotorch issue: https://github.com/dollspace/ferrotorch/issues/1130.
- Number of trainable parameters in upstream torchvision model: 59,137,258.
- SHA-256 of
model.safetensors(this file is pinned inferrotorch-hub/src/registry.rs):73e282340493d58731dc08314df5f4f483fd537f55b3bb2fc188c17cfd922dfb.
How to load
use ferrotorch_vision::models::registry::get_model;
let model = get_model("keypointrcnn_resnet50_fpn", /* pretrained = */ true, /* num_classes = */ 2).unwrap();
The loader downloads this file, verifies SHA-256, then calls
Module::load_state_dict(state_dict, strict=false). strict=false
is required because ferrotorch's Module::named_parameters() does
not yet expose BatchNorm2d running statistics
(running_mean / running_var), so those keys in this safetensors
file are intentionally ignored at load time until ferrotorch
issue #995 closes. They are still included here so re-uploading
is unnecessary once that work lands.
Conversion notes
All upstream torchvision keys were mapped 1:1 to ferrotorch parameter slots.
Upstream license (verbatim, torchvision 0.21 LICENSE)
BSD 3-Clause License
Copyright (c) Soumith Chintala 2016,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.