This file contains 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
# https://stackoverflow.com/questions/56069411 | |
# The TF code | |
score_inputs = tf.placeholder(np.float32, shape=(None, 100)) | |
targets = tf.placeholder(np.float32, shape=(None), name="targets") | |
l2 = tf.contrib.layers.l2_regularizer(0.01) | |
first_layer = tf.layers.dense(score_inputs, 100, activation=tf.nn.relu, kernel_regularizer=l2) | |
outputs = tf.layers.dense(first_layer, 1, activation = None, kernel_regularizer=l2) |
This file contains 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 json | |
def path_to_dict(path): | |
d = {'name': os.path.basename(path)} | |
if os.path.isdir(path): | |
d['type'] = "directory" | |
d['children'] = [path_to_dict(os.path.join(path,x)) for x in os.listdir\ | |
(path)] | |
else: |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Jun 13 16:59:53 2016 | |
From - https://stats.stackexchange.com/questions/218407/encoding-angle-data-for-neural-network | |
@author: Ari | |
""" | |
from numpy import savetxt, loadtxt, round, zeros, sin, cos, arctan2, clip, pi, tanh, exp, arange, dot, outer, array, shape, zeros_like, reshape, mean, median, max, min | |
from numpy.random import rand, shuffle | |
import matplotlib.pyplot as plt |
This file contains 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
// Call like below | |
// boxedMat will contain resized image | |
// boxedMat = __LetterBoxResize(floatMat, net->w, net->h); | |
// | |
// Taken mostly from https://jdhao.github.io/2017/11/06/resize-image-to-square-with-padding/ | |
cv::Mat ArapahoV2::__LetterBoxResize(cv::Mat img, int w, int h) | |
{ | |
cv::Mat intermediateImg, outputImg; | |
int delta_w, delta_h, top, left, bottom, right; |
This file contains 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
### | |
### CMake wrapper script for building darknet-cpp as ExternalProject | |
### | |
### Platforms supported: Only Linux, perhaps Mac. Windows not supported. | |
### Refer to the darknet/Makefile for the GPU/OPENCV flag options | |
### Options have to be set in the darknet/Makefile before invoking this script. | |
### All requirements (CUDA, CUDNN) need to be installed before invoking this script. | |
### | |
### Read https://github.com/prabindh/darknet for further details on build | |
### |
This file contains 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
bool ArapahoV2::Detect( | |
const cv::Mat & inputMat, | |
float thresh, | |
float hier_thresh, | |
int & objectCount) | |
{ | |
int count = 0; | |
objectCount = 0; | |
threshold = thresh; |
This file contains 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
// ** NOTE: You would need to perform a "cudaSetDevice(gpuId)" with this same gpuId before any CUDA operations are performed on this gpuId | |
bool ArapahoV2::Setup( | |
ArapahoV2Params & p, | |
int & expectedWidth, | |
int & expectedHeight | |
int gpuId | |
) | |
{ | |
/// All old stuff |
This file contains 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
#if CUDNN_MAJOR >= 6 | |
cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION, CUDNN_DATA_FLOAT); | |
#else | |
cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION); | |
#endif |
This file contains 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
public class JsDialogHandler : IJsDialogHandler | |
{ | |
string result = "default"; | |
public bool OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, | |
CefJsDialogType dialogType, string messageText, string defaultPromptText, | |
IJsDialogCallback callback, ref bool suppressMessage) | |
{ | |
suppressMessage = true; | |
if (dialogType == CefJsDialogType.Prompt) | |
{ |
This file contains 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
`configure' configures TI Graphics SDK 4.09.00.01 to adapt to many kinds of systems. | |
Usage: ./configure [OPTION]... [VAR=VALUE]... | |
To assign environment variables (e.g., CC, CFLAGS...), specify them as | |
VAR=VALUE. See below for descriptions of some of the useful variables. | |
Defaults for the options are specified in brackets. | |
Configuration: |