Example #1
0
        private static void StartImageProcessor()
        {
            var db     = new EntityFrameworkImageProcessorStorage();
            var tagger = new GcpVision();

            var imageProcessor = new ImageProcessorApp(db, tagger);

            ImageProcessorApp.OnLookingForTags += image =>
            {
                Console.WriteLine("Crawling for " + image.Id);
            };
            ImageProcessorApp.OnFoundTags += image =>
            {
                Console.WriteLine("Tags found for " + image.Id);
            };
            ImageProcessorApp.OnDbInserted += image =>
            {
                Console.WriteLine("DB Insert for " + image.Id);
            };
            ImageProcessorApp.OnDbSaved += () =>
            {
                Console.WriteLine("DB SAVED");
            };
            imageProcessor.Process();
        }
Example #2
0
        public void GcpVisionFromUri()
        {
            var tagger = new GcpVision();
            var uri    = "https://www.bilderdepot24.de/item/images/1149747/1000x1000/1149747_1.jpg";
            var mtags  = tagger.GetTagsForImageUrl(uri);

            var db    = new EntityFrameworkImageProcessorStorage();
            var image = new Image {
                MachineTags = mtags, Id = 1
            };

            db.InsertMachineTagsWithoutSaving(image);
            db.DoSave();
        }