Procházet zdrojové kódy

train YOLOv2 on COCO

yjh0410 před 2 roky
rodič
revize
9d27a3ce43
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  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))