This repo is revision version of Erik Linder-Norén's repo
xmltotxt is originated from Isabek Tashiev's repo
As I use origin version, I got several errors and I want to share what I do to overcome
If you are interested, visit origin repository above
한국어 버전은 여기
I made this to use in Windows environment
Some version difference issues are revised
- cut specific class and store that class part only
- classes will be in data/coco.names
- be aware of class index start with 0s
- stored images will be located in 'stroe/'
- below is example case of dog
- .sh files in config, data folder are converted for window users to use
- additional file to apply above easily can be used
- tf1 version codes are converted to tf2 usage
# add tf.compat.v1.disable_eager_execution()
# tf.Summary => tf.compat.v1.Summary# ByteTensor => BoolTensor- Not general purpose
- Now you can apply models with video/cam
- output will be saved in output folder
- press space to pause
- press s to capture
- press r to record
- press t to finish recording
- insert hyperparameter value
- momentum=0.9 -> momentum=float(hyperparams["momentum"]
- eps=1e-5 -> eps=float(hyperparams['decay']- add mish activation
class Mish(nn.Module):
def __init__(self):
super(Mish, self).__init__()
def forward(self, x):
return x * torch.tanh(F.softplus(x))
elif module_def["activation"] == "mish":
modules.add_module(f"mish_{module_i}", Mish())- As not using wget, manually download files via enter urls
- Files below should be located in weights folder
# for v4
# yolov4.conv.137
https://drive.google.com/file/d/1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT/view
# weights
https://drive.google.com/file/d/1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT/view#############################################################################
# for v3
# darknet
https://pjreddie.com/media/files/darknet53.conv.74
# yolo
https://pjreddie.com/media/files/yolov3-tiny.weights
# yolo-tiny
https://pjreddie.com/media/files/yolov3-tiny.weights- After done above, you can use pretrained model immedeately
- After locate images in data/sample_images, and apply below
$ python detect.py- Annotated output will be cound in output folder
- This is added function
- Only per a video now and storing is not realized yet
- Enter the command below and you can see pop-up
$ python video.py- If someone wants to use own webcam, command below would be useful
$ python video.py --cam True- Dataset should have images and labels(annotations)
- Put images in data/custom/images folder
-
Put labels in data/labels folder with *.txt
-
If you have xml version, use xmltotxt
-
Write down your datasets' labels in classes.txt and enter the command below
$ python xmltotxt.py - Outputs can be found in output folder and copy and paste them
- Write down your classes in custom/classes.names
- Should have one empty space
- I merge some functions
- After preparing datsets properly, enter the code below
- It will make yolov3-custom.py and trian.txt, valid.txt for training
$ python build_custom.py -n <number of classes>- Only left thing is training model
$ python3 train.py --model_def config/yolov3-custom.cfg --data_config config/custom.data- You can add
--pretrained_weights weights/darknet53.conv.74to start with pretrained model - Command below acts same except
model_def- It use the latest training model in checkpoint folder
$ python train.py --use_custom True- After training, detect images and videos
__use_customoption will use the latest trained model
# for images
$ python detect.py --use_custom True
# for video/cam
$ python video.py --use_custom True --cam TrueJoseph Redmon, Ali Farhadi
Abstract
We present some updates to YOLO! We made a bunch
of little design changes to make it better. We also trained
this new network that’s pretty swell. It’s a little bigger than
last time but more accurate. It’s still fast though, don’t
worry. At 320 × 320 YOLOv3 runs in 22 ms at 28.2 mAP,
as accurate as SSD but three times faster. When we look
at the old .5 IOU mAP detection metric YOLOv3 is quite
good. It achieves 57.9 AP50 in 51 ms on a Titan X, compared
to 57.5 AP50 in 198 ms by RetinaNet, similar performance
but 3.8× faster. As always, all the code is online at
https://pjreddie.com/yolo/.
[Paper] [Project Webpage] [Authors' Implementation]
@article{yolov3,
title={YOLOv3: An Incremental Improvement},
author={Redmon, Joseph and Farhadi, Ali},
journal = {arXiv},
year={2018}
}

