Category与Attributes
-
标注的 类型
-
标注的 属性
-
配置文件格式如下:
image_list.yml
- 图片列表 配置文件
需要图片文件夹 放到 .\scalabel-master\app\dist\images
这个目录下
.\scalabel-master\data
该目录 存放工作成果
- 配置文件格式如下:
这里需要导入 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"