public void testAddTrainingPhotosToPersonGroup() { SharePointOnlineService service = new SharePointOnlineService("https://xxx.sharepoint.com/", "https://xxx-my.sharepoint.com", "*****@*****.**", "xxx", "https://xxx.sharepoint.com/TrainingImages/"); Dictionary<string, PhotoPerson> photos = service.getTrainingPhotos(); FaceTagger tagger = new FaceTagger("subscriptionkey"); var task = Task.Run(async () => await tagger.createFaceGroup("trainingphotos")); while (!task.IsCompleted) { } task = Task.Run(async () => await tagger.addPhotosToTrainingGroup(photos, "trainingphotos")); while (!task.IsCompleted) { } }
public void testAddPhotosToTrainingGroupAndTagPhotos() { SharePointOnlineService service = new SharePointOnlineService("https://xxx.sharepoint.com/", "https://xxx-my.sharepoint.com", "*****@*****.**", "xxx", "https://xxx.sharepoint.com/TrainingImages/", "https://xxx.sharepoint.com/PicturesToTag/"); Dictionary<string, PhotoPerson> photos = service.getTrainingPhotos(); FaceTagger tagger = new FaceTagger("subscriptionkey"); var task = Task.Run(async () => await tagger.createFaceGroup("trainingphotos")); while (!task.IsCompleted) { } if (task.IsFaulted) { throw task.Exception; } task = Task.Run(async () => await tagger.addPhotosToTrainingGroup(photos, "trainingphotos")); while (!task.IsCompleted) { } if (task.IsFaulted) { throw task.Exception; } List<Photo> photosToTag = service.getPhotosToTag(); task = Task.Run(async () => await tagger.identifyPhotosInGroup("trainingphotos", photosToTag)); while (!task.IsCompleted) { } if (task.IsFaulted) { throw task.Exception; } service.updateTaggedPhotosWithMatchedPeople(photosToTag); }
public void testGetTrainingPhotos() { SharePointOnlineService service = new SharePointOnlineService("https://xxx.sharepoint.com/", "https://xxx-my.sharepoint.com", "*****@*****.**", "xxx", "https://xxx.sharepoint.com/TrainingImages/"); Dictionary<string, PhotoPerson> photos = service.getTrainingPhotos(); }