浏览代码

train YOLOv2 on COCO

yjh0410 2 年之前
父节点
当前提交
9d27a3ce43
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      dataset/data_augment/ssd_augment.py

+ 4 - 0
dataset/data_augment/ssd_augment.py

@@ -184,6 +184,10 @@ class RandomSampleCrop(object):
 
     def __call__(self, image, boxes=None, labels=None):
         height, width, _ = image.shape
+        # check
+        if len(boxes) == 0:
+            return image, boxes, labels
+
         while True:
             # randomly choose a mode
             sample_id = np.random.randint(len(self.sample_options))