Skip to content

Instantly share code, notes, and snippets.

@allskyee
allskyee / dlib_face_landmarks.py
Last active Mar 7, 2017
Face landmark detection using dlib
View dlib_face_landmarks.py
#!/usr/bin/env python
import sys
import dlib
import cv2
import numpy as np
from opencv_webcam_multithread import WebcamVideoStream
# dlib predictor can be found in
# http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
View aligned_face_webcam.py
#!/usr/bin/env python2
#
# Example to run classifier on webcam stream.
# Brandon Amos & Vijayenthiran
# 2016/06/21
#
# Chon Sky modified to generate aligned face images from webcam
# 2017/03/02
#
# Copyright 2015-2016 Carnegie Mellon University
@allskyee
allskyee / faster_rcnn_webcam.py
Last active Sep 7, 2021
Faster RCNN (ZFnet) detection and classification on image from webcam
View faster_rcnn_webcam.py
#!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see https://github.com/rbgirshick/py-faster-rcnn/blob/master/LICENSE for details]
# Written by Ross Girshick
# Modified by Sky Chon for webcam use
# --------------------------------------------------------
@allskyee
allskyee / opencv_webcam_multithread.py
Last active Aug 10, 2022
opencv python camera frame grab and display on different threads with safe synchronization
View opencv_webcam_multithread.py
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@allskyee
allskyee / gist:9247125
Created Feb 27, 2014
freebsd ports cross compile
View gist:9247125
make \
WRKDIRPREFIX=/home/xxx/ports/obj PREFIX=/home/xxx/ports/install \
CONFIGURE_ARGS="--host=arm --prefix=/home/xxx/ports/install" \
LDFLAGS="-rpath=$BUILDWORLD/tmp/lib:$BUILDWORLD/tmp/usr/lib:/home/xxx/ports/install/lib:$BUILDWORLD/lib -L$BUILDWORLD/tmp/lib -L$BUILDWORLD/tmp/usr/lib -L/home/xxx/ports/install/lib -L$BUILDWORLD/lib" \
NO_PKG_REGISTER=1 WITHOUT_CHECKS=yes install
@allskyee
allskyee / gist:9247112
Created Feb 27, 2014
Makefile debugging
View gist:9247112
Use -d with c, e flags
c Print debugging information about conditional evaluation.
e Print debugging information about failed commands and
targets.