浏览代码

Fix import order in _utils.py

Kentaro Wada 1 年之前
父节点
当前提交
05812d5993
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      labelme/ai/_utils.py

+ 3 - 2
labelme/ai/_utils.py

@@ -1,7 +1,6 @@
+import imgviz
 import numpy as np
 import skimage
-import PIL.Image
-import imgviz
 
 
 def _get_contour_length(contour):
@@ -22,6 +21,8 @@ def compute_polygon_from_mask(mask):
     polygon = polygon[:-1]  # drop last point that is duplicate of first point
 
     if 0:
+        import PIL.Image
+
         image_pil = PIL.Image.fromarray(
             imgviz.gray2rgb(imgviz.bool2ubyte(mask))
         )