Skip to content

Instantly share code, notes, and snippets.

💭

El Bruno elbruno

💭
Block or report user

Report or block elbruno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@elbruno
elbruno / ImageAIRealTimeWebCamPerformance.py
Created Aug 11, 2019
ImageAIRealTimeWebCamPerformance.py
View ImageAIRealTimeWebCamPerformance.py
# load HL detection model from imageAI
# open camera with openCV, analyze frame by frame
# draw a red frame around the detected object
# display FPS, resize image to 1/4 to improve performance
from imageai.Detection.Custom import CustomObjectDetection
import os
import cv2
import time
@elbruno
elbruno / ImageAIRealTimeWebCam.py
Created Aug 6, 2019
ImageAIRealTimeWebCam.py
View ImageAIRealTimeWebCam.py
# load HL detection model from imageAI
# open camera with openCV, analyze frame by frame
# draw a red frame around the detected object
from imageai.Detection.Custom import CustomObjectDetection
import os
import cv2
detector = CustomObjectDetection()
detector.setModelTypeAsYOLOv3()
@elbruno
elbruno / FaceDetectionOpenCvOpenCameraLowResolution.py
Created Jun 27, 2019
FaceDetectionOpenCvOpenCameraLowResolution.py
View FaceDetectionOpenCvOpenCameraLowResolution.py
# standard face detection sample with FPS in console
# open camera in low resolution to get better FPS
import face_recognition
import cv2
import time
video_capture = cv2.VideoCapture(0)
video_capture.set(cv2.CAP_PROP_FRAME_WIDTH,640)
@elbruno
elbruno / FaceDetectionFastDisplayPFS.py
Created May 30, 2019
FaceDetectionFastDisplayPFS.py
View FaceDetectionFastDisplayPFS.py
# fast face detection sample with FPS in console
import face_recognition
import cv2
import time
video_capture = cv2.VideoCapture(0)
while True:
start_time = time.time()
@elbruno
elbruno / FaceDetectionNormalDisplayPFS.py
Created May 30, 2019
FaceDetectionNormalDisplayPFS.py
View FaceDetectionNormalDisplayPFS.py
# standard face detection sample with FPS in console
import face_recognition
import cv2
import time
video_capture = cv2.VideoCapture(0)
while True:
@elbruno
elbruno / FaceRecognitionDetecFacialFeaturesAndFaceRecog.py
Created May 29, 2019
FaceRecognitionDetecFacialFeaturesAndFaceRecog.py
View FaceRecognitionDetecFacialFeaturesAndFaceRecog.py
import face_recognition
import cv2
import numpy as np
def LoadFaces():
bruno_image = face_recognition.load_image_file("d:\Faces\Bruno1.jpg")
bruno_face_encoding = face_recognition.face_encodings(bruno_image)[0]
valentino_image = face_recognition.load_image_file("d:\Faces\Valen1.jpg")
valentino_face_encoding = face_recognition.face_encodings(valentino_image)[0]
@elbruno
elbruno / FaceRecognitionDetecFacialFeatures.py
Created May 28, 2019
FaceRecognitionDetecFacialFeatures.py
View FaceRecognitionDetecFacialFeatures.py
import face_recognition
import cv2
import numpy as np
video_capture = cv2.VideoCapture(0)
while True:
ret, frame = video_capture.read()
rgb_frame = frame[:, :, ::-1]
@elbruno
elbruno / FaceRecognitionSample.py
Last active May 22, 2019
FaceRecognitionSample.py
View FaceRecognitionSample.py
import face_recognition
import cv2
import numpy as np
def LoadFaces():
bruno_image = face_recognition.load_image_file("d:\Faces\Bruno1.jpg")
bruno_face_encoding = face_recognition.face_encodings(bruno_image)[0]
valentino_image = face_recognition.load_image_file("d:\Faces\Valen1.jpg")
valentino_face_encoding = face_recognition.face_encodings(valentino_image)[0]
@elbruno
elbruno / FaceDetectionLoadFaces.py
Created May 22, 2019
FaceDetectionLoadFaces.py
View FaceDetectionLoadFaces.py
def LoadFaces():
bruno_image = face_recognition.load_image_file("d:\Faces\Bruno1.jpg")
bruno_face_encoding = face_recognition.face_encodings(bruno_image)[0]
valentino_image = face_recognition.load_image_file("d:\Faces\Valen1.jpg")
valentino_face_encoding = face_recognition.face_encodings(valentino_image)[0]
known_face_encodings = [
bruno_face_encoding,
valentino_face_encoding
]
@elbruno
elbruno / FaceDetectionSimple.py
Created May 21, 2019
FaceDetectionSimple.py
View FaceDetectionSimple.py
import face_recognition
import cv2
video_capture = cv2.VideoCapture(0)
while True:
ret, frame = video_capture.read()
rgb_frame = frame[:, :, ::-1]
face_locations = face_recognition.face_locations(rgb_frame)
You can’t perform that action at this time.