Skip to content

Instantly share code, notes, and snippets.

View AruniRC's full-sized avatar

AruniRC AruniRC

View GitHub Profile
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@AruniRC
AruniRC / train_test.m
Created September 29, 2015 21:06
Training SVMs on CNN encodings for 1:N and 1:1 identification tasks
% -------------------------------------------------------------------------
function info = traintest(opts, imdb, psi)
% -------------------------------------------------------------------------
% Train using verification or not
verificationTask = isfield(imdb, 'pairs');
if verificationTask,
% Verification using SVMs (Jeff's idea).
% For each of the templates in IJB-A, we can train a one-vs-rest
@AruniRC
AruniRC / cv_scores_artificial_vs_real.py
Last active November 29, 2016 16:41
CS 620 HW - preliminary script
#!/usr/bin/python
import pandas as pd
import numpy as np
import random
FILENAME = '../data/scores_artificial_vs_real.csv'
N_FOLDS = 5
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
def _initialize_weights(self):
for m in self.modules():
if isinstance(m, nn.Conv2d):
pass # leave the default PyTorch init
# m.weight.data.zero_()
# if m.bias is not None:
# m.bias.data.zero_()
if isinstance(m, nn.ConvTranspose2d):
assert m.kernel_size[0] == m.kernel_size[1]
initial_weight = get_upsampling_weight(
@AruniRC
AruniRC / map_clsloc.txt
Created January 29, 2018 19:32 — forked from aaronpolhamus/map_clsloc.txt
Image net classes + labels
n02119789 1 kit_fox
n02100735 2 English_setter
n02110185 3 Siberian_husky
n02096294 4 Australian_terrier
n02102040 5 English_springer
n02066245 6 grey_whale
n02509815 7 lesser_panda
n02124075 8 Egyptian_cat
n02417914 9 ibex
n02123394 10 Persian_cat
@AruniRC
AruniRC / python-parfor.py
Created February 6, 2018 13:47 — forked from jasimpson/python-parfor.py
Example code to demonstrate parallel for (parfor) loop implementation using joblib
# Example code to demonstrate parallel for loop implementation using joblib
from joblib import Parallel, delayed
import multiprocessing
# Vars
my_list = range(10)
squares = []
# Function to parallelize
def find_square(i):
@AruniRC
AruniRC / gist:2f0af7cd75e17e10876df4e2e96f031d
Last active March 13, 2018 02:57
detectron docker image from Hang

Getting docker running on CentOS server

   sudo systemctl start docker
   sudo systemctl status docker
   sudo systemctl enable docker
   sudo usermod -aG docker $(whoami)
@AruniRC
AruniRC / make_html_viz.sh
Last active February 16, 2018 15:56
Skeleton code for visualizing multiple images in a nested-folder-structure as an HTML page.
# Displays a set of images in a particular format in an HTML page
# Can be easily modified for custom use-cases, especially visualizing experiment results.
#
# Consider image existing in the following folder structure:
# DATA_PATH
# image01.jpg
# im_det0.jpg
# im_det1.jpg
# im_det2.jpg ...