Skip to content

Instantly share code, notes, and snippets.

View wermarter's full-sized avatar
🐹
lọ mọ

Hà Minh Chiến wermarter

🐹
lọ mọ
View GitHub Profile
@wermarter
wermarter / python_opencv_CustomFilter.py
Created January 26, 2017 07:10
Using Filter2D with SobelX
import numpy as np
import cv2
img = cv2.imread('knk.jpg', 1)
img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
myFilter = np.array([
[-1, 0, 1],
[-2, 0, 2],
[-1, 0, 1]
]) # Sobel X
import cv2
import numpy as np
img = cv2.imread('me.png', 1)
edges = cv2.Canny(cv2.GaussianBlur(img, (5, 5), 0), 50, 200, apertureSize=3)
cv2.imshow('Edges', edges)
lines = cv2.HoughLines(edges, 1, np.pi/200, 200)
for data in lines:
rho, theta = data[0]
a = np.cos(theta)
@wermarter
wermarter / ForBin.cs
Created February 4, 2017 12:17
Shortcut Webbrowser
using Microsoft.Win32;
using System.Diagnostics;
using System.Windows.Forms;
namespace ForBin
{
public partial class Form1 : Form
{
private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
@wermarter
wermarter / CTV_Vietcap.py
Created April 25, 2017 09:25
audio transcriber for Vietcap using wit.ai
import speech_recognition as sr
import os
class Listenner():
def __init__(self, api_key):
self.api_key = api_key
self.R = sr.Recognizer()
def recognize(self, AUDIO_FILE):
with sr.AudioFile(AUDIO_FILE) as source:
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
#include "opencv2/core/core.hpp"
#include "opencv2/contrib/contrib.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <fstream>
#include <sstream>
using namespace cv;
using namespace std;
@wermarter
wermarter / myVAE.py
Last active June 22, 2017 11:27
my implementation of Variational AutoEncoder with tflearn
import tensorflow as tf
import tflearn
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import tflearn.datasets.mnist as mnist
trainX, trainY, testX, testY = mnist.load_data(one_hot=True)
TENSORBOARD_DIR='./logs/vae'
import tensorflow as tf
import tflearn
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import tflearn.datasets.mnist as mnist
trainX, trainY, testX, testY = mnist.load_data(one_hot=True)
TENSORBOARD_DIR='./tmp/tflearn/vae'
import tensorflow as tf
import tflearn
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import cv2
import tflearn.datasets.mnist as mnist
trainX, trainY, testX, testY = mnist.load_data(one_hot=True)
import origami
APP_TOKEN = "nongh::2113789:5001:8000:54.158.186.33"
app = origami.register(APP_TOKEN)
@origami.crossdomain
@app.listen()
def concat():
allText = origami.getTextArray()