Label-studio

Label-studio

概要

在label-studio工具中集成机器学习模型,可以辅助自动化标注数据集,非常节约时间。一般手工标注直接安装label-studio后打开就行,安装后根据需求选取模板标注(非常简单,按照GitHub流程来就行)。主要记录一下自己在label-studio中集成机器学习模型的经历,先介绍label-studio的安装方式,再介绍label-studio-ml集成,最后介绍数据Cloud storage setup

安装流程

1.安装label-studio
1.1Anaconda

# Install locally with pip
pip install label-studio

# Install locally with Anaconda
conda create --name label-studio
conda activate label-studio
conda install psycopg2
pip install label-studio

# Start the server at http://localhost:8080
label-studio

window和Linux系统下安装anaconda,创建虚拟环境运行都能成功。

1.2Docker
还可以用docker(第一次接触,不太熟,后面集成模型遇到很多问题,也是因为这个成功)安装

# install label-studio images
docker pull heartexlabs/label-studio:latest

# Run Label Studio in a Docker container
docker run -it -p 8080:8080 -v $(pwd)/mydata:/label-studio/data heartexlabs/label-studio:latest

/mydata设置为自己的数据集目录,docker在Linux上安装没得权限,在window下查阅说安装Docker Desktop。
Docker Desktop安装网址,需要注意Hyper-V和WSL2这两个东西,因为第一次接触docker少了开启Hyper-V服务中的容器,导致不成功。安装配置成功后,运行上述命令会生成一个image镜像,并创建一个独立的container,如下图所示:
image
container

启动流程

1.Anaconda
1.1在anaconda中pip install label-studio

label-studio or label-studio start

启动label-studio
1.2本地启动label-studio
下载代码,完成后进入目录

# Install all package dependencies
pip install -e .
# Run database migrations
python label_studio/manage.py migrate
python label_studio/manage.py collectstatic
# Start the server in development mode at http://localhost:8080
python label_studio/manage.py runserver

Linux系统中没有问题,window会出错,原因是因为有一个包没有window版的。
Linux本地启动label-studio
2.Docker
如果要重新创建一个标注容器则启动image,继续上一个容器则启动container

标注流程

1.注册账号(sign up)
注册
2.登陆后create自己的项目(项目名、上传数据、选择模板)
project name

dataset

template

根据自己的任务选择template,或者创建自己需要的template。
3.以computer vision-keypoint labeling为例:
keypoint template
自定义标签名,可增可删,切换到coda,以hxml文件定义模板(定义参数在下面有解释):
coda template
保存后就能标注了!
labeling

annoation技术名词解释

选择template时,根据需求定义annoation信息

value* string - Value of the label
selected true / false - Whether to preselect this label
maxUsages number - Maximum number of times this label can be used per task
hint string - Hint for label on hover
hotkey string - Hotkey to use for the label. Automatically generated if not specified
alias string - Label alias
showAlias true / false - Whether to show alias inside label text
aliasstyle string - CSS style for the alias
size string - Size of text in the label
background string - Background color of an active label in hexadecimal
selectedColor string - Color of text in an active label in hexadecimal
granularity symbol/ word - Set control based on symbol or word selection (only for Text)
html string - HTML code is used to display label button instead of raw text provided by value' (should be properly escaped)

小结

接触Docker后,确实好用,后续模型集成自动标注和cloud storage都是调试Docker先成功,再尝试其他方法。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值