{"id":21448333,"url":"https://github.com/berensrwu/complex_yolo","last_synced_at":"2025-07-14T20:31:19.951Z","repository":{"id":45245679,"uuid":"302075026","full_name":"BerensRWU/Complex_YOLO","owner":"BerensRWU","description":"PyTorch implementation of ComplexYOLO. This Repository is meant for students to learn object detection and working with LiDAR/RADAR datasets.","archived":false,"fork":false,"pushed_at":"2023-01-23T14:09:07.000Z","size":1414,"stargazers_count":14,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T14:44:41.820Z","etag":null,"topics":["astyx","birds-eye-view","lidar-data","object-detection","radar-data","radar-lidar"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BerensRWU.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-10-07T15:12:18.000Z","updated_at":"2025-01-07T02:35:32.000Z","dependencies_parsed_at":"2023-02-12T23:45:38.589Z","dependency_job_id":null,"html_url":"https://github.com/BerensRWU/Complex_YOLO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BerensRWU/Complex_YOLO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerensRWU%2FComplex_YOLO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerensRWU%2FComplex_YOLO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerensRWU%2FComplex_YOLO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerensRWU%2FComplex_YOLO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BerensRWU","download_url":"https://codeload.github.com/BerensRWU/Complex_YOLO/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerensRWU%2FComplex_YOLO/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265344827,"owners_count":23750566,"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":["astyx","birds-eye-view","lidar-data","object-detection","radar-data","radar-lidar"],"created_at":"2024-11-23T03:15:01.541Z","updated_at":"2025-07-14T20:31:19.418Z","avatar_url":"https://github.com/BerensRWU.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ComplexYOLO\nThis repository contains a PyTorch implementation of [ComplexYOLO](https://arxiv.org/pdf/1803.06199.pdf) using YOLO version 3. It is build to be applied on the data from the Astyx Dataset.\n\n## Installation\n### Requirements\nThe repo was tested on the following systems with the following versions:\n#### Ubuntu 18.04.5 LTS\nTo run the program you need to install those libraries with dependencies:\n  * torch (Tested with pytorch version 1.6.0, torchvision 0.7.0)\n  * cv2 (Tested with opencv-python 4.1.1)\n  * json\n  * numpy \n  * shapely \n  \n  \n#### Windows 10\nTo run the program you need to install those libraries with dependencies:\n  * torch (Tested with pytorch version 1.5.1, torchvision 0.6.1)\n  * cv2\n  * json\n  * numpy \n  * shapely\n\n#### Google Colab\nIn google colab you do not need to install any libraries. But you will need a google account. If you want to use colab you click on \"main.ipynb\" and then on \"open in colab\". After you loged into your google account, you have to upload the scripts and weights to the files in the notebook. Because of the size the Astyx data should be uploaded to your drive and change in ```utils-\u003econfig-\u003eroot_dir``` the root directory to ```drive/My Drive/dataset``` or wherever you saved the dataset. \n\nInstead of flags we can specify in the fourth cell what we want to do. ```visualize=True``` then we will visualize the data, ```estimate_bb=True``` the bounding boxes will be estimated, ```evaluate=True``` the performance of the detector will be evaluated (Then ```estimate_bb``` must also be true). For RADAR data we have to set ```radar=True```.  \n  \n#### Installation for working on your machine\nAn easy way to install libaries on Windows and Linux is with [anaconda](https://www.anaconda.com/) or [miniconda](https://docs.conda.io/en/latest/miniconda.html). Then you can install e.g. torch:\n```\nconda install pytorch torchvision cpuonly -c pytorch\n```\n\n#### Steps\n1. Install all requirements\n1. Download or clone this repo by using ```git clone https://github.com/BerensRWU/ComplexYOLO/``` in the terminal.\n1. Save the Astyx dataset in the folder ```dataset```.(See Section Astyx HiRes).\n1. Run ```main.py --visualize``` to visualize the ground truth data of the validation split from the Astyx dataset.\n1. Download the weights for the RADAR and LiDAR detector from the moodle page of the Lecture.\n1. Save the weights files in a folder ```checkpoints``` in the ```Complex_YOLO``` folder. \n1. Write the iou function in ```utils.py```.\n1. Run ```main.py --estimate_bb``` to estimate the bounding boxes.\n1. Run ```main.py --estimate_bb --visualize``` to estimate the bounding boxes and to visualize the estimation together with the ground truth.\n1. Run ```main.py --estimate_bb --evaluate``` to estimate the bounding boxes and to evaluate them.\n1. If we want to use RADAR data and detector instead of LiDAR we have to use the flag ```radar```. E.g. ```main.py --estimate_bb --evaluate --radar``` will evaluate the performance of the RADAR detector.\n\n## Scripts\nmain.py.\n```\npython main.py\n```\n#### Arguments:\n  * ```estimate_bb```: Flag, to estimate bounding boxes. Default ```False```.\n  * ```radar```: Flag, if True use radar data otherwise lidar. Default ```False```.\n  * ```model_def```: Path to model definition file. Default ```config/yolov3-custom.cfg```.\n  * ```weights_path```: Path where the weights are saved. Default ```checkpoints```.\n  * ```conf_thres```: If bounding boxes are estimated, only those with a confidence greater than thethreshold will be used. Default ```0.5```.\n  * ```iou_thres```: If bounding boxes are estimated, threshold for a correct detection. Default ```0.5```.\n  * ```nms_thres```: If estimated bounding boxes overlap with an IoU greater than the ```nms_thres``` only the bounding box with highest confidence remains. Default ```0.2```.\n  * ```split```: Which split to use ```valid```, ```train```. Default ```valid```.\n  * ```visualize```: Whether to visualize the data.\n  * ```evaluate```: Whether to evaluate the data.\n  \n### visualize.py\nA script for the visualization of the data.\n\n### detector.py\nA script for the detection of bounding boxes from BEV.\n\n### evaluation.py\nA script for the evaluation of the predicted bounding boxes. Calculation whether the prediction is a true positive or not and the average precision.\n\n# How to use this Repo for the LiDAR RADAR lecture\nIf you want to use this repository for the LiDAR RADAR lecture, you have two ways:\n## Terminal\nTo run on your own machine in the terminal, download this repository. Install python and all requirements. Define the path to the data in ```utils/config.py``` it should have the order like in section Astyx HiRes. Now we can run the main function in the terminal:\n```\npython main.py\n```\nThis will check if you have defined the correct path to the data.\n\nIn the next step we will visualize the data:\n```\npython main.py --visualize\n```\nThis will save the BEVs and the ground truth data in the folder ```output```. In default this will use LiDAR data, if we want to use radar data we have to add the flag ```--radar```. The coordinates of the ground truth are in the RADAR coordinatesystem. Because of this the LiDAR data is transformed to the RADAR coordinatesystem.\n\nNext we want to predict bounding boxes. For this we need to download the weights for the network and store them in the folder ```checkpoints```, one for RADAR and one for LiDAR. Also we need non maximum supression, such that predicted bounding boxes that overlap get merged to one. For the non maximum supression we need the intersection over union, to write this function is your task. You find a starting point in ```utils/utils.py``` in the function ```def compute_iou(box, boxes)``` it gets one bounding box as shapley polygon and a list of shapley polygones and returns a list of the corresponding iou values. Then the prediction can be done with the following command:\n```\npython main.py --estimate_bb\n```\nTo visualize and predict we can use the following command:\n```\npython main.py --estimate_bb --visualize\n```\nTo evaluate the predictions we use the average precision, so we need next to a function for the IoU a function for the average precision. In the script ```evaluation.py``` you find funcitons for this.\n\nTo evaluate the prediction we can use the following command:\n```\npython main.py --estimate_bb --evaluate\n```\n\n# Astyx HiRes\nThe Astyx HiRes is a dataset from Astyx for object detection for autonomous driving. Astyx has a sensor setup consisting of camera, LiDAR, RADAR. Additional information can be found here: [Dataset Paper](https://www.astyx.com/fileadmin/redakteur/dokumente/Automotive_Radar_Dataset_for_Deep_learning_Based_3D_Object_Detection.PDF) and [Specification](https://www.astyx.com/fileadmin/redakteur/dokumente/Astyx_Dataset_HiRes2019_specification.pdf)\n\n```\n└── dataset/\n       ├── dataset_astyx_hires2019    \u003c-- 546 data\n       |   ├── calibration \n       |   ├── camera_front\n       |   ├── groundtruth_obj3d\n       |   ├── lidar_vlp16\n       |   ├── radar_6455\n       └── split\n           ├── train.txt\n           └── valid.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberensrwu%2Fcomplex_yolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberensrwu%2Fcomplex_yolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberensrwu%2Fcomplex_yolo/lists"}