|
|
@@ -290,8 +290,9 @@ class VOCDetection(Dataset):
|
|
|
logging.error(
|
|
|
"No voc record found in %s' % (file_list)", exit=True)
|
|
|
self.pos_num = len(self.file_list)
|
|
|
- if self.allow_empty:
|
|
|
+ if self.allow_empty and neg_file_list:
|
|
|
self.file_list += self._sample_empty(neg_file_list)
|
|
|
+ self.num_workers = 0
|
|
|
logging.info(
|
|
|
"{} samples in file {}, including {} positive samples and {} negative samples.".
|
|
|
format(
|
|
|
@@ -423,7 +424,10 @@ class VOCDetection(Dataset):
|
|
|
**
|
|
|
label_info
|
|
|
})
|
|
|
- self.file_list += self._sample_empty(neg_file_list)
|
|
|
+ if neg_file_list:
|
|
|
+ self.allow_empty = True
|
|
|
+ self.file_list += self._sample_empty(neg_file_list)
|
|
|
+ self.num_workers = 0
|
|
|
logging.info(
|
|
|
"{} negative samples added. Dataset contains {} positive samples and {} negative samples.".
|
|
|
format(
|