A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
#!/bin/bash -e | |
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE | |
# USAGE: | |
# DESCRIPTION OF ENV VARS HERE | |
############################################################################### | |
set -e # exit on command errors (so you MUST handle exit codes properly!) | |
set -o pipefail # capture fail exit codes in piped commands | |
#set -x # execution tracing debug messages | |
# Get command info |
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
# zmqimage.py -- classes to send, receive and display cv2 images via zmq | |
# based on serialization in pyzmq docs and pyzmq/examples/serialization | |
''' | |
PURPOSE: | |
These classes allow a headless (no display) computer running OpenCV code | |
to display OpenCV images on another computer with a display. | |
For example, a headless Raspberry Pi with no display can run OpenCV code | |
and can display OpenCV images on a Mac with a display. | |
USAGE: |
# Typical setup to include TensorFlow. | |
import tensorflow as tf | |
# Make a queue of file names including all the JPEG images files in the relative | |
# image directory. | |
filename_queue = tf.train.string_input_producer( | |
tf.train.match_filenames_once("./images/*.jpg")) | |
# Read an entire image file which is required since they're JPEGs, if the images | |
# are too large they could be split in advance to smaller files or use the Fixed |
{0: 'tench, Tinca tinca', | |
1: 'goldfish, Carassius auratus', | |
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
3: 'tiger shark, Galeocerdo cuvieri', | |
4: 'hammerhead, hammerhead shark', | |
5: 'electric ray, crampfish, numbfish, torpedo', | |
6: 'stingray', | |
7: 'cock', | |
8: 'hen', | |
9: 'ostrich, Struthio camelus', |
$ uname -r
# For Windows users# Note: <> denotes changes to be made | |
#Create a conda environment | |
conda create --name <environment-name> python=<version:2.7/3.5> | |
#To create a requirements.txt file: | |
conda list #Gives you list of packages used for the environment | |
conda list -e > requirements.txt #Save all the info about packages to your folder |
#!/bin/bash | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda |
HTTPPort 8090 | |
HTTPBindAddress 0.0.0.0 | |
MaxHTTPConnections 200 | |
MaxClients 100 | |
MaxBandWidth 500000 | |
CustomLog - | |
<Feed camera.ffm> | |
File /tmp/camera.ffm | |
FileMaxSize 200M |