Giter Site home page Giter Site logo

trellixvulnteam / banknotes-classification-rcnn_a8fv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cwanyo/banknotes-classification-rcnn

0.0 0.0 0.0 443.51 MB

Region-based Convolutional Neural Network for banknotes detection

Shell 0.90% JavaScript 0.22% C++ 10.36% Python 67.17% Java 0.10% Makefile 0.03% HTML 0.98% GLSL 0.01% Jupyter Notebook 19.30% Starlark 0.90% Dockerfile 0.03%

banknotes-classification-rcnn_a8fv's Introduction

INSTALLING

1. REQUIRED DEPENDENCIES

  • python 3
  • tensorflow cpu or gpu >= 1.5.0

2. INSTALL DEPENDENCIES USING PIP3:

pip3 install tensorflow-gpu
pip3 install Cython
pip3 install pillow
pip3 install lxml
pip3 install jupyter
pip3 install matplotlib

3. INSTALL PROTOC

SETTING UP

1. SET PATH

  • REPLACE "YOUR_SYSTEM_PATH"
set PYTHONPATH=YOUR_SYSTEM_PATH/models;YOUR_SYSTEM_PATH/models/research;YOUR_SYSTEM_PATH/models/research/slim

set PATH=%PATH%;%PYTHONPATH%

2. PROTOC - GO TO models/research

protoc ./object_detection/protos/*.proto --python_out=.

3. BUILD & INSTALL

py -3 setup.py build
py -3 setup.py install

4. TEST IF IT WORKING OR NOT - GO TO models/research/object_detection

jupyter notebook object_detection_tutorial.ipynb

PREPARING TO TRAIN

1. COLLECT IMAGES

./images
--/test
--/train

2. GENERATE CSV - GO TO models/research/object_detection

py -3 xml_to_csv.py

7. GENERATE TFRECORD

  • OPEN generate_tfrecord.py AND EDIT THE LABEL MAP
# TO-DO replace this with label map
def class_text_to_int(row_label):
    if row_label == 'one':
        return 1
    elif row_label == 'two':
        return 2
    elif row_label == 'three':
        return 3
    else:
        None

THEN,

py -3 generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record

py -3 generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record

8. CREATE label_map.pbtxt

item {
  id: 1
  name: 'one'
}

item {
  id: 2
  name: 'two'
}

item {
  id: 3
  name: 'three'
}
  • EXAMPLE AT models/research/object_detection/data
  • PUT label_map.pbtxt IN THE models/research/object_detection/training

9. CONFIGURE TRAINING

9.1 CONFIGURE MODEL

  • COPY THE CONFIG FILE models/research/object_detection/samples/configs/XXXX.config
  • PUT THE CONFIG IN THE models/research/object_detection/training

9.2 FINE TUNE MODEL

10. EDIT CONFIG FILE FROM (9.1)

  • num_classes = NUM OF CLASSES
  • REPLACE all "PATH_TO_BE_CONFIGURED"
  • eval_config>num_examples = NUMBER OF TEST IMAGES
  • max_detections_per_class = 1
  • max_total_detections = 1

11. TRAINING

  • REPLACE XXXX
py -3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/XXXX.config

12. EVALUATION

  • REPLACE XXXX
py -3 eval.py --logtostderr --train_dir=training/ --pipeline_config_path=training/XXXX.config --checkpoint_dir=training/ --eval_dir=eval/

TENSORBOARD

tensorboard --logdir=training

tensorboard --logdir=eval

13. EXPORT INFERENCE GRAPH

  • REPLACE XXXX and YYYY
py -3 export_inference_graph.py --input_type image_tensor --pipeline_config_path training/XXXX.config --trained_checkpoint_prefix training/model.ckpt-YYYY --output_directory inference_graph

ERRORS

REF

banknotes-classification-rcnn_a8fv's People

Contributors

cwanyo avatar trellixvulnteam 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.