Giter VIP home page Giter VIP logo

vernacular_demo's Introduction

Vernacular Image Classification using the Nanonets API

A project to classify images containing vernacular text using the Nanonets Image classification api. The code is in python

Getting Started

You need to clone the repository using the command:

git clone https://github.com/nanonets/vernacular_demo.git

Prerequisites

  1. python 2.7
  2. pip
  3. requests

On ubuntu run:

sudo apt-get install python-setuptools python-dev build-essential 
sudo pip install requests

Project Structure

project
│   README.md
│
└───code
│   │   create_model.py 
│   │   get_model_state.py 
│   │   predict_file.py
│   │   predict_url.py
│  
│  
└───images
    │
    └───HindiJokes
    │   │   1.jpg
    │   │   2.jpg
    │   │   ...
    │
    └───TeluguJokes
    │   │   1.jpg
    │   │   2.jpg
    │   │   ...
    │   
    └───MarathiJokes
    │   │   1.jpg
    │   │   2.jpg
    │   │   ...
    │   
    └───BengaliJokes
        │   1.jpg
        │   2.jpg
        │   ... 

Running the code

There are 3 steps:

  1. Creating a model
  2. Checking the model state
  3. Testing the model

1. Creating a model

To create a model run:

python code/create_model.py

This will create a model, upload the data and train the model. This will take a while to run. This will also print a MODEL_ID you need this for the next step.

2. Checking model state

To test the state of the model run:

python code/get_model_state.py MODEL_ID

This will output the state of the model. Once the state of the model is trained we can begin using the model. Trained is a MODEL_STATE = 5

3. Testing the model

To test the model once the image has been trained either pass a file or pass a url:

File

python code/predict_file.py MODEL_ID path/of/image/file.jpg

URL

python code/predict_file.py MODEL_ID https://myurl.domain.com/image.jpg

Training Data

The training data we used had the following images:

  1. HindiJokes - 152
  2. MarathiJokes - 150
  3. BengaliJokes - 146
  4. TeluguJokes - 146

RESULTS

The accuracy of the model was 90%

API Documentation

For api documentation please visit https://nanonets.com/documentation/

License

This project is licensed under the MIT License

vernacular_demo's People

Contributors

prats226 avatar sjain07 avatar

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.