├── labels.txt ├── sample_result.PNG ├── sample_result2.PNG ├── cfg ├── ._yolo_custom.cfg └── yolo_custom.cfg ├── sample_img ├── examples1.png ├── test_image1.jpg ├── test_image2.jpg ├── test_image3.jpg ├── test_image4.jpg └── test_image5.jpg └── README.md /labels.txt: -------------------------------------------------------------------------------- 1 | ball 2 | goal post 3 | -------------------------------------------------------------------------------- /sample_result.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_result.PNG -------------------------------------------------------------------------------- /sample_result2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_result2.PNG -------------------------------------------------------------------------------- /cfg/._yolo_custom.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/cfg/._yolo_custom.cfg -------------------------------------------------------------------------------- /sample_img/examples1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/examples1.png -------------------------------------------------------------------------------- /sample_img/test_image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/test_image1.jpg -------------------------------------------------------------------------------- /sample_img/test_image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/test_image2.jpg -------------------------------------------------------------------------------- /sample_img/test_image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/test_image3.jpg -------------------------------------------------------------------------------- /sample_img/test_image4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/test_image4.jpg -------------------------------------------------------------------------------- /sample_img/test_image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-diver/Soccer-Ball-Detection-YOLOv2/HEAD/sample_img/test_image5.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Soccer Ball Detection using YOLOv2 (Darkflow) 2 | 3 | 4 | 5 | ## Introduction 6 | This notebook shows how object detection can be done on your own dataset by training YOLOv2. I am going to use soccer playing images as training dataset as an example to detect soccer ball. After finishing this notebook, you will be able to train your own model, and detect objects that you are interested in. 7 | 8 | ## Contents 9 | 1. How to prepare your own dataset 10 | 2. How to make your own configuration file 11 | 3. How to define options for training for your own dataset 12 | 4. How to load from checkpoint 13 | 5. How to make a prediction 14 | 15 | **Please click the image below to see a video file on Youtube** 16 | 17 | [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/1MwIVcni0P4/0.jpg)](https://www.youtube.com/watch?v=1MwIVcni0P4) 18 | -------------------------------------------------------------------------------- /cfg/yolo_custom.cfg: -------------------------------------------------------------------------------- 1 | [net] 2 | # Testing 3 | batch=1 4 | subdivisions=1 5 | # Training 6 | # batch=64 7 | # subdivisions=8 8 | width=608 9 | height=608 10 | channels=3 11 | momentum=0.9 12 | decay=0.0005 13 | angle=0 14 | saturation = 1.5 15 | exposure = 1.5 16 | hue=.1 17 | 18 | learning_rate=0.001 19 | burn_in=1000 20 | max_batches = 500200 21 | policy=steps 22 | steps=400000,450000 23 | scales=.1,.1 24 | 25 | [convolutional] 26 | batch_normalize=1 27 | filters=32 28 | size=3 29 | stride=1 30 | pad=1 31 | activation=leaky 32 | 33 | [maxpool] 34 | size=2 35 | stride=2 36 | 37 | [convolutional] 38 | batch_normalize=1 39 | filters=64 40 | size=3 41 | stride=1 42 | pad=1 43 | activation=leaky 44 | 45 | [maxpool] 46 | size=2 47 | stride=2 48 | 49 | [convolutional] 50 | batch_normalize=1 51 | filters=128 52 | size=3 53 | stride=1 54 | pad=1 55 | activation=leaky 56 | 57 | [convolutional] 58 | batch_normalize=1 59 | filters=64 60 | size=1 61 | stride=1 62 | pad=1 63 | activation=leaky 64 | 65 | [convolutional] 66 | batch_normalize=1 67 | filters=128 68 | size=3 69 | stride=1 70 | pad=1 71 | activation=leaky 72 | 73 | [maxpool] 74 | size=2 75 | stride=2 76 | 77 | [convolutional] 78 | batch_normalize=1 79 | filters=256 80 | size=3 81 | stride=1 82 | pad=1 83 | activation=leaky 84 | 85 | [convolutional] 86 | batch_normalize=1 87 | filters=128 88 | size=1 89 | stride=1 90 | pad=1 91 | activation=leaky 92 | 93 | [convolutional] 94 | batch_normalize=1 95 | filters=256 96 | size=3 97 | stride=1 98 | pad=1 99 | activation=leaky 100 | 101 | [maxpool] 102 | size=2 103 | stride=2 104 | 105 | [convolutional] 106 | batch_normalize=1 107 | filters=512 108 | size=3 109 | stride=1 110 | pad=1 111 | activation=leaky 112 | 113 | [convolutional] 114 | batch_normalize=1 115 | filters=256 116 | size=1 117 | stride=1 118 | pad=1 119 | activation=leaky 120 | 121 | [convolutional] 122 | batch_normalize=1 123 | filters=512 124 | size=3 125 | stride=1 126 | pad=1 127 | activation=leaky 128 | 129 | [convolutional] 130 | batch_normalize=1 131 | filters=256 132 | size=1 133 | stride=1 134 | pad=1 135 | activation=leaky 136 | 137 | [convolutional] 138 | batch_normalize=1 139 | filters=512 140 | size=3 141 | stride=1 142 | pad=1 143 | activation=leaky 144 | 145 | [maxpool] 146 | size=2 147 | stride=2 148 | 149 | [convolutional] 150 | batch_normalize=1 151 | filters=1024 152 | size=3 153 | stride=1 154 | pad=1 155 | activation=leaky 156 | 157 | [convolutional] 158 | batch_normalize=1 159 | filters=512 160 | size=1 161 | stride=1 162 | pad=1 163 | activation=leaky 164 | 165 | [convolutional] 166 | batch_normalize=1 167 | filters=1024 168 | size=3 169 | stride=1 170 | pad=1 171 | activation=leaky 172 | 173 | [convolutional] 174 | batch_normalize=1 175 | filters=512 176 | size=1 177 | stride=1 178 | pad=1 179 | activation=leaky 180 | 181 | [convolutional] 182 | batch_normalize=1 183 | filters=1024 184 | size=3 185 | stride=1 186 | pad=1 187 | activation=leaky 188 | 189 | 190 | ####### 191 | 192 | [convolutional] 193 | batch_normalize=1 194 | size=3 195 | stride=1 196 | pad=1 197 | filters=1024 198 | activation=leaky 199 | 200 | [convolutional] 201 | batch_normalize=1 202 | size=3 203 | stride=1 204 | pad=1 205 | filters=1024 206 | activation=leaky 207 | 208 | [route] 209 | layers=-9 210 | 211 | [convolutional] 212 | batch_normalize=1 213 | size=1 214 | stride=1 215 | pad=1 216 | filters=64 217 | activation=leaky 218 | 219 | [reorg] 220 | stride=2 221 | 222 | [route] 223 | layers=-1,-4 224 | 225 | [convolutional] 226 | batch_normalize=1 227 | size=3 228 | stride=1 229 | pad=1 230 | filters=1024 231 | activation=leaky 232 | 233 | [convolutional] 234 | size=1 235 | stride=1 236 | pad=1 237 | filters=35 238 | activation=linear 239 | 240 | 241 | [region] 242 | anchors = 0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828 243 | bias_match=1 244 | classes=2 245 | coords=4 246 | num=5 247 | softmax=1 248 | jitter=.3 249 | rescore=1 250 | 251 | object_scale=5 252 | noobject_scale=1 253 | class_scale=1 254 | coord_scale=1 255 | 256 | absolute=1 257 | thresh = .1 258 | random=1 259 | --------------------------------------------------------------------------------