Coder Social home page Coder Social logo

spectr's Introduction

SPECTR: Segmentation using Positional Encoding, CNNs, and Transformers


SPECTR by Anshul Ahluwalia, Aditya Singh, and Ranveer Thind

SPECTR Diagram

Visual Results (Cityscapes Image and Predicted Output):

images_slideshow pred_output_slideshow

Installation

To install SPECTR, we first much create a conda environment with the appropriate libraries.

conda env create -f environment.yml
conda activate spectr-v1

Next, install spectr as a module:

pip install -e .

Training Instructions

  1. Download the Cityscapes Dataset onto your local machine and unzip the files: leftImg8bit_trainvaltest.zip and gtFine_trainvaltest.zip.
  2. To preprocess the image data and labels, run python spectr/src/cityscapes_preprocess.py. Before running this script, make sure to modify the file paths to be correct for your machine.
  3. Modify the hyperparameters defined in spectr/config/config.yaml.
  4. Finally, run python spectr/src/lightning_train.py to train the model using the Pytorch Lightning Framework. As training proceeds, a recent copy of your model will be saved in the lightning_logs/checkpoints directory.

Testing Instructions

  1. To evaluate the SPECTR model checkpoint on a random training or testing batch, run python spectr/src/lightning_test.py.
    • This will calculate mIoU for the model on the specific batch and dump all visualizations inside the viz folder.
    • You must specify the absolute file path to the pytorch checkpoint model.

spectr's People

Contributors

adisingh50 avatar anshulcgm avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

spectr's Issues

Resizing semantically segmented labels creates new hex codes which we can't classify

Original Image (1920x1208):
image

Downsampled Image (480x304):
image

Notice that in the downsampled image, there are some intermediate pixels that are uniquely generated. Such as the half-yellow/half-pink pixels or the half-blue/half-pink pixels. This is a problem because when we implement our loss function, we won't be able to determine the class of these unique pixels, for their hex codes don't show up in class_list.json.

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.