Skip to content

Text Detection: Add text detection metrics #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions benchmark/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import argparse

# import sys
# sys.path.append('/')
import yaml
import numpy as np
import cv2 as cv

from detection_metric import detect_metric
from models import MODELS
from utils import METRICS, DATALOADERS

Expand Down Expand Up @@ -118,13 +119,17 @@ def printResults(self):
# prepend PYTHONPATH to each path
prepend_pythonpath(cfg)

# Instantiate benchmarking
benchmark = Benchmark(**cfg['Benchmark'])

# Instantiate model
model = build_from_cfg(cfg=cfg['Model'], registery=MODELS, key='name')

# Run benchmarking
print('Benchmarking {}:'.format(model.name))
benchmark.run(model)
benchmark.printResults()

type = cfg['Benchmark']['type']
if type=="Detection metrics":
detect_metric(model,**cfg['Benchmark'])
else:
# Instantiate benchmarking
benchmark = Benchmark(**cfg['Benchmark'])

# Run benchmarking
benchmark.run(model)
benchmark.printResults()
Loading