Git Product home page Git Product logo

image-classification's Introduction

Image Classification

Pre-trained VGG-Net Model for image classification using tensorflow

DataSets :

we used each of this DataSets for Image Classification training

After Training :

Resultat of UC Merced Land DataSet After Image Classification Training

Testing the classification of one batch of Pictures from UC Merced Land Use Dataset

test UC Merced Land

Cost and Accuracy :

graph represent the values of both of cost and accuracy each epoch graph

How To use :

you can use this model to classify any DataSet just follow the 4 next instruction

Instalation :

 pip install tensorflow matplotlib opencv-python imutils

Train the Model:

To Train Model for different DataSets or Different Classification follow the steps :

Exploit your DataSet

python dataSetGenerator.py  [-h] --path path [--SaveTo SaveTo] [--resize resize]
                      [--resize_to resize_to] [--percentage percentage]
                      [--dataAug dataAugmentation]
Example
python dataSetGenerator.py  --path Desktop/SIRI-WHU --resize --resize_to 200
Help
image dataSet as numpy file.

       picture dataSets
          |
          |----------class-1
          |        .   |-------image-1
          |        .   |         .
          |        .   |         .
          |        .   |         .
          |        .   |-------image-n
          |        .
          |-------class-n

optional arguments:
  -h, --help            show this help message and exit
  --path path           the path for picture dataSets folder (/)
  --SaveTo SaveTo       the path when we save dataSet (/)
  --resize resize       choose resize the pictures or not
  --resize_to resize_to
                        the new size of pictures
  --percentage percentage
                        how many pictures you want to use for training
  --dataAug dataAugmentation
                        apply data Augmentation Strategy

Train your DataSet

python   train_vgg19.py [-h] --dataset dataset [--batch batch] [--epochs epochs]
Example
python train_vgg19.py  --dataset SIRI-WHU
Help
Train vgg19 [-h] --dataset dataset [--batch batch] [--epochs epochs]

Simple tester for the vgg19_trainable

optional arguments:
  -h, --help         show this help message and exit
  --dataset dataset  DataSet Name
  --batch batch      batch size
  --epochs epochs    number of epoch to train the network

Test your Model :

to test your model

python test_vgg19.py [-h] --dataset dataset [--batch batch]
Example
python test_vgg19.py  --dataset SIRI-WHU

Help

tester for the vgg19_trainable

optional arguments:
  -h, --help         show this help message and exit
  --dataset dataset  DataSet Name
  --batch batch      batch size

Confusion Matrix :

to Draw Confusion matrix (the output in images)

python confusion_matrix.py -h [-h] --dataset dataset [--batch batch] [--showPic showPic]

Help

Draw Confusion Matrix for the vgg19

optional arguments:
  -h, --help         show this help message and exit
  --dataset dataset  DataSet Name
  --batch batch      batch size
  --showPic showPic  Show patch of picture each epoch

For Distributed Tensorflow [optional] :

  1. Download and install nmap

  2. install nmap python module

 pip install python-nmap
  1. Set Workers and pss (parameter servers) devices name in train_vgg19_distibuted
workers = ['PC1','PC2']
pss = ['PC3']

image-classification's People

Contributors

sakhrihoussem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

image-classification's Issues

Confusion matrix

when I try to draw the confusion matrix I'm getting this error

File "confusion_matrix.py", line 54, in <module>
     if args.showPic: picShow(batch[:min_batch], labels[:min_batch], classes, None, prob)
TypeError: only integer scalar arrays can be converted to a scalar index

accuracy

Hello, the accuracy rate is very low after the reproduction procedure. Why is this?

SyntaxError: invalid syntax

When i'm typing this code
python dataSetGenerator.py --path Desktop/SIRI-WHU --resize --resize_to 200
i'm getting this error

def plotFiles(*path,xlabel='# epochs',ylabel='Error and Accu',reduce_each=False,autoClose=False,ff="None",save_as="plot",save_to="images"):
                             ^
SyntaxError: invalid syntax

any idea !!!

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.