{"id":13442666,"url":"https://github.com/ruhyadi/YOLO3D","last_synced_at":"2025-03-20T15:30:28.667Z","repository":{"id":39653469,"uuid":"465132518","full_name":"ruhyadi/YOLO3D","owner":"ruhyadi","description":"YOLO 3D Object Detection for Autonomous Driving Vehicle","archived":false,"fork":false,"pushed_at":"2024-06-30T14:11:08.000Z","size":25402,"stargazers_count":220,"open_issues_count":17,"forks_count":40,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-01T03:41:35.515Z","etag":null,"topics":["3d-object-detection","deep-learning","pytorch","self-driving-car","yolo"],"latest_commit_sha":null,"homepage":"https://ruhyadi.github.io/project/computer-vision/yolo3d","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruhyadi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-02T02:44:10.000Z","updated_at":"2024-07-29T12:24:04.000Z","dependencies_parsed_at":"2024-06-22T21:29:07.427Z","dependency_job_id":null,"html_url":"https://github.com/ruhyadi/YOLO3D","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/ruhyadi%2FYOLO3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2FYOLO3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2FYOLO3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2FYOLO3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruhyadi","download_url":"https://codeload.github.com/ruhyadi/YOLO3D/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221772532,"owners_count":16878121,"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":["3d-object-detection","deep-learning","pytorch","self-driving-car","yolo"],"created_at":"2024-07-31T03:01:48.865Z","updated_at":"2025-03-20T15:30:28.661Z","avatar_url":"https://github.com/ruhyadi.png","language":"Python","funding_links":[],"categories":["Python","Object Detection Applications"],"sub_categories":[],"readme":"# YOLO For 3D Object Detection\n\n#### Note\nI have created a new repository of improvements of YOLO3D wrapped in pytorch lightning and more various object detector backbones, currently on development. Please check [ruhyadi/yolo3d-lightning](https://github.com/ruhyadi/yolo3d-lightning).\n\nUnofficial implementation of [Mousavian et al](https://arxiv.org/abs/1612.00496) in their paper *3D Bounding Box Estimation Using Deep Learning and Geometry*. YOLO3D uses a different approach, as the detector uses YOLOv5 which previously used Faster-RCNN, and Regressor uses ResNet18/VGG11 which was previously VGG19.\n\n![inference](docs/demo.gif)\n\n## Installation\nFor installation you can use virtual environment like anaconda or using docker image. For anaconda follow:\n\n### Ananconda Virtual Env\nCreate conda environment\n```\nconda create -n yolo3d python=3.8 numpy\n```\nInstall PyTorch and torchvision version 1.8 above. If your GPU doesn't support it, please follow [Nelson Liu blogs](https://github.com/nelson-liu/pytorch-manylinux-binaries). \n```\npip install torch==1.8.1 torcvision==0.9.1\n```\nLast, install requirements\n```\npip install -r requirements.txt\n```\n\n### Docker Engine \nDocker engine is easy way to install all you need. Pull docker image from repository:\n```\ndocker pull ruhyadi/yolo3d:latest\n```\nrun docker container from docker image with\n```\ncd ${YOLO3D_DIR}\n./runDocker.sh\n```\nYou will get in to docker container interactive terminal. You can run inference code or flask app, follow code below.\n\n### Download Pretrained Weights\nIn order to run inference code or resuming training, you can download pretrained ResNet18 or VGG11 model. I have train model with 10 epoch each. You can download model with `resnet18` or `vgg11` for `--weights` arguments.\n```\ncd ${YOLO3D_DIR}/weights\npython get_weights.py --weights resnet18\n```\n\n## Inference\nFor inference with pretrained model you can run code below. It can be run in conda env or docker container. \n```\npython inference.py \\\n    --weights yolov5s.pt \\\n    --source eval/image_2 \\\n    --reg_weights weights/resnet18.pkl \\\n    --model_select resnet18 \\\n    --output_path runs/ \\\n    --show_result --save_result\n```\nInference can be run on Colab Notebook, please visit [this link](https://colab.research.google.com/drive/1vhgGRRDqHEqsrqZXBjBJHDFWJk9Pw0qZ?usp=sharing).\n\n## Training\nYOLO3D model can be train with PyTorch or PyTorch Lightning. In order to train you need API KEY for [comet.ml](https://www.comet.ml) (visualize your training loss/accuracy). Follow comet.ml documentation to get API key.\n```\npython train.py \\\n    --epochs 10 \\\n    --batch_size 32 \\\n    --num_workers 2 \\\n    --save_epoch 5 \\\n    --train_path ./dataset/KITTI/training \\\n    --model_path ./weights \\\n    --select_model resnet18 \\\n    --api_key xxx\n```\nIn order train with pytorch lightning run code below:\n```\n!python train_lightning.py \\\n    --train_path dataset/KITTI/training \\\n    --checkpoint_path weights/checkpoints \\\n    --model_select resnet18 \\\n    --epochs 10 \\\n    --batch_size 32 \\\n    --num_workers 2 \\\n    --gpu 1 \\\n    --val_split 0.1 \\\n    --model_path weights \\\n    --api_key xxx\n```\n\n## Reference\n- [YOLOv5 by Ultralytics](https://github.com/ultralytics/yolov5)\n- [shakdem/3D-BoungingBox](https://github.com/skhadem/3D-BoundingBox)\n\n```\n@misc{mousavian20173d,\n      title={3D Bounding Box Estimation Using Deep Learning and Geometry}, \n      author={Arsalan Mousavian and Dragomir Anguelov and John Flynn and Jana Kosecka},\n      year={2017},\n      eprint={1612.00496},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhyadi%2FYOLO3D","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruhyadi%2FYOLO3D","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhyadi%2FYOLO3D/lists"}