Skip to content

Model designed to recognize a number with two digits, require by the CADC competition, trained on SVHN dataset, implemented using PyTorch.

Notifications You must be signed in to change notification settings

qawsedrg/CADC-SVHN-PyTorch

Repository files navigation

CADC-SVHN-PyTorch

Model designed to recognize a number with two digits, trained on SVHN dataset, implemented using PyTorch. Automatic parameter searching using NNI.

Requirements

  • torch 1.0.1

  • torchvision 0.2.1

  • Pillow

  • protobuf

  • lmdb

  • h5py

    $ sudo apt-get install libhdf5-dev
    $ pip install h5py
    
  • NNI (for AutoML)

Setup

  1. Download SVHN Dataset format 1

  2. Extract to data folder, now your folder structure should be like below:

    SVHNClassifier
        - data
            - extra
                - 1.png 
                - 2.png
                - ...
                - digitStruct.mat
            - test
                - 1.png 
                - 2.png
                - ...
                - digitStruct.mat
            - train
                - 1.png 
                - 2.png
                - ...
                - digitStruct.mat
    

Data pre-process

  1. Convert to LMDB format

    $ python convert_to_lmdb.py --data_dir ./data
    

    Please note that I have cut picture to 2 digits, resize them to 5454 and suppressed all pictures small than 5454, you may make changes in order to meet your requirement.

  2. (Optional) Test for reading LMDBs

    Open read_lmdb_sample.ipynb in Jupyter

Download the converted and processed lmdb dataset

链接: https://pan.baidu.com/s/1Q7d1BrFzn7l5eLAnD8ckyQ 密码: owdc

Train, test and convert to .pt

Open `mobilenet.ipynb` in Jupyter

AutoML

  1. (Optional) modify parameters in search_space.json and in config.yml
  2. $ nnictl create --config ./config.yml

About

Model designed to recognize a number with two digits, require by the CADC competition, trained on SVHN dataset, implemented using PyTorch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages