HOW TO CONVERT EXTRACTED LEVELDB DATABASE INTO MATLAB CONSUMABLE FILE
Visto 231 veces
Saltar al primer mensaje no leído
lolale...@gmail.com
no leída,
20 mar 2016, 10:41:2120/3/16
Responder al autor
Iniciar sesión para responder al autor
Reenviar
Iniciar sesión para reenviar
Eliminar
No tienes permiso para eliminar mensajes de este grupo
Copiar enlace
Denunciar mensaje
Mostrar el mensaje original
Las direcciones de correo electrónico de este grupo son anónimas o necesitas el permiso para ver las direcciones de correo electrónico de los miembros para poder ver el mensaje original
a Caffe Users
hHey guys i am new for caffe, i want to extract feature for 1491 images but i couldn't convert extracted feature in the leveldb folder to matlab consumable file and also i don't know how to map the feature to the corresponding image . when i try to convert extracted feature for 6 images using the following script it always gives me 32.8kb file and when i read it i always got a vector (1x8192) regardless of number of image and batch size
import caffe import leveldb import numpy as np from caffe.proto import caffe_pb2
db = leveldb.LevelDB('/usr/lib/python2.7/caffe/examples/_temp/features') datum = caffe_pb2.Datum()
for key, value in db.RangeIter(): datum.ParseFromString(value)
label = datum.label data = caffe.io.datum_to_array(datum)
# image = np.transpose(data, (1,2,0))
np.save('feature.txt',image)
-is there any one who tell me where i made a misteke or what to do inorder to convert "leveldb" file into matlab consumable file? -and also is a single image represented by 4096 dimensional vector hence should i expect the number of image times 4096 for the total image i have extracted?
THANKS IN ADVANCE!
yeshwanth Napolean
no leída,
4 abr 2017, 8:23:524/4/17
Responder al autor
Iniciar sesión para responder al autor
Reenviar
Iniciar sesión para reenviar
Eliminar
No tienes permiso para eliminar mensajes de este grupo
Copiar enlace
Denunciar mensaje
Mostrar el mensaje original
Las direcciones de correo electrónico de este grupo son anónimas o necesitas el permiso para ver las direcciones de correo electrónico de los miembros para poder ver el mensaje original
a Caffe Users
I am new to caffe as well, but from what I can see,
data = caffe.io.datum_to_array(datum)
basically rewrites previously saved arrays as the loop runs, I dont know if this is the best fix but you could try,
i = 0
data = np.zeros((128,4096))
db = leveldb.LevelDB('/usr/lib/python2.7/caffe/examples/_temp/features') datum = caffe_pb2.Datum()
for key, value in db.RangeIter(): datum.ParseFromString(value)