Giter VIP home page Giter VIP logo

flowers-classification's Introduction

Classification of flower images starting from a small dataset

report/images/sal3.png

Installation

Python3 is required alogn with cudnna and CUDA Toolkit.

Use the package manager pip to install the required dependencies.

pip install -r requirements.txt

Download the dataset from https://www.robots.ox.ac.uk/~vgg/data/flowers/102/

Create a folder called data and move the downloaded archive. Then execute

matlab -nodisplay -nosplash -nodesktop -r "run('split_dataset_paper.m');exit;"

in the same folder.

Usage

Training

trainer.py [-h] [--batch [BATCH]] [--arch [ARCHITECTURE]] [--opt [OPTIMIZER]] [--clr [CLR]] [--step [STEP]] [--dropout [DROPOUT]] [--config [CONFIG]] [--mp] [--da] [--epoch [EPOCH]]
optional arguments:
  -h, --help            show this help message and exit
  --batch [BATCH]       Batch size used during training
  --arch [{efficientnetb4,frozenefficientnetb4,inceptionv3,resnet18}]
                        Architecture
  --opt [{Adam,SGD}]    Optimizer
  --clr [{triangular,triangular2,exp}]
                        Cyclical learning rate
  --step [STEP]         Step size
  --dropout [DROPOUT]   Dropout rate (when used with FrozenEfficientNetB4 it's used for the freeze rate)
  --config [CONFIG]     Configuration file
  --mp                  Enable mixed precision operations (16bit-32bit)
  --da                  Enable Data Augmentation
  --epoch [EPOCH]       Set the number of epochs

The script will produce plots and checkpoints in ./output/plots and ./output/checkpoints

Learning Rate Finder

python learningratefinder.py [-h] [--batch [BATCH]] [--arch [ARCHITECTURE]] [--opt [OPTIMIZER]] [--dropout [DROPOUT]] [--config [CONFIG]] [--da] [--freeze [FREEZE]] [--epoch [EPOCH]]
optional arguments:
  -h, --help            show this help message and exit
  --batch [BATCH]       Batch size used during training
  --arch [{efficientnetb4,frozenefficientnetb4,inceptionv3,resnet18}]
                        Architecture
  --opt [{Adam,SGD}]    Optimizer
  --dropout [DROPOUT]   Dropout rate
  --config [CONFIG]     Configuration file
  --da                  Enable Data Augmentation
  --freeze [FREEZE]     Frozen layers
  --epoch [EPOCH]       Set the number of epochs

Visualization

To visualize Saliency Map and Grad-CAM run

python3 visualize.py

The image must be store with the following pattern ./images/{class}/{image}.jpg

Contributing

The repository is hosted in Github https://github.com/firaja/aml

License

MIT

flowers-classification's People

Contributors

davidbertoldi avatar firaja avatar

Stargazers

 avatar

Watchers

 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.