flutteribm-cloudibm-watsonvisual-recognition

How to get threshold value of image sent to IBM server?


After I send an image to my custom IBM Cloud Server for visual recognition, I get back the image's classification. However, I want to get the threshold values that Watson has to rank the image (Image 1--A:0.8 B:0.1 C:0.1). I have seen this used before as like a confidence meter and want to use it in a similar fashion. Is this possible with what I am doing?

StreamBuilder(
                    stream: StreamMyClassifier(
                        _image,
                        'NRDjngCby2d-pSHOPyWQJxhuB6vOY2uOTCX6KV2BCfwB',
                        'CompostxLandfillxRecycle_2056123069'),
                    builder: (context, snapshot) {
                      if (snapshot.hasData) {
                        _text = snapshot.data;
                        return Center(
                          child: Container(
                            margin: EdgeInsets.only(
                                top: MediaQuery.of(context).size.height / 2),
                            child: Text(
                              _text,
                              style:
                                  TextStyle(color: Colors.white, fontSize: 33),
                            ),
                          ),
                        );
                      } else {
                        return Container();
                      }
                    })

Solution

  • The API doesn't return the threshold in the response, so I don't think you can achieve what you want. For more info, see the API reference