Skip to content

Auto log a few images from train and val dataset to self.log #1064

Open
@bw4sz

Description

@bw4sz

I find myself always needing to make sure the annotations and images line up as expected, its such a common error. We should just auto log five images before training, I think the cost to the user is very low and it sets up well for tensorboard or comet or wandb.

I can imagine a on_train_start hook in main.py

something like

  n = 5 if non_empty_train_annotations.shape[0] > 5 else non_empty_train_annotations.shape[0]
  for filename in non_empty_train_annotations.image_path.sample(n=n).unique():
      sample_train_annotations_for_image = non_empty_train_annotations[non_empty_train_annotations.image_path == filename]
      sample_train_annotations_for_image.root_dir = train_image_dir
      visualize.plot_annotations(sample_train_annotations_for_image, savedir=tmpdir)
      comet_logger.experiment.log_image(os.path.join(tmpdir, filename),metadata={"name":filename,"context":'detection_train'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions