车道线标注工具 在标注中会出现的问题

标注工具:Scalabel
工具下载:GitHub

质检

【车道任务】
别人已经做好的数据,需要对其进行审核。
导入json文件,进行审核。
可能会有漏标情况,补线并保存,但 #Labels 数量不会进行更新。
labels
【进行确认】
这里我新增了2条车道线
导出 json文件,查找 *Categories(类别)中的唯一类别属性 *category(每新增一个线值就会加一),确定更改后的 #Labels数量为 289(图片上#Labels数量为287)
research
【结论】
Scalabel只会统计 导入的json文件 #Label数量。

【解决方法】

  1. 用notepad查询*category数量
  2. 重新导入更改后的json文件,查看 #Labels 数量
  3. 写个小程序 一劳永逸提取*category数量
# _*_coding:utf-8
import re
import os

path = input('请输入json所在地址:')

count = 0
img_count = 0
label_count = 0
files = os.listdir(path)
files_num = len([file for file in files if file.endswith('.json')])
for file in files:
    if(file.endswith('.json')):
        file_path = os.path.join(path, file)
        # 统计josn文件中'category'的数量
        json = open(file_path, 'r', encoding='utf-8').read()
        for ch in '|"!@#$%^&*()_=+-/,:;"<>?\\`[]{|}.~':
            json = json.replace(ch, " ")
        words = json.split()
        counts = {}
        for word in words:
            counts[word] = counts.get(word, 0)+1
        num_img = counts['index']
        try:
            label_count += counts['category']
            count += 1
            rate = int(count * 100 / files_num)
            print(f'\r当前进度:{"="*(2*rate//10)+">"}{" "*(20-2*rate//10)}{rate}%', end="")

        # 没有category的情况
        except KeyError:
            count += 1
            rate = int(count * 100 / files_num)
            print(f'\r当前进度:{"="*(2*rate//10)+">"}{" "*(20-2*rate//10)}{rate}%', end="")
    img_count += num_img

print(f'\n标框数量: {label_count}')
print(f'图片数量: {img_count}')


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值