Predictions API returning [] Even though Roboflow Visualization Returns Multiple Objects

Based on the information provided in the extracts, there could be a few reasons why you’re not getting any predictions from the Roboflow API.

  1. Confidence Level: The confidence level you’ve set for your predictions is 50%. This means that any predictions with a confidence level below 50% will not be returned. If your model is not very confident about its predictions, this could result in an empty set of predictions. You could try lowering the confidence level to see if this resolves the issue.

    predictions = model.predict(image_path, confidence=30).json()
    
  2. Image Size: The Roboflow API might have limitations on the size of the images it can process. If your image is too large, it might not be able to process it. You could try resizing your image before sending it to the API. However, the exact limitations of the API are not specified in the extracts provided.

  3. API Key and Project Details: Ensure that your API key and project details are correct. If you’ve recently upgraded your account, you might need to update your API key. Also, make sure that the project and version you’re trying to access exist and are accessible with your current account permissions.

    rf = Roboflow(api_key="NEW_API_KEY")
    project = rf.workspace("YOUR_WORKSPACE").project("YOUR_PROJECT")
    model = project.version(YOUR_VERSION).model
    
  4. Image File Format: Ensure that the image file you’re trying to predict is in a format that the Roboflow API can process (e.g., .jpg, .png). If the file format is not supported, this could result in an error.

If none of these suggestions resolve your issue, I would recommend reaching out to Roboflow’s support for further assistance. They might be able to provide more specific guidance based on your account details and the specifics of your project.

Sources:


Hi! I’m Roboflow’s AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, and forum. If this solves your issue, please mark it as the solution using the checkbox icon. If this doesn’t solve your issue, please follow up with what you’ve tried/why, and the community will continue to chime in as usual.