{"id":13642515,"url":"https://github.com/experiencor/keras-yolo3","last_synced_at":"2025-05-15T13:03:55.305Z","repository":{"id":39731299,"uuid":"128623159","full_name":"experiencor/keras-yolo3","owner":"experiencor","description":"Training and Detecting Objects with YOLO3","archived":false,"fork":false,"pushed_at":"2023-09-05T07:29:29.000Z","size":94,"stargazers_count":1612,"open_issues_count":238,"forks_count":857,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-04-07T14:09:45.227Z","etag":null,"topics":["deep-learning","object-detection","yolo"],"latest_commit_sha":null,"homepage":"","language":"Python","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/experiencor.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}},"created_at":"2018-04-08T09:18:10.000Z","updated_at":"2025-04-07T13:03:59.000Z","dependencies_parsed_at":"2023-01-23T02:46:03.362Z","dependency_job_id":"7092df10-470c-4c50-8aff-638e73b9d186","html_url":"https://github.com/experiencor/keras-yolo3","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/experiencor%2Fkeras-yolo3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/experiencor%2Fkeras-yolo3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/experiencor%2Fkeras-yolo3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/experiencor%2Fkeras-yolo3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/experiencor","download_url":"https://codeload.github.com/experiencor/keras-yolo3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961096,"owners_count":21189991,"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","yolo"],"created_at":"2024-08-02T01:01:32.481Z","updated_at":"2025-04-14T20:54:48.287Z","avatar_url":"https://github.com/experiencor.png","language":"Python","funding_links":[],"categories":["Other Versions of YOLO"],"sub_categories":[],"readme":"# YOLO3 (Detection, Training, and Evaluation)\n\n## Dataset and Model\n\nDataset | mAP | Demo | Config | Model\n:---:|:---:|:---:|:---:|:---:\nKangaroo Detection (1 class) (https://github.com/experiencor/kangaroo) | 95% | https://youtu.be/URO3UDHvoLY | check zoo | https://bit.ly/39rLNoE\nLicense Plate Detection (European in Romania) (1 class) (https://github.com/RobertLucian/license-plate-dataset) | 90% | https://youtu.be/HrqzIXFVCRo | check zoo | https://bit.ly/2tIpvPl\nRaccoon Detection (1 class) (https://github.com/experiencor/raccoon_dataset) | 98% | https://youtu.be/lxLyLIL7OsU | check zoo | https://bit.ly/39rLNoE\nRed Blood Cell Detection (3 classes) (https://github.com/experiencor/BCCD_Dataset) | 84% | https://imgur.com/a/uJl2lRI | check zoo | https://bit.ly/39rLNoE\nVOC (20 classes) (http://host.robots.ox.ac.uk/pascal/VOC/voc2012/) | 72% | https://youtu.be/0RmOI6hcfBI | check zoo | https://bit.ly/39rLNoE\n\n## Todo list:\n- [x] Yolo3 detection\n- [x] Yolo3 training (warmup and multi-scale)\n- [x] mAP Evaluation\n- [x] Multi-GPU training\n- [x] Evaluation on VOC\n- [ ] Evaluation on COCO\n- [ ] MobileNet, DenseNet, ResNet, and VGG backends\n\n## Installing\n\nTo install the dependencies, run\n```bash\npip install -r requirements.txt\n```\nAnd for the GPU to work, make sure you've got the drivers installed beforehand (CUDA).\n\nIt has been tested to work with Python 2.7.13 and 3.5.3.\n\n## Detection\n\nGrab the pretrained weights of yolo3 from https://pjreddie.com/media/files/yolov3.weights.\n\n```python yolo3_one_file_to_detect_them_all.py -w yolo3.weights -i dog.jpg``` \n\n## Training\n\n### 1. Data preparation \n\nDownload the Raccoon dataset from from https://github.com/experiencor/raccoon_dataset.\n\nOrganize the dataset into 4 folders:\n\n+ train_image_folder \u003c= the folder that contains the train images.\n\n+ train_annot_folder \u003c= the folder that contains the train annotations in VOC format.\n\n+ valid_image_folder \u003c= the folder that contains the validation images.\n\n+ valid_annot_folder \u003c= the folder that contains the validation annotations in VOC format.\n    \nThere is a one-to-one correspondence by file name between images and annotations. If the validation set is empty, the training set will be automatically splitted into the training set and validation set using the ratio of 0.8.\n\nAlso, if you've got the dataset split into 2 folders such as one for images and the other one for annotations and you need to set a custom size for the validation set, use `create_validation_set.sh` script to that. The script expects the following parameters in the following order:\n```bash\n./create_validation_set.sh $param1 $param2 $param3 $param4\n# 1st param - folder where the images are found\n# 2nd param - folder where the annotations are found\n# 3rd param - number of random choices (aka the size of the validation set in absolute value)\n# 4th param - folder where validation images/annots end up (must have images/annots folders inside the given directory as the 4th param)\n```\n\n### 2. Edit the configuration file\nThe configuration file is a json file, which looks like this:\n\n```python\n{\n    \"model\" : {\n        \"min_input_size\":       352,\n        \"max_input_size\":       448,\n        \"anchors\":              [10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326],\n        \"labels\":               [\"raccoon\"]\n    },\n\n    \"train\": {\n        \"train_image_folder\":   \"/home/andy/data/raccoon_dataset/images/\",\n        \"train_annot_folder\":   \"/home/andy/data/raccoon_dataset/anns/\",      \n          \n        \"train_times\":          10,             # the number of time to cycle through the training set, useful for small datasets\n        \"pretrained_weights\":   \"\",             # specify the path of the pretrained weights, but it's fine to start from scratch\n        \"batch_size\":           16,             # the number of images to read in each batch\n        \"learning_rate\":        1e-4,           # the base learning rate of the default Adam rate scheduler\n        \"nb_epoch\":             50,             # number of epoches\n        \"warmup_epochs\":        3,              # the number of initial epochs during which the sizes of the 5 boxes in each cell is forced to match the sizes of the 5 anchors, this trick seems to improve precision emperically\n        \"ignore_thresh\":        0.5,\n        \"gpus\":                 \"0,1\",\n\n        \"saved_weights_name\":   \"raccoon.h5\",\n        \"debug\":                true            # turn on/off the line that prints current confidence, position, size, class losses and recall\n    },\n\n    \"valid\": {\n        \"valid_image_folder\":   \"\",\n        \"valid_annot_folder\":   \"\",\n\n        \"valid_times\":          1\n    }\n}\n\n```\n\nThe ```labels``` setting lists the labels to be trained on. Only images, which has labels being listed, are fed to the network. The rest images are simply ignored. By this way, a Dog Detector can easily be trained using VOC or COCO dataset by setting ```labels``` to ```['dog']```.\n\nDownload pretrained weights for backend at:\n\nhttps://bit.ly/39rLNoE\n\n**This weights must be put in the root folder of the repository. They are the pretrained weights for the backend only and will be loaded during model creation. The code does not work without this weights.**\n\n### 3. Generate anchors for your dataset (optional)\n\n`python gen_anchors.py -c config.json`\n\nCopy the generated anchors printed on the terminal to the ```anchors``` setting in ```config.json```.\n\n### 4. Start the training process\n\n`python train.py -c config.json`\n\nBy the end of this process, the code will write the weights of the best model to file best_weights.h5 (or whatever name specified in the setting \"saved_weights_name\" in the config.json file). The training process stops when the loss on the validation set is not improved in 3 consecutive epoches.\n\n### 5. Perform detection using trained weights on image, set of images, video, or webcam\n`python predict.py -c config.json -i /path/to/image/or/video`\n\nIt carries out detection on the image and write the image with detected bounding boxes to the same folder.\n\nIf you wish to change the object threshold or IOU threshold, you can do it by altering `obj_thresh` and `nms_thresh` variables. By default, they are set to `0.5` and `0.45` respectively.\n\n## Evaluation\n\n`python evaluate.py -c config.json`\n\nCompute the mAP performance of the model defined in `saved_weights_name` on the validation dataset defined in `valid_image_folder` and `valid_annot_folder`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexperiencor%2Fkeras-yolo3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexperiencor%2Fkeras-yolo3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexperiencor%2Fkeras-yolo3/lists"}