def METHOD_NAME(self, feature_extractor):
    transform_configs = self.configs["IndexProcess"]["transform_ops"]
    preprocess_ops = create_operators(transform_configs)
    embedding_size = self.configs["Arch"]["Head"]["embedding_size"]
    batch_index = 0
    input_tensor = paddle.zeros(self.image_shape)
    gallery_feature = paddle.zeros(
        (len(self.gallery_images), embedding_size))
    for i, image_path in enumerate(self.gallery_images):
        image = cv2.imread(image_path)[:, :, ::-1]
        for op in preprocess_ops:
            image = op(image)
        input_tensor[batch_index] = image
        batch_index += 1
        if batch_index == self.batch_size or i == len(
                self.gallery_images) - 1:
            batch_feature = feature_extractor(input_tensor)["features"]
            for j in range(batch_index):
                feature = batch_feature[j]
                norm_feature = paddle.nn.functional.normalize(
                    feature, axis=0)
                gallery_feature[i - batch_index + j + 1] = norm_feature
            batch_index = 0
    self.gallery_layer.set_state_dict({"_layer.weight": gallery_feature.T})