Эх сурвалжийг харах

Fix check of len(self.points) <= 2

Kentaro Wada 7 жил өмнө
parent
commit
7f7bd93a0e
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      labelme/shape.py

+ 2 - 1
labelme/shape.py

@@ -55,7 +55,8 @@ class Shape(object):
             self.line_color = line_color
 
     def close(self):
-        logger.warn('Polygon should be created with points >2')
+        if len(self.points) <= 2:
+            logger.warn('Polygon should be created with points >2')
         self._closed = True
 
     def addPoint(self, point):