Views
No views yet
d_fine_l_objects365-coco_hgnet_v2_b4_pp-imagenet22k_reparameterized.d_fine_l_objects365-coco_hgnet_v2_b4_pp-imagenet22k, and reparameterize the model only after training is complete.DISABLE_CUSTOM_KERNELS=1 before loading the model.| Input size | mAP | mAP (reparam.) | mAP@50 | mAP@50 (reparam.) | mAP@75 | mAP@75 (reparam.) |
|---|---|---|---|---|---|---|
| 512 x 512 | 54.00 | 53.99 | 71.85 | 71.84 | 58.64 | 58.64 |
| 576 x 576 | 55.47 | 55.49 | 73.07 | 73.08 | 60.31 | 60.32 |
| 608 x 608 | 55.77 | 55.77 | 73.34 | 73.37 | 60.81 | 60.79 |
| 640 x 640 | 56.09 | 56.08 | 73.51 | 73.51 | 60.98 | 60.97 |
| 672 x 672 | 56.21 | 56.21 | 73.56 | 73.56 | 61.21 | 61.21 |
| 704 x 704 | 56.43 | 56.43 | 73.87 | 73.87 | 61.54 | 61.53 |
1import birder
2from birder.inference.detection import infer_image
3
4# Option 1: manual setup (more control over preprocessing)
5net, model_info = birder.load_pretrained_model("d_fine_l_objects365-coco_hgnet_v2_b4_pp-imagenet22k", inference=True)
6
7# Get the image size the model was trained on
8size = birder.get_size_from_signature(model_info.signature)
9
10# Create an inference transform
11transform = birder.detection_transform(size, model_info.rgb_stats, dynamic_size=model_info.signature["dynamic"])
12
13# Option 2: helper (quick start with default preprocessing)
14net, model_info, transform = birder.load_pretrained_model_and_transform("d_fine_l_objects365-coco_hgnet_v2_b4_pp-imagenet22k", inference=True)
15
16image = "path/to/image.jpeg" # or a PIL image, must be loaded in RGB format
17detections = infer_image(net, image, transform)
18# detections is a dict with keys: 'boxes', 'labels', 'scores'
19# boxes: torch.Tensor with shape (N, 4) in [x1, y1, x2, y2] format
20# labels: torch.Tensor with shape (N,) containing class indices
21# scores: torch.Tensor with shape (N,) containing confidence scores_reparameterized checkpoint for inference-oriented deployment.
Birder automatically constructs the matching reparameterized architecture, no additional conversion flag is needed.1import birder
2from birder.inference.detection import infer_image
3
4weights = "d_fine_l_objects365-coco_hgnet_v2_b4_pp-imagenet22k_reparameterized"
5net, model_info, transform = birder.load_pretrained_model_and_transform(weights, inference=True)
6
7image = "path/to/image.jpeg" # or a PIL image, must be loaded in RGB format
8detections = infer_image(net, image, transform)1@misc{peng2024dfineredefineregressiontask,
2 title={D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement},
3 author={Yansong Peng and Hebei Li and Peixi Wu and Yueyi Zhang and Xiaoyan Sun and Feng Wu},
4 year={2024},
5 eprint={2410.13842},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2410.13842},
9}