Skip to content

Unity Watson SDK 0.10.0 #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
738d511
* Added camera target with path
ereneld Aug 25, 2016
69dd2d1
* Added distance to make it more flexible with path
ereneld Aug 26, 2016
388e88c
Update README.md
mediumTaj Aug 27, 2016
d11ab90
change classify score from string to double
mediumTaj Aug 27, 2016
675e369
Merge pull request #140 from watson-developer-cloud/hotfix-classifyScore
mediumTaj Aug 27, 2016
47dc78c
classify arguments were reversed
mediumTaj Aug 27, 2016
1d21c16
remove dialog from ConfigEditor
mediumTaj Aug 27, 2016
eda72a7
removed dialog from service examples
mediumTaj Aug 27, 2016
aeacc4c
fixed examples for visual recognition
mediumTaj Aug 27, 2016
5db3118
bug where classifier is not being passed into call
mediumTaj Aug 28, 2016
1cad71e
Merge pull request #141 from watson-developer-cloud/hotfix-hackathon
mediumTaj Aug 28, 2016
b4420bf
* Minor fix touch-event-manager
ereneld Aug 29, 2016
9a0d878
disabled warnings on tests and examples. Removed some unused variables.
mediumTaj Aug 31, 2016
b1ba562
* Fix unregistration from taps - TouchManager
ereneld Sep 1, 2016
28dc397
no message
ereneld Sep 1, 2016
885894a
encrypt config
mediumTaj Sep 1, 2016
6a23d28
Merge pull request #145 from watson-developer-cloud/feature-144-fixTouch
mediumTaj Sep 1, 2016
2ff7bce
Merge branch 'develop' into hotfix-warnings
mediumTaj Sep 1, 2016
3cd9afa
encrypt config
mediumTaj Sep 1, 2016
b07eb60
* hot fix added for spline interpolator
ereneld Sep 1, 2016
ea3695a
encrypt config
mediumTaj Sep 1, 2016
ec416ac
replaced old vr credentials
mediumTaj Sep 1, 2016
6b06bef
Merge pull request #146 from watson-developer-cloud/feature-hotfix-ca…
mediumTaj Sep 1, 2016
29e9ce9
merge in develop, encrypt credentials
mediumTaj Sep 1, 2016
d7ceb89
Merge pull request #143 from watson-developer-cloud/hotfix-warnings
mediumTaj Sep 1, 2016
78cf630
disable warnings from 3rd party plugins
mediumTaj Sep 1, 2016
04b95ef
Merge pull request #147 from watson-developer-cloud/hotfix-3rdPartyWa…
mediumTaj Sep 1, 2016
ab5d5b5
HOTFIX: Increased fragment to max size for now.
Sep 1, 2016
f1f060e
Merge pull request #148 from watson-developer-cloud/FragmentSize
mediumTaj Sep 1, 2016
b94c98e
* Fix by adding public members of tap and dragging events
ereneld Sep 5, 2016
a9c274d
Merge branch 'develop' into feature-fix-149-TouchWidget
ereneld Sep 5, 2016
289b41b
Merge pull request #150 from watson-developer-cloud/feature-fix-149-T…
mediumTaj Sep 6, 2016
16fa1cb
HOTFIX: TTS keeps saying the word "quote" at the end of all speech, I…
Sep 11, 2016
ac2e850
Merge pull request #151 from watson-developer-cloud/ROB-1359
mediumTaj Sep 11, 2016
ca7eed2
added similarity search endpoints to visualrecognition service
mediumTaj Sep 14, 2016
cab4df0
Similarity search data models
mediumTaj Sep 14, 2016
1f8368f
comment out endpoints to hit in VisualRecognition
mediumTaj Sep 14, 2016
48a719d
added callback delegates for each similarity search endpoint
mediumTaj Sep 14, 2016
d13cd60
GetCollections
mediumTaj Sep 14, 2016
90c0c88
CreateCollection
mediumTaj Sep 14, 2016
5c787b9
Delete collection
mediumTaj Sep 14, 2016
81ba79b
Get Collection
mediumTaj Sep 14, 2016
9f755cf
GetCollectionImages and AddCollectionImages
mediumTaj Sep 15, 2016
f09d706
delete collection image
mediumTaj Sep 15, 2016
8852a34
delete image metadata
mediumTaj Sep 15, 2016
14779d0
GetImageMetadata
mediumTaj Sep 15, 2016
9d03941
find similar
mediumTaj Sep 15, 2016
f196f49
start unit test framework
mediumTaj Sep 15, 2016
f506a80
integration tests
mediumTaj Sep 15, 2016
c470075
WIP - integration tests
mediumTaj Sep 15, 2016
5773aee
complete integration tests
mediumTaj Sep 16, 2016
d7356d8
Fixing issue with error on sending message with conversation ID and e…
mediumTaj Sep 20, 2016
9e1155a
removing overload message with only conversationID, helper methods in…
mediumTaj Sep 23, 2016
c6c2a50
Updated changelog and readme to include similarity search documentation
mediumTaj Sep 23, 2016
adce3b0
Merge pull request #152 from watson-developer-cloud/de-430-similarity…
mediumTaj Sep 23, 2016
a6ce912
Merge branch 'develop' into feature-conversationIDFix
mediumTaj Sep 23, 2016
bae0588
updated user-agent
mediumTaj Sep 23, 2016
7187d1d
revise error text when no customizationID for STT is found
mediumTaj Sep 23, 2016
54b3496
Merge pull request #153 from watson-developer-cloud/feature-conversat…
mediumTaj Sep 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Change Log
==========
## Version 0.10.0
_2016_09_23_

