Skip to content

Commit

Permalink
Merge pull request #48 from wiazur/patch-8
Browse files Browse the repository at this point in the history
Updated endpoint
  • Loading branch information
wiazur authored Sep 26, 2019
2 parents e674c7c + b2ed698 commit 3a485be
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeDoma

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)
{
RecognizeDomainSpecificContentSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
Expand All @@ -27,8 +29,8 @@ public class RecognizeDomainSpecificContentSample
public static async Task RunAsync(string endpoint, string key)
{
Console.WriteLine("Recognize domain specific content (celebrities/landmarks) in 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/celebrities.jpg";

await RecognizeDomainSpecificContentFromUrlAsync(remoteImageUrl, endpoint, key, "celebrities");
Expand Down

0 comments on commit 3a485be

Please sign in to comment.