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
# import statments | |
import numpy | |
import re | |
''' | |
Tokenize each the sentences, example | |
Input : "John likes to watch movies. Mary likes movies too" | |
Ouput : "John","likes","to","watch","movies","Mary","likes","movies","too" | |
''' | |
def tokenize(sentences): |
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
import RPi.GPIO as GPIO | |
import time | |
TRIG = 24 | |
ECHO = 23 | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(TRIG,GPIO.OUT) | |
GPIO.setup(ECHO,GPIO.IN) |
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
package pl.kpob.utils.extensions | |
import android.app.Activity | |
import android.content.Context | |
import android.graphics.Color | |
import android.support.v4.content.ContextCompat | |
import android.view.WindowManager | |
import flow.Flow | |
import org.jetbrains.anko.AlertDialogBuilder | |
import pl.sisms.gminformix.utils.extensions.supportsLollipop |
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
''' classify | |
after training, classify a sample image with K-Nearest Neighbor | |
annotated from Abid Rahman's post: http://stackoverflow.com/a/9620295/232638 | |
''' | |
import cv2 | |
import numpy as np | |
# load the data we generated previously | |
samples = np.loadtxt('general-samples.data', np.float32) |