Cannot Pass URL with %20 in custom vision API

Garen Kwan 1 Reputation point
2021-10-07T11:04:39.417+00:00

I have deployed a custom vision model and it works when passing a request to an endpoint:
https://southeastasia.api.cognitive.microsoft.com/customvision/v3.1/Prediction/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/detect/iterations/project-name/url
the result is fine and I get a response as expected.

However, if the url has a space in it denoted by a "%20" example: https://ozcorp.sharepoint.com/sites/Teams/testimage%202.jpg
I get the following response:
{
"code": "BadRequestImageUrl",
"message": "Invalid url: https://ozcorp.sharepoint.com/sites/Teams/testimage 2.jpg"
}

it seems to me that the problem is with custom vision not being able to parse this url.
i have also tried passing https://ozcorp.sharepoint.com/sites/Teams/testimage 2.jpg for the image url but it fails too.

the spaces are part of the url and cannot be removed, how can i resolve this?

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
381 questions
Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
250 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. GiftA-MSFT 11,171 Reputation points
    2021-10-07T23:26:20.543+00:00

    Hi, try renaming the file (remove space) or apply the following encoding testimage+2.jpg.


    --- *kindly accept answer if the information provided helps, this helps the community find answers faster.*

    0 comments No comments

  2. Garen Kwan 1 Reputation point
    2021-10-08T02:01:36.047+00:00

    Hi, afraid I cannot do that.
    Also, I think I misconstructed the problem. I could be facing authentication issues when trying to link the custom vision endpoint to a file saved using forms.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.