* New: Added `similarity search` to the `Visual Recognition` service.
* Fix: `Touch Widget` improvmements.
* Fix: Disabled 3rd Party plugin warnings.
* Fix: Removed `Conversation` Message overload method that takes only input and conversationID.
* Fix: Rewrote `Conversation` example script to show how to create MessageRequest object.

## Version 0.9.0
_2016-08-26_

Expand Down
Binary file modified Config.json.enc
Binary file not shown.
4 changes: 3 additions & 1 deletion Examples/ServiceExamples/Scripts/ExampleAlchemyLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using IBM.Watson.DeveloperCloud.Services.AlchemyAPI.v1;
using IBM.Watson.DeveloperCloud.Logging;

#pragma warning disable 0219
#pragma warning disable 0414
public class ExampleAlchemyLanguage : MonoBehaviour
{
private AlchemyAPI m_AlchemyAPI = new AlchemyAPI();
Expand Down Expand Up @@ -52,7 +54,7 @@ void Start()
// Log.Debug("ExampleAlchemyLanguage", "Failed to get concepts HTML POST!");

////Get Concepts URL POST
//if (!m_AlchemyAPI.GetRankedConcepts(OnGetConcepts, m_ExampleURL_watsonJeopardy))
//if (!m_AlchemyAPI.GetRankedConcepts(OnGetCzoncepts, m_ExampleURL_watsonJeopardy))
// Log.Debug("ExampleAlchemyLanguage", "Failed to get concepts HTML POST!");

////Get Date URL POST
Expand Down
71 changes: 46 additions & 25 deletions Examples/ServiceExamples/Scripts/ExampleConversation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,69 @@
*/

using UnityEngine;
using System.Collections;
using IBM.Watson.DeveloperCloud.Services.Conversation.v1;
using IBM.Watson.DeveloperCloud.Utilities;
using IBM.Watson.DeveloperCloud.Logging;
using System;

public class ExampleConversation : MonoBehaviour
{
private Conversation m_Conversation = new Conversation();
private string m_WorkspaceID;
private string m_Input = "Can you unlock the door?";
private string m_ConversationID;
private bool m_UseAlternateIntents = true;
private string[] questionArray = { "can you turn up the AC", "can you turn on the wipers", "can you turn off the wipers", "can you turn down the ac", "can you unlock the door"};

void Start () {
LogSystem.InstallDefaultReactors();
m_WorkspaceID = Config.Instance.GetVariableValue("ConversationV1_ID");
Debug.Log("User: " + m_Input);

// Message with input only
//m_Conversation.Message(OnMessage, m_WorkspaceID, m_Input);
Debug.Log("**********User: Hello!");
MessageWithOnlyInput("Hello!");
}

// Message by creating message request
//MessageRequest messageRequest = new MessageRequest();
//messageRequest.inputText = m_Input;
//m_Conversation.Message(OnMessage, m_WorkspaceID, messageRequest);
private void MessageWithOnlyInput(string input)
{
if (string.IsNullOrEmpty(input))
throw new ArgumentNullException("input");

m_Conversation.Message(OnMessageWithOnlyInput, m_WorkspaceID, input);
}


private void OnMessageWithOnlyInput(MessageResponse resp, string customData)
{
if (resp != null)
{
foreach (Intent mi in resp.intents)
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);

if (resp.output != null && resp.output.text.Length > 0)
foreach (string txt in resp.output.text)
Debug.Log("output: " + txt);

m_ConversationID = resp.context.conversation_id;

string questionStr = questionArray[UnityEngine.Random.Range(0, questionArray.Length - 1)];
Debug.Log(string.Format("**********User: {0}", questionStr));

MessageRequest messageRequest = new MessageRequest();
messageRequest.InputText = questionStr;
messageRequest.alternate_intents = m_UseAlternateIntents;
messageRequest.ContextData = resp.context;

// Message by passing input, alternate intents and conversationID
m_Conversation.Message(OnMessage, m_WorkspaceID, m_Input, false, null);
MessageWithFullMessageRequest(messageRequest);
}
else
{
Debug.Log("Failed to invoke Message();");
}
}

void OnMessage (MessageResponse resp, string customData)
private void MessageWithFullMessageRequest(MessageRequest messageRequest)
{
if(resp != null)
{
foreach(Intent mi in resp.intents)
Debug.Log("intent: " + mi.intent + ", confidence: " + mi.confidence);

if(resp.output != null && resp.output.text.Length > 0)
foreach(string txt in resp.output.text)
Debug.Log("output: " + txt);
}
else
{
Debug.Log("Failed to invoke Message();");
}
if (messageRequest == null)
throw new ArgumentNullException("messageRequest");
m_Conversation.Message(OnMessageWithOnlyInput, m_WorkspaceID, messageRequest);
}
}
1 change: 1 addition & 0 deletions Examples/ServiceExamples/Scripts/ExampleRetrieveAndRank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using UnityEditor;
#endif

