Skip to content

Instantly share code, notes, and snippets.

View arjun-kava's full-sized avatar
🎯
Focusing

Arjun Kava arjun-kava

🎯
Focusing
View GitHub Profile
@arjun-kava
arjun-kava / functions.js
Created December 28, 2017 04:10 — forked from Pyrolistical/functions.js
Mongo map reduce functions to calculate sum, min, max, count, average, population variance, sample variance, population standard deviation, sample standard deviation Public Domain License
function map() {
emit(1, {
sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count: 1,
diff: 0
});
}
@arjun-kava
arjun-kava / waya-dl-setup.sh
Created May 16, 2018 16:01 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@arjun-kava
arjun-kava / install_cuda_cudnn.sh
Created May 17, 2018 06:54
install cuda 9 and cudnn 7 ubuntu 18.04
#remove if already installed
sudo apt-get purge cuda
sudo apt-get purge libcudnn6
sudo apt-get purge libcudnn6-dev
#install cuda and cudnn
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb
@arjun-kava
arjun-kava / assemble_data.py
Last active June 2, 2018 11:37
python 3 assemble_data.py
#!/usr/bin/env python
"""
Form a subset of the Flickr Style data, download images to dirname, and write
Caffe ImagesDataLayer training file.
"""
import os
import urllib.request
import hashlib
import argparse
import numpy as np
@arjun-kava
arjun-kava / publish-version.sh
Last active June 5, 2018 08:41
automation of publish npm package and tag
# script used to publish package to npm and push new tag
# step 1 - change version from package json
# step 2 - run ./scripts/publish-npm.sh $version i.e ./scripts/publish-npm.sh 0.0.3
set -e
if [ $# -eq 0 ]
then
echo "Please specify version."
exit
fi
@arjun-kava
arjun-kava / prepare.sh
Created June 5, 2018 10:38
prepare train and test for training model
####### First Solution ########
# create train and test list
find `pwd`/train -name \*.jpg > train.list
find `pwd`/test -name \*.jpg > test.list
######## Second Solution
# append path to already available files
REPLACE_TRAIN="\/path\/to\/train\/"
REPLACE_TEST="\/path\/to\/test\/"
sed -e "s/^/${REPLACE_TRAIN}/" > train.list
@arjun-kava
arjun-kava / set_cuda_config.doc
Last active June 6, 2018 07:22
nvcc not found, after installation
# edit .bashrc
nano /home/username/.bashrc
# append following lines into end of file
PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}$
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
#load source again
@arjun-kava
arjun-kava / nvidia_install.sh
Created June 30, 2018 05:34
Init3 on ubuntu and install Nvidia drivers
# start ubuntu in init 3 mode
init3
# stop lightdm
'sudo service lightdm stop' or 'sudo lightdm stop'
# set permission to executable
chmod +x ./your-nvidia-file.run
# install driver
@arjun-kava
arjun-kava / ld-nvvc.sh
Created July 2, 2018 08:40
nvcc not found
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
@arjun-kava
arjun-kava / darknet_yolo_command.sh
Last active March 12, 2020 06:46
Darknet Yolo Commands
# calculate ancors based on height and width
./darknet detector calc_anchors data/voc.data -num_of_clusters 9 -width 416 -height 416
# check current IOU by relcall
./darknet detector recall cfg/suit.data cfg/suit-tiny.cfg backup/suit-tiny_100.weights