diff --git a/example/vision/detetcion/README.md b/example/vision/detetcion/README.md index c7ca1dfc6a5618b83e4f0fa5aaa718be888cc0c0..9152415244ccad954d790f21aae720ad0cc4d781 100644 --- a/example/vision/detetcion/README.md +++ b/example/vision/detetcion/README.md @@ -31,7 +31,112 @@ ## 2 图像数据标注 -## 3 使用星河社区 AI Studio 训练检测模型 +### 2.1 Labelme 标注工具安装 + +Labelme 是一个 python 语言编写,带有图形界面的图像标注软件。可用于图像分类,目标检测,图像分割等任务,在图像分类的标注任务中,标签存储为 JSON 文件。在本章节中,我们使用这个软件来标注数据。 + +首先,点击 [Labelme 下载地址](https://sourceforge.net/projects/labelme-ima-polygonal.mirror/files/v5.5.0/Labelme.exe/download),耐心等待几秒后,浏览器将自动开始下载 Labelme,如下图: + +![](images/sourceForge.png) + +一般来说,下载完成后,系统的下载文件夹内将多出 **Labelme.exe** + +![](images/download.png) + +> 注: +> +> 如果网速太慢,我们也提供了百度网盘的下载链接,点击链接 [Labelme 标注工具(提取码:cyqc)](https://pan.baidu.com/s/1ssdBXxhoE1tME3nh-xqNzQ) 即可下载 + +### 2.2 标注前的准备 + +首先,请参考 [摄像头使用指南](./example/periphery/capture) 利用 **Lockzhiner Vision Module 图片获取助手** 拍摄你需要进行标注的图片,如下图所示: + +![](images/capture_images.png) + +选择一个你想存放数据集的位置,将 **Labelme.exe** 移动到文件夹下同时创建一个空的文件夹并命名为 **Dataset**,如下图: + +![](images/move.png) + +进入 **Dataset** 文件夹,创建 **images** 文件夹、**annotations** 文件夹、**flags.txt** 文件,如下图: + +![](images/creatre.png) + +进入 **Dataset** 文件夹,打开 **images**目录,将 **Lockzhiner Vision Module 图片获取助手** 保存的图片数据(在程序运行目录的 **LockzhinerVisionModuleImages** 文件夹内)移动到该文件夹内,如下图: + +![](images/move_images.png) + +进入 **Dataset** 文件夹,打开 **flags.txt** 按行写入待标注数据集的类别,写入完成后如下图所示: + +![](images/flags.png) + +进入 **Dataset** 文件夹所在的目录,按住键盘`Shift`键后,单击鼠标右键,点击 **在此处打开 Powershell 窗口**。 + +![](images/open_powershll.png) + +弹出 **Powershell 窗口**后,输入以下命令来打开 **Labelme**,如下图: + +```bash +.\Labelme.exe .\Dataset\images --nodata --autosave --output .\Dataset\annotations --labels .\Dataset\flags.txt +``` + +![](images/open_labelme.png) + +参数意义如下: + +* --labels 类别标签路径。 +* --nodata 停止将图像数据存储到JSON文件。 +* --autosave 自动存储 +* --ouput 标签文件存储路径 + +命令执行后将打开 **Labelme** 程序,如下图 + +![](images/Labelme.png) + +### 2.3 标注并产出数据集 + +点击"编辑"选择标注类型 + +![](images/labelme_compile.png) + +选择创建矩形框 + +![](images/labelme_Create_rectangle.png) + +在图片上拖动十字框选目标区域 + +![](images/labelme_Select_target.png) + +再次点击选择目标框类别 + +![](images/labelme_category.png) + +标注好后点击存储。(若在启动 **labelme** 时未指定 --output 字段,会在第一次存储时提示选择存储路径,若指定 --autosave 字段使用自动保存,则无需点击存储按钮) + +![](images/labelme_save.png) + +然后点击"下一幅"进行下一张图片的标注 + +![](images/labelme_next.png) + +最终标注好的标签文件如图所示 + +![](images/Annotate_images.png) + +进入 **Dataset** 文件夹所在的目录,将 **Dataset** 目录压缩为文件夹。注意,压缩包的最外层需要有 **Dataset** 目录。这里我们建议你使用 **Bandzip** 压缩软件进行压缩,具体的操作步骤如下: + +![](images/compress.png) + +![](images/compress_1.png) + +![](images/compress_2.png) + +压缩完成后,打开压缩文件检查下最外层是否有 Dataset 目录 + +![](images/compress_3.png) + + + +## 3 使用 AIStudio 训练检测模型 ## 4 在凌智视觉模块上部署模型 diff --git a/example/vision/detetcion/images/Annotate_images.png b/example/vision/detetcion/images/Annotate_images.png new file mode 100644 index 0000000000000000000000000000000000000000..16c9e0f40c718c346f4328f4996dc4d491dc14b6 Binary files /dev/null and b/example/vision/detetcion/images/Annotate_images.png differ diff --git a/example/vision/detetcion/images/capture_images.png b/example/vision/detetcion/images/capture_images.png new file mode 100644 index 0000000000000000000000000000000000000000..a1cd0fabde1897043824253f7660c897c0ad7f28 Binary files /dev/null and b/example/vision/detetcion/images/capture_images.png differ diff --git a/example/vision/detetcion/images/compress.png b/example/vision/detetcion/images/compress.png new file mode 100644 index 0000000000000000000000000000000000000000..4425f7d98762ded9e106336aeb1fc499a32c3460 Binary files /dev/null and b/example/vision/detetcion/images/compress.png differ diff --git a/example/vision/detetcion/images/compress_1.png b/example/vision/detetcion/images/compress_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e622757b6450a5e9eac0c6717522b7e764f8d2ac Binary files /dev/null and b/example/vision/detetcion/images/compress_1.png differ diff --git a/example/vision/detetcion/images/compress_2.png b/example/vision/detetcion/images/compress_2.png new file mode 100644 index 0000000000000000000000000000000000000000..2f2549aa1bf12a5610cd14677edb308871c44aba Binary files /dev/null and b/example/vision/detetcion/images/compress_2.png differ diff --git a/example/vision/detetcion/images/compress_3.png b/example/vision/detetcion/images/compress_3.png new file mode 100644 index 0000000000000000000000000000000000000000..150da4cb7606dc2eeca58366274fae8860f389f0 Binary files /dev/null and b/example/vision/detetcion/images/compress_3.png differ diff --git a/example/vision/detetcion/images/creatre.png b/example/vision/detetcion/images/creatre.png new file mode 100644 index 0000000000000000000000000000000000000000..69de80b5b03d2f85b134c59d8d77a17f9c7966fe Binary files /dev/null and b/example/vision/detetcion/images/creatre.png differ diff --git a/example/vision/detetcion/images/download.png b/example/vision/detetcion/images/download.png new file mode 100644 index 0000000000000000000000000000000000000000..72f796df45a7fefd08cfdc8cbf09fadb2fcb4c51 Binary files /dev/null and b/example/vision/detetcion/images/download.png differ diff --git a/example/vision/detetcion/images/flags.png b/example/vision/detetcion/images/flags.png new file mode 100644 index 0000000000000000000000000000000000000000..dba9e59faf83f024c4a23b1975b0357d4b3a50c5 Binary files /dev/null and b/example/vision/detetcion/images/flags.png differ diff --git a/example/vision/detetcion/images/labelme.png b/example/vision/detetcion/images/labelme.png new file mode 100644 index 0000000000000000000000000000000000000000..61f7186f690e2c8b0110740d493fef7c872d4e62 Binary files /dev/null and b/example/vision/detetcion/images/labelme.png differ diff --git a/example/vision/detetcion/images/labelme_Create_rectangle.png b/example/vision/detetcion/images/labelme_Create_rectangle.png new file mode 100644 index 0000000000000000000000000000000000000000..bc60d8891bb30af56a5f3dcd3f441bfb146c9779 Binary files /dev/null and b/example/vision/detetcion/images/labelme_Create_rectangle.png differ diff --git a/example/vision/detetcion/images/labelme_Select_target.png b/example/vision/detetcion/images/labelme_Select_target.png new file mode 100644 index 0000000000000000000000000000000000000000..c6b4da8b5eace58f63871ca64286baafeb66c3f5 Binary files /dev/null and b/example/vision/detetcion/images/labelme_Select_target.png differ diff --git a/example/vision/detetcion/images/labelme_category.png b/example/vision/detetcion/images/labelme_category.png new file mode 100644 index 0000000000000000000000000000000000000000..97caf7051c4371ba353f5ae9bfbe89d0888415b5 Binary files /dev/null and b/example/vision/detetcion/images/labelme_category.png differ diff --git a/example/vision/detetcion/images/labelme_compile.png b/example/vision/detetcion/images/labelme_compile.png new file mode 100644 index 0000000000000000000000000000000000000000..9e3089ec445bb2e7281869587c4ad694c07b1297 Binary files /dev/null and b/example/vision/detetcion/images/labelme_compile.png differ diff --git a/example/vision/detetcion/images/labelme_next.png b/example/vision/detetcion/images/labelme_next.png new file mode 100644 index 0000000000000000000000000000000000000000..e7fd93b0e4850e795c8e057608899ccb706e262a Binary files /dev/null and b/example/vision/detetcion/images/labelme_next.png differ diff --git a/example/vision/detetcion/images/labelme_save.png b/example/vision/detetcion/images/labelme_save.png new file mode 100644 index 0000000000000000000000000000000000000000..8307a761bcafe01d12a34194ce5afdc7e8af99b7 Binary files /dev/null and b/example/vision/detetcion/images/labelme_save.png differ diff --git a/example/vision/detetcion/images/move.png b/example/vision/detetcion/images/move.png new file mode 100644 index 0000000000000000000000000000000000000000..2d8e0fc41cfa5750d1e8422640770057d34aa8b0 Binary files /dev/null and b/example/vision/detetcion/images/move.png differ diff --git a/example/vision/detetcion/images/move_feil.png b/example/vision/detetcion/images/move_feil.png new file mode 100644 index 0000000000000000000000000000000000000000..a6bac39124f9564a7671acb80a11cd4593c83672 Binary files /dev/null and b/example/vision/detetcion/images/move_feil.png differ diff --git a/example/vision/detetcion/images/move_images.png b/example/vision/detetcion/images/move_images.png new file mode 100644 index 0000000000000000000000000000000000000000..ac667124ded2d8278ee25314798d5d4c989d1219 Binary files /dev/null and b/example/vision/detetcion/images/move_images.png differ diff --git a/example/vision/detetcion/images/open_labelme.png b/example/vision/detetcion/images/open_labelme.png new file mode 100644 index 0000000000000000000000000000000000000000..f6771019f5ec3f0147b5f7f96b249bc9124c4031 Binary files /dev/null and b/example/vision/detetcion/images/open_labelme.png differ diff --git a/example/vision/detetcion/images/open_powershll.png b/example/vision/detetcion/images/open_powershll.png new file mode 100644 index 0000000000000000000000000000000000000000..5dbb1f9052eb673224ec0bb11c2c9c4320918ccd Binary files /dev/null and b/example/vision/detetcion/images/open_powershll.png differ diff --git a/example/vision/detetcion/images/sourceForge.png b/example/vision/detetcion/images/sourceForge.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9d3d3ede87112602db99bf324186e700ac8e79 Binary files /dev/null and b/example/vision/detetcion/images/sourceForge.png differ diff --git a/example/vision/detetcion/images/terminal.png b/example/vision/detetcion/images/terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..d0bbcd5dfb80f5274df2f14ca230038ea2e84d86 Binary files /dev/null and b/example/vision/detetcion/images/terminal.png differ