def set_category_num_annotations(self, conf):
weights = [1 / self.num_categories] * self.num_categories
num_annotations = conf.num_annotations
annotations = [None for c in range(self.num_categories)]
card = [self.categories[c].num_instances() -
self.categories[c].num_annotated_instances
for c in range(self.num_categories)]
if num_annotations > sum(card):
After Change
def set_category_num_annotations(self, conf):
weights = np.full((self.num_categories,), 1 / self.num_categories)
num_annotations = conf.num_annotations
annotations = np.full((self.num_categories,), None)
card = [self.categories[c].num_instances() -
self.categories[c].num_annotated_instances
for c in range(self.num_categories)]
sum_card = sum(card)