{"id":20948441,"url":"https://github.com/devbruce/yolov1-tf2","last_synced_at":"2025-10-11T20:32:29.465Z","repository":{"id":53546436,"uuid":"344376406","full_name":"devbruce/yolov1-tf2","owner":"devbruce","description":"YOLOv1 implementation with TensorFlow2","archived":false,"fork":false,"pushed_at":"2022-12-01T11:30:20.000Z","size":2277,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T19:50:14.080Z","etag":null,"topics":["object-detection","tensorboard","tensorflow2","tf2","yolo","yolov1"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/devbruce.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":"2021-03-04T06:42:54.000Z","updated_at":"2024-09-18T10:11:35.000Z","dependencies_parsed_at":"2023-01-22T14:00:39.763Z","dependency_job_id":null,"html_url":"https://github.com/devbruce/yolov1-tf2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devbruce/yolov1-tf2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbruce%2Fyolov1-tf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbruce%2Fyolov1-tf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbruce%2Fyolov1-tf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbruce%2Fyolov1-tf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devbruce","download_url":"https://codeload.github.com/devbruce/yolov1-tf2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbruce%2Fyolov1-tf2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008618,"owners_count":26084480,"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-11T02:00:06.511Z","response_time":55,"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":["object-detection","tensorboard","tensorflow2","tf2","yolo","yolov1"],"created_at":"2024-11-19T00:18:57.106Z","updated_at":"2025-10-11T20:32:29.440Z","avatar_url":"https://github.com/devbruce.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLOv1 with Tensorflow 2\n\n![tf-v2.5.0](https://img.shields.io/badge/TensorFlow-v2.5.0-orange)\n\nFor ease of implementation, i have not implemented exactly the same as paper.  \nThe things presented below are implemented differently from the paper.\n\n- Backbone network(Used **Xception** instead of network mentioned in the paper.)\n\n- Learning rate schedule(Used `tf.keras.optimizers.schedules.ExponentialDecay`)\n\n- Data augmentations\n\n- Hyper parameters\n\n- And so on ...\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Preview\n\n### Tensorboard\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"./preview/tb_scalars_val_aps.jpeg\"\u003e\n\u003cimg src=\"./preview/tb_scalars_val_aps.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003ca href=\"./preview/tb_scalars_lr_losses.jpeg\"\u003e\n\u003cimg src=\"./preview/tb_scalars_lr_losses.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"./preview/tb_imgs_train.jpeg\"\u003e\n\u003cimg src=\"./preview/tb_imgs_train.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003ca href=\"./preview/tb_imgs_val.jpeg\"\u003e\n\u003cimg src=\"./preview/tb_imgs_val.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n### Inference Visualization\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"./preview/voc2007_test_sample01_viz.jpeg\"\u003e\n\u003cimg src=\"./preview/voc2007_test_sample01_viz.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003ca href=\"./preview/voc2007_test_sample02_viz.jpeg\"\u003e\n\u003cimg src=\"./preview/voc2007_test_sample02_viz.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"./preview/voc2007_test_sample03_viz.jpeg\"\u003e\n\u003cimg src=\"./preview/voc2007_test_sample03_viz.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003ca href=\"./preview/voc2007_test_sample04_viz.jpeg\"\u003e\n\u003cimg src=\"./preview/voc2007_test_sample04_viz.jpeg\" width=\"400\" height=\"240\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Build Environment with Docker\n\n### Build Docker Image\n\n```bash\ndocker build -t ${ImageName}:${ImageTag} .\n```\n\n### Create a Container\n\n- Example\n\n```bash\ndocker run -d -it --gpus all --shm-size=${ShmSize} ${ImageName}:${ImageTag} /bin/bash\n```\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Training Dataset: Pascal VOC Dataset ([Link](http://host.robots.ox.ac.uk/pascal/VOC/))\n\n\u003e Pascal VOC Dataset with [TFDS](https://www.tensorflow.org/datasets/overview)\n\n### Number of Images\n\n|                 | Train | Validation | Test                   |\n|-----------------|-------|------------|------------------------|\n| Pascal VOC 2007 | 2501  | 2510       | 4952 (Used Validation) |\n| Pascal VOC 2012 | 5717  | 5823       | 10991 (No labels)      |\n\n- Training Set: VOC2007 trainval + VOC2012 trainval (Total: 16551)\n- Validation Set: VOC2007 test (Total: 4952)\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Pretrained PB File\n\nTrained with default values of this repo. (Total Epoch: 105)\n\n- **Download pb file: \\\u003c[Google Drive Link](https://drive.google.com/file/d/1s-3HXGmlRUhuZ5uiZzxQDGrfOA5Y-5_a/view?usp=sharing)\\\u003e**\n\npb file is uploaded as `tar.gz`. So, you have to decompress this file like below.\n\n```bash\ntar -zxvf yolo_voc_448x448.tar.gz\n```\n\nIf you want to inference with this pb file, infer to [inference_tutorial.ipynb](./inference_tutorial.ipynb)\n\n\u003cbr\u003e\n\n### Performance\n\n#### Evaluation with VOC2007 test\n\n| class name  | AP         |\n|-------------|------------|\n| dog         | 0.7464     |\n| pottedplant | 0.2250     |\n| car         | 0.5021     |\n| person      | 0.4482     |\n| tvmonitor   | 0.5213     |\n| diningtable | 0.4564     |\n| bicycle     | 0.5927     |\n| chair       | 0.2041     |\n| motorbike   | 0.5595     |\n| sofa        | 0.4801     |\n| bus         | 0.6215     |\n| boat        | 0.3274     |\n| horse       | 0.7049     |\n| aeroplane   | 0.5872     |\n| sheep       | 0.4223     |\n| bottle      | 0.1312     |\n| train       | 0.7917     |\n| cat         | 0.8044     |\n| bird        | 0.4824     |\n| cow         | 0.4548     |\n| **mAP**     | **0.5032** |\n\n\u003cbr\u003e\n\n#### Inference Speed\n\n- GPU(GeForce RTX 3090): About 8 FPS\n- CPU(AMD Ryzen 5 5600X 6-Core Processor): About 4 FPS\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Training Script\n\n\u003e Path: [./voc_scripts/train_voc.py](./voc_scripts/train_voc.py)\n\n```bash\npython train_voc.py\n```\n\n**Options**  \n\nDefault option values are [./configs/configs.py](./configs/configs.py).  \nIf the options are given, the default config values are overridden.  \n\n- `--epochs`: Number of training epochs\n- `--init_lr`: Initial learning rate\n- `--lr_decay_rate`: Learning rate decay rate\n- `--lr_decay_steps`: Learning rate decay steps\n- `--batch_size`: Training batch size\n- `--val_step`: Validation interval during training\n- `--tb_img_max_outputs `: Number of visualized prediction images in tensorboard\n- `--train_ds_sample_ratio`: Training dataset sampling ratio\n- `--val_ds_sample_ratio`: Validation dataset sampling ratio\n\n\u003cbr\u003e\n\n## Evaluation Script\n\n\u003e Path: [./voc_scripts/eval_voc.py](./voc_scripts/eval_voc.py)\n\nEvaluation pretrained model with VOC2007 Test Dataset\n\n```bash\npython eval_voc.py\n```\n\n**Options**  \n\n- `--batch_size`: Evaluation batch size (Default: batch_size of [./configs/configs.py](./configs/configs.py).)\n- `--pb_dir`: Save pb directory path (Default: `./ckpts/voc_ckpts/yolo_voc_448x448`)\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Citation\n\n**You Only Look Once: Unified, Real-Time Object Detection** \\\u003c[arxiv link](https://arxiv.org/abs/1506.02640)\\\u003e\n\n```\n@misc{redmon2016look,\n      title={You Only Look Once: Unified, Real-Time Object Detection}, \n      author={Joseph Redmon and Santosh Divvala and Ross Girshick and Ali Farhadi},\n      year={2016},\n      eprint={1506.02640},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbruce%2Fyolov1-tf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevbruce%2Fyolov1-tf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbruce%2Fyolov1-tf2/lists"}