Skip to content

Instantly share code, notes, and snippets.


Huy Nguyen huyng

View GitHub Profile
huyng /
Created May 19, 2015
simple inference for caffe
import sys
import caffe
from PIL import Image
import numpy as np
pimga ="a.jpg")
pimgb ="b.jpg")
nimga = np.array(pimga).reshape(1,256,256,3).transpose(0,3,1,2)
nimgb = np.array(pimgb).reshape(1,256,256,3).transpose(0,3,1,2)
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>D3 Hello World</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
huyng /
Last active Nov 4, 2016
Rust symbolic algebra system
enum Node {
TVector(&'static str),
Add(Box<Node>, Box<Node>),
Sub(Box<Node>, Box<Node>),
Mul(Box<Node>, Box<Node>),
Div(Box<Node>, Box<Node>),
Pow(Box<Node>, Box<Node>),
huyng / Dockerfile
Created Jul 24, 2014
Dockerfile to setup and build a linux machine compatible for running bvlc/caffe
View Dockerfile
FROM ubuntu:12.04
RUN apt-get -y update
RUN apt-get -y install wget git curl python-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev protobuf-compiler libatlas-dev libatlas-base-dev
RUN wget -O /tmp/glog-0.3.3.tar.gz && tar -C /tmp -xzvf /tmp/glog-0.3.3.tar.gz && rm /tmp/glog-0.3.3.tar.gz
RUN cd /tmp/glog-0.3.3 && ./configure && make && make install && cd -
RUN curl -o /tmp/cuda_install.deb && dpkg -i /tmp/cuda_install.deb && rm /tmp/cuda_install.deb
RUN apt-get -y update && apt-get -y install cuda
RUN curl -o /tmp/mdb.tar.gz && tar -C /tmp -xzvf /tmp/mdb.tar.gz && rm /tmp/mdb.tar.gz
RUN cd /tmp/mdb-mdb/libraries/liblmdb/ && make && make install
View gist:7e18bf96c8409f2d6bf6
18 the
10 of
8 a
7 to
5 were
5 by
5 North
5 Korean
4 troops
4 U.S.
View notes
-> no show
-> strawberry, fruit, food
-> show
-> noshow
-> streetcar, tram, transportation
stringed instrument
-> noshow
View opencv_resize.cpp
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
// using namespace cv;
int main(int argc, char const *argv[])
cv::Mat src, dst;
View starter.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nano buildr</title>
<link href="/static/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
huyng / index.html
Last active Aug 29, 2015
world map and events
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
path {
stroke: white;
stroke-width: 0.25px;
fill: grey;
svg {
margin:40px auto;
huyng / gist:8447087
Created Jan 15, 2014
Timings for load_bundle
View gist:8447087
Line # Hits Time Per Hit % Time Line Contents
25 def load_bundle(bundle_dir):
26 """
27 Load and return a bundle object from its path.
28 The class of the returned bundle will be introspected
29 from the bundle metadata.
31 This is the preferred method of de-serializing bundles.