code: def crop_cli(cfg):
      """Crops images into one sub-image for each object.
  
      Args:
          cfg:
              The default configs are loaded from the config file.
              To overwrite them please see the section on the config file
              (.config.config.yaml).
  
      Command-Line Args:
          input_dir:
              Path to the input directory where images are stored.
          labels_dir:
              Path to the directory where the labels are stored. There must be one label file for each image.
              The label file must have the same name as the image file, but the extension .txt.
              For example, img_123.txt for img_123.jpg. The label file must be in YOLO format.
          output_dir:
              Path to the directory where the cropped images are stored. They are stored in one directory per input image.
          crop_padding: Optional
              The additonal padding about the bounding box. This makes the crops include the context of the object.
              The padding is relative and added to the width and height.
          label_names_file: Optional
              A yaml file including the names of the classes. If it is given, the filenames of the cropped images include
              the class names instead of the class id. This file is usually included when having a dataset in yolo format.
              Example contents of such a label_names_file.yaml: "names: ['class_name_a', 'class_name_b']"
  
  
      Examples:
          >>> # Crop images and set the crop to be 20% around the bounding box
          >>> lightly-crop input_dir=data/images label_dir=data/labels output_dir=data/cropped_images crop_padding=0.2
  
          >>> # Crop images and use the class names in the filename
          >>> lightly-crop input_dir=data/images label_dir=data/labels output_dir=data/cropped_images label_names_file=data/data.yaml
  
      """
      return _crop_cli(cfg)
  
file_path: lightly/lightly/cli/crop_cli.py
imports: import os.path
  from typing import List
  import hydra
  import yaml
  from lightly.cli._helpers import fix_hydra_arguments, fix_input_path
  from lightly.data import LightlyDataset
  from lightly.utils.bounding_box import BoundingBox
  from lightly.utils.cropping.crop_image_by_bounding_boxes import crop_dataset_by_bounding_boxes_and_save
  from lightly.utils.cropping.read_yolo_label_file import read_yolo_label_file
  from lightly.utils.hipify import bcolors
label_desc: Use image node_id 2 for calling a global function with example usage: crop_cli(cfg) and returns: _crop_cli