private IEnumerable <ImageInfo> GetAllImages()
        {
            var taggedImages   = GetImagesInBatch((batchSize, skip) => TrainingApi.GetTaggedImages(ProjectId, IterationId, take: batchSize, skip: skip));
            var untaggedImages = GetImagesInBatch((batchSize, skip) => TrainingApi.GetUntaggedImages(ProjectId, IterationId, take: batchSize, skip: skip));

            return(taggedImages.Concat(untaggedImages));
        }
        private IEnumerable <ImageInfo> GetImagesByTags(ICollection <Guid> tagIds)
        {
            var images = GetImagesInBatch((batchSize, skip) => TrainingApi.GetTaggedImages(ProjectId, IterationId, take: batchSize, skip: skip, tagIds: tagIds.Select(x => x.ToString()).ToList()));

            return(images.Select(x =>
            {
                var allowed = x.TagIds.Select(tagIds.Contains).ToList();
                x.TagIds = x.TagIds.Where((val, i) => allowed[i]).ToList();
                x.TagNames = x.TagNames.Where((val, i) => allowed[i]).ToList();
                return x;
            }));
        }
Example #3
0
        public void ShouldExportResults()
        {
            //_detector.TrainingApi.ExportIterationWithHttpMessagesAsync("", "", "");
            var origin_guid               = new Guid("751e5e0b-2447-4aa5-b242-176aca9f94c8");
            var originTrainingApiKey      = "52fad44c9d264790a059a3a1ae307eb7";
            var origin_guid_iteration     = new Guid("ba3fbeec-171f-4be0-905e-b6c1be9d63dc");
            var destinationTrainingApiKey = "4f1697a47b224d82bef1e93687b52935";

            var originTraining = new TrainingApi()
            {
                ApiKey = originTrainingApiKey
            };
            var destinationTraining = new TrainingApi()
            {
                ApiKey = destinationTrainingApiKey
            };

            var destination_guid           = new Guid("19883999-6a28-4bd9-a7b9-6d461e60c263");
            var destination_guid_iteration = new Guid("ba3fbeec-171f-4be0-905e-b6c1be9d63dc");

            var taggedImages = originTraining.GetTaggedImages(origin_guid, origin_guid_iteration);

            var tags = taggedImages.SelectMany(t => t.Tags).Distinct();

            //foreach(var tag in taggedImages)
            //{



            //    //Create tag
            //    destinationTraining.CreateImageTags(destination_guid, new ImageTagCreateBatch {
            //        Tags =
            //    });



            //    //Create regions
            //}
        }