Skip to content

Commit 170cd1d

Browse files
committed
remove tensorflow dependency in COCOmAP metric
1 parent d6b86d3 commit 170cd1d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lpot/metric/coco_tools.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@
5757
5858
"""
5959
from collections import OrderedDict
60-
from lpot.utils.utility import LazyImport
6160
import copy
6261
import time
6362
import numpy as np
64-
65-
tf = LazyImport('tensorflow')
66-
pycocotools = LazyImport('pycocotools')
63+
from ..utils import logger
6764

6865
from pycocotools import coco
6966
from pycocotools import cocoeval
@@ -121,7 +118,7 @@ def LoadAnnotations(self, annotations):
121118
results = coco.COCO()
122119
results.dataset['images'] = [img for img in self.dataset['images']]
123120

124-
tf.compat.v1.logging.info(
121+
logger.info(
125122
'Loading and preparing annotation results...')
126123
tic = time.time()
127124

@@ -145,7 +142,7 @@ def LoadAnnotations(self, annotations):
145142
ann['bbox'] = mask.toBbox(ann['segmentation'])
146143
ann['id'] = idx + 1
147144
ann['iscrowd'] = 0
148-
tf.compat.v1.logging.info('DONE (t=%0.2fs)', (time.time() - tic))
145+
logger.info('DONE (t=%0.2fs)', (time.time() - tic))
149146

150147
results.dataset['annotations'] = annotations
151148
results.createIndex()

0 commit comments

Comments
 (0)