diff --git a/PythonAPI/pycocotools/coco.py b/PythonAPI/pycocotools/coco.py index e4182c74..df304aae 100644 --- a/PythonAPI/pycocotools/coco.py +++ b/PythonAPI/pycocotools/coco.py @@ -64,7 +64,7 @@ def _isArrayLike(obj): - return hasattr(obj, '__iter__') and hasattr(obj, '__len__') + return hasattr(obj, '__iter__') and hasattr(obj, '__len__') and not isinstance(obj, str) class COCO: @@ -438,4 +438,4 @@ def annToMask(self, ann): """ rle = self.annToRLE(ann) m = maskUtils.decode(rle) - return m \ No newline at end of file + return m