Giter Site home page Giter Site logo

dtoyoda7 / traffic_sign_detection Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 367.67 MB

Traffic sign recognition is a technology by which a vehicle can recognize road signs placed on the road. This repo is Traffic sign detection using Retinanet and image tiling

Python 8.15% Shell 0.07% Jupyter Notebook 91.78%
machine-learning opencv-python traffic-sign-classification

traffic_sign_detection's Introduction

Traffic Sign Detection

Dataset

https://www.kaggle.com/phhasian0710/za-traffic-2020/download

Method

After taking a quick look at the dataset, we can see that there are many small signs. Which makes the model hard to detect them. One of the possible methods in this scenario is Image Tiling

In detail, I will crop the image into a few parts with some overlaps, predict each part and the original image. Then combine the result using non-max suppression.

1. Image cropping

tiling

2. Predict on each part (the color looks strange because the images are pre-processed)

tiling

3. Predict on the whole image

tiling

3. Combine the results

tiling

Data augmentation

Data augmentation used for trainning includes:

  1. Random brightness adjustment (p=50%)
  2. Random contrast adjustment (p=50%)
  3. Auto crop a region contains at least 1 bouding box (p=50%)
  4. Random horizontal flipping (p=50%)
  5. Random gaussian blur or motion blur (p=50%)

Trainning

python3 train.py --input {image_dir}\
                  --backbone resnet50\
                  --batch-size 4\
                  --checkpoint-dir /content/weights

Inference

python3 prediction.py --input {image_dir}\
                      --output submission.json\
                      --weight weights/weight_resnet50.h5\   # weight file should has format weight_{backbone}.h5
                      --save-dir /content/inference_images   # or "" if you dont want to save images
                      --scales 896,1024                      # Separated by comma
                      --tiling                               # Apply tiling if provided, useful for small objects

Inference result

./images/pred_1.png ./images/pred_2.png ./images/pred_3.png


NOTE

This project is running on Google Colaboratory environment, so it may contain some issues when running on local machine, please don't hesitate to create a new issue


traffic_sign_detection's People

Contributors

dtoyoda7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ai0228

traffic_sign_detection's Issues

Why?

@ptran1203 FYI this person copied your repo and removed all credit, making it look like he wrote all code himself.

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.