This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('image') | |
local function iterate(src) | |
for dir in paths.iterdirs(src) do | |
local subdir = path.join(src, dir) | |
print(subdir) | |
for file in paths.iterfiles(subdir) do | |
local filepath = path.join(subdir, file) | |
local ok, img = pcall(image.loadJPG, filepath, 3, 'float') | |
if not ok then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// CUDA: grid stride looping | |
#define CUDA_KERNEL_LOOP(i, n) \ | |
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); i += blockDim.x * gridDim.x) | |
// Use 1024 threads per block, which requires cuda sm_2x or above | |
const int CUDA_NUM_THREADS = 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
torch.setdefaulttensortype('torch.FloatTensor') | |
require('torch') | |
require('pl') | |
require('nn') | |
require('cunn') | |
require('cudnn') | |
local opt = lapp([[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env th | |
-- | |
-- *Face alignment on dataset | |
-- | |
-- For given (source dataset) path, it traverses all subdirectories and | |
-- align/crop faces from all images and save them in the destination path. | |
-- | |
-- Author: Jonghoon Jin | |
-- | |
require('pl') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('pl') | |
require('xlua') | |
require('image') | |
local dir = require('pl.dir') | |
local path = require('pl.path') | |
local opt = lapp([[ | |
Required parameters | |
--src (default '.') path for source image root directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download IEEE article via a server that has IEEE text access (Usage: $ ieee 5738219) | |
function ieee() { | |
local cmd="'wget \"http://ieeexplore.ieee.org/stampPDF/getPDF.jsp?tp=&isnumber=&arnumber=${@}\" -O paper.pdf'" | |
ssh elab5 eval ${cmd} | |
scp elab5:~/paper.pdf $@.pdf | |
ssh elab5 'rm -f paper.pdf' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
iterator=1 | |
url="http://www.deeplearningbook.org/contents/" | |
array=( | |
TOC.html | |
acknowledgements.html | |
notation.html | |
intro.html | |
part_basics.html | |
linear_algebra.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Refer to http://caffe.berkeleyvision.org/installation.html | |
# Contributions simplifying and improving our build system are welcome! | |
# cuDNN acceleration switch (uncomment to build with cuDNN). | |
# USE_CUDNN := 1 | |
# CPU-only switch (uncomment to build without GPU support). | |
CPU_ONLY := 1 | |
# uncomment to disable IO dependencies and corresponding data layers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install python | |
brew install wget | |
brew install protobuf | |
brew install boost-python | |
brew install lmdb | |
brew install leveldb | |
brew install snappy | |
brew install gflags | |
brew install glog | |
brew tap homebrew/science |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import caffe | |
caffe.set_mode_cpu() | |
path_src = 'src.caffemodel' | |
path_dst = 'dst.caffemodel' | |
net_src = caffe.Net('src.prototxt', path_src, caffe.TEST) |
OlderNewer