Giter Club home page Giter Club logo

safety-helmet-wearing-dataset's Introduction

SafetyHelmetWearing-Dataset(安全帽佩戴检测数据集)

Safety helmet (hardhat) wearing detect dataset(安全帽佩戴检测数据集, SHWD). We also provide pretrained models.

Introduction

SHWD provide the dataset used for both safety helmet wearing and human head detection. It includes 7581 images with 9044 human safety helmet wearing objects(positive) and 111514 normal head objects(not wearing or negative). The positive objects got from goolge or baidu, and we manually labeld with LabelImg. Some of negative objects got from SCUT-HEAD. We fixed some bugs for original SCUT-HEAD and make the data can be directly loaded as normal Pascal VOC format. Also we provide some pretrained models with MXNet GluonCV.

Dataset and model download

Dataset

BaiduDrive GoogleDrive

Model

BaiduDrive GoogleDrive

Benchmark

model darknet mobile1.0 mobile0.25
map 88.5 86.3 75.0

How to use dataset

We annotate the data as Pascal VOC format:

---VOC2028    
    ---Annotations    
    ---ImageSets    
    ---JPEGImages   

Two object class names for the task, "hat" for positive object and "person" for negative object.

How to run

Dependency

Make sure you install MXNet, GluonCV, OpenCV

Test with pretrained models

Two way to inference.

First way

Download models from link BaiduDrive.

Run "python test_yolo.py" with default settings, or change options:  
--network: darknet/mobile1.0/mobile0.25 network, default darknet53;  
--threshold: confidence that filter object;  
--gpu: use gpu or cpu, default gpu;  
--short: short side input size for original image.

Second way, inference with mxnet symbol

Download symbol models from BaiduDrive, (or GoogleDrive), then inference with symbol:

python test_symbol.py

Notice

1. This repo provide 3 yolo models with different size, default darknet53.
2. Parameter "short" means the input size of short side for original image, you can try larger value if want to detect dense objects or big size image.
3. Hyper-parameter threshold means the confidence for detect, change it for different task.

How to train

You can see function "get_dataset" in the file "train_yolo.py" to set dataset path. An example, download dataset and unzip to the path such as "D:\VOCdevkit\VOC2028", train/val dataset can set as:

train_dataset = VOCLike(root='D:\VOCdevkit', splits=[(2028, 'trainval')])
val_dataset = VOCLike(root='D:\VOCdevkit', splits=[(2028, 'test')])

Then check train_yolo.py to set options and train, such as:

python train_yolo.py --batch-size 4 -j 4 --warmup-epochs 3

Notice

1. One common problem when train yolo is gradient explosion, try more epoches to warmup or use smaller learning rate.
2. Much time spent on dataset loading with CPU, set "-j" number bigger if you have multi-core CPU and will improve train speed.
3. If train on Windows, sometimes program may blocked, see https://discuss.gluon.ai/t/topic/9388/11, if train on Linux make sure you have enough share memory.

Demo

safety-helmet-wearing-dataset's People

Contributors

njvisionpower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safety-helmet-wearing-dataset's Issues

gluoncv

请问这是为何:
INFO:root:[Epoch 0] Training cost: 54.634, ObjLoss=1272.633, BoxCenterLoss=15.013, BoxScaleLoss=13.004, ClassLoss=7.164
Traceback (most recent call last):
File "train_yolo.py", line 346, in
train(net, train_data, val_data, eval_metric, ctx, args)
File "train_yolo.py", line 299, in train
map_name, mean_ap = validate(net, val_data, ctx, eval_metric)
File "train_yolo.py", line 184, in validate
return eval_metric.get()
File "C:\Users\Lenovo.virtualenvs\Safety-Helmet-Wearing-Dataset-master-lk7_jszv\lib\site-packages\gluoncv\utils\metrics\voc_detection.py", line 57, in get
self._update() # update metric at this time
File "C:\Users\Lenovo.virtualenvs\Safety-Helmet-Wearing-Dataset-master-lk7_jszv\lib\site-packages\gluoncv\utils\metrics\voc_detection.py", line 181, in _update
recall, precs = self._recall_prec()
File "C:\Users\Lenovo.virtualenvs\Safety-Helmet-Wearing-Dataset-master-lk7_jszv\lib\site-packages\gluoncv\utils\metrics\voc_detection.py", line 197, in _recall_prec
n_fg_class = max(self._n_pos.keys()) + 1
ValueError: max() arg is an empty sequence

