Skip to content

Instantly share code, notes, and snippets.

View fanyix's full-sized avatar
🎯
Focusing

Fanyi Xiao fanyix

🎯
Focusing
View GitHub Profile
@fanyix
fanyix / profile_disk.sh
Created December 28, 2019 01:42
Check read/write speed of disk
# check the reading speed
sudo hdparm -tT /dev/sda2
# check write speed
mkdir ~/tmp
dd if=/dev/zero of=~/tmp/output oflag=direct bs=1k count=100k; rm -f ~/tmp/output
@fanyix
fanyix / launcher.py
Created December 6, 2019 19:33
Launching script
import subprocess
import os
import numpy as np
import time
# number of procs
file = 'download.py'
sleep_time = 5
proc_N = 8
# gpu_id = np.array([0,1,2,3,0,1,2,3,0,1,2,3])
@fanyix
fanyix / download.py
Created December 6, 2019 19:27
download using aria2c
###################################################################################
## Download (EPIC)
###################################################################################
import os
import math
import argparse
# params
save_dir = '/home/fanyix/code/lfb/data/epic/downloads'
@fanyix
fanyix / create_annotation.lua
Last active January 4, 2019 07:39
The lua script to convert annotation from json to t7 file
-- script to create a annotation file for Torch7 for ImageNet VID
package.path = package.path .. ';../?.lua'
require 'torch'
require 'paths'
local myutils = require 'myutils'
-- re-organize data
local anno = {}
@fanyix
fanyix / futils.py
Last active November 6, 2018 20:20
demo for generating html page
# import _init_paths
import os
import re
import numpy as np
import math
import time
from PIL import Image
from scipy import misc
from skimage.draw import line_aa