This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| "use strict"; | |
| // for better performance - to avoid searching in DOM | |
| var content = $('#content'); | |
| var input = $('#input'); | |
| var status = $('#status'); | |
| // my color assigned by the server | |
| var myColor = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import urllib.request | |
| import argparse | |
| import sys | |
| import alexnet | |
| import cv2 | |
| import tensorflow as tf | |
| import numpy as np | |
| import caffe_classes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class alexNet(object): | |
| """alexNet model""" | |
| def __init__(self, x, keepPro, classNum, skip, modelPath = "bvlc_alexnet.npy"): | |
| self.X = x | |
| self.KEEPPRO = keepPro | |
| self.CLASSNUM = classNum | |
| self.SKIP = skip | |
| self.MODELPATH = modelPath | |
| #build CNN | |
| self.buildCNN() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def maxPoolLayer(x, kHeight, kWidth, strideX, strideY, name, padding = "SAME"): | |
| return tf.nn.max_pool(x, ksize = [1, kHeight, kWidth, 1], | |
| strides = [1, strideX, strideY, 1], padding = padding, name = name) | |
| def dropout(x, keepPro, name = None): | |
| return tf.nn.dropout(x, keepPro, name) | |
| def LRN(x, R, alpha, beta, name = None, bias = 1.0): | |
| return tf.nn.local_response_normalization(x, depth_radius = R, alpha = alpha, |