Coder Social home page Coder Social logo

glyphreader's Introduction

GlyphReader

A deeplearning approach to classifying the ancient Egyptian hieroglyphs. The source code is written in python3 using the popular Keras framework (with a Tensorflow backend). It attempts to classify images to their Gardiner labels, such as:

Image GitHub Logo GitHub Logo GitHub Logo
Gardener Label S29 V13 G43

In addition to the source code, we also provide a dataset containing 4210 manually annotated images of Egyptian hieroglyphs found in the Pyramid of Unas. The dataset will be automatically downloaded when using train.py to train a new classifier, but is also available here

Requirements

  • pip3 install numpy sklearn scipy pyyaml h5py
  • tensorflow (tested with version 1.3.1)
  • keras (tested with version 2.1.2)

Usage

python3 src/classify.py examples

Expected output:

Predicting the Hieroglyph type...
image name                ::: top 5 best matching hieroglyphs
200000_S29.png            --> ['S29' 'U33' 'R8' 'F12' 'Y3']
200001_V13.png            --> ['V13' 'N37' 'N18' 'V4' 'N35']
200002_V13.png            --> ['V13' 'V31' 'F22' 'N18' 'D156']
200003_G43.png            --> ['G43' 'G17' 'G21' 'W25' 'G25']
200004_D21.png            --> ['D21' 'V30' 'O50' 'D10' 'N5']
200005_O50.png            --> ['O50' 'N5' 'X6' 'D21' 'V25']
200006_X1.png             --> ['X1' 'N29' 'G1' 'D19' 'G4']
200007_M23.png            --> ['M23' 'G39' 'G25' 'I10' 'Aa26']
200008_G43.png            --> ['G43' 'G39' 'G29' 'G1' 'G4']
200009_S29.png            --> ['S29' 'Y3' 'D34' 'N5' 'W18']
200010_V13.png            --> ['V13' 'D52' 'N18' 'G17' 'F22']
200011_M23.png            --> ['M23' 'F16' 'U1' 'N14' 'M4']
200012_G43.png            --> ['G43' 'G21' 'G39' 'G1' 'G17']
200013_D21.png            --> ['D21' 'T30' 'N5' 'X6' 'U1']
200014_O50.png            --> ['O50' 'X1' 'V31' 'U33' 'U1']
200015_V13.png            --> ['V13' 'F22' 'D36' 'D46' 'V4']
200016_G43.png            --> ['G43' 'G17' 'G5' 'G7' 'G4']
200017_S29.png            --> ['S29' 'M195' 'M17' 'W18' 'M1']

Training

In case you would like to train your own classifier, use train.py. It takes no arguments, but when running it for the first time it will download the dataset, and starts training. Training itself consist of 2 phases:

  1. Feature Extraction extract deeplearning features from the images (corresponding to the avg_pool layer from the InceptionV3 network).
  2. Train Classifier train an SVM on the deeplearning features If you do not have a GPU, or simply want to retrain the classifier, it is possible to skip the first step and download the precomputed features directly at http://iamai.nl/downloads/features.npy, store them in intermediates/features.npy.

glyphreader's People

Contributors

morrisfranken 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.