Skip to content

Instantly share code, notes, and snippets.

View seanbenhur's full-sized avatar
🚀
Teaching machines to learn!!

Sean Benhur seanbenhur

🚀
Teaching machines to learn!!
View GitHub Profile
routes = []
#write a function to find path
def find_path(node, cities, path, distance):
#add way point
path.append(node)
#calcualte path length
if len(path) > 1:
distance += cities[path[-2]][node]
#if path contains all cities and is not a dead end
#add path from the first city
@seanbenhur
seanbenhur / facedetect.py
Created May 16, 2020 13:56
This Face Detection code is built on using HaarCascade Classifier which will detect eyes and Face You will need Python to implement this code!! You should also install libraries numpy,opencv for this!! Which you can install it via pip-install command on your terminal
import cv2
face_cascade=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade=cv2.CascadeClassifier('haarcascade_eye.xml')
cap=cv2.VideoCapture(0)
while True:
ret,img=cap.read()
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)