从Labelbox导出到其他公共论坛的转换器
LBExporters的Python项目详细描述
labelbox脚本
用法
设置
测试了Python3.6.4。安装到site-packages
以供使用:
python setup.py install
labelbox json到coco
将labelbox json导出文件转换为coco格式。
# import labelbox2coco libraryimportlabelbox2cocoaslb2co# set labeled_data to the file path of the Labelbox JSON exportlabeled_data='test-fixtures/labelbox_1.json'# set coco_output to the file name you want the COCO data to be written tococo_output='lb2co_1.json'# call the Labelbox to COCO conversionlb2co.from_json(labeled_data=labeled_data,coco_output=coco_output)
labelbox json到pascal voc
将labelbox json导出文件转换为pascal voc格式。
# import labelbox2pascal libraryimportlabelbox2pascalaslb2pa# set labeled_data to the file path of the Labelbox JSON exportlabeled_data='test-fixtures/labelbox_1.json'# set ann_output_dir to the file path of the directory to write Pascal VOC# annotation files. The directory must exist.ann_output_dir='./Annotations'# set images_output_dir to the file path of the directory to write images.# The directory must exist.images_output_dir='./Images'# call the Labelbox to Pascal conversion# NOTE: make sure to specify the correct label_format based on the export# format chosen on Labelbox; 'WKT' or 'XY'.lb2pa.from_json(labeled_data=labeled_data,ann_output_dir=ann_output_dir,images_output_dir=images_output_dir,label_format='WKT')
开发
pipenv
用于管理虚拟机和依赖项。
要设置:
pipenv install --dev -e '.[dev]'
运行测试:
pipenv run pytest
为向后兼容生成requirements.txt
:
pipenv lock -r --dev
释放
pipenv run python setup.py sdist bdist_wheel
twine upload 'dist/*'