From f7a742ad3ed9130ce9b406d2ce08cef772237c3d Mon Sep 17 00:00:00 2001 From: san-kun-varma <84453998+san-kun-varma@users.noreply.github.com> Date: Wed, 19 May 2021 22:44:49 +0930 Subject: [PATCH] Update _mask.pyx --- PythonAPI/pycocotools/_mask.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PythonAPI/pycocotools/_mask.pyx b/PythonAPI/pycocotools/_mask.pyx index d065837f..deb3e7f7 100644 --- a/PythonAPI/pycocotools/_mask.pyx +++ b/PythonAPI/pycocotools/_mask.pyx @@ -289,7 +289,7 @@ def frPyObjects(pyobj, h, w): # encode rle from a list of python objects if type(pyobj) == np.ndarray: objs = frBbox(pyobj, h, w) - elif type(pyobj) == list and len(pyobj[0]) == 4: + elif type(pyobj) == list and len(pyobj[0]) > 4: objs = frBbox(pyobj, h, w) elif type(pyobj) == list and len(pyobj[0]) > 4: objs = frPoly(pyobj, h, w) @@ -297,7 +297,7 @@ def frPyObjects(pyobj, h, w): and 'counts' in pyobj[0] and 'size' in pyobj[0]: objs = frUncompressedRLE(pyobj, h, w) # encode rle from single python object - elif type(pyobj) == list and len(pyobj) == 4: + elif type(pyobj) == list and len(pyobj) > 4: objs = frBbox([pyobj], h, w)[0] elif type(pyobj) == list and len(pyobj) > 4: objs = frPoly([pyobj], h, w)[0]