Esempio n. 1
0
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
array = np.array(range(1000), dtype=float)
for i in range(num_operations):
    db.set(i , array.tostring())