code: def embed_images(checkpoint: str, config_path: str = None, **kwargs):
      """Embed images with a self-supervised model.
  
      Calls the same function as lightly-embed. All arguments passed to
      lightly-embed can also be passed to this function (see below for an
      example).
  
      Args:
          checkpoint:
              Path to the checkpoint file for the embedding model.
          config_path:
              Path to config.yaml. If None, the default configs will be used.
          **kwargs:
              Overwrite default configs py passing keyword arguments.
  
      Returns:
          Embeddings, labels, and filenames of the images.
  
      Examples:
          >>> import lightly
          >>> my_checkpoint_path = 'path/to/checkpoint.ckpt'
          >>>
          >>> # embed images with default configs
          >>> embeddings, _, _ = lightly.embed_images(
          >>>     my_checkpoint_path, input_dir='path/to/data')
          >>>
          >>> # embed images with separate config file
          >>> my_config_path = 'my/config/file.yaml'
          >>> embeddings, _, _ = lightly.embed_images(
          >>>     my_checkpoint_path, input_dir='path/to/data', config_path=my_config_path)
          >>>
          >>> # embed images with default settings and overwrites: at inference,
          >>> # we can use larger input_sizes because it requires less memory.
          >>> my_collate = {input_size: 256}
          >>> embeddings, _, _ = lightly.embed_images(
          >>>     my_checkpoint_path, input_dir='path/to/data', collate=my_collate)
          >>> # the command above is equivalent to:
          >>> # lightly-embed input_dir='path/to/data' collate.input_size=256
  
      """
      config_path = _get_config_path(config_path)
      config_args = _load_config_file(config_path)
      config_args = _add_kwargs(config_args, kwargs)
  
      config_args["checkpoint"] = checkpoint
  
      return _embed_cli(config_args, is_cli_call=False)
  
file_path: lightly/lightly/core.py
imports: import os
  from typing import List, Tuple
  import numpy
  import yaml
  import lightly.cli
  from lightly.cli.embed_cli import _embed_cli
  from lightly.cli.lightly_cli import _lightly_cli
  from lightly.cli.train_cli import _train_cli
label_desc: Use image node_id 6 for calling a global function with example usage: embed_images(checkpoint, config_path) and returns: _embed_cli