FasterRCNNDetection/data/coco_camera_traps_dataset.py [191:226]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            return np.max(self.classes).tolist() + 1


    def get_example(self, i):
        """Returns the i-th example.

        Returns a color image and bounding boxes. The image is in CHW format.
        The returned image is RGB.

        Args:
            i (int): The index of the example.

        Returns:
            tuple of an image in CHW format, bounding boxes in 
            ('ymin', 'xmin', 'ymax', 'xmax')  format, label as int32
            starting from 0 and difficult_flag, which is usually 0.

        """

        img_file = os.path.join(self.root, self.impaths[i])
        img = read_image(img_file, color=True)
        
        bboxes = np.array(self.bboxes[i])
        labels = np.array(self.labels[i])
        difficulties = np.array([0 for _ in labels])
        image_id = np.array([self.image_ids[i]])
        
        return img, bboxes, labels, difficulties, image_id

    
    __getitem__ = get_example
    

    def get_class_names(self):

        return self.class_names
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



FasterRCNNDetection/data/vott_dataset.py [145:175]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return np.max(self.classes).tolist() + 1

    def get_example(self, i):
        """Returns the i-th example.

        Returns a color image and bounding boxes. The image is in CHW format.
        The returned image is RGB.

        Args:
            i (int): The index of the example.

        Returns:
            tuple of an image in CHW format, bounding boxes in 
            ('ymin', 'xmin', 'ymax', 'xmax')  format, label as int32
            starting from 0 and difficult_flag

        """
        img_file = os.path.join(self.root, self.impaths[i])
        img = read_image(img_file, color=True)
        
        bboxes = np.array(self.bboxes[i])
        labels = np.array(self.labels[i])
        difficulties = np.array([0 for _ in labels])
        image_id = np.array([self.image_ids[i]])
        
        return img, bboxes, labels, difficulties, image_id

    __getitem__ = get_example
    
    def get_class_names(self):
        return self.class_names
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



