Lane assist for ETS2, built with the ultra-fast-lane-detection model.

Overview

Euro-Truck-Simulator-2-Lane-Assist

Lane assist for ETS2, built with the ultra-fast-lane-detection model.

This project was made possible by the amazing people behind the original Ultra Fast Lane Detection paper. In addition to ibaiGorordo for his example scripts for Pytorch and rdbender for his sun valley theme for ttk.

Example Video

It is important to note that in the video I overlayed the laneAssist window on top of ETS2, unfortunately I do not yet know how to get it on top without messing with the screen capture.

Installation

Copy the repository ( Code -> Download zip ) and unpack it to a folder. Now install all the requirements.

Requirements

You must have at least python 3.7 installed for pytorch to work. To install pytorch go to their website and select the appropriate options. If you have an nvidia graphics card then select cuda, otherwise go for cpu. If you download cuda then you also have to download the cuda api from NVIDIA.

Other requirements can be installed with pip like this (if you have > python 3.10, then use pip3.10):

pip3 install -r requirements.txt

Lane Detection models

In addition to the normal requirements this application requires a lane detection model to work. This is a new deeper model from Adorable Jiang. So far from the very little testing all the models work. These models will likely run slower but work better, I have added support for these so choose if you want these or the defaults.

To download a pretrained model go to the Ultra Fast Lane Detection github page and scroll down until you see Trained models.

There are two different models to choose from. CUlane is a more stable model, but might not work in more difficult situations (like the road being white). On the other hand Tusimple is a more sporadic model that will almost certainly work in any situation. It is also worth noting that Tusimple in some cases requires some of the top of the dashboard and steering wheel to show, while CUlane doesn't. There is a tradeoff to both but I have included a way to switch between them while running the app, so downloading both of them is no issue. After you have downloaded a model, make a models folder in the root folder of the app (the folder where MainFile.py is) and move the model there.

Preparations

Before even starting the app make sure your ETS2 or any other game is in borderless mode. It is not required for the app to work, but for setting it up it is highly recommended. Also disable automatic indicators in game. To start the app, open a command prompt or terminal in the app's folder ( on windows this can be done by holding alt and right clicking ). Once the terminal is open type:

python3 MainFile.py

This will start the application and you should see two windows. One is the main window where you can start the program and change the settings. The other is the preview to show you what the program sees. Don't worry if it's black, that doesn't mean that it isn't working.

Before pressing Toggle Enable it is important to head over to the settings to configure a couple of important options.

The first is to change the position of the video capture from the general tab. I recommend starting up ETS 2 and setting the game on pause. Then move the window around by changing the position values (I recommend setting them to 0x0 and then going from there) so that the app sees the road, but preferably not the steering wheel as this can throw off the lane detection. Even though it's not recommended you might also need to change the dimensions of the screen capture. This might have to be done on 1080 or 4k monitors for example. Just if you do try to keep the aspect ratio the same (16:9)

The second important option is your input device. Even if you play on a keyboard you must have a controller selected otherwise the app will crash. The default selection is for my G29. If you also have one then be sure to make sure the controller is correct, after that you can head over to the next step.

If you do not play on a G29 then select your controller and additionally select the steering axis ( the blue slider will move with the axis ) and the button to toggle the Lane Assist ( this can usually be found by searching on google for controller button numbers ). In addition you will have to select your indicator buttons.

After that go to the final tab, and if you do have a nvidia gpu then you can enable Use GPU, after that you can hit Change Model.

Finally if you want to save your settings, most of them can be easily changed by editing MainFile.py

Usage

Once all the preparations are done let's actually use the lane assist. When you start the program it will make a virtual xbox 360 controller. You have to set the ingame steering axis to this controller, it will not recognize the controller unless put it as a secondary device. Under the main device (Should be Keyboard + controller) there are a multitude of slots, one of these slots must be the 360. This controller follows your own wheel/gamepad so managing to set it in the settings can be hard. Unfortunately this virtual controller means you will lose all force feedback from your main wheel.

Once the controller is setup in game it's time to use the app. To start the lane assist you can either press the set button on your controller or manually toggle it with Toggle Enable. You should see the lane show up on the preview and after that, Happy Trucking!

You might also like...
Implementation of our paper 'RESA: Recurrent Feature-Shift Aggregator for Lane Detection' in AAAI2021.
Implementation of our paper 'RESA: Recurrent Feature-Shift Aggregator for Lane Detection' in AAAI2021.

RESA PyTorch implementation of the paper "RESA: Recurrent Feature-Shift Aggregator for Lane Detection". Our paper has been accepted by AAAI2021. Intro

LaneAF: Robust Multi-Lane Detection with Affinity Fields

