microsoft / conditional-detr-resnet-50

huggingface.co
Total runs: 6.9K
24-hour runs: -53
7-day runs: -408
30-day runs: 252
Model's Last Updated: May 08 2024
object-detection

Introduction of conditional-detr-resnet-50

Model Details of conditional-detr-resnet-50

Conditional DETR model with ResNet-50 backbone

Conditional DEtection TRansformer (DETR) model trained end-to-end on COCO 2017 object detection (118k annotated images). It was introduced in the paper Conditional DETR for Fast Training Convergence by Meng et al. and first released in this repository .

Model description

The recently-developed DETR approach applies the transformer encoder and decoder architecture to object detection and achieves promising performance. In this paper, we handle the critical issue, slow training convergence, and present a conditional cross-attention mechanism for fast DETR training. Our approach is motivated by that the cross-attention in DETR relies highly on the content embeddings for localizing the four extremities and predicting the box, which increases the need for high-quality content embeddings and thus the training difficulty. Our approach, named conditional DETR, learns a conditional spatial query from the decoder embedding for decoder multi-head cross-attention. The benefit is that through the conditional spatial query, each cross-attention head is able to attend to a band containing a distinct region, e.g., one object extremity or a region inside the object box. This narrows down the spatial range for localizing the distinct regions for object classification and box regression, thus relaxing the dependence on the content embeddings and easing the training. Empirical results show that conditional DETR converges 6.7× faster for the backbones R50 and R101 and 10× faster for stronger backbones DC5-R50 and DC5-R101.

model image

Intended uses & limitations

You can use the raw model for object detection. See the model hub to look for all available Conditional DETR models.

How to use

Here is how to use this model:

from transformers import AutoImageProcessor, ConditionalDetrForObjectDetection
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

processor = AutoImageProcessor.from_pretrained("microsoft/conditional-detr-resnet-50")
model = ConditionalDetrForObjectDetection.from_pretrained("microsoft/conditional-detr-resnet-50")

inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)

# convert outputs (bounding boxes and class logits) to COCO API
# let's only keep detections with score > 0.7
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.7)[0]

for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    box = [round(i, 2) for i in box.tolist()]
    print(
            f"Detected {model.config.id2label[label.item()]} with confidence "
            f"{round(score.item(), 3)} at location {box}"
    )

This should output:

Detected remote with confidence 0.833 at location [38.31, 72.1, 177.63, 118.45]
Detected cat with confidence 0.831 at location [9.2, 51.38, 321.13, 469.0]
Detected cat with confidence 0.804 at location [340.3, 16.85, 642.93, 370.95]

Currently, both the feature extractor and model support PyTorch.

Training data

The Conditional DETR model was trained on COCO 2017 object detection , a dataset consisting of 118k/5k annotated images for training/validation respectively.

BibTeX entry and citation info
@inproceedings{MengCFZLYS021,
  author    = {Depu Meng and
               Xiaokang Chen and
               Zejia Fan and
               Gang Zeng and
               Houqiang Li and
               Yuhui Yuan and
               Lei Sun and
               Jingdong Wang},
  title     = {Conditional {DETR} for Fast Training Convergence},
  booktitle = {2021 {IEEE/CVF} International Conference on Computer Vision, {ICCV}
               2021, Montreal, QC, Canada, October 10-17, 2021},
}

Runs of microsoft conditional-detr-resnet-50 on huggingface.co

6.9K
Total runs
-53
24-hour runs
82
3-day runs
-408
7-day runs
252
30-day runs

More Information About conditional-detr-resnet-50 huggingface.co Model

More conditional-detr-resnet-50 license Visit here:

https://choosealicense.com/licenses/apache-2.0

conditional-detr-resnet-50 huggingface.co

conditional-detr-resnet-50 huggingface.co is an AI model on huggingface.co that provides conditional-detr-resnet-50's model effect (), which can be used instantly with this microsoft conditional-detr-resnet-50 model. huggingface.co supports a free trial of the conditional-detr-resnet-50 model, and also provides paid use of the conditional-detr-resnet-50. Support call conditional-detr-resnet-50 model through api, including Node.js, Python, http.

