Skip to content

Handy classification model zoo with flat structured code

License

Notifications You must be signed in to change notification settings

neilctwu/modelib-classification

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ModeLIB - SoTA Classification models in Keras / Pytorch

License: WTFPL build

Overview

This repository contains reimplementation of state-of-the-art Image Classification models:

Models Published year Paper
VGG16 2014 Very Deep Convolutional Networks for Large-Scale Image Recognition
InceptionV3 2015 Rethinking the Inception Architecture for Computer Vision
ResNet50 2015 Deep Residual Learning for Image Recognition
DenseNet121 2016 Densely Connected Convolutional Networks
Xception 2016 Xception: Deep Learning with Depthwise Separable Convolutions
ResNeXt50 2016 Aggregated Residual Transformations for Deep Neural Networks
MobileNetV3 2019 Searching for MobileNetV3

The goal of this implementation is to be simple, flat structured,
highly extensible, and easy to integrate into your own projects.

At current moment, you can easily:

  • Build any of the above models in nn.Module class
  • Use models for classification or feature extraction
  • Train/Test models with your in-house data
  • Evaluate models by validation dataset within training

Upcoming features: In the next few days, you will be able to:

  • Local installation / pip installation

Pre-trained model will be readied ASAP, we're seeking for proper cloud storage now.

  • Load pre-trained weights for models
  • Finetune models on your own dataset

Table of contents

  1. About Models
  2. Requesties
  3. Installation
  4. Usage
  5. Contributing
  6. LICENSE

About Models

We collect models that bring huge impacts to Image Classification task, and re-implement it with flat structured code. Although most of these models have several types where their layers altered such as ResNet18/30/50, we only implement one of those in order to remain code legibility.

Model Details

All Params are calculated with input size=(224, 224, 3) and classes=1000. Top-1 Acc. were evaluated by pre-trained model on ImageNet dataset

Name keras torch Pretrained # Params Top-1 Acc.
VGG16 v v x 138,357,544 ?
InceptionV3 v v x 25,081,224 ?
ResNet50 v v x 25,621,352 ?
DenseNet121 v v x 7,899,430 ?
Xception x v x ? ?
ResNeXt50 v v x 38,715,196 ?
MobileNetV3 v v x 4,320,632 ?

Requesties:

Keras:

  • keras v2.2.4

Pytorch:

Installation

This repo doesn't need any installation so far. Please clone the repo and directly import via LOCAL PATH.

$ git clone https://github.com/lsc-psd/modelib-classification

Usage

Example: Train from bash

python train.py -m VGG16 -f PATH_TO_TRAINDATA
"""
option: -m :        neural network structure
        -train :    path to train data folder, structure showed as below:
                    train_folder
                    ├─ Class1 (e.g. dog)
                    |   ├─ image1.jpg
                    |   └─ image2.jpg
                    └─ Class2 (e.g. cat)
                        ├─ image1.jpg
                        └─ image2.jpg
        -valid :    path to valid data folder, structure is same with train
"""        

Example: Customize in python

Load a model in python:

from .models.SOME_MODEL import SOME_MODEL

Contributing

If you want us to add other models, feel free to create an issue, or submit a pull request. If you find a bug or having any question, create an issue and we'll solve it ASAP.

LISCENCE

WTFPL licensed, just do what the fuck you want to public, cheers.

About

Handy classification model zoo with flat structured code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%