Parcourir la source

train YOLOv2 on COCO

yjh0410 il y a 2 ans
Parent
commit
9d27a3ce43
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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))