def to_json(self, key_id_map: KeyIdMap=None):
        '''
        The function to_json convert videoannotation to json format
        :param key_id_map: KeyIdMap class object
        :return: videoannotation in json format
        '''
        res_json = {
                        IMG_SIZE: {
                                    IMG_SIZE_HEIGHT: int(self.img_size[0]),
                                    IMG_SIZE_WIDTH: int(self.img_size[1])
                                  },
                        DESCRIPTION: self.description,
                        KEY: self.key().hex,
                        TAGS: self.tags.to_json(key_id_map),
                        OBJECTS: self.objects.to_json(key_id_map),
                        FRAMES: self.frames.to_json(key_id_map),
                        FRAMES_COUNT: self.frames_count
                    }

        if key_id_map is not None:
            video_id = key_id_map.get_video_id(self.key())
            if video_id is not None:
                res_json[VIDEO_ID] = video_id

        return res_json
    def to_json(self, key_id_map: KeyIdMap = None):
        res_json = {
            DESCRIPTION: self.description,
            KEY: self.key().hex,
            TAGS: self.tags.to_json(key_id_map),
            OBJECTS: self.objects.to_json(key_id_map),
            FIGURES: [figure.to_json(key_id_map) for figure in self.figures]
        }

        if key_id_map is not None:
            pointcloud_id = key_id_map.get_video_id(self.key())
            if pointcloud_id is not None:
                res_json[POINTCLOUD_ID] = pointcloud_id

        return res_json
    def to_json(self, key_id_map: KeyIdMap = None):
        '''
        The function to_json convert PointcloudAnnotation to json format
        :param key_id_map: KeyIdMap class object
        :return: PointcloudAnnotation in json format
        '''
        res_json = {
            DESCRIPTION: self.description,
            KEY: self.key().hex,
            TAGS: self.tags.to_json(key_id_map),
            OBJECTS: self.objects.to_json(key_id_map),
            FIGURES: [figure.to_json(key_id_map) for figure in self.figures]
        }

        if key_id_map is not None:
            pointcloud_id = key_id_map.get_video_id(self.key())
            if pointcloud_id is not None:
                res_json[POINTCLOUD_ID] = pointcloud_id

        return res_json
    def to_json(self, key_id_map: KeyIdMap = None):
        res_json = {
            IMG_SIZE: {
                IMG_SIZE_HEIGHT: int(self.img_size[0]),
                IMG_SIZE_WIDTH: int(self.img_size[1])
            },
            DESCRIPTION: self.description,
            KEY: self.key().hex,
            TAGS: self.tags.to_json(key_id_map),
            OBJECTS: self.objects.to_json(key_id_map),
            FRAMES: self.frames.to_json(key_id_map),
            FRAMES_COUNT: self.frames_count
        }

        if key_id_map is not None:
            video_id = key_id_map.get_video_id(self.key())
            if video_id is not None:
                res_json[VIDEO_ID] = video_id

        return res_json