{"id":21216722,"url":"https://github.com/mingtaoguo/retinanet_tensorflow","last_synced_at":"2025-07-10T11:32:27.490Z","repository":{"id":168646425,"uuid":"224759381","full_name":"MingtaoGuo/RetinaNet_TensorFlow","owner":"MingtaoGuo","description":"Implementation of RetinaNet (focal loss) by TensorFlow (object detection)","archived":false,"fork":false,"pushed_at":"2019-11-29T03:22:24.000Z","size":680,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T13:11:21.118Z","etag":null,"topics":["focal-loss","object-detection","retinanet","tensorflow"],"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/MingtaoGuo.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-29T02:08:07.000Z","updated_at":"2024-02-17T12:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f095a15-47f7-473d-b495-807e19526115","html_url":"https://github.com/MingtaoGuo/RetinaNet_TensorFlow","commit_stats":null,"previous_names":["mingtaoguo/retinanet_tensorflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MingtaoGuo/RetinaNet_TensorFlow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FRetinaNet_TensorFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FRetinaNet_TensorFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FRetinaNet_TensorFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FRetinaNet_TensorFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MingtaoGuo","download_url":"https://codeload.github.com/MingtaoGuo/RetinaNet_TensorFlow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FRetinaNet_TensorFlow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264573157,"owners_count":23630429,"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":["focal-loss","object-detection","retinanet","tensorflow"],"created_at":"2024-11-20T21:55:19.738Z","updated_at":"2025-07-10T11:32:27.484Z","avatar_url":"https://github.com/MingtaoGuo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RetinaNet_TensorFlow\nImplementation of RetinaNet by TensorFlow (object detection)\n\n# Introduction\n![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/introduction.jpg)\n\n### Focal Loss\n![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/formula.jpg)\n``` python\ndef focal_loss(logits, labels, alpha=0.25, gamma=2):\n    pos_pt = tf.clip_by_value(tf.nn.sigmoid(logits), 1e-10, 0.999)\n    fl = labels * tf.log(pos_pt) * tf.pow(1 - pos_pt, gamma) * alpha + (1 - labels) * tf.log(1 - pos_pt) * tf.pow(pos_pt, gamma) * (1 - alpha)\n    fl = -tf.reduce_sum(fl, axis=2)\n    return fl\n```\n# How to use\n### Dataset\nPascal Voc: http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar\n### Training phase\n1. Downloading the pre-trained model of ResNet50, and put it into the folder **resnet_ckpt** \n   \n   Address: http://download.tensorflow.org/models/resnet_v2_50_2017_04_14.tar.gz\n\n2. According to your own dataset, modify the **config.py** by yourself\n3. Executing **train.py** \n### Testing phase\n1. Changing the IMG_PATH or VIDEO_PATH in **test.py** for testing\n2. Executing **test.py**\n\n    Model we trained: https://drive.google.com/open?id=1_j-bjQ_SWT3txqCabM8_Ny0IMUqTb8Lk\n# Requirement\n1. python\n2. tensorflow\n3. pillow\n4. numpy\n5. cv2\n# Results\n|Total Loss|Class Loss|Box Loss|\n|-|-|-|\n|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/total_loss.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/class_loss.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/box_loss.jpg)|\n\n||||\n|-|-|-|\n|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/1.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/8.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/6.jpg)|\n|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/7.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/9.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/4.jpg)|\n|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/2.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/3.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/14.jpg)|\n|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/10.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/12.jpg)|![](https://github.com/MingtaoGuo/RetinaNet_TensorFlow/blob/master/IMGS/13.jpg)|\n\n# Reference\n[1] Lin, Tsung-Yi, et al. \"Focal loss for dense object detection.\" Proceedings of the IEEE international conference on computer vision. 2017.\n# Author\nMingtao Guo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingtaoguo%2Fretinanet_tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingtaoguo%2Fretinanet_tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingtaoguo%2Fretinanet_tensorflow/lists"}