Giter Club home page Giter Club logo

marinecreatureclassification's Introduction

Marine Creature Classfication

Description

This project is my course project for "An introduction to Artificial Intelligence"

Setup

The code relies on the deep learning framework of Pytorch

Requirements

  • Anaconda
  • numpy
  • torch
  • torchvision
  • tqdm
  • matplotlib
  • Pillow
  • bidict
  • torchcam

Dataset

Please download the dataset from here and unzip it. You are recommand to rename the dataset directory into marine-creature-dataset.

Pre-Trained Models

You can download the pretrained model from here.

You are recommanded to put the pretrained model under the ./pretrained_models/ directory.

Train

Run the following command to train on ConvNet:

python train.py --epochs 100 --image_dir /path/to/your/dataset

Or you can train on ResNet101 or DenseNet121 with the folowing command:

python train.py --model resnet101 --epochs 20 --image_dir /path/to/your/dataset
python train.py --model densenet --epochs 20 --image_dir /path/to/your/dataset

During training, you can supervise the process with tensorboard. The best model on validation set will be recorded under the ./logs directory.

Please refer to the options.py for detailed parameters of training.

Inference

Run the following command to inference on trained model:

python inference.py --pretrained_model /path/to/your/model --image_dir /path/to/your/dataset

For example:

python inference.py --pretrained_model ./pretrained_models/densenet.pth --image_dir ./marine-creature-dataset

You can specifify network layer for creating the heatmap by adding the --layer options like:

python inference.py --pretrained_model ./pretrained_models/densenet.pth --image_dir ./marine-creature-dataset --layer net.features

After inference, you can see the classfication precision and recall value on terminal. The visualization output will be recorded under the ./results directory.

Also, please refer to the options.py for detailed parameters of inferencing.

marinecreatureclassification's People

Contributors

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