Skip to content

Commit

Permalink
Updated endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
wiazur authored Aug 30, 2019
1 parent 0d20f1e commit 803006b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dotnet/ComputerVision/RecognizeText/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeText

public class Program
{
public const string subscriptionKey = "<your training key here>"; //Insert your Cognitive Services subscription key here
public const string endpoint = "https://westus.api.cognitive.microsoft.com"; // You must use the same Azure region that you generated your subscription keys for. Free trial subscription keys are generated in the westus region.

public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY");
public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT");
static void Main(string[] args)
{
RecognizeTextSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
Expand All @@ -28,8 +28,8 @@ public class RecognizeTextSample
public static async Task RunAsync(string endpoint, string key)
{
Console.WriteLine("Recognizing text from the images:");

string imageFilePath = @"Images\handwritten_text.jpg"; // See this repo's readme.md for info on how to get these images. Alternatively, you can just set the path to any appropriate image on your machine.
// See this repo's readme.md for info on how to get these images. Or, set the path to any appropriate image on your machine.
string imageFilePath = @"Images\handwritten_text.jpg";
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/printed_text.jpg";

await RecognizeTextFromStreamAsync(imageFilePath, endpoint, key, "Handwritten"); //the last parameter is whether the text that has to be extracted is printed or handwritten
Expand Down

0 comments on commit 803006b

Please sign in to comment.