Spaces:
Runtime error
Runtime error
Download mmocr/models/textdet/postprocess/base_postprocessor.py from tomofi/MMOCR: direct link, hf CLI and curl.
- Browser
- Download file 485 Bytes
-
https://huggingface.co/spaces/tomofi/MMOCR/resolve/main/mmocr/models/textdet/postprocess/base_postprocessor.py
- Command line
-
hf download hf://spaces/tomofi/MMOCR/mmocr/models/textdet/postprocess/base_postprocessor.py
-
curl -L -o base_postprocessor.py https://huggingface.co/spaces/tomofi/MMOCR/resolve/main/mmocr/models/textdet/postprocess/base_postprocessor.py
485 Bytes
| # Copyright (c) OpenMMLab. All rights reserved. | |
| class BasePostprocessor: | |
| def __init__(self, text_repr_type='poly'): | |
| assert text_repr_type in ['poly', 'quad' | |
| ], f'Invalid text repr type {text_repr_type}' | |
| self.text_repr_type = text_repr_type | |
| def is_valid_instance(self, area, confidence, area_thresh, | |
| confidence_thresh): | |
| return bool(area >= area_thresh and confidence > confidence_thresh) | |