Views
No views yet
facebook/detr-resnet-101-panoptic for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.DETRPanopticSegment): each query predicts a class, box, and mask (COCO things + stuff).1import os
2os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
3
4from PIL import Image
5from zeromodels.models.detr import DETRPanopticSegment, DETRImageProcessor
6
7model = DETRPanopticSegment.from_weights("zeromodels/detr-resnet-101-panoptic")
8processor = DETRImageProcessor.from_weights("zeromodels/detr-resnet-101-panoptic")
9
10image = Image.open("your_image.jpg").convert("RGB")
11output = model(processor(image)["pixel_values"], training=False)
12# output['logits'], output['pred_boxes'], output['pred_masks']from_weights("zeromodels/<variant>") (use DETRPanopticSegment for this repo):| Variant | Hub | Task |
|---|---|---|
detr-resnet-50 | zeromodels/detr-resnet-50 | object detection |
detr-resnet-101 | zeromodels/detr-resnet-101 | object detection |
detr-resnet-50-panoptic | zeromodels/detr-resnet-50-panoptic | panoptic segmentation |
detr-resnet-101-panoptic | zeromodels/detr-resnet-101-panoptic | panoptic segmentation |
KERAS_BACKEND before importing Keras / zeromodels.DETRDetect + post_process_object_detection (try threshold=0.9 on clean COCO scenes).DETRPanopticSegment returns pred_masks per query; threshold at zero and resize to the image size yourself.hf: prefix, e.g. DETRPanopticSegment.from_weights("hf:facebook/detr-resnet-101-panoptic").