Skip to content

Instantly share code, notes, and snippets.

Avatar

Evgeni Dimov GenchoBG

  • Argo Ventures Digital Ltd.
  • Sofia, Bulgaria
View GitHub Profile
@GenchoBG
GenchoBG / XMLProcessing.cs
Created Apr 15, 2019
Process all of the XML annotation file in the desired format & generate the labels.txt file needed to train our model
View XMLProcessing.cs
using System;
using System.IO;
using System.Text.RegularExpressions;
namespace XMLProcessing
{
class Program
{
public static void Main(string[] args)
{
@GenchoBG
GenchoBG / IsEverythingFine.cs
Last active Apr 14, 2019
Once the have the data loaded we pass it into this function which identifies if there is an error.
View IsEverythingFine.cs
public static bool IsEverythingFine(List<SubPicture> subPictures)
{
const int tolerance = 100;
var labels = subPictures.Where(sp => sp.Label.Contains("label")).ToList();
var maxItemY = subPictures.Except(labels).Min(i => i.TopLeft.Y);
foreach (var label in labels.ToArray())
{
if (label.TopLeft.Y < maxItemY)
@GenchoBG
GenchoBG / JsonParser.cs
Created Apr 14, 2019
Parsing the JSON files with coordinates from our Machine Learning model
View JsonParser.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Recognize_TextSdk;
@GenchoBG
GenchoBG / TextExtractor.cs
Created Apr 14, 2019
Used to extracting the product number from a label
View TextExtractor.cs
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models;
namespace Recognize_TextSdk
{
public static class TextExtractor