Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if mask_dir is available for segmentation task in Folder data #1277

Conversation

samet-akcay
Copy link
Contributor

Description

Changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which refactors the code base)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the pre-commit style and check guidelines of this project.
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • I have added a summary of my changes to the CHANGELOG (not for minor changes, docs and tests).

@samet-akcay samet-akcay changed the title Add mask_dir check to Folder data Check if mask_dir is available for segmentation task in Folder data Aug 16, 2023
Copy link
Contributor

@djdameln djdameln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this may be a bit too restricting, and could cause problems with the Lightning inferencer. The following is actually a valid dataset config, which will successfully train a model:

dataset:
  name: folder
  format: folder
  root: ./datasets/MVTec/bottle
  normal_dir: train/good
  abnormal_dir: null
  normal_test_dir: null
  mask_dir: null
  extensions: null
  task: segmentation
  train_batch_size: 32
  eval_batch_size: 32
  num_workers: 8
  image_size: 256 # dimensions to which images are resized (mandatory)
  center_crop: null # dimensions to which images are center-cropped after resizing (optional)
  normalization: imagenet # data distribution to which the images will be normalized: [none, imagenet]
  transform_config:
    train: null
    eval: null
  test_split_mode: none # options: [from_dir, synthetic]
  test_split_ratio: 0.2 # fraction of train images held out testing (usage depends on test_split_mode)
  val_split_mode: none # options: [same_as_test, from_test, synthetic]
  val_split_ratio: 0.5 # fraction of train/test images held out for validation (usage depends on val_split_mode)

This is the config that one would use to train a model when no anomalous images are available, and then use that model for segmentation during inference.

As a solution, maybe we could check if the val_split_mode is NONE.

Copy link
Contributor

@djdameln djdameln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@samet-akcay samet-akcay merged commit cdedf05 into openvinotoolkit:main Aug 17, 2023
5 checks passed
@ashwinvaidya17 ashwinvaidya17 mentioned this pull request Aug 28, 2023
@samet-akcay samet-akcay deleted the fix/add-mask-dir-check-to-folder-data branch November 28, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable read the mask image
2 participants