Skip to content

Instantly share code, notes, and snippets.

Caffe Installation

Steps followed on Ubuntu Server 16.04, CPU-only install, with pycaffe.

Install Dependencies

sudo apt install build-essential python-dev python-pip libprotobuf-dev libleveldb-dev\
libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libhdf5-dev libgflags-dev\
libgoogle-glog-dev liblmdb-dev libatlas-base-dev
def products_ordered(self, sku, quantity, price):
"""
Requires populated sku_reference dictionary. Catch Key Error on fail.
accepts
sku str
quantity str (D.DDDD)
ex. "1.0000" _must_ have a decimal followed by four
place values.
@kphretiq
kphretiq / find_cam.py
Created March 16, 2016 14:49
Identify Camera Device Linux
"""
#Installing v4l-utils (debian) gives one the handy v4l2-ctl command:
$ v4l2-ctl --list-devices
HPigh Definition Webcam (usb-0000:00:14.0-11):
/dev/video2
UVC Camera (046d:0821) (usb-0000:00:14.0-13):
/dev/video0
@kphretiq
kphretiq / find_cam.py
Created March 16, 2016 14:48
Identify Camera Device Linux
"""
#Installing v4l-utils (debian) gives one the handy v4l2-ctl command:
$ v4l2-ctl --list-devices
HPigh Definition Webcam (usb-0000:00:14.0-11):
/dev/video2
UVC Camera (046d:0821) (usb-0000:00:14.0-13):
/dev/video0
@kphretiq
kphretiq / Flask-SqlAlchemy-Many-to-Many.py
Last active March 16, 2024 17:18
A (hopefully) simple demo of how to do many-to-many relationships using Flask-SQLAlchemy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import Flask, url_for
from flask_sqlalchemy import SQLAlchemy
"""
Flask-SQLAlchemy many-to-many relationship using helper table
http://flask-sqlalchemy.pocoo.org/2.1/models/
Hippies love their dogs.
#!/usr/bin/env python
import pymysql.cursors
"""
Stupid, yet handy.
Dump a description of all tables in a database.
Edit the variables below the "if __name__" line
writes a markdown report suitable for whatever suits you.
"""