yuwenmichael / Grounding-DINO-Batch-Inference

Support batch inference of Grounding DINO. "Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection"
2 stars 0 forks source link

Issue with Batch Processing in predict_batch Function #2

Open codefanw opened 7 months ago

codefanw commented 7 months ago

The predict_batch function seems to only process the first image in a batch when generating predictions. Specifically, the lines:

prediction_logits = outputs["pred_logits"].cpu().sigmoid()[0]
prediction_boxes = outputs["pred_boxes"].cpu()[0]

These lines appear to only handle the logits and boxes for the first image in the batch, ignoring the rest.

yuwenmichael commented 6 months ago

Yes and that's the reason I create this repo, to solve the problem which only predicting an image a time. Pls check out batch_utilities.py for batch inference.