improve

How to improve the code and use the computer's camera to detect the safety helmet

请问windows下运行退出原因

我在T430本子上的win10 x64跑这个程序,进入到train()函数后,没有任何提示就退出了。跟踪了一下,发现执行完这个语句后退出的:net.collect_params().reset_ctx(ctx) 。 可以讨教下原因吗?我检查了下我的cuda是8.0, python 3.6.6。是不是我下的mxnet-cu80/gluoncv/opencv/ 这3个包版本不对呢?

mxnet.base.MXNetError

Hello author, I would like to ask a question, when I was running test_yolo. Py, there was such a mistake: "mxnet.base.mxneterror: [19:26:26] C:\Jenkins\workspace\mxnet\mxnet\3rdparty\dmlc-core\ SRC \ IO \local_filesys. Cc :209: Check failed: allow_null:LocalFileSystem::Open "darknet.params": No such file or directory", how should I solve?Looking forward to your reply!

Download model outside China

Dear Nan Jing,

Can you provide another way to download models?! I'm from Brazil and can't download model from Baidu Drive.

Best regards,

Renato.

检测输出结果咨询

你好,我是目标检测新手,您那个test_yolo.py 输出是检测框好的图片,我怎么获取一张图片检测输出的结果,就是python 代码中取到识别的标签和位置

dataset issues

000377.xml has 4 dogs annotaions. but the 000377.jpg image does NOT have dog. The dataset download from baidu pan is correct?

                dog
                Unspecified
                0
                1
                
                        622
                        102
                        705
                        185
                
        

mxnet

你好,麻烦问一下这个问题怎么解决啊
mxnet.base.MXNetError: [16:50:21] src/ndarray/ndarray.cc:1285: GPU is not enable

caffe 训练数据集

您好,我还有个问题咨询下,您提供的数据集我可以直接拿来在caffe-ssd框架下训练吗?我看caffe VOC0712 数据集里面 ImageSets Main, txt 文件里名称后面有-1 标注,我尝试直接用VOC2028 ,create_list.sh 都没成功,不知是否我使用不当

输出结果请教,谢谢

你好,为什么我在使用图像进行检测的时候,检测出的人头数永远是100吖,不管里面有几个人头,然后超出的部分全是0。求指教,谢谢!!

model and weights

can you provide your pre-trained model and weights? because my computer have no gpu. So it may take a long long time to train. My teacher need me research object detection of helmet. in the school. If you can, thanks a lot for you please...

About “json” file

Hello, thank you very much for your previous answer. I want to ask you how to generate the json file in the symbol file. After training, only the following: "yolo3_darknet53_voc_best.params", "yolo3_darknet53_voc_best_map" and "yolo3_darknet53_voc_train", Looking forward to your reply, thank you!

dataset license question

hi,

many thanks for your work.

could i use this dataset for acdemic purpose to evaluate the effectiveness of my proposed model?

if possible, there is any paper or patent, book that can be cited?

many thanks

ImportError: cannot import name 'SyncBatchNorm'

File "F:\Anaconda\envs\NLPenv\lib\site-packages\gluoncv\model_zoo\faster_rcnn\faster_rcnn.py", line 10, in
from mxnet.gluon.contrib.nn import SyncBatchNorm
ImportError: cannot import name 'SyncBatchNorm'

How to solve the problem that the input image can't be decoded

Have you ever met the decoded input image?
And the error is displayed as below
"mxnet.base.MXNetError: [14:35:46] src/io/image_io.cc:147: Check failed: !res.empty(): Decoding failed. Invalid image file."
If you have ever met, how did you solve the problem?

训练所需配置

作者您好,非常感谢开源这么棒的模型和训练方法。如果我要训练自己的数据集,请问对于电脑配置的要求是怎么样的?一般要训练多长时间呢?我的电脑配置是:

