Skip to content
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