LaneAF: Robust Multi-Lane Detection with Affinity Fields This repository contains Pytorch code for training and testing LaneAF lane detection models i

 CondLaneNet: a Top-to-down Lane Detection Framework Based on Conditional Convolution
CondLaneNet: a Top-to-down Lane Detection Framework Based on Conditional Convolution

CondLaneNet: a Top-to-down Lane Detection Framework Based on Conditional Convolution This is the official implementation code of the paper "CondLaneNe

Code for the IJCAI 2021 paper
Code for the IJCAI 2021 paper "Structure Guided Lane Detection"

SGNet Project for the IJCAI 2021 paper "Structure Guided Lane Detection" Abstract Recently, lane detection has made great progress with the rapid deve

PyTorch implementation of 'Gen-LaneNet: a generalized and scalable approach for 3D lane detection'
PyTorch implementation of 'Gen-LaneNet: a generalized and scalable approach for 3D lane detection'

(pytorch) Gen-LaneNet: a generalized and scalable approach for 3D lane detection Introduction This is a pytorch implementation of Gen-LaneNet, which p

Use tensorflow to implement a Deep Neural Network for real time lane detection
Use tensorflow to implement a Deep Neural Network for real time lane detection

LaneNet-Lane-Detection Use tensorflow to implement a Deep Neural Network for real time lane detection mainly based on the IEEE IV conference paper "To

A lane detection integrated Real-time Instance Segmentation based on YOLACT (You Only Look At CoefficienTs)
A lane detection integrated Real-time Instance Segmentation based on YOLACT (You Only Look At CoefficienTs)

