File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class COCO(_COCO):
1515 """
1616
1717 def __init__ (self , annotation_file = None ):
18- if not getattr (pycocotools , '__version__' , '0' ) >= '12.0.2' :
18+ if getattr (pycocotools , '__version__' , '0' ) >= '12.0.2' :
1919 warnings .warn (
2020 'mmpycocotools is deprecated. Please install official pycocotools by "pip install pycocotools"' , # noqa: E501
2121 UserWarning )
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ def load_annotations(self, ann_file):
278278
279279 try :
280280 import lvis
281- if lvis . __version__ >= '10.5.3' :
281+ if getattr ( lvis , ' __version__' , '0' ) >= '10.5.3' :
282282 warnings .warn (
283283 'mmlvis is deprecated, please install official lvis-api by "pip install git+https://github.com/lvis-dataset/lvis-api.git"' , # noqa: E501
284284 UserWarning )
@@ -336,7 +336,7 @@ def evaluate(self,
336336
337337 try :
338338 import lvis
339- if lvis . __version__ >= '10.5.3' :
339+ if getattr ( lvis , ' __version__' , '0' ) >= '10.5.3' :
340340 warnings .warn (
341341 'mmlvis is deprecated, please install official lvis-api by "pip install git+https://github.com/lvis-dataset/lvis-api.git"' , # noqa: E501
342342 UserWarning )
@@ -711,6 +711,11 @@ class LVISV1Dataset(LVISDataset):
711711
712712 def load_annotations (self , ann_file ):
713713 try :
714+ import lvis
715+ if getattr (lvis , '__version__' , '0' ) >= '10.5.3' :
716+ warnings .warn (
717+ 'mmlvis is deprecated, please install official lvis-api by "pip install git+https://github.com/lvis-dataset/lvis-api.git"' , # noqa: E501
718+ UserWarning )
714719 from lvis import LVIS
715720 except ImportError :
716721 raise ImportError (
You can’t perform that action at this time.
0 commit comments