Giter VIP home page Giter VIP logo

lumen's Introduction

Lumen

Blind companion model created on the occasion of Lauzhack 2020 - Winner of the SBB challenge

โœ… Check our detection result on unseen images here! (YouTube video)

Blico-min

Deep learning

Our Deep model has been designed with the following object detector frameworks.

Efficient det

  • Use 'sbb2coco.py' which adds some missing parts to the data (area, isCrowd, imageSize)
  • Clone and configure Google repository (https://github.com/google/automl/tree/master/efficientdet)
  • Produce the tfrecord chunks from the dataset as examplained in tutorial.ipynb
  • Run training with main.py
  • Run inference with inspect.py

Yolov5

Yolov5 is an interesting repository because of the autoresizing anchors, capable of detecting both small (like buttons) and big objects (like doors) precisely.

Train your model

  • Use sbb2yolo.py which adapts the folder structure and the annotations (xmin,ymin,w,h) to normalized Yolo coordinates (xmid,ymid,w,h)
  • git clone https://github.com/ultralytics/yolov5.git
  • cd yolov5/
  • pip install -r requirements.txt
  • Create config.yaml
 names:
 - "Door button"
 - "Open door"
 - "Door handle"
 - "Door"
 nc: 4
 train: ../dyolo/images/train
 val: ../dyolo/images/val
  • Configure wandb for logging (it's awesome)
  • Train mutilple model such as small for edge devices, large and xlarge for best performance
  • In our case we trained
 train.py --img-size 840 --batch 8 --epochs 20 --data config.yaml --weights yolov5x.pt
 train.py --img-size 420 --batch 32 --epochs 30 --data config.yaml --weights yolov5s.pt
 train.py --img-size 640 --batch 16 --epochs 20 --data config.yaml --weights yolov5l.pt
  • Export the small model in jit version for android
  • Evaluate the labels topping accuracy: combine the xlarge and large models (exp6 and exp10 in our case) and use tta (--augment) which further improve performances
python detect.py --source ../test/ --weights runs/train/exp6/weights/best.pt runs/train/exp10/weights/best.pt --save-txt --conf-thres 0.4 --save-conf --augment

Sources examples:

 0  # webcam
 file.jpg  # image 
 file.mp4  # video
 path/  # directory
 path/*.jpg  # glob
 rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa  # rtsp stream
 rtmp://192.168.1.105/live/test  # rtmp stream
 http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8  # http stream

Inference with our pretrained weights

  • git clone https://github.com/ultralytics/yolov5.git
  • cd yolov5/
  • pip install -r requirements.txt
  • wget -P pretrained https://objectstorage.uk-london-1.oraclecloud.com/n/orasealps/b/LauzHack2020-noid/o/yolov5l.pt
  • wget -P pretrained https://objectstorage.uk-london-1.oraclecloud.com/n/orasealps/b/LauzHack2020-noid/o/yolov5x.pt
  • python detect.py --source ../test/ --weights pretrained/yolov5l.pt pretrained/yolov5x.pt --save-txt --conf-thres 0.4 --save-conf --augment

Sources examples

 0  # webcam
 file.jpg  # image 
 file.mp4  # video
 path/  # directory
 path/*.jpg  # glob
 rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa  # rtsp stream
 rtmp://192.168.1.105/live/test  # rtmp stream
 http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8  # http stream
  • Output will be saved into runs/detect/exp[N]
  • Further postprocessing step is required to adpat labels to other format, check convert_yolo_output.ipynb

The companion app (OBSOLETE, old prototype built fort Lauzhack 2020)

Built with Kotlin (the interface) and Java (the camera and classifier) on Android Studio.

  • The interface is inspired from SBB's original app.

  • The camera is pretty simple in the purpose of assuring the UI/UX fluidity.

  • Implements the AI pytorch model yoloV5s that we trained for this use.

To implement the model please unzip the file from Blico/Interface SBB Blico with cam - test -2/app/src/main/assets/last.torchscript.pt.zip

lumen's People

Contributors

achraf99jday avatar antho1426 avatar nodiz avatar tripincloud avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.