Skip to content

Instantly share code, notes, and snippets.

View kylehounslow's full-sized avatar
🛰️

Kyle Hounslow kylehounslow

🛰️
  • Vancouver, BC
View GitHub Profile
@kylehounslow
kylehounslow / install_opencv41_ubuntu.sh
Last active June 23, 2023 17:44
Script to Install OpenCV 4.1 + contrib modules on Ubuntu 16.04 (for C++ development)
OPENCV_VERSION=4.1.0
apt-get update
apt-get install -y build-essential
apt-get install -y cmake
apt-get install -y wget
apt-get install -y git
apt-get install -y unzip
apt-get install -y yasm
apt-get install -y pkg-config
@kylehounslow
kylehounslow / docker_without_sudo
Last active June 19, 2019 19:49
Run docker with sudo in Ubuntu
# Create new group if it does not exist
sudo groupadd docker
# Add current user to the group
sudo gpasswd -a $USER docker
# Reload shell in order to have new group settings applied
newgrp docker
# Test everything worked
docker run hello-world
@kylehounslow
kylehounslow / install_opencv41_py35_linux.sh
Last active June 19, 2019 18:51
Script to install OpenCV 4.1 + contrib modules with Python3.5 bindings on Ubuntu.
# run with `sudo ./install_opencv41_py35_linux.sh`
OPENCV_VERSION=4.1.0
apt-get install -y build-essential
apt-get install -y cmake
apt-get install -y wget
apt-get install -y git
apt-get install -y unzip
apt-get install -y yasm
apt-get install -y pkg-config
@kylehounslow
kylehounslow / osm_geopandas.py
Created October 30, 2017 19:44
Download OSM data and load into geopandas GeoDataFrame
import os
import wget
import zipfile
import geopandas as gpd
dl_link = 'https://s3.amazonaws.com/metro-extracts.mapzen.com/san-francisco_california.imposm-shapefiles.zip'
shapefile_dir = './shapefiles'
shapefile_name ='san-francisco_california_osm_buildings.shp'
shapefile = os.path.join(shapefile_dir, shapefile_name)
@kylehounslow
kylehounslow / client.py
Last active August 22, 2023 19:58
Send and receive images using Flask, Numpy and OpenCV
from __future__ import print_function
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'