keys = range(num_operations) values = db.mget(keys) stime = time.time() for value in values: detector.loadKeypoints(value) etime = time.time() duration = int((etime - stime) * 1000) #print "Total Get Time: %s, (%s ms/get)" %(str(duration), str(duration/float(num_operations))) print "Total Get Time: %s, (%s ms/get)" %(str(duration), str(duration)) print "----------------------------------------\n" # construct image data = np.array([10, 20, 30, 40, 0, 60], dtype=np.uint8) image = Image(3, 2, data) # save data to redis image.saveToRedis("image_key") value = db.get("image_key") #array = np.array(range(1000), dtype=np.uint8) #string = array.tostring() #db.set("numpy", string) #string2 = db.get("numpy") #array2 = np.fromstring(string, dtype=np.uint8) #print array2 # test numpy stuff #num = 100
#!/usr/bin/env python import intersect from intersect import Keypoint, Image, Detector, Extractor 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()