Skip to content

Latest commit

 

History

History
80 lines (48 loc) · 2.13 KB

README.md

File metadata and controls

80 lines (48 loc) · 2.13 KB

Exploring Box Convolutional Layers

This repo contains code testing using box convolutional layers (see paper, github), which learn the size and location of a convolutional layer, in place of the usual 3x3.

This was a final project for CS231n at Stanford in Spring 2019.

Please see the final report for the full writeup of our findings.

Authors

Getting Started

Installing

To run the models in this repo you must install the Python package box_convolution:

python3 -m pip install git+https://github.com/shrubb/box-convolutions.git
python3 -m box_convolution.test # if throws errors, please open a GitHub issue

Usage

import torch
from box_convolution import BoxConv2d

box_conv = BoxConv2d(16, 8, 240, 320)
help(BoxConv2d)

Running the models

Classification and Segmentation

In order to train the resnet models, run the command:

python scripts/box_res_train.py

To train the box resnet models with, run:

python scripts/res_net_train.py

Argparse is not used, so the parameters have to be adjusted manually within the file.

For each run, the .pkl file of the losses and accuracies will be saved in the same folder.

Use the command visdom in order to see the training process.

Object Detection

The files for object detection can be found in ssd/ and were adapted from this repo.

ssd/ssd.py contains the regular SSD model, box_ssd2.py is SSD with some of the traditional convolutional layers replaced by BoxConv2d, and ssd_full_box.py is SSD where all tradtional convolutional layers which can be are replaced.

Run

# Example
python ssd/train.py --arch full_box_ssd

Data