• Stars
    star
    153
  • Rank 241,886 (Top 5 %)
  • Language
    Python
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NanoNets OCR API Example for Python

NanoNets OCR Python Sample


Reading Number Plates

Images and annotations taken from - https://dataturks.com/projects/devika.mishra/Indian_Number_plates

Annotations include bounding boxes for each image and have the same name as the image name. You can find the example to train a model in python, by updating the api-key and model id in corresponding file. There is also a pre-processed json annotations folder that are ready payload for nanonets api.


Build a Number Plate Recognition Model

Note: Make sure you have python and pip installed on your system if you don't visit Python pip

number-plate-detection-gif

Step 1: Clone the Repo, Install dependencies

git clone https://github.com/NanoNets/nanonets-ocr-sample-python.git
cd nanonets-ocr-sample-python
sudo pip install requests tqdm

Step 2: Get your free API Key

Get your free API Key from http://app.nanonets.com/#/keys

Step 3: Set the API key as an Environment Variable

export NANONETS_API_KEY=YOUR_API_KEY_GOES_HERE

Step 4: Create a New Model

python ./code/create-model.py

_Note: This generates a MODEL_ID that you need for the next step

Step 5: Add Model Id as Environment Variable

export NANONETS_MODEL_ID=YOUR_MODEL_ID

_Note: you will get YOUR_MODEL_ID from the previous step

Step 6: Upload the Training Data

The training data is found in images (image files) and annotations (annotations for the image files)

python ./code/upload-training.py

Step 7: Train Model

Once the Images have been uploaded, begin training the Model

python ./code/train-model.py

Step 8: Get Model State

The model takes ~2 hours to train. You will get an email once the model is trained. In the meanwhile you check the state of the model

python ./code/model-state.py

Step 9: Make Prediction

Once the model is trained. You can make predictions using the model

python ./code/prediction.py PATH_TO_YOUR_IMAGE.jpg

Sample Usage:

python ./code/prediction.py ./images/151.jpg

Note the python sample uses the converted json instead of the xml payload for convenience purposes, hence it has no dependencies.

Nanonets PDF to CSV

We've recently launched a tool that lets you easily convert PDFs to CSVs from here

More Repositories

1

RaspberryPi-ObjectDetection-TensorFlow

Object Detection using TensorFlow on a Raspberry Pi
Python
165
star
2

ocr-with-tesseract

A comprehensive tutorial for OCR in python using Tesseract-OCR and OpenCV
Jupyter Notebook
96
star
3

object-detection-sample-python

NanoNets Object Detection API Example for Python
Jupyter Notebook
65
star
4

number-plate-detection

Automatic License Plate Reader using tensorflow attention OCR
Python
57
star
5

IndianRoadsObjectDetectionDataset

Python
47
star
6

TF-OD-Pi-Test

Tensorflow Object Detection Prediction Running on the Raspberry Pi
Python
36
star
7

ocr-python

OCR library to extract text & tables from PDF files and images. Convert any image or PDF to CSV / TXT / JSON / Searchable PDF.
Jupyter Notebook
23
star
8

nanonets-id-card-digitization

Python demo for ID card digitization using Nanonets
Python
23
star
9

bert-text-moderation

BERT + CNN for toxic comments multi label classification.
Jupyter Notebook
23
star
10

invoice-processing-with-python-nanonets

Invoice Processing with Python and Nanonets
23
star
11

object-detection-sample-golang

NanoNets Object Detection API Example for Golang
Go
12
star
12

nanonets-pedestrian-detection

NanoNets Crowd Counting Detection API Example for Python
Python
10
star
13

SignatureDetectionDataset

Python
8
star
14

object-detection-sample-nodejs

NanoNets Object Detection API Example for Node.js
JavaScript
7
star
15

nnblog

Code for NN blog article
HTML
6
star
16

nanonets-cracked-screen-detection

Nanonets. Build your own Cracked Screen Detection Model
Python
5
star
17

image-classification-sample-python

NanoNets Image Classification API Example for Python
Python
5
star
18

multi-label-classification-sample-python

Nanonets API interface for training MultiLabel Image Classification Problem
Python
4
star
19

object-detection-sample-php

PHP code to integrate Nanonets API into your Project
PHP
4
star
20

fashion_mnist

Repository for training Nanonets model on fashion MNIST dataset
Python
4
star
21

nanonets-car-damage-classification

A simple classifier to find if a car in an image is damaged or not
Python
3
star
22

SyncAirtablePostgres

Utility to sync tables from Airtable to Postgres
Python
3
star
23

docker-models

Guide to Dockerizing Deep Learning Models
Python
3
star
24

tutorials

repo with data and code samples for running object detection, classification jobs using Nanonets API.
Jupyter Notebook
2
star
25

nsfw-api

Nanonets NSFW API
Python
2
star
26

celebrity-detection

Celebrity Face detection and identification for 10 Indian celebrity
Python
1
star
27

ic-js-sdk

NanoNets' Image Classification Node.js SDK.
JavaScript
1
star
28

ocr-js-sdk

NanoNets' Optical Character Recognition Node.js SDK.
JavaScript
1
star
29

tutorials-page

JavaScript
1
star
30

nanonets-python-client

pip package
Python
1
star
31

code-samples

Code Sample for Object Detection
JavaScript
1
star