《Mac M1 环境下CV标注工具建设》
M1 下载环境的时候会遇到很多问题,本以为下载这两个标注工具会很费事,没想到出乎意料的顺利,简单记录一下 Mac M1 下安装 CV 的标注工具,及其用法。
Key Words:labelme、PixelAnnotation、Apple M1
Beijing, 2021
作者:mxsurui
- 系统环境如下
labelme
- 注意,直接使用 pip install labelme 在 Apple M1 下是不灵的
conda install pyqt
pip install labelme
pixelAnnotation
install
- 下载 OpenCV 并编译
- 执行下面脚本就完成了
git clone https://github.com/abreheret/PixelAnnotationTool.git
mkdir build&cd build
cmake ..
make -j4
usage
- 左上角的 File 选择你要标注图片的文件夹路径,标注结果会保存在数据路径,标注后会保存三份结果_watershed_mask.png、_color_mask.png、_mask.png,实际上 _mask.png 是训练需要的
- Tool 选择你标注任务的 .config 文件位置
.config 文件格式如下:
给出了两个类别的 config 格式
其中每个 label 下的 id 是对应的类别的像素值
{
"labels": {
"bicycle": {
"categorie": "vehicle",
"color": [
119,
11,
32
],
"id": 33,
"id_categorie": 7,
"name": "bicycle"
},
"bridge": {
"categorie": "construction",
"color": [
150,
100,
100
],
"id": 15,
"id_categorie": 2,
"name": "bridge"
}
}
}