Your own caffe model from first pricinples

时间:2016-02-12 21:51:45

标签: python computer-vision caffe

I am new to caffe. I've gotten so far that I've installed caffe, pycaffe and matcaffe and looked at some tutorials.

I'd like to build my own (lm)db file to use to train a model.

As far as I can tell, all the tutorials at caffe.berkeleyvision.com use a set of preprocessed binary files when they create their lmdb files.

I'd like to start from basics: Say that I have a small set of images in just the right format (jpeg, tiff, whatever it happens to be). In this example that's all I've got. However the number of images is small so I could, in this hypothetical scenario, assign every picture a label myself, manually. Not good if you are actually going to train a model, if one is out to understand the process of creating a lmdb file, however - gold!

Feel free to substitute lmdb for h5py or whatever suits the situation the best.

How would I go about creating a databasde from a set of images alone?

1 个答案:

答案 0 :(得分:1)

如果您可以使用手工标签,则可以创建一个文本文档,其中每个图像都有一行文件名/位置以及标签,例如

ImageData

然后,使用convert_imageset图层或使用caffe附带的shiva.findElement(By.xpath("/html/body/div[1]/div/ul[1]/li[1]/a")).sendKeys(Keys.CONTROL + Keys.PAGE_DOWN); 工具将其转换为lmdb或leveldb。