{"id":13441413,"url":"https://github.com/lucastabelini/PolyLaneNet","last_synced_at":"2025-03-20T12:30:26.702Z","repository":{"id":41189088,"uuid":"256029034","full_name":"lucastabelini/PolyLaneNet","owner":"lucastabelini","description":"Code for the paper entitled \"PolyLaneNet: Lane Estimation via Deep Polynomial Regression\" (ICPR 2020)","archived":false,"fork":false,"pushed_at":"2021-05-31T16:34:54.000Z","size":537,"stargazers_count":292,"open_issues_count":1,"forks_count":76,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-01T03:34:21.932Z","etag":null,"topics":["deep-learning","lane-detection","pytorch"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2004.10924","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucastabelini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T20:28:17.000Z","updated_at":"2024-07-25T06:51:16.000Z","dependencies_parsed_at":"2022-09-03T02:50:26.815Z","dependency_job_id":null,"html_url":"https://github.com/lucastabelini/PolyLaneNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucastabelini%2FPolyLaneNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucastabelini%2FPolyLaneNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucastabelini%2FPolyLaneNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucastabelini%2FPolyLaneNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucastabelini","download_url":"https://codeload.github.com/lucastabelini/PolyLaneNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221759971,"owners_count":16876327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","lane-detection","pytorch"],"created_at":"2024-07-31T03:01:33.638Z","updated_at":"2024-10-28T01:30:49.273Z","avatar_url":"https://github.com/lucastabelini.png","language":"Python","funding_links":[],"categories":["Python","2020"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# PolyLaneNet\n![Method overview](figures/method-overview.png \"Method overview\")\n\u003c/div\u003e\n\n## Description\nCode for the [PolyLaneNet paper](https://arxiv.org/abs/2004.10924 \"PolyLaneNet paper\"), accepted to ICPR 2020, by [Lucas Tabelini](https://github.com/lucastabelini), [Thiago M. Paixão](https://sites.google.com/view/thiagopx), [Rodrigo F. Berriel](http://rodrigoberriel.com), [Claudine Badue](https://www.inf.ufes.br/~claudine/),\n[Alberto F. De Souza](https://inf.ufes.br/~alberto), and [Thiago Oliveira-Santos](https://www.inf.ufes.br/~todsantos/home).\n\n**News**: The source code for our new state-of-the-art lane detection method, LaneATT, has been released. Check it out [here](https://github.com/lucastabelini/LaneATT/).\n\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Reproducing the paper results](#reproducing)\n\n\u003ca name=\"installation\"/\u003e\n\n### Installation\nThe code requires Python 3, and has been tested on Python 3.5.2, but should work on newer versions of Python too.\n\nInstall dependencies:\n```\npip install -r requirements.txt\n```\n\n\u003ca name=\"usage\"/\u003e\n\n### Usage\n#### Training\nEvery setting for a training is set through a YAML configuration file.\nThus, in order to train a model you will have to setup the configuration file.\nAn example is shown:\n```yaml\n# Training settings\nexps_dir: 'experiments' # Path to the root for the experiments directory (not only the one you will run)\niter_log_interval: 1 # Log training iteration every N iterations\niter_time_window: 100 # Moving average iterations window for the printed loss metric\nmodel_save_interval: 1 # Save model every N epochs\nseed: 0 # Seed for randomness\nbackup: drive:polylanenet-experiments # The experiment directory will be automatically uploaded using rclone after the training ends. Leave empty if you do not want this.\nmodel:\n  name: PolyRegression\n  parameters:\n    num_outputs: 35 # (5 lanes) * (1 conf + 2 (upper \u0026 lower) + 4 poly coeffs)\n    pretrained: true\n    backbone: 'efficientnet-b0'\n    pred_category: false\nloss_parameters:\n  conf_weight: 1\n  lower_weight: 1\n  upper_weight: 1\n  cls_weight: 0\n  poly_weight: 300\nbatch_size: 16\nepochs: 2695\noptimizer:\n  name: Adam\n  parameters:\n    lr: 3.0e-4\nlr_scheduler:\n  name: CosineAnnealingLR\n  parameters:\n    T_max: 385\n\n# Testing settings\ntest_parameters:\n  conf_threshold: 0.5 # Set predictions with confidence lower than this to 0 (i.e., set as invalid for the metrics)\n\n# Dataset settings\ndatasets:\n  train:\n    type: PointsDataset\n    parameters:\n      dataset: tusimple\n      split: train\n      img_size: [360, 640]\n      normalize: true\n      aug_chance: 0.9090909090909091 # 10/11\n      augmentations: # ImgAug augmentations\n       - name: Affine\n         parameters:\n           rotate: !!python/tuple [-10, 10]\n       - name: HorizontalFlip\n         parameters:\n           p: 0.5\n       - name: CropToFixedSize\n         parameters:\n           width: 1152\n           height: 648\n      root: \"datasets/tusimple\" # Dataset root\n\n  test: \u0026test\n    type: PointsDataset\n    parameters:\n      dataset: tusimple\n      split: val\n      img_size: [360, 640]\n      root: \"datasets/tusimple\"\n      normalize: true\n      augmentations: []\n\n  # val = test\n  val:\n    \u003c\u003c: *test\n```\n\nWith the config file created, run the training script:\n```bash\npython train.py --exp_name tusimple --cfg config.yaml\n```\nThis script's options are:\n```\n  --exp_name            Experiment name.\n  --cfg                 Config file for the training (.yaml)\n  --resume              Resume training. If a training session was interrupted, run it again with the same arguments and this option to resume the training from the last checkpoint.\n  --validate            Wheter to validate during the training session. Was not in our experiments, which means it has not been thoroughly tested.\n  --deterministic       set cudnn.deterministic = True and cudnn.benchmark = False\n```\n\n#### Testing\nAfter training, run the `test.py` script to get the metrics:\n```bash\npython test.py --exp_name tusimple --cfg config.yaml --epoch 2695\n```\nThis script's options are:\n```\n  --exp_name            Experiment name.\n  --cfg                 Config file for the test (.yaml). (probably the same one used in the training)\n  --epoch EPOCH         Epoch to test the model on\n  --batch_size          Number of images per batch\n  --view                Show predictions. Will draw the predictions in an image and then show it (cv.imshow)\n```\n\nIf you have any issues with either training or testing feel free to open an issue.\n\n\u003ca name=\"reproducing\"/\u003e\n\n### Reproducing the paper results\n\n#### Models\nAll models trained for the paper can be found [here](https://drive.google.com/open?id=1oyZncVnUB1GRJl5L4oXz50RkcNFM_FFC \"Models on Google Drive\").\n\n#### Datasets\n- [TuSimple](https://github.com/TuSimple/tusimple-benchmark \"TuSimple\")\n- [ELAS](https://github.com/rodrigoberriel/ego-lane-analysis-system/tree/master/datasets \"ELAS\")\n- [LLAMAS](https://unsupervised-llamas.com/llamas/ \"LLAMAS\")\n\n#### How to\nTo reproduce the results, you can either retrain a model with the same settings (which should yield results pretty close to the reported ones) or just test the model.\nIf you want to retrain, you only need the appropriate YAML settings file, which you can find in the `cfgs` directory.\nIf you just want to reproduce the exact reported metrics by testing the model, you'll have to:\n1. Download the experiment directory. You don't need to download all model checkpoints if you want, you'll only need the last one (`model_2695.pt`, with the exception of the experiments on ELAS and LLAMAS).\n1. Modify all path related fields (i.e., dataset paths and `exps_dir`) in the `config.yaml` file inside the experiment directory.\n1. Move the downloaded experiment to your `exps_dir` folder.\n\nThen, run:\n\n```bash\npython test.py --exp_name $exp_name --cfg $exps_dir/$exp_name/config.yaml --epoch 2695\n```\nReplacing `$exp_name` with the name of the directory you downloaded (the name of the experiment) and `$exps_dir` with the `exps_dir` value you defined inside the `config.yaml` file. The script will look for a directory named `$exps_dir/$exp_name/models` to load the model.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucastabelini%2FPolyLaneNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucastabelini%2FPolyLaneNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucastabelini%2FPolyLaneNet/lists"}