内存:16G

处理器:Intel® Core™ i5-9400F CPU @ 2.90GHz × 6

显卡:GeForce GTX 1060 6GB/PCIe/SSE2

YOLO3 异常退出

我试图运行test_yolo.py. 但是我得到如下的错误:

python test-yolo.py
use darknet to extract feature
Illegal instruction (core dumped)

这是我的conda环境:

Name Version Build Channel

_libgcc_mutex 0.1 main
_mutex_mxnet 0.0.40 mkl
asn1crypto 1.0.1 py37_0
blas 1.0 mkl
bzip2 1.0.8 h7b6447c_0
ca-certificates 2019.8.28 0
cairo 1.14.12 h8948797_3
certifi 2019.9.11 py37_0
cffi 1.12.3 py37h2e261b9_0
chardet 3.0.4 py37_1003
cryptography 2.7 py37h1ba5d50_0
cycler 0.10.0 pypi_0 pypi
ffmpeg 4.0 hcdf2ecd_0
fontconfig 2.13.0 h9420a91_0
freeglut 3.0.0 hf484d3e_5
freetype 2.9.1 h8a8886c_1
glib 2.56.2 hd408876_0
gluoncv 0.5.0 pypi_0 pypi
graphite2 1.3.13 h23475e2_0
harfbuzz 1.8.8 hffaf4a1_0
hdf5 1.10.2 hba1933b_1
icu 58.2 h9c2bf20_1
idna 2.8 pypi_0 pypi
intel-openmp 2019.4 243
jasper 2.0.14 h07fcdf6_1
jpeg 9b h024ee3a_2
kiwisolver 1.1.0 pypi_0 pypi
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libglu 9.0.0 hf484d3e_1
libmklml 2019.0.5 0
libmxnet 1.5.0 mkl_hfe83b78_0
libopencv 3.4.2 hb342d67_1
libopus 1.3 h7b6447c_0
libpng 1.6.37 hbc83047_0
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.0.10 h2733197_2
libuuid 1.0.3 h1bed415_2
libvpx 1.7.0 h439df22_0
libxcb 1.13 h1bed415_1
libxml2 2.9.9 hea5a465_1
matplotlib 3.1.1 pypi_0 pypi
mkl 2019.4 243
mkl-dnn 0.19 hfd86e86_1
mkl-service 2.3.0 py37he904b0f_0
mkl_fft 1.0.14 py37ha843d7b_0
mkl_random 1.1.0 py37hd6b4f25_0
mxnet 1.5.0 hea8a0af_0
ncurses 6.1 he6710b0_1
numpy 1.17.2 pypi_0 pypi
numpy-base 1.17.2 py37hde5b4d6_0
opencv-contrib-python 4.1.1.26 pypi_0 pypi
opencv-python 4.1.1.26 pypi_0 pypi
openssl 1.1.1d h7b6447c_2
pcre 8.43 he6710b0_0
pillow 6.2.0 pypi_0 pypi
pip 19.2.3 py37_0
pixman 0.38.0 h7b6447c_0
py-mxnet 1.5.0 py37hc738527_0
pycparser 2.19 py37_0
pyopenssl 19.0.0 py37_0
pyparsing 2.4.2 pypi_0 pypi
pysocks 1.7.1 py37_0
python 3.7.4 h265db76_1
python-dateutil 2.8.0 pypi_0 pypi
python-graphviz 0.8.4 pypi_0 pypi
readline 7.0 h7b6447c_5
requests 2.22.0 py37_0
scipy 1.3.1 pypi_0 pypi
setuptools 41.4.0 py37_0
six 1.12.0 pypi_0 pypi
sqlite 3.30.0 h7b6447c_0
tk 8.6.8 hbc83047_0
tqdm 4.36.1 pypi_0 pypi
urllib3 1.25.6 pypi_0 pypi
wheel 0.33.6 py37_0
xz 5.2.4 h14c3975_4
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0

我的CPU是intel xeon E5-2680

数据集开源协议

