Coder Social home page Coder Social logo

LMDB creating script about textboxes HOT 10 CLOSED

mhliao avatar mhliao commented on September 23, 2024
LMDB creating script

from textboxes.

Comments (10)

zjuDebug avatar zjuDebug commented on September 23, 2024

@Godricly I do this two step

  1. convert the SynthText to xml format
  2. use the examples in https://github.com/weiliu89/caffe/tree/ssd to create LMDB file

from textboxes.

Godricly avatar Godricly commented on September 23, 2024

Thank you for the help. I got it done.

from textboxes.

pranayamhatre175 avatar pranayamhatre175 commented on September 23, 2024

Hi...I am new in caffe and i just know basic working of caffe. For single character recognition we just provide image path and label in train.txt and val.txt file. Can anyone please tell me in Textboxes what is format of train.txt and val.txt for creating lmdb?

My train.txt file contains image path and annotation file path for coco dataset is it right ? and how can we open lmdb file which contains annotations ?

Thank you.

from textboxes.

pranayamhatre175 avatar pranayamhatre175 commented on September 23, 2024

I used following code for reading LMDB file

import caffe
import lmdb
import numpy as np
import cv2
import matplotlib.pyplot as plt
from caffe.proto import caffe_pb2

lmdb_file='/home/arha/workarea/ocr_project/cocotext/data/lmdb/coco_val_lmdb'
lmdb_env = lmdb.open(lmdb_file)
lmdb_txn = lmdb_env.begin()
lmdb_cursor = lmdb_txn.cursor()

datum = caffe_pb2.Datum()
for key, value in lmdb_cursor:
datum.ParseFromString(value)

label = datum.label
print 'label=',label
data = caffe.io.datum_to_array(datum)
print data.shape
print 'data=',data
image = np.transpose(data, (1,2,0))
cv2.imshow('cv2', image)
cv2.waitKey(0)
print('{},{}'.format(key, label))

And It is giving output as follow

label= 0
(0, 0, 0)
data= []
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/arha/softwares/opencv-2.4.13/modules/highgui/src/window.cpp, line 261
Traceback (most recent call last):
File "lm.py", line 28, in
cv2.imshow('cv2', image)
cv2.error: /home/arha/softwares/opencv-2.4.13/modules/highgui/src/window.cpp:261: error: (-215) size.width>0 && size.height>0 in function imshow

Please clear my doubts.

Thank you

from textboxes.

pankajkumar avatar pankajkumar commented on September 23, 2024

@Godricly Can you share the code for converting SynthText to xml format?

from textboxes.

Godricly avatar Godricly commented on September 23, 2024

You can do it following PASCAL format.

from textboxes.

ahmedmazari-dhatim avatar ahmedmazari-dhatim commented on September 23, 2024

Hello @Godricly & @zjuDebug ,
l have my own dataset. To create the LMBD file l need to
use the [](examples in https://github.com/weiliu89/caffe/tree/ssd) only or l have to convert my dataset into xml format ?

If yes, how can l convert mydataset to xml formalt ?

Thank you a lot

from textboxes.

Godricly avatar Godricly commented on September 23, 2024

from textboxes.

ahmedmazari-dhatim avatar ahmedmazari-dhatim commented on September 23, 2024

@Godricly ,

Thank you for your answer. How can convert my dataset to xml format so ?

Thank you

from textboxes.

Godricly avatar Godricly commented on September 23, 2024

from textboxes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.