label-studio的内容存储数据库(sqlite3)读取

前言

Label Studio是一个非常好用的开源数据标注工具,拥有对包括音频、文本、图片、视频和时间序列等各种数据类型的标注能力,有简单易用的UI设计和多导出格式的支持,能够有利于数据准备和利用已有训练数据提升机器学习模型精度。
在这里插入图片描述
本文内容简要介绍如何读取label-studio的内容存储数据库的内容。

实现

当我们希望使用脚本读取或批量修改label-studio的数据内容时,需要通过存储数据内容的sqlite3文件访问内容:

cd ~/.local/share/label-studio
ls -l

在这里插入图片描述

import sqlite3

sql_file_path = 'label_studio.sqlite3'
conn = sqlite3.connect(sql_file_path)

cursor = conn.cursor()
cursor.execute("select name from sqlite_master where type='table' order by name;")
values = cursor.fetchall()
print(values)

cursor.execute("PRAGMA table_info(project);")
values_t = cursor.fetchall()
print(values_t)

cursor.execute("select * from project")
values_t = cursor.fetchall()
print(values_t)

cursor.execute("select * from task")
values_t = cursor.fetchall()
print(values_t)

cursor.execute("select * from task where project_id=0")
values_t = cursor.fetchall()
print(values_t)
print(len(values_t))

版权说明

本文为原创文章,独家发布在blog.csdn.net/TracelessLe。未经个人允许不得转载。如需帮助请email至tracelessle@163.com或扫描个人介绍栏二维码咨询。
在这里插入图片描述

参考资料

[1] heartexlabs/label-studio: Label Studio is a multi-type data labeling and annotation tool with standardized output format
[2] Label Studio – Open Source Data Labeling

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

TracelessLe

❀点个赞加个关注再走吧❀

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值