Giter Club home page Giter Club logo

smartiv_yolov5's Introduction

smartiv_yolov5SmartIV-yolov5(参考链接:YOLOV5)

0.数据集下载

├── smartIV_yolov5
└── Task1Dataset
    ├── data.yaml  # 数据集配置文件
    ├── images  # 原始图片(8008)
    ├── labels  # txt_处理标签
    └── labels_json  # json_原始标签

1.权重下载:runs/best.pth

└── smartIV_yolov5
	......
    ├── models
    ├── README.md
    ├── requirements.txt
    ├── Tools  -->可视化工具文件
    ├── runs
        ├── train
            ├── exp
                └── weights
                    ├── best.pt
                    └── last.pt
	......

2.Tools工具使用:

├── Tools
    ├── single_json_to_txt.ipynb  # json转txt
    ├── statistic.ipynb  # 数据集标签统计
    ├── split_file.py  # 数据集划分
    ├── vis_dataset.py  # 数据集标签可视化
    ├── vis_result.py  # 测试结果可视化
    ├── compare_img.py  # 前二者可视化结果比较
    └──img2vid.py  # 多帧图片合成视频

3.运行:python detect_task1.py --weights best.pt -- source task1

4.保存json结果:task_result/smartIV/

5.docker 镜像安装(可选):

5.1 镜像下载链接task1_smartiv.tar

5.1 加载镜像:(加载需要一会儿时间)

docker load < task1_smartiv.tar

image-20221101114630511

加载成功如下图所示:

image-20221101115704711

5.2 查看镜像:

docker images

image-20221101103218388

5.3 容器创建:将本地测试图片链接到docker环境的/root/app/task1路径下(可参考下一条具体示例)

docker run --name <容器名称> --gpus all -it -v <本地存放测试图片文件位置>:/root/app/task1  task1_smartiv:v2

示例:假设容器名为test,本地测试图片存放路径为/home/wmj/Docker_envs/local_file/imgs

image-20221101104252070

将其链接到docker环境下的task1文件夹,docker内路径为/usr/src/app/task1,具体命令如下:

docker run --name test --gpus all -it -v /home/wmj/Docker_envs/local_file/imgs:/usr/src/app/task1  task1_smartiv:v2

image-20221101104915032

5.4 文件说明:容器创建后默认进入/usr/src/app/文件夹下,只需要关注4个文件:

1 detect_task1.py 主要运行文件
2 best.pt 训练好的模型权重
3 task1 存放测试图片,与之前的本地路径的imgs文件夹链接
4 task1_result 内有子文件夹smartIV,存放测试结果.json文件

image-20221101105902008

5.5 运行: 在/usr/src/app/路径下,运行如下命令:

python detect_task1.py --weights best.pt --source task1

image-20221101111317461

5.6 结果查看: 将生成的.json文件自动创建并放置于/usr/src/app/task1_result/smartIV

image-20221101110637584

5.7 文件转移:如果想将结果文件从docker镜像迁移出来保存至本地,可以将docker镜像内的文件或者文件夹放到task1文件夹下,然后在本地的/home/wmj/Docker_envs/local_file/imgs就可以看到了。

smartiv_yolov5's People

Contributors

wmj142326 avatar

Stargazers

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