open-mmlab / mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox
https://mmocr.readthedocs.io/en/dev-1.x/
Apache License 2.0
4.35k stars 750 forks source link

SPTS has filepaths which are not explained to what they are #2012

Open yCobanoglu opened 11 months ago

yCobanoglu commented 11 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmocr

Environment

doesn't matter

Reproduces the problem - code sample

in spts_resnet50_8xb8-200e_icdar2015.py what is 'data/icdar2015/lexicons/GenericVocabulary_new.txt' and 'data/icdar2015/lexicons/' and 'GenericVocabulary_pair_list.txt',

val_evaluator = [
    dict(
        type='E2EPointMetric',
        prefix='generic',
        lexicon_path='data/icdar2015/lexicons/GenericVocabulary_new.txt',
        pair_path='data/icdar2015/lexicons/'
        'GenericVocabulary_pair_list.txt',
        match_dist_thr=None),
    dict(
        type='E2EPointMetric',
        prefix='weak',
        lexicon_path='data/icdar2015/lexicons/'
        'ch4_test_vocabulary_new.txt',
        pair_path='data/icdar2015/lexicons/'
        'ch4_test_vocabulary_pair_list.txt',
        match_dist_thr=0.4),
    dict(
        type='E2EPointMetric',
        prefix='strong',
        lexicon_path='data/icdar2015/lexicons/'
        'new_strong_lexicon/lexicons/',
        lexicon_mapping=('(.*).jpg', r'new_voc_\1.txt'),
        pair_path='data/icdar2015/lexicons/'
        'new_strong_lexicon/pairs/',
        pair_mapping=('(.*).jpg', r'pair_voc_\1.txt'),
        match_dist_thr=0.4),
]

Reproduces the problem - command or script

mim train mmocr config/spts/spts_resnet50_8xb8-200e_icdar2015.py --work-dir work_dirs/ --amp

Reproduces the problem - error message

mim train mmocr config/spts/spts_resnet50_8xb8-200e_icdar2015.py --work-dir work_dirs/ --amp

Traceback (most recent call last):
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmocr/.mim/tools/train.py", line 114, in <module>
    main()
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmocr/.mim/tools/train.py", line 110, in main
    runner.train()
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/runner/runner.py", line 1742, in train
    self._val_loop = self.build_val_loop(
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/runner/runner.py", line 1562, in build_val_loop
    loop = LOOPS.build(
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/runner/loops.py", line 338, in __init__
    self.evaluator = runner.build_evaluator(evaluator)  # type: ignore
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/runner/runner.py", line 1321, in build_evaluator
    return Evaluator(evaluator)  # type: ignore
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/evaluator/evaluator.py", line 25, in __init__
    self.metrics.append(METRICS.build(metric))
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/.venv/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/cuneiform_ocr/projects/SPTS/spts/metric/e2e_point_metric.py", line 67, in __init__
    self.lexicons = self._read_lexicon(lexicon_path)
  File "/home/yunus/PycharmProjects/cuneiform-text-detection/cuneiform-ocr-classification-detection/cuneiform_ocr/projects/SPTS/spts/metric/e2e_point_metric.py", line 72, in _read_lexicon
    lexicon = open(lexicon_path, 'r').read().splitlines()
FileNotFoundError: [Errno 2] No such file or directory: 'data/icdar2015/lexicons/GenericVocabulary_new.txt'

Additional information

No response