code: def upload_to_comet(
      folder: str | None = None,
  ):
      """Upload the data in csv files to comet.
  
      Creates a project named benchmarking_[two random characters]. This is so that the project names are unique.
      One issue is that it does not check for collision
  
      Args:
          folder (optional, str): Sub-directory from which runs are picked up. Defaults to None. If none picks from runs.
      """
      project = f"benchmarking_{get_unique_key(2)}"
      tag_list = [
          "dataset.category",
          "model_name",
          "dataset.image_size",
          "model.backbone",
          "device",
      ]
      search_path = (
          "runs/*.csv" if folder is None else f"runs/{folder}/*.csv"
      )
      for csv_file in glob(search_path):
          table = pd.read_csv(csv_file)
          for index, row in table.iterrows():
              row = dict(row[1:])  # remove index column
              tags = [
                  str(row[column])
                  for column in tag_list
                  if column in row.keys()
              ]
              experiment = Experiment(project_name=project)
              experiment.set_name(
                  f"{row['model_name']}_{row['dataset.category']}_{index}"
              )
              experiment.log_metrics(
                  row, step=1, epoch=1
              )  # populates auto-generated charts on panel view
              experiment.add_tags(tags)
              experiment.log_table(filename=csv_file)
  
file_path: anomalib/tools/benchmarking/utils/metrics.py
imports: from __future__ import annotations
  import random
  import string
  from glob import glob
  from pathlib import Path
  import pandas
  import wandb
  from comet_ml import Experiment
  from torch.utils.tensorboard.writer import SummaryWriter
label_desc: Use image node_id 5 for calling a global function with example usage: upload_to_comet(folder) without return types