System Info
transformers version: 4.41.2
- Platform: Linux-5.4.0-182-generic-x86_64-with-glibc2.31
- Python version: 3.11.8
- Huggingface_hub version: 0.23.0
- Safetensors version: 0.4.2
- Accelerate version: 0.30.1
- Accelerate config: not found
- PyTorch version (GPU?): 2.2.2+cu121 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?:
- Using distributed or parallel set-up in script?:
When running the ObjectDetectionPipeline in a batch, the output will only be the bounding boxes of the first input image due to ObjectDetectionPipeline.py accessing element [0] in postprocessing and not looping over all outputs.
|
raw_annotation = raw_annotations[0] |
This accesses only and always the first element, instead of looping over all outputs.
Only the first element is accessed in postprocessing
Who can help?
@Narsil
Information
Tasks
Reproduction
- Create object detection Pipeline
pipe = pipeline("object-detection", model=model_name, image_processor=preprocessor_name, device=device)
- use batch inference with batch_size > 2.
for out in tqdm(pipe(dataset, batch_size=batch_size)):
Expected behavior
Expected Output: 2 Elements with each x items (bboxes).
Actual Output, only bboxes of the first input element.
System Info
transformersversion: 4.41.2When running the ObjectDetectionPipeline in a batch, the output will only be the bounding boxes of the first input image due to ObjectDetectionPipeline.py accessing element [0] in postprocessing and not looping over all outputs.
transformers/src/transformers/pipelines/object_detection.py
Line 150 in a4e1a1d
This accesses only and always the first element, instead of looping over all outputs.
Only the first element is accessed in postprocessing
Who can help?
@Narsil
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
pipe = pipeline("object-detection", model=model_name, image_processor=preprocessor_name, device=device)for out in tqdm(pipe(dataset, batch_size=batch_size)):Expected behavior
Expected Output: 2 Elements with each x items (bboxes).
Actual Output, only bboxes of the first input element.