作者你好,请问一下您制作的安全帽训练数据集采用何种开源协议?我们学校的比赛正好需要用到

运行报错

ax = utils.viz.cv_plot_bbox(orig_img, bboxes[0], scores[0], box_ids[0], class_names=net.classes,
thresh=args.threshold) 运行到这里报错了。
AttributeError: module 'gluoncv.utils.viz' has no attribute 'cv_plot_bbox' 请问这是为什么呢

从预训练权重开始训练的问题

您好,我用train_yolo.py训练了80个epoch,得到了一个params,然后再重新开始训练,在args.resume里把这个params加载进去,结果出现了下面这种问题,AssertionError: Failed loading Parameter 'yolov30_yolooutputv32_conv0_weight' from saved params: shape incompatible expected (75, 0, 1, 1) vs saved (21, 256, 1, 1),是维度不匹配吗?请问是哪里出了问题呢,谢谢!

小白,请问一些基本问题。

下载玩数据集和模型之后,是用train_yolo.py这个文件进行数据处理吗,我运行这个文件出现如下错误是mxnet.base.MXNetError: [11:12:12] C:\Jenkins\workspace\mxnet-tag\mxnet\src\ndarray\ndarray.cc:1288: GPU is not enabled。
之后看到您之前的回答,把版本修改为和您一样的,还是gpu无法使用。
我只下载了mxnet这个库,没有下载mxnet-cu90,和mxnet-gpu,会有影响吗
,训练完数据之后是在用symbol模型进行测试吗?
初学者,只学了一些基础理论知识,望您能指点一二 。

o<

可以检测框控制颜色吗

  我拿您的权重文件检测图片,出来的检测框正向数据(带安全帽)是红色,不带是蓝色,如果我想让负向数据是红色,正向的不显示检测框(盒),要在入口函数传参吗?这个可以控制吗?我看入口函数有个colors参数,但不知道具体什么格式,能请教下调用方式吗?

请教下在训练中出现的问题

我在加载网络:net = get_model(net_name, pretrained_base=True, classes=classes)
出现了AssertionError: Failed loading Parameter 'darknetv30_dense0_bias' from saved params: shape incompatible expected (['hat', 'person'],) vs saved (1000,)的问题,暂时没有别的解决方法,net_name为yolo3_darknet53_voc,和您加载的同一个,但出现了这个问题,让我有些难过

训练参数

您好,感谢分享!请问能否再分享一下训练时的超参数配置?包括batch size,epoch,learning rate等。

about scut-head

您这里用了scut-head,但是我发现图片数量对不上,scut-head原有PartA 2000张,PartB 2405张,但是您这里PartA 1999张,PartB 2341张。
请问是删掉了一些质量不好的图片吗?

你好,请教一个问题

就是标记数据生成的xml文件在两个不同的文件夹下,我试了一下感觉用不了这个标注好的数据集,不晓得是不是我太菜了[cry][cry][cry]

训练特别慢

你好,请问下我GPU训练的时候特别慢,不知道你遇到过没有呢?
INFO:root:Namespace(batch_size=2, data_shape=416, dataset='voc', epochs=100, gpus='0', label_smooth=False, log_interval=100, lr=0.001, lr_decay=0.1, lr_decay_epoch='60, 80', lr_decay_period=0, lr_mode='step', mixup=False, momentum=0.9, network='darknet53', no_mixup_epochs=20, no_random_shape=False, no_wd=False, num_samples=8462, num_workers=4, resume='', save_interval=5, save_prefix='yolo3_darknet53_voc', seed=233, start_epoch=0, syncbn=False, val_interval=1, warmup_epochs=3, warmup_lr=0.0, wd=0.0005)
INFO:root:Start training from [Epoch 0]
INFO:root:[Epoch 0][Batch 99], LR: 7.88E-06, Speed: 8.647 samples/sec, ObjLoss=2035.320, BoxCenterLoss=35.376, BoxScaleLoss=25.110, ClassLoss=18.088

就到这个地方后一直没反应了

您好,可以检测视频吗

前辈您好,请问这个源码可以改造成dlib调用摄像头的那种,实时分析监控图像吗,或者分析视频之类的。希望您有时间能够回复,麻烦您啦

