Преглед на файлове

Stop sorting to avoid unexpected behavior

Kentaro Wada преди 7 години
родител
ревизия
176af5ef81
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      labelme/utils.py

+ 1 - 1
labelme/utils.py

@@ -112,7 +112,7 @@ def draw_label(label, img, label_names, colormap=None):
 def labelme_shapes_to_label(img_shape, shapes):
     label_name_to_val = {'background': 0}
     lbl = np.zeros(img_shape[:2], dtype=np.int32)
-    for shape in sorted(shapes, key=lambda x: x['label']):
+    for shape in shapes:
         polygons = shape['points']
         label_name = shape['label']
         if label_name in label_name_to_val: