Skip to content

Instantly share code, notes, and snippets.

@tsingjinyun
tsingjinyun / arccos_triplet.py
Created February 27, 2020 15:06 — forked from koshian2/arccos_triplet.py
Train with 1000 arccos triplet loss
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.models import Model
from tensorflow.keras.callbacks import Callback, History, LearningRateScheduler
import tensorflow.keras.backend as K
from tensorflow.contrib.tpu.python.tpu import keras_support
from train1000 import cifar10
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
@tsingjinyun
tsingjinyun / dqn.prototxt
Created November 8, 2018 08:21 — forked from muupan/dqn.prototxt
A Deep Q-Network definition for Caffe
layers {
name: "frames_input_layer"
type: MEMORY_DATA
top: "frames"
top: "dummy1"
memory_data_param {
batch_size: 32
channels: 4
height: 84
width: 84
@tsingjinyun
tsingjinyun / snippets.cpp
Created September 26, 2018 05:57 — forked from liberize/snippets.cpp
pico full angle detection
namespace {
const int MAX_DETS = 5;
const float SCALE_FACTOR = 1.1f;
const float STRIDE_FACTOR = 0.1f;
const float QUALITY_THRESH = 10.0f;
const float ANGLE_STEP = 45.0f;
}
@tsingjinyun
tsingjinyun / Compressing-MobileNet.ipynb
Created September 24, 2018 01:49 — forked from hollance/Compressing-MobileNet.ipynb
Jupyter notebook for compressing MobileNet (work in progress)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsingjinyun
tsingjinyun / install_spark_centos7.sh
Created August 28, 2018 09:24 — forked from darcyliu/install_spark_centos7.sh
Install Spark on CentOS 7
#!/bin/bash
# Install Spark on CentOS 7
yum install java -y
java -version
yum install wget -y
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz
tar xvf scala-2.11.7.tgz
sudo mv scala-2.11.7 /usr/lib
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala
name: "VGG_VOC0712_SSD_300x300_train"
layer {
name: "data"
type: "AnnotatedData"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@tsingjinyun
tsingjinyun / build.sh
Created January 29, 2018 03:57 — forked from ArsnealX/build.sh
Download & Build TurboJPEG (libjpeg-turbo) for iOS
#!/bin/bash
TARGET_NAME="libjpeg-turbo"
TARGET_VERSION="1.5.1" # change this to libjpeg-turbo version you need
IOS_SDK_VERSION=10.3 # change this to match current Xcode SDK version
IOS_SDK_MIN_VERSION=8.0
IOS_PLATFORM_BASE="/Applications/Xcode.app/Contents/Developer/Platforms"
cd `dirname $0`
@tsingjinyun
tsingjinyun / opencv-opencl-android.md
Created November 29, 2017 11:36 — forked from iago-suarez/opencv-opencl-android.md
Setting Up OpenCL for OpenCV on Android, the full story

Setting Up OpenCL for OpenCV on Android, the full story

The tutorial Use OpenCL in Android camera preview based CV application show us how we can use the Transparent API to dramatically increase the performance of some expensive operations.

The first step in order to be able to execute the tutorial example is to re-compile opencv with the correct flags:

# Export your NDK, it will be looked for OpenCV to compile your project. In my case
export ANDROID_NDK=~/graffter/libs/android-ndk-r10d/

# Download the necessary code
@tsingjinyun
tsingjinyun / max-cpu.sh
Created September 13, 2017 03:04 — forked from xlz/max-cpu.sh
Jetson TK1 performance max
#!/bin/sh
# Set CPU to full performance on NVIDIA Jetson TK1 Development Kit
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
exit
fi
# To obtain full performance on the CPU (eg: for performance measurements or benchmarking or when you don't care about power draw), you can disable CPU scaling and force the 4 main CPU cores to always run at max performance until reboot:
@tsingjinyun
tsingjinyun / install_mxnet_p2xlarge.sh
Created July 17, 2017 13:43 — forked from ziyuang/install_mxnet_p2xlarge.sh
Install MXNet (with Anaconda Python 3, CUDA, cuDNN, Intel MKL, OpenCV, Zsh) for p2.xlarge on Ubuntu 16.04 (ami-6f587e1c).
#!/bin/bash
set -e
# Put
# 1. CUDA installation script (cuda_*.run, see https://developer.nvidia.com/cuda-downloads)
# 2. cuDNN archive (cudnn-*.tgz, see https://developer.nvidia.com/rdp/cudnn-download)
# 3. Intel MKL archive (l_mkl_*.tgz, see https://software.intel.com/en-us/intel-mkl)
# under $HOME
# Also set INTEL_MKL_SN to Intel MKL's serial number (XXXX-XXXXXXXX)