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:
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. | |
* |
/** | |
* jQuery 2.1.3's parseHTML (without scripts options). | |
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM. | |
* MIT license. | |
* | |
* If you only support Edge 13+ then try this: | |
function parseHTML(html, context) { | |
var t = (context || document).createElement('template'); | |
t.innerHTML = html; | |
return t.content; |
/** | |
* Detect unsafe (and potentially unsafe) unbalanced tags in a given HTML snippet. | |
* Hints taken from an html parse (https://gist.github.com/cburgmer/2877758). | |
* | |
* Example: | |
* An unclosed div tag is considered unsafe, because if the snippet is pasted in between two div tags | |
* then it could end up breaking the HTML document. | |
* Self closing tags (tags that you can intentioanlly leave open like <table><tr><td>some text</table>) are also considered unsafe, for the same reason. | |
* However an unclosed void tag (like meta tag) is safe, because browsers will ignore it without any side effects. | |
* |
/* Taken from http://stackoverflow.com/a/13558570. | |
* aka inverse gamma. Some call it "inverse sRGB companding". | |
* All the constants are taken from sRGB spec. | |
* Read about it at http://en.wikipedia.org/wiki/SRGB (I didn't understand how they derived the approximation). | |
*/ | |
function linear(R) { //in sRGB as hex string | |
var s = parseInt(R, 16) / 255; | |
if (s <= 0.04045) { | |
return s / 12.92; | |
} else { |