In this post we will use the OpenCV library for facial recognition. Here is an example using my webcam as an input:
The best part is that it can be done using less than 20 lines of code:
import cv2, os | |
BLUE_COLOR = (255, 0, 0) | |
STROKE = 2 | |
xml_path = 'haarcascade_frontalface_alt2.xml' | |
clf = cv2.CascadeClassifier(xml_path) | |
cap = cv2.VideoCapture(0) | |
while(not cv2.waitKey(20) & 0xFF == ord('q')): |
print('hello world') |
import re | |
PATTERN = '(.*), (.*) - (.*): [bB]om dia' | |
db = re.findall(PATTERN, txt) |
import cv2, os | |
# Funcao para busca de arquivos | |
def find(name, path): | |
for root, dirs, files in os.walk(path): | |
if (name in files) or (name in dirs): | |
print("O diretorio/arquivo {} encontra-se em: {}".format(name, root)) | |
return os.path.join(root, name) | |
# Caso nao encontre, recursao para diretorios anteriores | |
return find(name, os.path.dirname(path)) |
Instalar o Anaconda com Python 3.7:
# envolveu a combinação de encoding e o separador: | |
url_bernardo = 'https://raw.githubusercontent.com/beloureiro/Planning/main/DB11FB06-1447-11EB-AD05-1866DA94328D.csv' | |
df = pd.read_csv(url_bernardo, sep=';', encoding='latin') |