Git Product home page Git Product logo

ml_yolov3's Introduction

ML_YOLOV3

ML_YOLOV3(目标检测)

ML_YOLOV3

1.安装环境

numpy

torch >= 1.1.0

opencv-python

tqdm

2.总流程

迁移学习

python3 train.py --data data/coco_2cls.data --cfg cfg/yolov3-spp-2cls.cfg --weights weights/converted.pt --transfer

(下边这句不对,会报维度的问题) python3 train.py --data data/coco_2cls.data --cfg cfg/yolov3-spp-2cls.cfg --weights weights/last.pt --transfer

测试自己的模型

python3 test.py --data data/coco_1cls.data --weights weights/ultralytics49.pt

python3 test.py --weights weights/last.pt --cfg cfg/yolov3-spp-2cls.cfg --data data/coco_2cls.data

检测并且输出结果:

python3 detect.py --weights weights/last.pt --cfg cfg/yolov3-spp-1cls.cfg --data data/coco_1cls.data

3.数据集中图片的规格

maxHeight=1040 maxWeight=2008

4.lable的归一化处理

ultralytics/yolov3#341

ultralytics/yolov3#524

https://blog.csdn.net/djstavaV/article/details/86743175

def convert(size, box):

dw = 1./(size[0])

dh = 1./(size[1])

x = (box[0] + box[1])/2.0 - 1

y = (box[2] + box[3])/2.0 - 1

w = box[1] - box[0]

h = box[3] - box[2]

x = x*dw

w = w*dw

y = y*dh

h = h*dh
return (x,y,w,h)

5.使用screen管理后台进程(&创建的后台进程会随着xmanager结束而退出)

(1)screen -S yourname -> 新建一个叫yourname的session

(2)screen -ls -> 列出当前所有的session

(3)screen -r yourname -> 回到yourname这个session

(4)ctrl+a,d ->detach当前session

(5)screen -X -S [session # you want to kill] quit

(6)screen -d yourname -> 远程detach某个session

(7)screen -d -r yourname -> 结束当前session并回到yourname这个session

6.当网络很差时,安装pytorch可能会超时,解决办法

pip3 --default-timeout=1000 *

7.cfg中参数batch的理解

batch=64 每batch个样本更新一次参数。

subdivisions=16 如果内存不够大,将batch分割为subdivisions个子batch,每个子batch的大小为batch/subdivisions。

训练的话把上面注释掉,测试就把训练部分的注释掉

8.train.py各个输出结果的含义

https://blog.csdn.net/weixin_42731241/article/details/81474920

9.参考项目

代码:https://github.com/ultralytics/yolov3

理论:https://blog.csdn.net/happy990/article/details/89644833

10.清理linux的缓存(cache)来增加内存(df -h看磁盘,free -mh看内存)

echo 1 > /proc/sys/vm/drop_caches

echo 2 > /proc/sys/vm/drop_caches

echo 3 > /proc/sys/vm/drop_caches

11.常见问题

(1)执行test.py时,使用原默认参数,可以不加任何参数正常运行,这是要在coco_*.data中配置正确的图片路径, 并且images和labels到一一对应,否则会报奇怪的错误

ml_yolov3's People

Contributors

jayl323 avatar

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.