This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.apple.Dock contents-immutable -bool yes | |
defaults write com.apple.Dock size-immutable -bool yes | |
defaults write com.apple.Dock position-immutable -bool yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def text_cleaner(text): | |
rules = [ | |
{r'>\s+': u'>'}, # remove spaces after a tag opens or closes | |
{r'\s+': u' '}, # replace consecutive spaces | |
{r'\s*<br\s*/?>\s*': u'\n'}, # newline after a <br> | |
{r'</(div)\s*>\s*': u'\n'}, # newline after </p> and </div> and <h1/>... | |
{r'</(p|h\d)\s*>\s*': u'\n\n'}, # newline after </p> and </div> and <h1/>... | |
{r'<head>.*<\s*(/head|body)[^>]*>': u''}, # remove <head> to </head> | |
{r'<a\s+href="([^"]+)"[^>]*>.*</a>': r'\1'}, # show links instead of texts | |
{r'[ \t]*<[^<]*?/?>': u''}, # remove remaining tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'aws-sdk-s3' | |
require 'rack' | |
class BucketListObjectsWrapper | |
attr_reader :bucket | |
def initialize(bucket) | |
@bucket = bucket |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# MySQL Workbench module | |
# A MySQL Workbench plugin which exports a Model to Laravel 5 Migrations | |
# Written in MySQL Workbench 6.3.6 | |
# Support for MySQL Workbench 8.0 added | |
import cStringIO | |
import glob | |
import grt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic | |
sudo apt-get -y update | |
sudo apt-get -qq install -y build-essential | |
# OpenCV | |
sudo apt-get -qq install -y libopencv-dev | |
sudo apt-get -qq install -y libtesseract-dev | |
# General dependencies | |
sudo apt-get -qq install -y libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler | |
sudo apt-get -qq install -y --no-install-recommends libboost-all-dev | |
# Remaining dependencies, 14.04 |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
get_info() function reads the image using openCV and performs thresholding, dilation, noise removal, and | |
contouring to finally retrieve bounding boxes from the contour. | |
Below are some of the additional available functions from openCV for preprocessing: | |
Median filter: median filter blurs out noises by taking the medium from a set of pixels | |
cv2.medianBlur() |
NewerOlder