Skip to content

Instantly share code, notes, and snippets.

import cv2
import cv2.cv as cv
def detect(img, cascade_fn='haarcascades/haarcascade_frontalface_alt.xml',
scaleFactor=1.3, minNeighbors=4, minSize=(20, 20),
flags=cv.CV_HAAR_SCALE_IMAGE):
cascade = cv2.CascadeClassifier(cascade_fn)
rects = cascade.detectMultiScale(img, scaleFactor=scaleFactor,
# <author>Pieter Muller</author>
# <date>2012-11-14</date>
import sys
import sqlite3 as sqlite
tablesToIgnore = ["sqlite_sequence"]
outputFilename = None
#!/usr/bin/env python
# This script is like generate_image.py from the OSM Mapnik code,
# but it renders based on a given centre point, zoom and final image pixel size
# Author: Andrew Harvey <andrew.harvey4@gmail.com>
# License: CC0 http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
import luigi
class ATask(luigi.Task):
def output(self):
return luigi.LocalTarget("atask_output.txt")
def run(self):
with self.output().open("w") as outfile:
outfile.write("Test")
#The MIT License (MIT)
# Copyright (c) 2012 Jordan Wright <jordan-wright.github.io>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#!/bin/bash
#Converts images to text using tesseract (package tesseract-ocr & tesseract-ocr-eng)
function usage
{
echo "img2txt -i <input directory> -o <output directory> --concat"
}
function concat
{
# <author>Pieter Muller</author>
# <date>2012-11-14</date>
import sys
import sqlite3 as sqlite
tablesToIgnore = ["sqlite_sequence"]
outputFilename = None
# <author>Pieter Muller</author>
# <date>2013-03-05</date>
# <note>Targets Python 2.7</note>
import sqlite3 as sqlite
import sys
if __name__ == "__main__":
if (len(sys.argv) != 3):
print "\n\tRequires two arguments:"
import glob
import sys
import os
import sqlite3 as sqlite
def LoadScripts(scriptFolder):
''' Returns a list of module references '''
# Find Script Files:
scriptFiles = glob.glob(os.path.join(scriptFolder, "Script*.py"))
print "Found %d Script Files" % (len(scriptFiles))