Git Product home page Git Product logo

pvdn-urban-annotation-poc's Introduction

Detecting Oncoming Vehicles at Night in Urban Scenarios - An Annotation Proof-Of-Concept

This repository contains the code for the paper "Detecting Oncoming Vehicles at Night in Urban Scenarios - An Annotation Proof-Of-Concept".

Dataset

The dataset is available here on kaggle. Please download the dataset before you continue with the next steps.

The dataset only contains the images and original bounding box annotations. To generate the binary masks, follow the next steps.

The data is stored scene-wise. This means that the data for each recorded scene is stored in a separate directory. Each scene directory then contains an image and several annotations folders. For example, this is the structure of scene 3:

00003
    --- images
        --- image1.jpg
        --- image2.jpg
        --- ....
        --- imageN.jpg
    --- annotations1
        --- image1.json
        --- image2.json
        --- ....
        --- imageN.json
    --- annotations5
        --- image1.json
        --- image2.json
        --- ....
        --- imageN.json
    --- annotations8
        --- image1.json
        --- image2.json
        --- ....
        --- imageN.json

The scene was annotated from annotators 1, 5, and 8, thus containing the three distinct annotation directories.

Installation

This repo requires the pytorch & torchvision nightly builds. To install, do the following:

First, install PyTorch nightly:

python3 -m venv venv
source venv bin activate

pip install numpy

# adjust cuda version if necessary
pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu117

Install torchvision:

git clone https://github.com/pytorch/vision.git
cd vision
git checkout d2d448c71b4cb054d160000a0f63eecad7867bdb
python setup.py develop
pip install flake8 typing mypy pytest pytest-mock scipy

Install this repo as a package:

cd ..
pip install -e .

If you want to train the models, login to Weights & Biases:

wandb login

Create the segmentation masks

python3 scripts/create_mask_dataset.py --param-path dataset/best_config.json --data-dir <path/to/dataset/> --mask-subdir majority-best-params --aggregation majority

Create the 5-fold cross validation dataset

python3 scripts/create_k_fold_dataset.py --data-dir <path/to/dataset/> --out-dir <path/to/5-fold-dataset/> --k 5 

Train the model

python training/train_kfold.py --data-dir <path/to/5-fold-dataset/> --num-epochs 200 --learning-rate 0.001 --gamma 4 --out-dir out/ --run-name 5fold-resnet50 --mask-subdir masks/majority-best-params --backbone resnet50 --no-empty-masks

Reproduce annotation results

This notebook walks you through reproducing all the numbers from the analysis of the annotation PoC in the paper.

Reproduce the segmentation method parameter search

The scripts to perform a grid search for all the four segmentation methods mentiond in the paper are located in scripts/grid_search/. For example:

cd scripts/grid_search/
python3 grid_search_adapt_gaussian.py --data-dir <path/to/dataset>

pvdn-urban-annotation-poc's People

Contributors

lukazso avatar

Watchers

 avatar

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.