1234567891011121314151617181920212223242526272829303132333435363738394041 |
- from pathlib import Path
- from new import MD, Image, Dataset, parser_path
- image_path = Path('/Users/sxkj/Desktop/9.29/1/img')
- image_type = 1
- image_rotate = False
- ocr_address = 'local'
- ocr_name = 'regbook'
- md_name = 'RegBook'
- filed = 'regbook'
- md_path = None or image_path.parent
- md_file = parser_path(Path(md_path) / Path(md_name + image_path.stem), image_rotate)
- if __name__ == '__main__':
- markdown = MD(md_file)
- dataset = Dataset(image_path, image_type, ocr_name, ocr_address, filed, image_rotate)
- print(len(dataset))
- for d in dataset():
- print(d)
- dataset.evaluate()
- print(dataset.accuracy)
- markdown.write_total_accuracy(dataset)
- markdown.write_table_accuracy(dataset)
- markdown.write_table_result(dataset)
- print(md_file)
- markdown.f.create_md_file()
|