Open In Github
Python scripts for performing driver attention estimation using the SAGENet model in Pytorch
Original image:https://en.wikipedia.org/wiki/File:Axis_axis_crossing_the_road.JPG
Requirements
- Check the requirements.txt file.
- For Pytorch, check the official website to install the version matching your machine: https://pytorch.org/
- Additionally, pafy and youtube-dl are required for youtube video inference.
Installation (Except Pytorch)
1
2
pip install -r requirements.txt
pip install pafy youtube_dl=>2021.12.17
Pretrained model
Download the original model (https://drive.google.com/file/d/1GBCxIwAtuaC8EjMmQo4d9kVaGQzZaUZr/view?usp=sharing) and save it into the models folder.
Original Repository
The original repository also contains code for estimating the driver’s attention in Pytorch. This repository uses part of that code to make it easier to use the model in videos, images and webcamera.
Examples
- Image inference:
1
python image_attention_estimation.py
- Video inference:
1
python video_attention_estimation.py
- Webcam inference:
1
python webcam_attention_estimation.py
Inference video Example: https://youtu.be/I-tZNb7tBBw
Original video: https://youtu.be/bUhFfunT2ds
References:
- SAGENet Demo example: https://github.com/anwesanpal/SAGENet_demo
- Original paper: https://arxiv.org/abs/1911.10455