Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
fix separate use list, set
Browse files Browse the repository at this point in the history
  • Loading branch information
takecore committed Oct 25, 2019
1 parent 81c56eb commit bd765e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmnet/lmnet/datasets/mscoco.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def coco(self):
def _image_ids(self):
"""Return all files and gt_boxes list."""
classes = [class_name for class_name in self.classes if class_name is not "__background__"]
target_class_ids = self.coco.getCatIds(catNms=classes)
target_class_ids = set(self.coco.getCatIds(catNms=classes))
image_ids = []
for target_class_id in target_class_ids:
target_image_ids = self.coco.getImgIds(catIds=[target_class_id])
Expand All @@ -225,7 +225,7 @@ def coco_category_id_to_lmnet_class_id(self, cat_id):
@functools.lru_cache(maxsize=None)
def _gt_boxes_from_image_id(self, image_id):
"""Return gt boxes list ([[x, y, w, h, class_id]]) of a image."""
classes = set(class_name for class_name in self.classes if class_name is not "__background__")
classes = [class_name for class_name in self.classes if class_name is not "__background__"]
class_ids = set(self.coco.getCatIds(catNms=classes))

boxes = []
Expand Down

0 comments on commit bd765e9

Please sign in to comment.