def test_from_json(): if not os.path.isdir('test-results'): os.makedirs('test-results') # test 1 labeled_data = os.path.abspath('test-fixtures/labelbox_1.json') lb2co.from_json( labeled_data=labeled_data, coco_output=os.path.abspath('test-results/labelbox2coco_1.json')) # test 2 labeled_data = os.path.abspath('test-fixtures/labelbox_2.json') lb2co.from_json( labeled_data=labeled_data, coco_output=os.path.abspath('test-results/labelbox2coco_2.json'))
# import labelbox2coco library import labelbox2coco as lb2co # set labeled_data to the file path of the Labelbox JSON export labeled_data = '../data/labelbox_wkt-1.json' # set coco_output to the file name you want the COCO data to be written to coco_output = '../data/labelbox_coco.json' # call the Labelbox to COCO conversion lb2co.from_json(labeled_data=labeled_data, coco_output=coco_output)
def test_empty_skipped(output_file): labeled_data = os.path.abspath('test-fixtures/empty_skipped.json') lb2co.from_json(labeled_data=labeled_data, coco_output=output_file)
def test_v3_xy(output_file): labeled_data = os.path.abspath('test-fixtures/v3_xy.json') lb2co.from_json(labeled_data=labeled_data, coco_output=output_file, label_format='XY')
def test_v3_rectancle(output_file): labeled_data = os.path.abspath('test-fixtures/v3_wkt_rectangle.json') lb2co.from_json(labeled_data=labeled_data, coco_output=output_file)
def test_v2(output_file): labeled_data = os.path.abspath('test-fixtures/v2_wkt.json') lb2co.from_json(labeled_data=labeled_data, coco_output=output_file)
def test_labelbox_1(output_file): labeled_data = os.path.abspath('test-fixtures/labelbox_1.json') lb2co.from_json(labeled_data=labeled_data, coco_output=output_file)