← 开源
Adamdad

keras-YOLOv3-mobilenet

I transfer the backend of yolov3 into Mobilenetv1,VGG16,ResNet101 and ResNeXt101

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
561
Star
162
Fork
+0
本周
8
贡献者
创建于 2018-09-05 · 更新于 2026-06-26 · 今日第 16987 名
主要开发者
Adamdadqqwweeeb02902131

Adamdad/keras-YOLOv3-mobilenet 排名第 16,987,有 561 个星标。

同类别比较

Adamdad/keras-YOLOv3-mobilenet 排名第 16,987,此处有 8 个同类条目;EducationalTestingService/skll 排名第 16,989。

同类别比较
名称排名指标
kaixindelele/DRLib16,978
语言:
Python
星标数:
562
分叉数:
69
简介:
DRLib:a Concise Deep Reinforcement Learning Library, Integrating HER, PER and D2SR for Almost Off-Policy RL Algorithms.
mkshing/ziplora-pytorch16,979
语言:
Python
星标数:
562
分叉数:
36
简介:
Implementation of "ZipLoRA: Any Subject in Any Style by Effectively Merging LoRAs"
voidism/DoLa16,982
语言:
Python
星标数:
562
分叉数:
67
简介:
Official implementation for the paper "DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models"
yandex/faster-rnnlm16,984
语言:
C++
星标数:
562
分叉数:
138
简介:
Faster Recurrent Neural Network Language Modeling Toolkit with Noise Contrastive Estimation and Hierarchical Softmax
EducationalTestingService/skll16,989
语言:
Python
星标数:
561
分叉数:
69
简介:
SciKit-Learn Laboratory (SKLL) makes it easy to run machine learning experiments.
davidtellez/contrastive-predictive-coding16,995
语言:
Python
星标数:
561
分叉数:
119
简介:
Keras implementation of Representation Learning with Contrastive Predictive Coding
google-research/batch_rl16,998
语言:
Python
星标数:
561
分叉数:
73
简介:
Offline Reinforcement Learning (aka Batch Reinforcement Learning) on Atari 2600 games
hustvl/ViTMatte16,999
语言:
Python
星标数:
561
分叉数:
50
简介:
[Information Fusion (Vol.103, Mar. '24)] Boosting Image Matting with Pretrained Plain Vision Transformers
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词Computer vision, Object detection
星标数561
分叉数162
贡献者8
创建日期2018-09-05
更新日期2026-06-26
1 天星标数0
7 天星标数0
排名16,987
上次排名16,775
排名变化-212
7 天星标排名15,842
上次 7 天星标排名15,850
7 天星标排名变化8
总星标排名17,690
上次总星标排名17,656
总星标排名变化-34
国家China
README 摘录

keras-yolo3-Mobilenet Introduction A Keras implementation of YOLOv3 (Tensorflow backend) inspired by allanzelener/YAD2K. 22% | 29fps | Keras on 1080Ti | | YOLOv3-Mobilenet | 320x320 | VOC07+12 | VOC07 | 74. 56% | 29fps | Keras on 1080Ti | | YOLOv3-Mobilenet | 416x416 | VOC07+12 | VOC07 | 76. 82% | 25fps | Keras on 1080Ti | | MobileNet-SSD | 300x300 | VOC07+12+coco | VOC07 | 72. 2% | 151ms | Caffe on Titan X | |SSD,VGG-16 | 300x300 | VOC07+12 | VOC07 | 77. Compared with MobileNet-SSD, YOLOv3-Mobilenet is much better on VOC2007 test, even without

pre-training on Ms-COCO 2. I use the default anchor size that the author cluster on COCO with inputsize of 416\*416, whereas the anchors for VOC 320 input should be smaller. The change of anchor size could gain performance improvement. I only use the pure model of YOLOv3-Mobilenet with no additional tricks. py * **Code for training** * I change some of the code to read in the annotaions seperately (train. txt), remember to change that, and the . txt

file are in the same form descibed below 2. py * **Model_Mobilenet is the yolo model based on Mobilenet** * If you want to go through the source code,ignore the other function,please see the yolo_body (I extract three layers from the Mobilenet to make the prediction) 3. Download YOLOv3 weights from YOLO website. Convert the Darknet YOLO model to a Keras model. For Tiny YOLOv3, just do in a similar way, just specify model path and anchor path

with and . It is passed to the Keras multi_gpu_model(). Generate your own annotation file and class names file. If you use your own anchors, probably some changes are needed. The inference result is not totally the same as Darknet but the difference is small. Replacing PIL with opencv may help a little. Always load pretrained weights and freeze layers in the first stage of training. The training strategy is for reference only. Adjust it according to your dataset

and your goal. For speeding up the training process with frozen layers train_bottleneck. It will compute the bottleneck features of the frozen model first and then only trains the last layers. This makes training on CPU possible in a reasonable time. See this for more information on bottleneck features. Citation Please cite MobileNet-YOLO in your publications if it helps your research:

常见问题

记录了多少星标和分叉?

Adamdad/keras-YOLOv3-mobilenet 有 561 个星标和 162 个分叉。

仓库排名是多少?

Adamdad/keras-YOLOv3-mobilenet 排名第 16,987。

记录的语言和类别是什么?

Adamdad/keras-YOLOv3-mobilenet 有 561 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

Adamdad/keras-YOLOv3-mobilenet 与 EducationalTestingService/skll 比较,后者排名第 16,989,有 561 个星标。

README

keras-yolo3-Mobilenet

Introduction

A Keras implementation of YOLOv3 (Tensorflow backend) inspired by allanzelener/YAD2K.

And I change the backend of darknet53 into

  • [x] Mobilenet
  • [x] VGG16
  • [x] ResNet101
  • [x] ResNeXt101

Experiment on open datasets

Model name InputSize TrainSet TestSet mAP Speed Ps
YOLOv3-Mobilenet 320x320 VOC07 VOC07 64.22% 29fps Keras on 1080Ti
YOLOv3-Mobilenet 320x320 VOC07+12 VOC07 74.56% 29fps Keras on 1080Ti
YOLOv3-Mobilenet 416x416 VOC07+12 VOC07 76.82% 25fps Keras on 1080Ti
MobileNet-SSD 300x300 VOC07+12+coco VOC07 72.7% (unknown)
MobileNet-SSD 300x300 VOC07+12 VOC07 68% (unknown)
Faster RCNN, VGG-16 ~1000x600 VOC07+12 VOC07 73.2% 151ms Caffe on Titan X
SSD,VGG-16 300x300 VOC07+12 VOC07 77.5% 39fps Keras on Titan X

PS:

  1. Compared with MobileNet-SSD, YOLOv3-Mobilenet is much better on VOC2007 test, even without pre-training on Ms-COCO
  2. I use the default anchor size that the author cluster on COCO with inputsize of 416*416, whereas the anchors for VOC 320 input should be smaller. The change of anchor size could gain performance improvement.
  3. Evaluation on https://github.com/Adamdad/Object-Detection-Metrics.git
  4. I only use the pure model of YOLOv3-Mobilenet with no additional tricks.

Guide of keras-yolov3-Mobilenet

1.train_Mobilenet.py

  • Code for training
  • I change some of the code to read in the annotaions seperately (train.txt and val.txt), remember to change that, and the .txt file are in the same form descibed below

2.yolo3/model_Mobilenet.py

  • Model_Mobilenet is the yolo model based on Mobilenet
  • If you want to go through the source code,ignore the other function,please see the yolo_body (I extract three layers from the Mobilenet to make the prediction)

3.yolo_Mobilenet.py

  • Testing on images
Be sure that you do not load pretrained model when training because I did it on keras_applications,and the keras will load the pretrained model for you
if you find anything tricky, contact me as you wish

Evaluation

Please use this repo to draw the RP curve calculate the MAP https://github.com/Adamdad/Object-Detection-Metrics.git


Guide of keras-yolov3

[this is the guide for darknet53 not mobilenet]

Quick Start

  1. Download YOLOv3 weights from YOLO website.
  2. Convert the Darknet YOLO model to a Keras model.
  3. Run YOLO detection.
wget https://pjreddie.com/media/files/yolov3.weights
python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5
python yolo_video.py [OPTIONS...] --image, for image detection mode, OR
python yolo_video.py [video_path] [output_path (optional)]

For Tiny YOLOv3, just do in a similar way, just specify model path and anchor path with --model model_file and --anchors anchor_file.

Usage

Use --help to see usage of yolo_video.py:

usage: yolo_video.py [-h] [--model MODEL] [--anchors ANCHORS]
                     [--classes CLASSES] [--gpu_num GPU_NUM] [--image]
                     [--input] [--output]

positional arguments:
  --input        Video input path
  --output       Video output path

optional arguments:
  -h, --help         show this help message and exit
  --model MODEL      path to model weight file, default model_data/yolo.h5
  --anchors ANCHORS  path to anchor definitions, default
                     model_data/yolo_anchors.txt
  --classes CLASSES  path to class definitions, default
                     model_data/coco_classes.txt
  --gpu_num GPU_NUM  Number of GPU to use, default 1
  --image            Image detection mode, will ignore all positional arguments

  1. MultiGPU usage: use --gpu_num N to use N GPUs. It is passed to the Keras multi_gpu_model().

Training

  1. Generate your own annotation file and class names file.
    One row for one image;
    Row format: image_file_path box1 box2 ... boxN;
    Box format: x_min,y_min,x_max,y_max,class_id (no space).
    For VOC dataset, try python voc_annotation.py
    Here is an example:

    path/to/img1.jpg 50,100,150,200,0 30,50,200,120,3
    path/to/img2.jpg 120,300,250,600,2
    ...
    
  2. Make sure you have run python convert.py -w yolov3.cfg yolov3.weights model_data/yolo_weights.h5
    The file model_data/yolo_weights.h5 is used to load pretrained weights.

  3. Modify train.py and start training.
    python train.py
    Use your trained weights or checkpoint weights with command line option --model model_file when using yolo_video.py Remember to modify class path or anchor path, with --classes class_file and --anchors anchor_file.

If you want to use original pretrained weights for YOLOv3:
1. wget https://pjreddie.com/media/files/darknet53.conv.74
2. rename it as darknet53.weights
3. python convert.py -w darknet53.cfg darknet53.weights model_data/darknet53_weights.h5
4. use model_data/darknet53_weights.h5 in train.py


Some issues to know

  1. The test environment is

    • Python 3.5.2
    • Keras 2.1.5
    • tensorflow 1.6.0
  2. Default anchors are used. If you use your own anchors, probably some changes are needed.

  3. The inference result is not totally the same as Darknet but the difference is small.

  4. The speed is slower than Darknet. Replacing PIL with opencv may help a little.

  5. Always load pretrained weights and freeze layers in the first stage of training. Or try Darknet training. It's OK if there is a mismatch warning.

  6. The training strategy is for reference only. Adjust it according to your dataset and your goal. And add further strategy if needed.

  7. For speeding up the training process with frozen layers train_bottleneck.py can be used. It will compute the bottleneck features of the frozen model first and then only trains the last layers. This makes training on CPU possible in a reasonable time. See this for more information on bottleneck features.

Citation

Please cite MobileNet-YOLO in your publications if it helps your research:

@article{MobileNet-Yolov3,
     Author = {Adam Yang},
     Year = {2018}
}
 @article{yolov3,
     title={YOLOv3: An Incremental Improvement},
     author={Redmon, Joseph and Farhadi, Ali},
     journal = {arXiv},
     year={2018}
}
@article{mobilenets,
     title={MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications},
     author={Andrew G. Howard, Menglong Zhu, Bo Chen,Dmitry Kalenichenko,Weijun Wang, Tobias Weyand,Marco Andreetto, Hartwig Adam},
     journal = {arXiv},
     year = {2017}
}
排名相邻
同类项目