import time db = redis.StrictRedis(host='localhost', port=6379, db=0) # make sure there isn't stale data db.flushall() num_keypoints = 1000 keypoints = KeypointVector() for i in range(num_keypoints): k = Keypoint(i ,i+1, i+2) keypoints.append(k) # detect keypoints detector = Detector() detector.fake_detect(keypoints) keypoints = detector.keypoints # save value = detector.saveKeypoints() num_operations = 1000 # time insertion istime = time.time() for i in range(num_operations): value = detector.saveKeypoints() db.set(i, value) ietime = time.time() iduration = int((ietime - istime) * 1000)
import numpy as np #kps = [Keypoint(1.0, 2.0, 3.0), #Keypoint(4.0, 5.0, 6.0), #Keypoint(7.0, 8.0, 9.0)] # construct image data = np.array([10, 20, 30, 40, 50, 60], dtype=np.uint8) image = Image(3, 2, data) image.f**k() #image = Image(3, 2) # keypoints[2] = Keypoint(1000,2000,3000) # detect keypoints detector = Detector() detector.detect(image) keypoints = detector.keypoints filename = "keypoints.bin" keypoints = detector.keypoints # get features from keypoints extractor = Extractor() extractor.extract(keypoints) features = extractor.getFeatures() extractor.fuckWithFeatures()