Closed monkeycc closed 1 year ago
I have the same question, please help us solve the problem !!
Hi, you could use the following dataset section in your config.yaml
to train without anomalous images:
dataset:
name: NAME
format: folder
path: F:/2022
normal_dir: OK
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: synthetic # 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)
tiling:
apply: false
tile_size: null
stride: null
remove_border_count: 0
use_random_tiling: False
random_tile_count: 16
By setting the test_split_mode
to none
, you will prevent Anomalib from trying to create a testing subset. Evaluation stage will be skipped because there are no anomalous samples that could be used to check the true positive rate of the model. It is recommended to set val_split_mode
to synthetic
, because this means that synthetic anomalous validation images will be generated from a part of the normal training data using Perlin noise augmentations. This helps the model to find a good anomaly score threshold that can be used during inference.
Let me know if this answers your question. We're happy to answer any additional questions that you may have.
Thank you for your reply, it helps a lot !!!
https://github.com/openvinotoolkit/anomalib/pull/572
I only have normal pictures Diagram without defects
I want to automatically simulate defects draem anomaly_source_path:dtd
python tools/train.py --config anomalib/models/draemNO/config.yaml