static void Main(string[] args) { Passenger valentina = new Passenger("Valentina", "Alvarez", 52315904); Passenger agustin = new Passenger("Agustin", "Gonzalez", 7894561); Passenger francisco = new Passenger("Francisco", "Ibañez", 45678904); Passenger alejandro = new Passenger("Alejandro", "Affonso", 12478954); Driver conductor1 = new Pool("Juan", "Perez", 45789047, "Audi", "Hola! Soy estudiante en la UCU", 4); valentina.Califications(conductor1, 5); agustin.Califications(conductor1, 4); francisco.Califications(conductor1, 4); alejandro.Califications(conductor1, 5); conductor1.Califications(valentina, 5); conductor1.Califications(agustin, 4); conductor1.Califications(francisco, 4); conductor1.Califications(alejandro, 5); //Se debe pasar por parametro la API Key y el color del recuadro a dibujar //en caso de encontrar una cara en la foto CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242", true); cog.Recognize(@"sonrisa.jpg"); Herencia.FoundFace.DriverFace(cog, conductor1.Name, conductor1.PassengersCount, conductor1.Biography); cog.Recognize(@"images.jpg"); Herencia.FoundFace.PassengerFace(cog, valentina.Name, valentina.Surname, valentina.Id); }
public static bool FaceRecognition(string image) { CognitiveFace recognition = new CognitiveFace("a36648d3c5134ab692acd35605d491f7", false); recognition.Recognize(image); return(recognition.FaceFound); }
public void AddConductor(Conductor conductor) { this.conductores.Add(conductor); var twitter = new TwitterImage("g7rkPB5uI2xOqELAhlNrorSU4", "8hOTyS71GrTH9Ool3rXykAJRY5AmgSPiy78b1wYUPcvfIzXeEc", "1396065818-8vnV9HJFW5ArcfFg2zE9hLA68CZYFXO8Cjv6o2E", "675fHmUzeaPajtj3pO64w5xd3p9YI3kco7kSvKhzeEvYe"); CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242"); cog.Recognize(conductor.Foto); if (cog.FaceFound) { if (cog.SmileFound) { Console.WriteLine(twitter.PublishToTwitter($"Tenemos un nuevo conductor! Bienvenid@ {conductor.Nombre} {conductor.Apellido}!", conductor.Foto)); } else { Console.WriteLine("Por favor, sonría en la foto"); } } else { Console.WriteLine("Por favor, suba una foto con su rostro y sonriendo"); } }
public static Boolean FotoValida(string foto) { CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242", false); cog.Recognize(@foto); return(FoundSmilingFace(cog)); }
static void Main(string[] args) { CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242", true); Person gus = new Passenger("Augusto", "Taño", "1234567-8", @"bill.jpg", cog); Person gonza = new Passenger("Gonzalo", "Barreiro", "7894561-2", @"bill.jpg", cog); Person rafa = new Passenger("Rafael", "Duran", "4561275-8", @"bill.jpg", cog); Driver vale = new Driver("Valentina", "Alvarez", "9876543-2", "Hola soy Vale", "Suzuki Swift - Blue", @"claramente-no-es-bill.jpg", cog); }
public bool IsValid(string image) { CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242", false); cog.Recognize(image); if (cog.FaceFound) { return(true); } System.Console.WriteLine("Imagen inválida."); return(false); }
public override bool GoodPhoto() { CognitiveFace cog = new CognitiveFace("620e818a46524ceb92628cde08068242", false); cog.Recognize(this.UrlPhoto); if (cog.FaceFound) { return(true); } else { return(false); } }
private static Boolean FoundSmilingFace(CognitiveFace cog) { if (cog.FaceFound) { if (cog.SmileFound) { return(true); } else { return(false); } } else { return(false); } }
public PictureValidator(string key = "620e818a46524ceb92628cde08068242") { // Acá aplicamos el patrón creator, la clase PictureValidator se encarga de crear la instancia de CognitiveFace ya // que es la clase que va a guardar dicha instancia this.cogFace = new CognitiveFace(key); }
public PictureValidator(string key = "620e818a46524ceb92628cde08068242") { this.cogFace = new CognitiveFace(key); }