watson-developer-cloud / unity-sdk

:video_game: Unity SDK to use the IBM Watson services.
Apache License 2.0
571 stars 208 forks source link

VisualRecognitionService does not work #647

Closed StavEW closed 3 years ago

StavEW commented 4 years ago

Hey,

So I've been trying to use the VisualRecognitionService in Unity without any luck

First of all, both the "Getting started with Visual Recognition" and "API reference" has code issues. If you'll just copy pate the code into a brand new script, it won't work because of some small referencing things like "reponse" and "response"

anyway, once fixed the small issues, when I'm trying to execute the functions, it gives me the next error: "The method or operation is not implemented"

here is the code (IEnumerator):

    var authenticator = new IamAuthenticator(
    apikey: "API KEY NOT INCLUDED"
    );

    while (!authenticator.CanAuthenticate())
        yield return null;

    var visualRecognition = new VisualRecognitionService("2018-03-19", authenticator);
    visualRecognition.SetServiceUrl("URL NOT INCLUDED");

    ClassifiedImages classifyResponse = null;
    visualRecognition.Classify(
        callback: (DetailedResponse<ClassifiedImages> response, IBMError error) =>
        {
            Log.Debug("VisualRecognitionServiceV3", "Classify result: {0}", response.Response);
            classifyResponse = response.Result;
        },
        url: "https://ibm.biz/BdzLPG"
        );

    while (classifyResponse == null)
        yield return null;

Thanks!

mamoonraja commented 4 years ago

@StavEW Thanks a lot for opening the issue and bringing the documentation issues to our attention. Can you please provide how you are importing the VisualRecogniton service? for example, is it like this: using IBM.Watson.VisualRecognition.V3;

StavEW commented 4 years ago

Sure,

I pretty much took everything possible I've also tried switching between v3 and v4 without any luck

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; using System.IO; using UnityEngine.UI; using TMPro; using IBM.Watson.SpeechToText.V1; using IBM.Cloud.SDK; using IBM.Cloud.SDK.Authentication; using IBM.Cloud.SDK.Authentication.Iam; using IBM.Cloud.SDK.Utilities; using IBM.Cloud.SDK.DataTypes; using IBM.Watson.VisualRecognition.V3.Model; using IBM.Watson.VisualRecognition.V3;

mamoonraja commented 4 years ago

Hmm, weird that it's happening, I was able to run the example using V3, can you provide which version of IBM.Cloud.SDK and Unity SDK are you using?

StavEW commented 4 years ago

Sure,

SDKCore (1.2.1) Watson (4.7.1)

There's no example scene in the SDK for the "VisualRecognitionService"

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

PowZone commented 3 years ago

Hello, I'm looking for an example scene of the VisualRecognitionService too. Do you plan to add it to repository?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.