300 Detection Limit in Downloaded Model Weights

I trained a YOLO26 instance segmentation model. My images contain 500+ objects, but I’m consistently getting only ~300 detections.

What I’ve tried:

  1. Roboflow Hosted API: Different confidence/IOU thresholds - always caps at 300
  2. Purchased model weights ($99): Downloaded to self-host with unlimited detections
  3. Roboflow Inference SDK: Deployed using the open-source inference library - still 300 limit
  4. Ultralytics: Built custom inference server with Ultralytics 8.4.6 using the downloaded weights
  5. Model inspection: Found max_det: 300 hardcoded in the Segment26 detection head of the model architecture

Questions:

  1. Is there a 300 detection limit built into models trained on Roboflow, even when self-hosting?
  2. If yes, how can I remove this limit from the downloaded weights?
  3. Can models be trained/retrained with a higher max_det value (e.g., 2000)?

I purchased the weights expecting to bypass the hosted API’s limitations, but the limit appears to be in the model architecture itself. Has anyone encountered this and found a solution?

Project Type: Instance Segmentation
Operating System & Browser: macOS / Chrome
Do you grant Roboflow Support permission to access your Workspace for troubleshooting? (Yes/No): Yes

Not sure if you saw this post from a year ago, but it indicates inference-sdk should work. Maybe check out the provided code in there and see if anything is different compared to what you tried.

Thanks, I’ve already looked at that and tried it out, but I’m still hitting the same 300 detection limit.

I’ve tried a few different setups at this point. The Roboflow hosted API always caps at 300 detections no matter how I change confidence or IOU. I also deployed inference-sdk myself on Google Cloud and explicitly set max_detections=2000, but the output still stops at 300. I even bought the model weights and ran inference locally, same result there too.

What’s throwing me off is that this limit seems to persist everywhere. Changing max_detections doesn’t appear to do anything, so I’m not sure if this is an inference-sdk thing, something baked into the trained model, or just a hard limit in the YOLO architecture.

For the Roboflow team:

  • Is there a max_det value fixed during training that defaults to 300?
  • When using inference-sdk with max_detections=2000, should it actually be possible to exceed 300, or is the model still capped?
  • Can models be retrained with a higher detection limit, or is this fundamentally a YOLO constraint?
  • Are purchased weights any different from the API models when it comes to detection limits?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.