{"id":13642591,"url":"https://github.com/ruiminshen/yolo-tf","last_synced_at":"2025-04-20T16:32:55.553Z","repository":{"id":93862672,"uuid":"84625902","full_name":"ruiminshen/yolo-tf","owner":"ruiminshen","description":"TensorFlow implementation of the YOLO (You Only Look Once)","archived":false,"fork":false,"pushed_at":"2019-08-22T20:52:20.000Z","size":163,"stargazers_count":198,"open_issues_count":13,"forks_count":72,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-08-02T01:16:30.469Z","etag":null,"topics":["deep-learning","object-detection","python","tensorflow","yolo","yolo2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruiminshen.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-11T05:18:40.000Z","updated_at":"2024-01-21T03:38:46.000Z","dependencies_parsed_at":"2023-03-29T20:48:05.636Z","dependency_job_id":null,"html_url":"https://github.com/ruiminshen/yolo-tf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruiminshen%2Fyolo-tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruiminshen%2Fyolo-tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruiminshen%2Fyolo-tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruiminshen%2Fyolo-tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruiminshen","download_url":"https://codeload.github.com/ruiminshen/yolo-tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223833200,"owners_count":17210798,"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","object-detection","python","tensorflow","yolo","yolo2"],"created_at":"2024-08-02T01:01:33.586Z","updated_at":"2024-11-09T13:32:25.317Z","avatar_url":"https://github.com/ruiminshen.png","language":"Python","funding_links":[],"categories":["Other Versions of YOLO"],"sub_categories":[],"readme":"This project is deprecated. Please see [yolo2-pytorch](https://github.com/ruiminshen/yolo2-pytorch)\n\n# TensorFlow implementation of the [YOLO (You Only Look Once)](https://arxiv.org/pdf/1506.02640.pdf) and [YOLOv2](https://arxiv.org/pdf/1612.08242.pdf)\n\n## Dependencies\n\n* [Python 3](https://www.python.org/)\n* [TensorFlow 1.0](https://www.tensorflow.org/)\n* [NumPy](www.numpy.org/)\n* [SciPy](https://www.scipy.org/)\n* [Pandas](pandas.pydata.org/)\n* [Matplotlib](https://matplotlib.org/)\n* [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup/)\n* [OpenCV](https://github.com/opencv/opencv)\n* [PIL](http://www.pythonware.com/products/pil/)\n* [tqdm](https://github.com/tqdm/tqdm)\n* [COCO](https://github.com/pdollar/coco) (optional)\n\n## Configuration\n\nConfigurations are mainly defined in the \"config.ini\" file. Such as the detection model (config/model), base directory (config/basedir, which identifies the cache files (.tfrecord), the model data files (.ckpt), and summary data for TensorBoard), and the inference function ([model]/inference). *Notability the configurations can be extended using the \"-c\" command-line argument*.\n\n## Basic Usage\n\n- Download the [PASCAL VOC](http://host.robots.ox.ac.uk/pascal/VOC/) 2007 ([training, validation](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar) and [test](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar)) and 2012 ([training and validation](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar)) dataset. Extract these tars into one directory (such as \"~/Documents/Database/\").\n\n- Download the [COCO](http://mscoco.org/) 2014 ([training](http://msvocds.blob.core.windows.net/coco2014/train2014.zip), [validation](http://msvocds.blob.core.windows.net/coco2014/val2014.zip), and [test](http://msvocds.blob.core.windows.net/coco2014/test2014.zip)) dataset. Extract these zip files into one directory (such as \"~/Documents/Database/coco/\").\n\n- Run \"cache.py\" to create the cache file for the training program. **A verify command-line argument \"-v\" is strongly recommended to check the training data and drop the corrupted examples**, such as the image \"COCO_val2014_000000320612.jpg\" in the COCO dataset.\n\n- Run \"train.py\" to start the training process (the model data saved previously will be loaded if it exists). Multiple command-line arguments can be defined to control the training process. Such as the batch size, the learning rate, the optimization algorithm and the maximum number of steps.\n\n- Run \"detect.py\" to detect objects in an image. Run \"export CUDA_VISIBLE_DEVICES=\" to avoid out of GPU memory error while the training process is running.\n\n## Examples\n\n### Training a 20 classes Darknet YOLOv2 model from a pretrained 80 classes model\n\n- Cache the 20 classes data using the customized config file argument. Cache files (.tfrecord) in \"~/Documents/Database/yolo-tf/cache/20\" will be created.\n\n```\npython3 cache.py -c config.ini config/yolo2/darknet-20.ini -v\n```\n\n- Download a 80 classes Darknet YOLOv2 model (the original file name is \"yolo.weights\", a [version](https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU) from Darkflow is recommanded). In this tutorial I put it in \"~/Downloads/yolo.weights\".\n\n- Parse the 80 classes Darknet YOLOv2 model into Tensorflow format (~/Documents/Database/yolo-tf/yolo2/darknet/80/model.ckpt). A warning like \"xxx bytes remaining\" indicates the file \"yolo.weights\" is not compatiable with the original Darknet YOLOv2 model (defined in the function `model.yolo2.inference.darknet`). **Make sure the 80 classes data is cached before parsing**.\n\n```\npython3 parse_darknet_yolo2.py ~/Downloads/yolo.weights -c config.ini config/yolo2/darknet-80.ini -d\n```\n\n- Transferring the 80 classes Darknet YOLOv2 model into a 20 classes model (~/Documents/Database/yolo-tf/yolo2/darknet/20) except the final convolutional layer. **Be ware the \"-d\" command-line argument will delete the model files and should be used only once when initializing the model**.\n\n```\npython3 train.py -c config.ini config/yolo2/darknet-20.ini -t ~/Documents/Database/yolo-tf/yolo2/darknet/80/model.ckpt -e yolo2_darknet/conv -d\n```\n\n- Using the following command in another terminal and opening the address \"localhost:6006\" in a web browser to monitor the training process.\n\n```\ntensorboard --logdir ~/Documents/Database/yolo-tf/yolo2/darknet/20\n```\n\n- If you think your model is stabilized, press Ctrl+C to cancel and restart the training with a greater batch size.\n\n```\npython3 train.py -c config.ini config/yolo2/darknet-20.ini -b 16\n```\n\n- Detect objects from an image file.\n\n```\npython3 detect.py $IMAGE_FILE -c config.ini config/yolo2/darknet-20.ini\n```\n\n- Detect objects with a camera.\n\n```\npython3 detect_camera.py -c config.ini config/yolo2/darknet-20.ini\n```\n\n## Checklist\n\n- [x] Batch normalization\n- [x] Passthrough layer\n- [ ] Multi-scale training\n- [ ] Dimension cluster\n- [x] Extendable configuration (via \"-c\" command-line argument)\n- [x] PASCAL VOC dataset supporting\n- [x] MS COCO dataset supporting\n- [x] Data augmentation: random crop\n- [x] Data augmentation: random flip horizontally\n- [x] Multi-thread data batch queue\n- [x] Darknet model file (.weights) parser\n- [x] Partial model transferring before training\n- [x] Detection from image\n- [x] Detection from camera\n- [ ] Multi-GPU supporting\n- [ ] Faster NMS using C/C++ or GPU\n- [ ] Performance evaluation\n\n## License\n\nThis project is released as the open source software with the GNU Lesser General Public License version 3 ([LGPL v3](http://www.gnu.org/licenses/lgpl-3.0.html)).\n\n# Acknowledgements\n\nThis project is mainly inspired by the following projects:\n\n* [YOLO (Darknet)](https://pjreddie.com/darknet/yolo/).\n* [Darkflow](https://github.com/thtrieu/darkflow).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruiminshen%2Fyolo-tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruiminshen%2Fyolo-tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruiminshen%2Fyolo-tf/lists"}