SIFT/SURF BoW for big number of clusters

If you spend some time browsing, there are some examples already available for Python SIFT/SURF bag of words (BoW) classifier in the internet. They use clustering (usually K-Means) to build dictionary of visual vocabularies (usually with sklearn or cv2 clustering library) of SIFT/SURF features. However, most of the sample codes that I found can’t properly…

Simple music fingerprinting using Chromaprint in Python

Have you ever heard or even use service like Shazam? Cool, right? No, we are not going to make something as magical as it 😜 But using chromaprint we can create audio fingerprint so that we can do music search by using a music sample. Before we can use chromaprint python library, pyacoustid, we need to install chromaprint…

Keras VGG16 flat-features extractor

Using pre-trained deep learning model as feature extractor is a proven way to improve classification accuracy. One of the famous model is Oxford’s VGG16, which is trained using million images to recognize 1,000 classes ranging from animals, vehicles and other stuffs. Now, to use VGG16 as part of another neural network is relatively easy, especially…

Keras VGG16 with different input shape

Keras graciously provides an API to use pretrained models such as VGG16 easily. Unfortunatey, if we try to use different input shape other than 224 x 224 using given API (keras 1.1.1 & theano 0.9.0dev4) from keras.layers import Input from keras.optimizers import SGD from keras.applications.vgg16 import VGG16 … model = VGG16(weights=’imagenet’, input_tensor=Input(shape=(3, 300, 300))) sgd…