conditional-detr-resnet-50 huggingface.co Url

https://huggingface.co/microsoft/conditional-detr-resnet-50

microsoft conditional-detr-resnet-50 online free

conditional-detr-resnet-50 huggingface.co is an online trial and call api platform, which integrates conditional-detr-resnet-50's modeling effects, including api services, and provides a free online trial of conditional-detr-resnet-50, you can try conditional-detr-resnet-50 online for free by clicking the link below.

microsoft conditional-detr-resnet-50 online free url in huggingface.co:

https://huggingface.co/microsoft/conditional-detr-resnet-50

conditional-detr-resnet-50 install

conditional-detr-resnet-50 is an open source model from GitHub that offers a free installation service, and any user can find conditional-detr-resnet-50 on GitHub to install. At the same time, huggingface.co provides the effect of conditional-detr-resnet-50 install, users can directly use conditional-detr-resnet-50 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

conditional-detr-resnet-50 install url in huggingface.co:

https://huggingface.co/microsoft/conditional-detr-resnet-50

Url of conditional-detr-resnet-50

conditional-detr-resnet-50 huggingface.co Url

Provider of conditional-detr-resnet-50 huggingface.co

microsoft
ORGANIZATIONS

Other API from microsoft

huggingface.co

Total runs: 19.4M
Run Growth: 12.4M
Growth Rate: 64.13%
Updated: February 14 2024
huggingface.co

Total runs: 5.3M
Run Growth: -300.5K
Growth Rate: -5.71%
Updated: September 26 2022
huggingface.co

Total runs: 2.1M
Run Growth: 281.5K
Growth Rate: 13.71%
Updated: April 24 2023
huggingface.co

Total runs: 859.1K
Run Growth: 683.3K
Growth Rate: 79.75%
Updated: February 03 2022
huggingface.co

Total runs: 528.5K
Run Growth: 133.9K
Growth Rate: 25.34%
Updated: February 28 2023
huggingface.co

Total runs: 230.0K
Run Growth: -46.8K
Growth Rate: -20.36%
Updated: April 30 2024
huggingface.co

Total runs: 209.9K
Run Growth: -51.4K
Growth Rate: -24.49%
Updated: August 19 2024
huggingface.co

Total runs: 135.4K
Run Growth: 25.1K
Growth Rate: 17.89%
Updated: November 08 2023
huggingface.co

Total runs: 131.5K
Run Growth: -9.1K
Growth Rate: -6.90%
Updated: April 30 2024
huggingface.co

Total runs: 107.7K
Run Growth: 52.9K
Growth Rate: 49.08%
Updated: April 08 2024
huggingface.co

Total runs: 75.5K
Run Growth: 41.4K
Growth Rate: 54.85%
Updated: September 18 2023
huggingface.co

Total runs: 49.0K
Run Growth: -23.7K
Growth Rate: -48.48%
Updated: February 03 2023
huggingface.co

Total runs: 44.3K
Run Growth: -651.9K
Growth Rate: -1470.37%
Updated: September 26 2022
huggingface.co

Total runs: 27.4K
Run Growth: 13.3K
Growth Rate: 48.68%
Updated: February 29 2024
huggingface.co

Total runs: 16.8K
Run Growth: 198
Growth Rate: 1.18%
Updated: November 23 2023
huggingface.co

Total runs: 11.6K
Run Growth: 1.1K
Growth Rate: 9.72%
Updated: December 23 2021
huggingface.co

Total runs: 10.6K
Run Growth: 6.6K
Growth Rate: 62.51%
Updated: June 27 2023
huggingface.co

Total runs: 10.1K
Run Growth: 5.0K
Growth Rate: 49.77%
Updated: July 02 2022
huggingface.co

Total runs: 9.5K
Run Growth: 468
Growth Rate: 4.92%
Updated: April 30 2024
huggingface.co

Total runs: 9.3K
Run Growth: 2.8K
Growth Rate: 30.09%
Updated: November 23 2023
huggingface.co

Total runs: 6.6K
Run Growth: 3.4K
Growth Rate: 51.46%
Updated: August 28 2024