快速生成 Scalabel标注工具 导入时的配置文件

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

Category与Attributes

  • 标注的 类型

  • 标注的 属性
    Attributes.yml Category.yml

  • 配置文件格式如下:
    Attributes Category

image_list.yml

  • 图片列表 配置文件

需要图片文件夹 放到 .\scalabel-master\app\dist\images 这个目录下
.\scalabel-master\data该目录 存放工作成果

  • 配置文件格式如下:
    image_list.yml

这里需要导入 image_list.yml 文件,需要按照一定格式填写,这里附一键生成代码
只需要输入地址,即可生成.yml文件

# -*- coding: utf-8 -*-
import os
import time

root_path = input("请输入图片所在地址:")

def get_file(root_path,suffix):
    try:
        #所有文件夹都写一遍yml
        for dir_name in os.listdir(root_path):
            
            exts = suffix.split(' ')
            #获取目录或文件的路径
            file_path = os.path.join(root_path,dir_name)
            #判断路径为文件还是路径
            if os.path.isdir(file_path):
                #递归获取所有文件和目录的路径                               
                get_file(file_path,suffix)      
            else:
                prefix = "- {url: 'http://localhost:8686/images/" + root_path.split('\\')[-1] + '/'
                outfile = root_path + '\\00_image_list_server.yml'
                file = open(outfile, 'w')
                dir_list = os.listdir(root_path)
                for name in dir_list:
                    for ext in exts:
                        if (name.endswith(ext)):
                            file.write(prefix + name + "'}" + "\n")
                file.close()                       

        #只写一个文件夹的yml
        # prefix = "- {url: 'http://localhost:8686/images/" + root_path.split('\\')[-1] + '/'
        # outfile = root_path + '\\00_image_list_server.yml'
        # file = open(outfile, 'w')
        # dir_list = os.listdir(root_path)
        # for name in dir_list:
        #     exts = suffix.split(' ')
        #     for ext in exts:
        #         # 根据后缀名判断文件类别
        #         if (name.endswith(ext)):
        #             file.write(prefix + name + "'}" + "\n")
        # print('文件写入完成'.center(20,'-'))
        # time.sleep(0.8)
        # file.close()

    except FileNotFoundError:
        print('地址输入错误,请检查地址'.center(20,'-'))
        # time.sleep(0.8)

if __name__ == "__main__":
    suffix = '.jpg'
    get_file(root_path,suffix)

已经部署好的 scalabel-master,可以直接下载使用
https://pan.baidu.com/s/1SDcYtI4X-3d4_HSSArbRHw

把 scalabel-master 文件夹放置到D盘
在cmd中输入如下命令 即可启动

cmd /k "cd /d D:\scalabel-master&&.\bin\scalabel.exe --config .\data\config.yml"
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值