Git Product home page Git Product logo

yolov3fromzero's Introduction

yolov3fromzero

tested on ubuntu1804 cuda11.4 NVIDIA RTX A5000

依赖包:

albumentations 1.0.2
torch 1.9.0
numpy 1.20.1
cv2 4.5.3

albumentations-team/albumentations#459 (comment) 数据增强库albumentations的bug需要参考上述链接手动修复.

使用前根据自己的代码的实际路径替换下面的/home/autocore/work

export PYTHONPATH=$PYTHONPATH:/home/autocore/work/yolov3fromzero:/home/autocore/work/yolov3fromzero/models

数据集存放于coco目录下.结构如下.

coco
├── images

│   ├── train2014
│   ├── train2017
│   ├── val2014
│   └── val2017
└── labels
    ├── train2014
    ├── train2017
    ├── val2014
    └── val2017

把该创建的目录创建好.

cd yolov3fromzero
mkdir input_imgs  //input_imgs目录用于存放原图经过处理后输入到模型的图片.
mkdir out_imgs    //out_imgs目录用于存放在原始图片上的检测效果图.
mkdir checkpoints //存放训练好的模型文件
mkdir log         //存放日志

测试数据处理

第一次训练前执行下面命令,以确保你的数据没有问题. 如果出错,请检查是否有不存在的图片或是label(包括缺失文件或者文件内容为空)

python dataset/dataset.py

会生成经过数据处理后送进模型的输入图片,位于input_imgs目录.

检测train.txt里是否有不存在label的图片

python coco/check_traintxt.py 如果有,修正traintxt. 新的文件命名为xxx.new label的格式默认为yolo的格式. cxywh xywh为比例.

训练

python train.py

指定gpu训练: 在id=1的卡上训练:

export CUDA_VISIBLE_DEVICES=1
python train.py

在id=0,1的两张卡上训练

export CUDA_VISIBLE_DEVICES=0,1
python train.py

yolov3fromzero's People

Contributors

sdu2011 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.