anomalib icon indicating copy to clipboard operation
anomalib copied to clipboard

[Task]: How to perform data enhancement in custom datasets

Open microchila opened this issue 1 year ago • 2 comments

What is the motivation for this task?

data enhancement in custom datasets

Describe the solution you'd like

Some effective data enhancement methods such as UDA can be performed

Additional context

NOPE

microchila avatar Aug 01 '24 03:08 microchila

You can try custom transforms. Although most anomaly detection papers do not use transforms at all because more robust models can be actually worse at detecting anomalies.

abc-125 avatar Aug 01 '24 17:08 abc-125

just like this

eval_transform = Compose(
    [
        v2.Resize((256, 256), antialias=True),
       v2.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
    ],
)    

datamodule = Folder(
    name= 'bottle',
    # root=dataset_root,
    normal_dir="good",
   
    abnormal_dir="test",
    
    normal_split_ratio=0,
    mask_dir=None,
    # mask_dir=None,
    train_batch_size = 1,
    # eval_batch_size=1,
    num_workers=8,
    train_transform = eval_transform,
    eval_transform = eval_transform,
   
    test_split_mode=TestSplitMode.NONE,
    
    task="segmentation",
 
)

zhongxiaj avatar Aug 28 '24 02:08 zhongxiaj