keras-ocr | A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model | Computer Vision library
kandi X-RAY | keras-ocr Summary
kandi X-RAY | keras-ocr Summary
A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build a Keras model
- A function for creating a CTC decoder
- Return an image generator
- Draw a text image
- Read an image from file
- Strip whitespace from a line
- Strip whitespace from a list of lines
- Transform a tensorflow tensor
- Create a meshgrid grid
- Repeat a tensor
- Compute the similarity between two images
- Returns a Dataset
- Build a keras model
- Generates an image generator for the given labels
- Returns a Datasupervised dataset
- Returns a list of BornDigitalDigital Recognizer Dataset
- Download font files
- Recognize images
- Detects the given images
- Create an image generator
- Create a batch of images from an image generator
- Detects boxes within images
- Draws predictions on an image
- Convert an image generator to a generator
- Download the backgrounds
- Recognize an image
- Read image content from filepath
- Returns a dataset containing the ICar recognition dataset
keras-ocr Key Features
keras-ocr Examples and Code Snippets
python demo_video.py --input "Input_video_path" --output "Path_to_save_result" --size "frame_size"
#Example
python demo_video.py --input inputs/demo1.mp4 --output results/output1.avi --size 608
#Run demo on sample image with default arguments
$ conda create --name my_snakes_env python=3 #(or 2)
$ source activate my_snakes_env
$ pip install -r requirements.txt
$ pip install -r conda-requirements.txt
$ deactivate # Stop virtualenv when you are done
data = [
('hrlz', [[ 68.343796, 42.088367],
[196.68803 , 26.907867],
[203.00832 , 80.343094],
[ 74.66408 , 95.5236 ]]),
('c1044',[[ 50.215836, 113.09602 ],
[217.72466 , 92.58473 ],
import easyocr
reader = easyocr.Reader(['en']) # need to run only once to load model into memory
reader.readtext(path_to_file, allowlist='0123456789')
img = cv2.imread(fileName)
gray = cv2.cvtColor(img, cv2.COLOR_B
[0,1,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0]
Model(inputs=input_data, outputs=y_pred).summary()
from scipy.misc import imread, imresize
#use width and height from your neural network here.
def load_for_nn(img_file):
image = imread(img_file, flatten=True)
model.fit(X_training_data,Y_training_data,...)
model.evaluate(X_test, y_test, verbose=0)
model.save('my_nn.hdf5')
testing_df = pd.read_csv('data/optdigits/optdigits
Community Discussions
Trending Discussions on keras-ocr
QUESTION
Im running Keras-OCR implementation from the following repository in the Notebook created in GCP VM
https://github.com/faustomorales/keras-ocr
The call to prediction_groups = pipeline.recognize(images) kills the Kernel. The error about Kernel has died is thrown.
The GCP VM is : Version: common-cu113.m87 Based on: Debian GNU/Linux 10 (buster) (GNU/Linux 4.19.0-18-cloud-amd64 x86_64\n)
Can you suggest on how it that to fix this issue?
...ANSWER
Answered 2022-Feb-03 at 19:33The issue was with opencv version. I had latest version which is 5.5.5. It worked when downgraded the version to 4.4
QUESTION
I am working with the keras_ocr recognizer and I want it to scan only inside the bounding boxes which I already selected. The API supports this kind of opperation with recognize_from_boxes
Just so you know: keras_ocr documentation.
ANSWER
Answered 2021-Sep-29 at 20:06In API documentation it mentions that box_groups
should be A list of groups of boxes, one for each image
which means it assumes there might be many boxes in a single image but your input is only a list on boxes
. If you have only one box per image then you can do it this way -
QUESTION
I am doing a License/Number plate recognition project and I'm on the stage of completion but there is a small problem, I have successfully recognized the characters, consider the below example:
This is an input image, I got the prediction as 2791 2g rj14
As you can, the ocr did a great job but the arrangement is destroyed (DESTROYING the whole purpose). Sometimes it does outputs in the correct sequence but sometimes it does not, so when it does not output in the correct sequence I'm trying to develop an algorithm which will take the predicted num_plate
string as input and rearrange it on the basis of my country (India).
Below are some images which tell us about the format of Indian Number/License Plate.
Also, I have collected all the states but for right now, I just want to do for only the 3 states which are: Delhi (DL), Haryana (HR), UttarPradesh (UP). More info : https://en.wikipedia.org/wiki/List_of_Regional_Transport_Office_districts_in_India
...ANSWER
Answered 2021-Aug-12 at 21:00If you can get the coordinates of each identified text box, then:
- Rotate the coordinates so the boxes are parallel with the X-axis
- Scale the Y-coordinates so they can be rounded to integers, so that boxes that are side-by-side will get the same integer Y-coordinate (like a line number)
- Sort the data by Y, then X coordinate
- Extract the texts in that order
Here is an example of such sequence:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install keras-ocr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page