Downloads · 30 days
141
11% of all-time downloads
birder-project/lw_detr_2stg_objects365_pe_spatial_s16
lw_detr_2stg_objects365_pe_spatial_s16 is a object detection model from birder-project. Use it when you need objects located in an image. It is set up for birder. The card lists the license as apache-2.0.
A two-stage LW-DETR object detector with a PE-Spatial s16 backbone, trained on Objects365-2020 as a fine-tuning-oriented checkpoint. The model was trained with a compact 40-epoch schedule, a constant learning rate, st…
Downloads · 30 days
141
11% of all-time downloads
All-time downloads
1.3K
Public
Repo size
266 MB
Likes
0
Public
Click a slice to open those files.
.pt133 MB · 100%
From the Hugging Face model README
A two-stage LW-DETR object detector with a PE-Spatial s16 backbone, trained on Objects365-2020 as a fine-tuning-oriented checkpoint. The model was trained with a compact 40-epoch schedule, a constant learning rate, strong backbone layer decay to keep the PE-Spatial representation stable and heavy detection augmentations including mosaic. Training used multi-resolution inputs sampled from 512px to 672px.
Custom Kernels: This model uses optimized custom kernel for Deformable Attention operations. If you encounter compilation issues or prefer to use pure PyTorch implementations, set the environment variable DISABLE_CUSTOM_KERNELS=1 before loading the model.
Model Type: Object detection
Model Stats:
Dataset: Objects365-2020 (365 classes)
Papers:
Metrics:
import birder
from birder.inference.detection import infer_image
# Option 1: manual setup (more control over preprocessing)
net, model_info = birder.load_pretrained_model("lw_detr_2stg_objects365_pe_spatial_s16", inference=True)
# Get the image size the model was trained on
size = birder.get_size_from_signature(model_info.signature)
# Create an inference transform
transform = birder.detection_transform(size, model_info.rgb_stats, dynamic_size=model_info.signature["dynamic"])
# Option 2: helper (quick start with default preprocessing)
net, model_info, transform = birder.load_pretrained_model_and_transform("lw_detr_2stg_objects365_pe_spatial_s16", inference=True)
image = "path/to/image.jpeg" # or a PIL image, must be loaded in RGB format
detections = infer_image(net, image, transform)
# detections is a dict with keys: 'boxes', 'labels', 'scores'
# boxes: torch.Tensor with shape (N, 4) in [x1, y1, x2, y2] format
# labels: torch.Tensor with shape (N,) containing class indices
# scores: torch.Tensor with shape (N,) containing confidence scores
@misc{chen2024lwdetrtransformerreplacementyolo,
title={LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection},
author={Qiang Chen and Xiangbo Su and Xinyu Zhang and Jian Wang and Jiahui Chen and Yunpeng Shen and Chuchu Han and Ziliang Chen and Weixiang Xu and Fanrong Li and Shan Zhang and Kun Yao and Errui Ding and Gang Zhang and Jingdong Wang},
year={2024},
eprint={2406.03459},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2406.03459},
}
@misc{bolya2025perceptionencoderbestvisual,
title={Perception Encoder: The best visual embeddings are not at the output of the network},
author={Daniel Bolya and Po-Yao Huang and Peize Sun and Jang Hyun Cho and Andrea Madotto and Chen Wei and Tengyu Ma and Jiale Zhi and Jathushan Rajasegaran and Hanoona Rasheed and Junke Wang and Marco Monteiro and Hu Xu and Shiyu Dong and Nikhila Ravi and Daniel Li and Piotr Dollár and Christoph Feichtenhofer},
year={2025},
eprint={2504.13181},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2504.13181},
}