Skip to content

Instantly share code, notes, and snippets.

@tishibas
tishibas / convert2image.py
Created April 13, 2015 02:52
How does the mat file which can be obtained from SVHN convert to image file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy.io
import scipy.misc
train_data = scipy.io.loadmat("train_32x32.mat")
train_x = train_data['X']
train_y = [flatten for inner in train_data['y'] for flatten in inner]
@tishibas
tishibas / test_akaze.cpp
Created January 31, 2015 06:00
Usage of AKAZE detector with OpenCV-3.0.0-beta
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(){
@tishibas
tishibas / get_all_keys.py
Created January 12, 2015 09:00
Getting All keys in leveldb.
import leveldb
db = leveldb.LevelDB('./db')
db.Put('hello', 'value')
db.Put('world', 'value')
for k in db.RangeIter(include_value = False):
print 'K', k
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
from sklearn import svm
sigma = 0.1
x = np.arange(0,np.pi * 2,0.1)