This function just supports labelImg and LabelImgTool.
import os
from convertmask.utils.xml2json.xml2json import getPolygon, x2jConvert, x2jConvert_pascal
BASE_DIR = os.path.abspath(os.path.dirname(os.getcwd())) + os.sep + 'static'
if __name__ == "__main__":
x2jConvert(BASE_DIR + os.sep + 'bbox_label.xml',
BASE_DIR + os.sep + 'bbox_label.jpg')
x2jConvert_pascal(BASE_DIR + os.sep + 'bbox_label.xml',
BASE_DIR + os.sep + 'bbox_label.jpg')