Instructions to use zeromodels/detr-resnet-50-panoptic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/detr-resnet-50-panoptic with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use zeromodels/detr-resnet-50-panoptic with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/detr-resnet-50-panoptic") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of DETR.
Run DETR with Keras 3: JAX, PyTorch, or TensorFlow
kerasformers/detr-resnet-50-panoptic
Paper: End-to-End Object Detection with Transformers (arXiv:2005.12872) · HF Papers
DETR (DEtection TRansformer) treats object detection as direct set prediction. A ResNet backbone produces a feature map, a transformer encoder-decoder attends over it with a fixed set of learned object queries, and each query emits one class and one box. Training uses a bipartite (Hungarian) matching loss, so every ground-truth object is assigned exactly one query. That framing removes anchors and NMS. Panoptic checkpoints add a mask head for things and stuff.
For more details on the model, please go to Facebook's original model card.
Pure-Keras 3 conversion of facebook/detr-resnet-50-panoptic for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a panoptic segmentation checkpoint (DETRPanopticSegment): each query predicts a class, box, and mask (COCO things + stuff).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from kerasformers.models.detr import DETRPanopticSegment, DETRImageProcessor
model = DETRPanopticSegment.from_weights("kerasformers/detr-resnet-50-panoptic")
processor = DETRImageProcessor.from_weights("kerasformers/detr-resnet-50-panoptic")
image = Image.open("your_image.jpg").convert("RGB")
output = model(processor(image)["pixel_values"], training=False)
# output['logits'], output['pred_boxes'], output['pred_masks']
Load any DETR variant the same way with from_weights("kerasformers/<variant>") (use DETRPanopticSegment for this repo):
| Variant | Hub | Task |
|---|---|---|
detr-resnet-50 |
kerasformers/detr-resnet-50 |
object detection |
detr-resnet-101 |
kerasformers/detr-resnet-101 |
object detection |
detr-resnet-50-panoptic |
kerasformers/detr-resnet-50-panoptic |
panoptic segmentation |
detr-resnet-101-panoptic |
kerasformers/detr-resnet-101-panoptic |
panoptic segmentation |
Tips
- Set
KERAS_BACKENDbefore importing Keras / kerasformers. - Detection:
DETRDetect+post_process_object_detection(trythreshold=0.9on clean COCO scenes). - Panoptic:
DETRPanopticSegmentreturnspred_masksper query; threshold at zero and resize to the image size yourself. - See DETR docs and Loading Weights.
- Community / upstream safetensors still work via the
hf:prefix, e.g.DETRPanopticSegment.from_weights("hf:facebook/detr-resnet-50-panoptic").
Special Thanks
A huge thank you to the Facebook AI Research DETR authors for creating and releasing these models.
License: Apache 2.0.
- Downloads last month
- 40
Model tree for zeromodels/detr-resnet-50-panoptic
Base model
facebook/detr-resnet-50-panoptic