请教可以继续训练吗

如果自己的数据已经标注完了,比如添加了若干类,能以您的权重文件继续训练吗?如果可以,应该采用哪种调用方式呢?我看参数中有个 --resume,这种方式报错,说参数不一致

关于模型转换到Keras的问题

你好,请问可以共享一下模型的cfg文件吗?我在尝试把这个模型转换成keras模型,但是转换出来的模型无法识别出目标,应该是配置文件没有设置好。这个是我用的cfg文件:

[net]
# Testing
# batch=1
# subdivisions=1
# Training
batch=64
subdivisions=16
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 50200
policy=steps
steps=40000,45000
scales=.1,.1



[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

# Downsample

[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

# Downsample

[convolutional]
batch_normalize=1
filters=128
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

# Downsample

[convolutional]
batch_normalize=1
filters=256
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

# Downsample

[convolutional]
batch_normalize=1
filters=512
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear


[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

# Downsample

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

######################

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=1024
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 6,7,8
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=2
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 61



[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 3,4,5
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=2
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 36



[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=256
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 0,1,2
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=2
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

训练自己的数据出现问题

我参考你的方法搜集图片并标注,建立一个voc格式的数据集,类别也是两类,train_yolo.py里面我也修改了classes,但是训练一开始就报错:
--network mobilenet1.0
use random shape
INFO:root:Namespace(batch_size=8, data_shape=416, dataset='voc', epochs=100, gpus='0', label_smooth=False, log_interval=100, lr=0.001, lr_decay=0.1, lr_decay_epoch='60, 80', lr_decay_period=0, lr_mode='step', mixup=False, momentum=0.9, network='mobilenet1.0', no_mixup_epochs=20, no_random_shape=False, no_wd=False, num_samples=5045, num_workers=8, resume='', save_interval=5, save_prefix='yolo3_mobilenet1.0_voc', seed=233, start_epoch=0, syncbn=False, val_interval=1, warmup_epochs=3, warmup_lr=0.0, wd=0.0005)
INFO:root:Start training from [Epoch 0]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/gluoncv/data/dataloader.py", line 154, in _worker_fn
batch = batchify_fn([t_dataset[i] for i in samples])
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/gluoncv/data/dataloader.py", line 154, in
batch = batchify_fn([t_dataset[i] for i in samples])
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/mxnet/gluon/data/dataset.py", line 124, in getitem
return self._fn(*item)
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/gluoncv/data/transforms/presets/yolo.py", line 160, in call
bbox = tbbox.translate(label, x_offset=expand[0], y_offset=expand[1])
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/gluoncv/data/transforms/bbox.py", line 160, in translate
bbox[:, :2] += (x_offset, y_offset)
IndexError: too many indices for array
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train_yolo.py", line 350, in
train(net, train_data, val_data, eval_metric, ctx, args)
File "train_yolo.py", line 261, in train
for i, batch in enumerate(train_data):
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/site-packages/mxnet/gluon/data/dataloader.py", line 451, in next
batch = pickle.loads(ret.get()) if self._dataset is None else ret.get()
File "/home/zrway/miniconda3/envs/gluon/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
IndexError: too many indices for array

希望能得到你的帮助,谢谢

Failed loading Parameter

Another problem is that after I modified the training path according to your instructions, there was such a problem as "AssertionError: Failed loading Parameter 'mobilenet0_dense0_bias' from saved params: shape incompatible expected (['hat', 'person'],) vs saved (1000,)", looking forward to your reply, thank you!

dataset

Hi,
When i tried to open the Annotations fold by labelImg, the folder cannot be opened and if i tried to directly open the iamge in folder, below error appears, I also googled it, but i have not found the solution yet, could you give me some tips? thanks in advance

Traceback (most recent call last): File "labelImg.py", line 1278, in openFile self.loadFile(filename) File "labelImg.py", line 990, in loadFile self.lineColor = QColor(*self.labelFile.lineColor) AttributeError: 'LabelFile' object has no attribute 'lineColor' Aborted (core dumped)

Best Regards,
Devin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.