misslivirose / unity-cognitive-services-demos

Examples of using Microsoft's Cognitive Services in Unity for HoloLens
42 stars 23 forks source link

<Solved> ArgumentOutofRangeException in unity vision demo #2

Open RollySeth opened 6 years ago

RollySeth commented 6 years ago

After pressing 'p' and spacebar in unity vision demo, I am getting the below error. Any inputs?


ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[Category].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) FoundImageObject.GetHighestCategory () (at Assets/Scripts/FoundImageObject.cs:47) FoundImageObject..ctor (.JSONObject cat) (at Assets/Scripts/FoundImageObject.cs:18) ParseComputerVisionResponse.ConvertObjectToFoundImageObject (.JSONObject obj) (at Assets/Scripts/ParseComputerVisionResponse.cs:37) ParseComputerVisionResponse.ParseJSONData (System.String respString) (at Assets/Scripts/ParseComputerVisionResponse.cs:27) ImageToComputerVisionAPI+c__Iterator0.MoveNext () (at Assets/Scripts/ImageToComputerVisionAPI.cs:54) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

RollySeth commented 6 years ago

solved it. had to update my EmotionURL to
string emotionURL = "https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/analyze"; as it was giving an invalid key error with the existing url.