Real-time Instance Segmentation and Lane Detection This is a lane detection integrated Real-time Instance Segmentation based on YOLACT (You Only Look

BitPack is a practical tool to efficiently save ultra-low precision/mixed-precision quantized models.
BitPack is a practical tool to efficiently save ultra-low precision/mixed-precision quantized models.

BitPack is a practical tool that can efficiently save quantized neural network models with mixed bitwidth.

Ultra-Data-Efficient GAN Training: Drawing A Lottery Ticket First, Then Training It Toughly
Ultra-Data-Efficient GAN Training: Drawing A Lottery Ticket First, Then Training It Toughly

Ultra-Data-Efficient GAN Training: Drawing A Lottery Ticket First, Then Training It Toughly Code for this paper Ultra-Data-Efficient GAN Tra

Comments
  • "Use GPU" not functioning properly

    Hi there, I believe that "Use GPU" isn't working properly, I'm running Python 3.8.5 & OpenCV compiled with CUDA enabled as well as the Drivers and Toolkits needed.

    Clicking "Use GPU" does not save the checkmark (is that intended?), and the FPS remains the same, so I believe that it has no effect.

    Any tips to get it running with the GPU? It's unusable with 1.6 FPS so I'd love to get this working at a higher frame rate, thank you!

    PS: My GPU is a RTX 2060 so it should fit the specs.

    opened by ceddose 7
  • Software crashes upon pressing

    Software crashes upon pressing "settings"

    I followed the installation video, step by step and got the software installed. Upon launch, I press settings where the whole software crashes. I get the message "NameError: name 'wheel' is not defined. Screenshot_1

    opened by shambala12 3
  • V0.1.4

    V0.1.4

    V0.1.4 - 20.8.2022

    Minor Update

    Fixed

    • Removed a debug print.
    • Removed reduntant width and height from MainFile.py
    • Set default screencapture position to 0x0 to avoid confusion.
    opened by Tumppi066 0
Releases(v.1.0.0)
  • v.1.0.0(Aug 8, 2022)

    It seems that there is a problem with python 3.11 and 3.10 during installation of pyarrow, to fix this downgrade your python version to 3.9

    (This is fixed with the experimental version, as pyarrow is no longer a requirement.)

    Either download updater.exe or updater.py

    • They are both the same application, but I got some requests for an exe so it is now included. The exe will not detect the current installed version, so the .py is superior.
    • The installation script will always download the most up to date version of the app (optionally even development versions). It will also handle updates and show the current version change log.

    Current installer version is 0.5 (18.11.2022):

    • Added full support for the experimental branch, to see the current features head to my Trello.

    This is the only "release" the app will get (for the foreseeable future atleast) as the installation script always downloads the newest source.

    Source code(tar.gz)
    Source code(zip)
    updater.exe(9.25 MB)
    updater.py(13.36 KB)
Tweesent-back - Tweesent backend uses fastAPI as the web framework

TweeSent Backend Tweesent backend. This repo uses fastAPI as the web framework.

0 Mar 26, 2022
subpixel: A subpixel convnet for super resolution with Tensorflow

subpixel: A subpixel convolutional neural network implementation with Tensorflow Left: input images / Right: output images with 4x super-resolution af

Atrium LTS 2.1k Dec 23, 2022
Code for "Sparse Steerable Convolutions: An Efficient Learning of SE(3)-Equivariant Features for Estimation and Tracking of Object Poses in 3D Space"

Sparse Steerable Convolution (SS-Conv) Code for "Sparse Steerable Convolutions: An Efficient Learning of SE(3)-Equivariant Features for Estimation and

25 Dec 21, 2022
A bare-bones Python library for quality diversity optimization.

pyribs Website Source PyPI Conda CI/CD Docs Docs Status Twitter pyribs.org GitHub docs.pyribs.org A bare-bones Python library for quality diversity op

ICAROS 127 Jan 06, 2023
An Straight Dilated Network with Wavelet for image Deblurring

SDWNet: A Straight Dilated Network with Wavelet Transformation for Image Deblurring(offical) 1. Introduction This repo is not only used for our paper(

FlyEgle 41 Jan 04, 2023
Sudoku solver - A sudoku solver with python

sudoku_solver A sudoku solver What is Sudoku? Sudoku (Japanese: 数独, romanized: s

Sikai Lu 0 May 22, 2022
Bio-OFC gym implementation and Gym-Fly environment

Bio-OFC gym implementation and Gym-Fly environment This repository includes the gym compatible implementation of the Bio-OFC algorithm from the paper

Siavash Golkar 1 Nov 16, 2021
Official code for "Maximum Likelihood Training of Score-Based Diffusion Models", NeurIPS 2021 (spotlight)

Maximum Likelihood Training of Score-Based Diffusion Models This repo contains the official implementation for the paper Maximum Likelihood Training o

Yang Song 84 Dec 12, 2022
Code for "R-GCN: The R Could Stand for Random"

RR-GCN: Random Relational Graph Convolutional Networks PyTorch Geometric code for the paper "R-GCN: The R Could Stand for Random" RR-GCN is an extensi

PreDiCT.IDLab 31 Sep 07, 2022
InferPy: Deep Probabilistic Modeling with Tensorflow Made Easy

InferPy: Deep Probabilistic Modeling Made Easy InferPy is a high-level API for probabilistic modeling written in Python and capable of running on top

PGM-Lab 141 Oct 13, 2022
DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation

DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation This repository is the implementation of DynaTune paper. This folder

4 Nov 02, 2022
TiP-Adapter: Training-free CLIP-Adapter for Better Vision-Language Modeling

TiP-Adapter: Training-free CLIP-Adapter for Better Vision-Language Modeling This is the official code release for the paper 'TiP-Adapter: Training-fre

peng gao 189 Jan 04, 2023
Code for Discriminative Sounding Objects Localization (NeurIPS 2020)

Discriminative Sounding Objects Localization Code for our NeurIPS 2020 paper Discriminative Sounding Objects Localization via Self-supervised Audiovis

51 Dec 11, 2022
Code for ACL2021 long paper: Knowledgeable or Educated Guess? Revisiting Language Models as Knowledge Bases

LANKA This is the source code for paper: Knowledgeable or Educated Guess? Revisiting Language Models as Knowledge Bases (ACL 2021, long paper) Referen

Boxi Cao 30 Oct 24, 2022
Unsupervised Image-to-Image Translation

UNIT: UNsupervised Image-to-image Translation Networks Imaginaire Repository We have a reimplementation of the UNIT method that is more performant. It

Ming-Yu Liu 劉洺堉 1.9k Dec 26, 2022
CenterPoint 3D Object Detection and Tracking using center points in the bird-eye view.

CenterPoint 3D Object Detection and Tracking using center points in the bird-eye view. Center-based 3D Object Detection and Tracking, Tianwei Yin, Xin

Tianwei Yin 134 Dec 23, 2022
Autoregressive Models in PyTorch.

Autoregressive This repository contains all the necessary PyTorch code, tailored to my presentation, to train and generate data from WaveNet-like auto

Christoph Heindl 41 Oct 09, 2022
The implementation of the lifelong infinite mixture model

Lifelong infinite mixture model 📋 This is the implementation of the Lifelong infinite mixture model 📋 Accepted by ICCV 2021 Title : Lifelong Infinit

Fei Ye 5 Oct 20, 2022
Pytorch code for "Text-Independent Speaker Verification Using 3D Convolutional Neural Networks".

:speaker: Deep Learning & 3D Convolutional Neural Networks for Speaker Verification

Amirsina Torfi 114 Dec 18, 2022
On the Limits of Pseudo Ground Truth in Visual Camera Re-Localization

On the Limits of Pseudo Ground Truth in Visual Camera Re-Localization This repository contains the evaluation code and alternative pseudo ground truth

Torsten Sattler 36 Dec 22, 2022