300 object maximum

Dear friends, we are testing a prediction model to count the amount of wood, but when uploading any image that has more than 300 pieces of wood (objects), it does not capture more than 300 as if it were its limit. My question is, is it because I am using the free version or does Roboflow have that limitation of 300 objects?
Attached screenshot.

Hi @ogonzalez - thanks for posting!

We default to 300 objects to speed up the inference. When you use the model in production you can change the object limit parameter to increase this.

To add more context here, you can change the maximum number of detections by setting the max_detections query parameter on the Hosted Inference API. This can also be set in the Python Inference SDK as well as the Inference Docker container.

Dear, we are using the Inference API (https://docs.roboflow.com/deploy/hosted-api/custom-models/object-detection)
Is there a way to increase objects with the roboflow sdk?

Hi @ogonzalez ,

I understand you installed roboflow package, unfortunately it’s not possible to increase this limit when running prediction through this package.

You can try with inference-sdk package:

import cv2 as cv
from inference_sdk import InferenceHTTPClient
from inference_sdk.http.entities import InferenceConfiguration
import supervision as sv


client = InferenceHTTPClient(
    api_url="https://detect.roboflow.com", api_key="<paste your API key here>"
)
client.configure(InferenceConfiguration(max_detections=1000))

result = client.infer(model_id="timber-log-v1/16", inference_input="/path/to/image.jpg or http(s)://url/to/image.jpg or image itself")

# if you have image available locally you can visualise
label_annotator = sv.LabelAnnotator()
dets = sv.Detections.from_inference(result)

img = cv.imread("/path/to/image.jpg")
annotated_frame = label_annotator.annotate(
    img, detections=dets
)

cv.imshow("", annotated_frame)
cv.waitKey(0)

1 Like

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