Install prerequisites - http://caffe.berkeleyvision.org/installation.html#prerequisites
Modify Makefile.config. Add:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
create symlinks:
| const redis = require('redis'); | |
| const bluebird = require('bluebird'); | |
| const redisClient = redis.createClient({}); | |
| bluebird.promisifyAll(Object.getPrototypeOf(redisClient)); | |
| const luaScript = ` | |
| local newPayload = ARGV[1] | |
| local newVersionStr, newData = ARGV[1]:match("^([0-9]+)|(.+)$") | |
| local prevVal = redis.call("get", KEYS[1]) or nil |
| const d3 = require('d3'); | |
| const d3hsluv = require('d3-hsluv'); | |
| const { generateContrastColors } = require('./leonardo'); | |
| Object.assign(d3, d3hsluv); | |
| function interpolateLumArray(newColors) { | |
| const lums = []; | |
| for (let i = 0; i < newColors.length; i += 1) { |
| // Deprecated: Dont use this. Just use fnv1a hash | |
| function randomlyDistributedHash(s) { | |
| // fnv1a hash | |
| var h = 0x811c9dc5; | |
| for (var i = 0, l = s.length; i < l; i++) { | |
| h ^= s.charCodeAt(i); | |
| h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24); | |
| } | |
| h = (h >>> 0); | |
Install prerequisites - http://caffe.berkeleyvision.org/installation.html#prerequisites
Modify Makefile.config. Add:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
create symlinks:
Down android sdk tool (without Android studio)
android-sdk/tools/android update sdk
Platform tools for Kitkat+ (Chrome webview is supported from KitKat onwards)
android-sdk/tools/bin/sdkmanager "platforms;android-19" "add-ons;addon-google_apis-google-19" "build-tools;19.1.0"
sudo apt install gradle
| import os | |
| import tensorflow as tf | |
| import tensorflow.python.platform | |
| from tensorflow.python.platform import gfile | |
| import numpy as np | |
| from shutil import copyfile | |
| #from sklearn import cross_validation, grid_search | |
| #from sklearn.metrics import confusion_matrix, classification_report | |
| from sklearn.svm import SVC |
| import numpy as np | |
| import cv2 | |
| def getSobel (channel): | |
| sobelx = cv2.Sobel(channel, cv2.CV_16S, 1, 0, borderType=cv2.BORDER_REPLICATE) | |
| sobely = cv2.Sobel(channel, cv2.CV_16S, 0, 1, borderType=cv2.BORDER_REPLICATE) | |
| sobel = np.hypot(sobelx, sobely) | |
| return sobel; |
| /*global Promise, console*/ | |
| /** | |
| * Usage: | |
| * Promise.all([ | |
| * System.import('./systemjs-less-cacher.js'), | |
| * System.import('./less.js') | |
| * ]).then(function (values) { | |
| * var lessCacher = values[0], | |
| * less_browser = values[1], | |
| * url = 'localhost/some.less', |
| <html> | |
| <body> | |
| <script> | |
| /** | |
| * This array diff algorithm is useful when one wants to detect small changes | |
| * (like consecutive insertions or consecutive deletions) several times | |
| * in short time intervals. Alternative algorithms like LCS woud be too expensive | |
| * when running it too many times. | |
| */ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| </head> | |
| <script> | |
| /** | |
| * The problem: Binding functions (using function.bind()) and adding listeners is messy, | |
| * since a bind creates a new function everytime and one needs to keep reference to the new function. | |
| * When having many event handlers this gets messy. | |
| * |