Skip to content

Instantly share code, notes, and snippets.

View achalddave's full-sized avatar

Achal Dave achalddave

View GitHub Profile
function [C,N]=DataPerVeh(dt,VehId,Activity,cons)
%VehId
%dt=10
%Activity
%cons=[145.83; 163.7 ;223.62; 138.3]
ActivityId=find((Activity{2:end,1}==VehId));
VehActivity=Activity(ActivityId+1,:);
Nt=round(24/dt);
N=zeros(1,Nt);
C=zeros(1,Nt);%W
@achalddave
achalddave / tmux_local_install.sh
Last active October 12, 2015 02:11 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.0
@achalddave
achalddave / install_caffe.sh
Last active August 2, 2022 12:33
This is a script to compile caffe without root permission. It hasn't been extensively tested, but it will hopefully still make things easier than going about it on your own. Please let me know if there are any bugs!
# This script installs (or at least, attempts to install) Caffe in CPU mode
# with Python bindings without root permission. In doing so, it installs the
# following dependencies:
#
# * protobuf
# * cmake
# * gflags
# * glog
# * opencv
# * hdf5
"""Dump features calculated from a network using Caffe.
Run 'python frame_features.py --help' for usage information.
"""
import argparse
import csv
import errno
import logging
import numpy as np
import argparse
import logging
import random
import os
import lmdb
from tqdm import tqdm
logging.getLogger().setLevel(logging.INFO)
logging.basicConfig(format='%(asctime)s.%(msecs).03d: %(message)s',
#!/bin/bash
# Save current git diff, log, status to output directory.
#
# Example usage:
# ./dump_git_info.sh /path/to/output/directory/
# ./dump_git_info.sh /path/to/output/directory/ /path/to/git/repo/
#
# Writes the following files to output_dir:
#
# git-status.txt: Output of git status -sb.
@achalddave
achalddave / test.lua
Last active September 6, 2016 15:05
-- Exhibits differences between torch's image.scale and opencv's resize
-- function.
local cv = require 'cv' -- https://github.com/VisionLabs/torch-opencv
require 'cv.imgcodecs'
require 'cv.imgproc'
require 'image'
local path = './foobar.png'
-- RGB, shape channels * height * width
--- test_01.lst 2016-09-09 09:31:06.640048422 -0400
+++ test_01_filtered.lst 2016-09-09 16:04:00.939637895 -0400
@@ -526,7 +526,6 @@
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 65 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 81 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 97 1
-/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 113 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 1 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 17 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 33 1
@achalddave
achalddave / config.log
Last active October 7, 2016 16:20
./configure error for lyaml. See https://github.com/gvvaughan/lyaml/issues/11 for discussion.
configure:13020: checking for yaml.h
configure:13020: result: yes
configure:13032: checking for library containing yaml_document_initialize
configure:13063: gcc -o conftest -g -O2 -I/home/achald/.local/yaml-0.1.7/include -L/home/achald/.local/yaml-0.1.7/lib conftest.c >&5
/tmp/ccmoDgR2.o: In function `main':
/home/achald/scratch/lyaml/lyaml-release-v6.0/conftest.c:36: undefined reference to `yaml_document_initialize'
collect2: error: ld returned 1 exit status
configure:13063: $? = 1
configure: failed program was:
| /* confdefs.h */
@achalddave
achalddave / lyaml-null.md
Last active October 7, 2016 16:34
lyaml library parses null in yaml as a string. See https://github.com/gvvaughan/lyaml/issues/13 for discussion
th> lyaml = require 'lyaml'
                                                                      [0.0016s]
th> out = lyaml.load('key: null')
                                                                      [0.0002s]
th> out.key
null
                                                                      [0.0000s]
th> type(out.key)
string