#pragma warning disable 219
public class ExampleRetrieveAndRank : MonoBehaviour
{
private RetrieveAndRank m_RetrieveAndRank = new RetrieveAndRank();
Expand Down
1 change: 1 addition & 0 deletions Examples/ServiceExamples/Scripts/ExampleTextToSpeech.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using UnityEngine;
using IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1;
using IBM.Watson.DeveloperCloud.Logging;
#pragma warning disable 0414

public class ExampleTextToSpeech : MonoBehaviour
{
Expand Down
41 changes: 23 additions & 18 deletions Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
using IBM.Watson.DeveloperCloud.Logging;
using IBM.Watson.DeveloperCloud.Utilities;

#pragma warning disable 0414

public class ExampleVisualRecognition : MonoBehaviour
{
private VisualRecognition m_VisualRecognition = new VisualRecognition();
private string m_classifierName = "Apples_OptionalParams";
private string m_classifierID = "ApplesClassifierNameWithSpaces_73100404";
private string m_classifierToDelete = "unitytestclassifier2b_37849361";
private string m_classifierName = "unity-test-classifier-example";
private string m_classifierID = "unitytestclassifierexample_487365485";
private string m_classifierToDelete = "unitytestclassifierexample_263072401";
private string m_imageURL = "https://upload.wikimedia.org/wikipedia/commons/e/e9/Official_portrait_of_Barack_Obama.jpg";
private string m_imageTextURL = "http://i.stack.imgur.com/ZS6nH.png";

Expand Down Expand Up @@ -65,37 +67,37 @@ void Start()

//// Classify get
//Log.Debug("ExampleVisualRecognition", "Attempting to get classify via URL");
//if (!m_VisualRecognition.Classify(m_imageURL, OnClassify))
//if (!m_VisualRecognition.Classify(OnClassify, m_imageURL))
// Log.Debug("ExampleVisualRecognition", "Classify image failed!");

//// Classify post image
//Log.Debug("ExampleVisualRecognition", "Attempting to classify via image on file system");
//string imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg";
//string[] owners = { "IBM", "me" };
//string[] classifierIDs = { "default" };
//if (!m_VisualRecognition.Classify(OnClassify, imagesPath, owners, classifierIDs, 0.5f))
// Log.Debug("ExampleVisualRecognition", "Classify image failed!");
Log.Debug("ExampleVisualRecognition", "Attempting to classify via image on file system");
string imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/giraffe_to_classify.jpg";
string[] owners = { "IBM", "me" };
string[] classifierIDs = { "default", m_classifierID };
if (!m_VisualRecognition.Classify(imagesPath, OnClassify, owners, classifierIDs, 0.5f))
Log.Debug("ExampleVisualRecognition", "Classify image failed!");

//// Detect faces get
//Log.Debug("ExampleVisualRecognition", "Attempting to detect faces via URL");
//if (!m_VisualRecognition.DetectFaces(m_imageURL, OnDetectFaces))
//if (!m_VisualRecognition.DetectFaces(OnDetectFaces, m_imageURL))
// Log.Debug("ExampleVisualRecogntiion", "Detect faces failed!");

//// Detect faces post image
//Log.Debug("ExampleVisualRecognition", "Attempting to detect faces via image");
//string faceExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/obama.jpg";
//if (!m_VisualRecognition.DetectFaces(OnDetectFaces, faceExamplePath))
//if (!m_VisualRecognition.DetectFaces(faceExamplePath, OnDetectFaces))
// Log.Debug("ExampleVisualRecognition", "Detect faces failed!");

//// Recognize text get
//Log.Debug("ExampleVisualRecognition", "Attempting to recognizeText via URL");
//if (!m_VisualRecognition.RecognizeText(m_imageTextURL, OnRecognizeText))
//if (!m_VisualRecognition.RecognizeText(OnRecognizeText, m_imageTextURL))
// Log.Debug("ExampleVisualRecognition", "Recognize text failed!");

//// Recognize text post image
//Log.Debug("ExampleVisualRecognition", "Attempting to recognizeText via image");
//string textExamplePath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/from_platos_apology.png";
//if (!m_VisualRecognition.RecognizeText(OnRecognizeText, textExamplePath))
//if (!m_VisualRecognition.RecognizeText(textExamplePath, OnRecognizeText))
// Log.Debug("ExampleVisualRecognition", "Recognize text failed!");
}

Expand Down Expand Up @@ -170,11 +172,14 @@ private void OnClassify(ClassifyTopLevelMultiple classify, string data)
foreach (ClassifyTopLevelSingle image in classify.images)
{
Log.Debug("ExampleVisualRecognition", "\tsource_url: " + image.source_url + ", resolved_url: " + image.resolved_url);
foreach (ClassifyPerClassifier classifier in image.classifiers)
if (image.classifiers != null && image.classifiers.Length > 0)
{
Log.Debug("ExampleVisualRecognition", "\t\tclassifier_id: " + classifier.classifier_id + ", name: " + classifier.name);
foreach (ClassResult classResult in classifier.classes)
Log.Debug("ExampleVisualRecognition", "\t\t\tclass: " + classResult.m_class + ", score: " + classResult.score + ", type_hierarchy: " + classResult.type_hierarchy);
foreach (ClassifyPerClassifier classifier in image.classifiers)
{
Log.Debug("ExampleVisualRecognition", "\t\tclassifier_id: " + classifier.classifier_id + ", name: " + classifier.name);
foreach (ClassResult classResult in classifier.classes)
Log.Debug("ExampleVisualRecognition", "\t\t\tclass: " + classResult.m_class + ", score: " + classResult.score + ", type_hierarchy: " + classResult.type_hierarchy);
}
}
}
}
Expand Down
47 changes: 3 additions & 44 deletions Examples/ServiceExamples/ServiceExamples.unity
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.3735644, g: 0.38112032, b: 0.35887682, a: 1}
m_IndirectSpecularColor: {r: 0.3735645, g: 0.38112062, b: 0.35887584, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -352,7 +352,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &859102723
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -633,7 +633,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!114 &1740459832
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -658,47 +658,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!1 &1979050314
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1979050316}
- 114: {fileID: 1979050315}
m_Layer: 0
m_Name: ExampleDialog
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &1979050315
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1979050314}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e8b52562568714a48a89536c62fb978e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_DialogID: 61343031353936302d333963322d346436622d393537312d333863373461656366666664
--- !u!4 &1979050316
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1979050314}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!1 &2004886371
GameObject:
m_ObjectHideFlags: 0
Expand Down
Loading