Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Apr 16, 2024
1 parent 38fc443 commit 7f2d85b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ C --> F([H-mean])
```
3. 计算指标
```python
from text_det_metric import DetectionIoUEvaluator
from text_det_metric import TextDetMetric
metric = DetectionIoUEvaluator()
metric = TextDetMetric()
pred_path = "pred.txt"
metric = metric(pred_path)
print(metric)
```
4. 得到结果
```bash
{'precision': 0.8300988648846577, 'recall': 0.8659281894576012, 'hmean': 0.8476350719760704, 'avg_elapse': 0.22463044243038827}
{'precision': 0.8301, 'recall': 0.8659, 'hmean': 0.8476, 'avg_elapse': 0.2246}
```
4 changes: 2 additions & 2 deletions compute_metric.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: [email protected]
from text_det_metric import DetectionIoUEvaluator
from text_det_metric import TextDetMetric

metric = DetectionIoUEvaluator()
metric = TextDetMetric()

pred_path = "pred.txt"
metric = metric(pred_path)
Expand Down
4 changes: 2 additions & 2 deletions text_det_metric/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: [email protected]
from .main import DetectionIoUEvaluator
from .main import TextDetMetric

__all__ = ["DetectionIoUEvaluator"]
__all__ = ["TextDetMetric"]
4 changes: 2 additions & 2 deletions text_det_metric/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from shapely.geometry import Polygon


class DetectionIoUEvaluator:
class TextDetMetric:
def __init__(self, iou_constraint=0.5, area_precision_constraint=0.5):
self.iou_constraint = iou_constraint
self.area_precision_constraint = area_precision_constraint
Expand Down Expand Up @@ -218,7 +218,7 @@ def main():
parser.add_argument("-pred", "--pred_path", type=str, required=True)
args = parser.parse_args()

evaluator = DetectionIoUEvaluator()
evaluator = TextDetMetric()
metrics = evaluator(args.pred_path)
print(metrics)

Expand Down

0 comments on commit 7f2d85b

Please sign in to comment.