Web app example: Image returned is incorrectly encoded

I’ve recently come upon an issue using the Example Web app.

Using it to test some example imagery that I’ve previously used for the same Example Web app, the image returned with the inferences is incorrectly encoded. Instead of being returned something like the middle image I get the blue image.

I’ve tested the Example web app with a different model and image and the issue persists.

I’m quite a beginner so I’m not entirely sure how to fix this.

  • **Project Type:Object detection
  • **Operating System & Browser:Windows/ Google Chrome
  • Project Universe Link or Workspace/Project ID:

Hi @abdullahmadawi

That’s an interesting issue. I have several questions to clarify your issue.

Did this happen when the API drew boxes around the images? Are you using our CodePen? If so, can you link to it?

Also, please share your project’s Universe link or workspace/project IDs.

Hi,

Here is a link to the example CodePen by the team at Roboflow. I’ve tried the app with different file formats and band visualisations (RGB and IR), both of which are returned with a ‘blue tint’. My guess is that the colour channels are reversed in the image binary blob from the POST response and I’m not sure how to rearrange the order. [Project ID: treedetection-hrs8w].

Bowood_2ndSept2021ir_088_090

Hi @abdullahmadawi

That’s certainly interesting. I was able to replicate your issue so I’ll take a look into it, but in the meantime, please revoke your API key since you posted it publicly. Your API key allows access to your account and therefore should never be posted publicly.

Edit: Also, what is the type/source of your images?

Thanks, your assistance is very much appreciated. The example images are tiles (png) from a Uint8 tiff. I have also tried with images taken from a tablet (jpeg).

Hi @abdullahmadawi

Does the issue occur when you upload the images through the Deploy tab in your project?

In the meantime, if you need the boxes drawn on your image, you could do it based on the JSON response from the inference result.

Also out of interest, what device are you taking the other image?

Have you solved this bug? Because I also experienced this problem, my image from request is rotated and in another color scale

Hi,

The issue does not occur through that method.

Yes, I have implemented that as a temporary solution.

@leo Are you working on fixing this bug?

Hi @John_Shepard

We are working on fixing this bug. In the meantime, you can use the alternative that was brought up before. Also, you can use Supervision’s utilities to draw your annotations onto images.