Skip to content

Instantly share code, notes, and snippets.

View henripal's full-sized avatar

henripal

View GitHub Profile
import dlib # dlib for accurate face detection
import cv2 # opencv
import imutils # helper functions from pyimagesearch.com
# Grab video from your webcam
stream = cv2.VideoCapture("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
# Face detector
detector = dlib.get_frontal_face_detector()
import cv2
cap = cv2.VideoCapture("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
# Create the haar cascade
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
cv2.namedWindow('demo', cv2.WINDOW_AUTOSIZE)
while(True):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@henripal
henripal / FurAnise.ipynb
Created August 10, 2017 00:33
ggplot histogram
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@henripal
henripal / LangmuirResponse.ipynb
Created May 31, 2016 16:50
Langmuir Data Analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var hist_height = 100;
var heat_height = 400;
var heat_width = 500;
var hist_width = 100;
var schem_width = 200;
var bar_padding = 2;
var margin = {top: 20, right: 90, bottom: 80, left: 60, center: 10, center_right: 10},
width = heat_width + 2*hist_width + margin.center_right + schem_width,
height = heat_height + hist_height + margin.center;
// margin.center is the margin between histogram and heatmap, center_right for the other histogram