mirror of
https://github.com/open-mmlab/mmocr.git
synced 2025-06-03 21:54:47 +08:00
* [Enhancement] Add windows CI * [Enhancement] Add windows CI * update * update * update * [Fix] using assert will keep lmdb file opend and fail to cleanup in test_loader.py * [Fix] map size should be small on windows in lmdb_util.py * [Fix] Fix some bugs * [Fix] Fix some bugs * [Fix] Fix some bugs * remove comments & fix bugs Co-authored-by: Mountchicken <mountchicken@outlook.com>
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
import argparse
|
|
|
|
from mmocr.utils import lmdb_converter
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument(
|
|
'--imglist', '-i', required=True, help='input imglist path')
|
|
parser.add_argument(
|
|
'--output', '-o', required=True, help='output lmdb path')
|
|
parser.add_argument(
|
|
'--batch_size',
|
|
'-b',
|
|
type=int,
|
|
default=10000,
|
|
help='processing batch size, default 10000')
|
|
parser.add_argument(
|
|
'--coding',
|
|
'-c',
|
|
default='utf8',
|
|
help='bytes coding scheme, default utf8')
|
|
parser.add_argument(
|
|
'--lmdb_map_size',
|
|
'-l',
|
|
default='109951162776',
|
|
help='maximum size database may grow to , default 109951162776 bytes')
|
|
opt = parser.parse_args()
|
|
|
|
lmdb_converter(
|
|
opt.imglist,
|
|
opt.output,
|
|
batch_size=opt.batch_size,
|
|
coding=opt.coding,
|
|
lmdb_map_size=opt.lmdb_map_size)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|