0
votes

In Visual Recognition in IBM Cloud, I created a custom model for object detection and created a classifier to detect a specific object. I ran the test (analysis of the image) in the GUI as shown in the image below, and it worked.

test result in the GUI

However, when I hit the api in curl and ran it, it did not return any of the values it detected, despite analyzing the exact same test image as the above image. I ran it as follows. (I executed two patterns.)

[pattern 1]

curl -X POST -u "apikey:{my_api}" -F "features=objects" -F "collection_ids={my_ids}" -F "images_file=@{my_image}" -F “threshold=0.2” "https://gateway.watsonplatform.net/visual-recognition/api/v4/analyze?version=2019-02-11"

[pattern 2]

curl -X POST -u "apikey:{my_api}" -F "features=objects" -F "collection_ids={my_ids}" -F "images_file=@{my_image}" -F “threshold=0.2” "{my_url}/api/v4/analyze?version=2019-02-11"

[test result with api]

{
"images": [
    {
        "source": {
            "type": "file",
            "filename": "IMG_2845.png"
        },
        "dimensions": {
            "height": 1792,
            "width": 828
        },
        "objects": {}
    }
]

}

For some reason, the contents of objects come back empty.

Am I missing some way to write it or a step to follow? I don't see how to specify threshold in the article I'm referring to or the official reference, so maybe I'm not specifying it properly. (If threshold is not specified, it defaults to 0.5. I'm thinking of lowering threshold to 0.2 , because the custom classifier I created this time didn't show detection accuracy above 0.5).

I'd appreciate it if you could tell me how to solve this problem.

Translated with www.DeepL.com/Translator (free version)

1

1 Answers

0
votes

When you got a result in the GUI, what was the score? The lowest score threshold you can provide in the v4 API is 0.15, perhaps try that instead of 0.2 (from the curl commands above)