{"id":28417666,"url":"https://github.com/apolloauto/apollo-model-yolox","last_synced_at":"2025-10-04T17:47:14.393Z","repository":{"id":206173861,"uuid":"715954255","full_name":"ApolloAuto/apollo-model-yolox","owner":"ApolloAuto","description":"[Apollo] This is the implementation of yolox3d first stage, a camera 2D object detection for autonomous driving perception.","archived":false,"fork":false,"pushed_at":"2023-12-07T09:08:36.000Z","size":11488,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-06-26T13:47:39.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ApolloAuto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-08T07:07:24.000Z","updated_at":"2025-04-24T09:24:01.000Z","dependencies_parsed_at":"2023-11-13T03:35:52.474Z","dependency_job_id":null,"html_url":"https://github.com/ApolloAuto/apollo-model-yolox","commit_stats":null,"previous_names":["apolloauto/apollo-model-yolox"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ApolloAuto/apollo-model-yolox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-model-yolox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-model-yolox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-model-yolox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-model-yolox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApolloAuto","download_url":"https://codeload.github.com/ApolloAuto/apollo-model-yolox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-model-yolox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278350797,"owners_count":25972671,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-04T07:15:25.552Z","updated_at":"2025-10-04T17:47:14.367Z","avatar_url":"https://github.com/ApolloAuto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/logo.png\" width=\"350\"\u003e\u003c/div\u003e\n\u003cimg src=\"assets/sunnyvale.jpeg\" \u003e\n\n## Introduction\nYOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and industrial communities.\nFor more details, please refer to our [report on Arxiv](https://arxiv.org/abs/2107.08430).\n\nThis repo is an implementation of PyTorch version YOLOX, there is also a [MegEngine implementation](https://github.com/MegEngine/YOLOX).\n\n\u003cimg src=\"assets/git_fig.png\" width=\"1000\" \u003e\n\n## Updates!!\n* 【2023/10/23】 We employ YOLOX(commit id ac58e0a5e68e57454b7b9ac822aced493b553c53) as the first stage in [Apollo](https://github.com/ApolloAuto/apollo) camera_detection_multi_stage component.\n* 【2023/02/28】 We support assignment visualization tool, see doc [here](./docs/assignment_visualization.md).\n* 【2022/04/14】 We support jit compile op.\n* 【2021/08/19】 We optimize the training process with **2x** faster training and **~1%** higher performance! See [notes](docs/updates_note.md) for more details.\n* 【2021/08/05】 We release [MegEngine version YOLOX](https://github.com/MegEngine/YOLOX).\n* 【2021/07/28】 We fix the fatal error of [memory leak](https://github.com/Megvii-BaseDetection/YOLOX/issues/103)\n* 【2021/07/26】 We now support [MegEngine](https://github.com/Megvii-BaseDetection/YOLOX/tree/main/demo/MegEngine) deployment.\n* 【2021/07/20】 We have released our technical report on [Arxiv](https://arxiv.org/abs/2107.08430).\n\n## Quick Start\n\n\u003cdetails\u003e\n\u003csummary\u003eInstallation\u003c/summary\u003e\n\nStep1. Install YOLOX from source.\n```shell\n# clone code\ngit clone git@github.com:ApolloAuto/apollo-model-yolox.git\n\ncd apollo-model-yolox\n\n# creat conda env\nconda create -n apollo_yolox python=3.8\nconda activate apollo_yolox\n\n# install requirements\npip3 install -r requirements.txt\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDemo\u003c/summary\u003e\n\nStep1. Download a pretrained model from the benchmark table.\n\n|Model |size | Params\u003cbr\u003e(M) |[Datasets](https://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=2d)| [Class](yolox/data/datasets/voc_classes.py)| weights |\n| ------  |:---: | :---: | :----: | :----: |:----: |\n|[YOLOX-voc-s](./exps/example/yolox_voc/yolox_voc_s.py) |640 | 8.9 | KITTI   | 6| [link](https://github.com/ApolloAuto/apollo-model-yolox/releases/download/model/best_kitti_ckpt.pth) |\n|[YOLOX-voc-s](./exps/example/yolox_voc/yolox_voc_s.py) |640 | 8.9 | L4      | 8| [link](https://github.com/ApolloAuto/apollo-model-yolox/releases/download/model/best_L4_ckpt.pth) |\n\nStep2. For example, here we use best_L4_ckpt model:\n\n```shell\npython tools/demo.py image -n yolox-s -c /path/to/your/best_L4_ckpt.pth --path sample/ --conf 0.25 --nms 0.45 --tsize 640 --save_result --device [cpu/gpu]\n```\nthen you will find result under path `YOLOX_outputs/yolox_s/`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eReproduce our results on KITTI\u003c/summary\u003e\n\nStep1. Prepare KITTI dataset\n```shell\ncd \u003cYOLOX_HOME\u003e\nln -s /path/to/your/KITTI ./datasets/KITTI\n```\n\nStep2. Tools for kitti type datasets\nWe provide tools for KITTI type datasets which can help to trans it to VOC type : [readme](datasets/README.md)\n\nStep3. change kitti configs\n\n1. change [yolox_voc_s](exps/example/yolox_voc/yolox_voc_s.py) \n- class number: 8 to 6\n- data_dir=os.path.join(get_yolox_datadir(), \"CUSTOMER\") to KITTI\n2. change [voc_classes.py](yolox/data/datasets/voc_classes.py) to KITTI class.\n3. modify [yolox_voc_s.py](exps/example/yolox_voc/yolox_voc_s.py) todo items.\n4. modify [voc.py](yolox/data/datasets/voc.py) line 119 change jpg to png\n- self._imgpath = os.path.join(\"%s\", \"JPEGImages\", \"%s.jpg\") # to png\n\n\nStep4. Reproduce our results on KITTI:\n\n```shell\npython3 tools/train.py -f exps/example/yolox_voc/yolox_voc_s.py -d 1 -b 16\n```\nor resume\n```shell\npython3 tools/train.py -f exps/example/yolox_voc/yolox_voc_s.py -d 1 -b 16 -c /path/to/your/latest_ckpt.pth --resume\n```\n\n* -d: number of gpu devices\n* -b: total batch size, the recommended number for -b is num-gpu * 8\n* --fp16: mixed precision training\n* --cache: caching imgs into RAM to accelarate training, which need large system RAM.\n* -c: checkpoint file path\n\nIf you want to visuialize your results, please refer to [Visualization guides](docs/assignment_visualization.md)\n\n\u003cdetails\u003e\n\u003csummary\u003eExport\u003c/summary\u003e\n\nWe support batch testing for fast evaluation:\n\n```shell\npython tools/export_onnx.py --input data -n yolox-s -c YOLOX_outputs/yolox_voc_s/latest_ckpt.pth  --output-name yolox.onnx\n\n```\n* --input: onnx model input blob name.\n* -c: path of model.\n* --output-name: the file name of covert model\n\n\u003c/details\u003e\n\n\n**Multi Machine Training**\n\nWe also support multi-nodes training. Just add the following args:\n* --num\\_machines: num of your total training nodes\n* --machine\\_rank: specify the rank of each node\n\nSuppose you want to train YOLOX on 2 machines, and your master machines's IP is 123.123.123.123, use port 12312 and TCP.\n\nOn master machine, run\n```shell\npython tools/train.py -n yolox-s -b 128 --dist-url tcp://123.123.123.123:12312 --num_machines 2 --machine_rank 0\n```\nOn the second machine, run\n```shell\npython tools/train.py -n yolox-s -b 128 --dist-url tcp://123.123.123.123:12312 --num_machines 2 --machine_rank 1\n```\n\n**Logging to Weights \u0026 Biases**\n\nTo log metrics, predictions and model checkpoints to [W\u0026B](https://docs.wandb.ai/guides/integrations/other/yolox) use the command line argument `--logger wandb` and use the prefix \"wandb-\" to specify arguments for initializing the wandb run.\n\n```shell\npython tools/train.py -n yolox-s -d 8 -b 64 --fp16 -o [--cache] --logger wandb wandb-project \u003cproject name\u003e\n                         yolox-m\n                         yolox-l\n                         yolox-x\n```\n\nAn example wandb dashboard is available [here](https://wandb.ai/manan-goel/yolox-nano/runs/3pzfeom0)\n\n**Others**\n\nSee more information with the following command:\n```shell\npython -m yolox.tools.train --help\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eEvaluation\u003c/summary\u003e\n\nWe support batch testing for fast evaluation:\n\n```shell\npython -m yolox.tools.eval -n  yolox-s -c yolox_s.pth -b 64 --exp_file exps/example/yolox_voc/yolox_voc_s.py -d 8 --conf 0.001 [--fp16] [--fuse]\n                               yolox-m\n                               yolox-l\n                               yolox-x\n```\n* --fuse: fuse conv and bn\n* -d: number of GPUs used for evaluation. DEFAULT: All GPUs available will be used.\n* -b: total batch size across on all GPUs\n\nTo reproduce speed test, we use the following command:\n```shell\npython -m yolox.tools.eval -n  yolox-s -c yolox_s.pth -b 1 --exp_file exps/example/yolox_voc/yolox_voc_s.py -d 1 --conf 0.001 --fp16 --fuse\n                               yolox-m\n                               yolox-l\n                               yolox-x\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eTutorials\u003c/summary\u003e\n\n*  [Training on custom data](docs/train_custom_data.md)\n*  [Caching for custom data](docs/cache.md)\n*  [Manipulating training image size](docs/manipulate_training_image_size.md)\n*  [Assignment visualization](docs/assignment_visualization.md)\n*  [Freezing model](docs/freeze_module.md)\n\n\u003c/details\u003e\n\n## Deployment\n\n\n1. [MegEngine in C++ and Python](./demo/MegEngine)\n2. [ONNX export and an ONNXRuntime](./demo/ONNXRuntime)\n3. [TensorRT in C++ and Python](./demo/TensorRT)\n4. [ncnn in C++ and Java](./demo/ncnn)\n5. [OpenVINO in C++ and Python](./demo/OpenVINO)\n6. [Accelerate YOLOX inference with nebullvm in Python](./demo/nebullvm)\n\n## Cite YOLOX\nIf you use YOLOX in your research, please cite our work by using the following BibTeX entry:\n\n```latex\n @article{yolox2021,\n  title={YOLOX: Exceeding YOLO Series in 2021},\n  author={Ge, Zheng and Liu, Songtao and Wang, Feng and Li, Zeming and Sun, Jian},\n  journal={arXiv preprint arXiv:2107.08430},\n  year={2021}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapolloauto%2Fapollo-model-yolox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapolloauto%2Fapollo-model-yolox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapolloauto%2Fapollo-model-yolox/lists"}