https://github.com/nagelflorian/document-classification
Image classifier based on the Inception model to get predictions on documents
https://github.com/nagelflorian/document-classification
documents flask image-classification inception tensorflow
Last synced: 7 months ago
JSON representation
Image classifier based on the Inception model to get predictions on documents
- Host: GitHub
- URL: https://github.com/nagelflorian/document-classification
- Owner: nagelflorian
- Created: 2017-05-28T22:51:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T22:55:05.000Z (over 8 years ago)
- Last Synced: 2025-03-09T00:32:03.826Z (7 months ago)
- Topics: documents, flask, image-classification, inception, tensorflow
- Language: Python
- Size: 15.6 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Document Image Classifier
This is a simple image classifier based on the [Inception model](https://github.com/google/inception) to get predictions on whether a supplied image is a document or not.
## Getting Started
Install Python dependencies using [PIP](https://pip.pypa.io/en/stable/):
```
pip install -r requirements.txt
```## Training
Add training images in the `training/images` directory like shown below. Due to the usage of the Inception model you can achieve great results with a relatively small data set (~100 images for each category).
```
├── training
│ ├── images
│ │ ├── documents [your training images]
│ │ └── random [your training images]
```Once we have the training images we can start the process of retraining the Inception model.
```
scripts/training.sh
```## Predictions
**Notice that this image classifier currently only works with JPEG images.**
```
$ python src/prediction.py
> document (score = 0.99978)
> random (score = 0.00022)
```## Rest-API (development-only)
For development purposes you can run a simple REST endpoint to serve predictions. For serious production use something like [TensorFlow Serving](https://tensorflow.github.io/serving/) is highly recommended.
```
export FLASK_APP="api.py"
export FLASK_DEBUG=1flask run
```