Different results between API and going through the UI in workspace

Hello RF team,
I have a RF model ( Roboflow Instant ) to detect vehicle wheels in a picture. I’ve trained the model directly through the site.

However, I’m running into issues where going through the Javascript serverless API is giving results that are wrong and differ from using the UI in my workspace. To be specific, I can take the same image and via the API, it will not detect wheels but using the same image in the UI, it will properly detect the wheels.

From the javascript side, I make my call like such:
const response = await axios({

    method: "POST",

    url: \`https://serverless.roboflow.com/${modelId}\`,

    params: {

        api_key: RF_API_KEY_GOES_HERE,

        image: imageUrl

    }

})

With this test photo and going through the API, I get 0 wheels found ( 0 predictions returned ):
Test photo

Here is my results on the UI in workspace:

One thing to note is that the file is particularly big dimensionally ( 4000x6000 and 4.68Mb ). But it works on the UI so I’m not sure if that is related.

For 90% of images, the API and UI have matching results but I’m starting to build a bigger and bigger bucket of images that have differences.

Hi @josh!
This is a great question, thank you for all of the context it’s incredibly helpful.

To solve this, I recommend preprocessing the images to a max size of 2048 x 2048 in Python before passing to the Serverless endpoint.

Happy building!

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