Giter Site home page Giter Site logo

pytorch-hymenoptera's Introduction

pytorch-hymenoptera

Pytorch CV project template for deep learning researchers, take hymenoptera dataset as an example.

Requirement

  • Pytorch 0.3+
  • Torch vision 0.1.9+
  • Python 2.7

Dataset

This template takes the Pytorch official tutorial's hymenoptera dataset as an example, to run the example:

  • Create a directory to store the dataset
cd pytorch-hymenoptera/

mkdir dataset
  • Update the config.json file in /pytorch-hymenoptera/data_loader
{
    "data_dir": "../dataset/hymenoptera_data",
    "batch_size": 4,
    "num_workers": 4
}
  • Download the dataset form here, put it into dataset directory and unzip it
 cd pytorch-hymenoptera/
 cd dataset/
 unzip hymenoptera_data.zip
  • Train and test

Example

  • Train the model, if you use the default model settings(including seed in config.json), you will get 94.118% val accuracy
python train.py
  • Test the model, in this example, we still use the validation set to test our model(don't do this in practice), so you will get the test accuracy near 94.118% too. Note that you should choose the checkpoint file manually
python test.py --checkpoint logging/checkpoint.pth
  • Plot the curve
python plot.py

This will produce two image files: accuracy.jpg, loss.jpg

accuracy loss

  • Resume from previous work
python train.py --resume logging/checkpoint_to_resume.pth

pytorch-hymenoptera's People

Contributors

kexiii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hatleon ngocdat56

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.