Skip to content

Commit

Permalink
Merge pull request #50 from wiazur/patch-10
Browse files Browse the repository at this point in the history
Updated endpoint
  • Loading branch information
wiazur authored Sep 26, 2019
2 parents 55d08b5 + 4df5b0d commit 63ec331
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dotnet/ComputerVision/TagImage/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.TagImage

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.

// Add your Azure Computer Vision subscription key and endpoint to your environment variables
public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY");
public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT");

static void Main(string[] args)
{
TagImageSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
Expand All @@ -27,8 +28,8 @@ public class TagImageSample
public static async Task RunAsync(string endpoint, string key)
{
Console.WriteLine("Find tags of images:");

string imageFilePath = @"Images\landmark.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\landmark.jpg";
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/objects.jpg";

await TagImageFromStreamAsync(imageFilePath, endpoint, key);
Expand Down

0 comments on commit 63ec331

Please sign in to comment.