Skip to content

Instantly share code, notes, and snippets.

@allskyee
allskyee / gist:9247112
Created February 27, 2014 09:39
Makefile debugging
Use -d with c, e flags
c Print debugging information about conditional evaluation.
e Print debugging information about failed commands and
targets.
@allskyee
allskyee / gist:9247125
Created February 27, 2014 09:40
freebsd ports cross compile
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
#!/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 / dlib_face_landmarks.py
Last active March 7, 2017 04:00
Face landmark detection using dlib
#!/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
@allskyee
allskyee / faster_rcnn_webcam.py
Last active September 7, 2021 16:05
Faster RCNN (ZFnet) detection and classification on image from webcam
#!/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 December 7, 2022 15:59
opencv python camera frame grab and display on different threads with safe synchronization
#!/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)