Add Image Processor Fast RT-DETR (#34354)

* add fast image processor rtdetr

* add gpu/cpu test and fix docstring

* remove prints

* add to doc

* nit docstring

* avoid iterating over images/annotations several times

* change torch typing

* Add image processor fast documentation
This commit is contained in:
Yoni Gozlan
2024-10-30 13:49:47 -04:00
committed by GitHub
parent 9f06fb0505
commit 48872fd6ae
12 changed files with 1251 additions and 317 deletions

View File

@@ -46,7 +46,7 @@ Initially, an image is processed using a pre-trained convolutional neural networ
>>> from PIL import Image
>>> from transformers import RTDetrForObjectDetection, RTDetrImageProcessor
>>> url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
>>> url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
>>> image = Image.open(requests.get(url, stream=True).raw)
>>> image_processor = RTDetrImageProcessor.from_pretrained("PekingU/rtdetr_r50vd")
@@ -95,6 +95,12 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- preprocess
- post_process_object_detection
## RTDetrImageProcessorFast
[[autodoc]] RTDetrImageProcessorFast
- preprocess
- post_process_object_detection
## RTDetrModel
[[autodoc]] RTDetrModel