How to set the dataset to BTech? #161
-
How to set the dataset to BTech in code and test these algorithms against its BTech classes like 01, 02 etc? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @brm738, the data section in the dataset:
name: btech #options: [mvtec, btech, folder]
format: btech
path: ./datasets/BTech
category: '01'
task: segmentation
image_size: 256
train_batch_size: 32
test_batch_size: 32
num_workers: 8
transform_config: null
create_validation_set: false
tiling:
apply: false
tile_size: null
stride: null
remove_border_count: 0
use_random_tiling: False
random_tile_count: 16 For instance, if you set the above configurations in I've noticed that it throws an error when saving the results into file. You could avoid the error by changing if "local" in module.hparams.project.log_images_to:
visualizer.save(Path(module.hparams.project.path) / "images" / filename.parent.name / filename.with_suffix(".png").name) I'll create a PR for a hotfix for this. |
Beta Was this translation helpful? Give feedback.
-
You may need to check the format of downloaded BTech dataset. After downloading and extracting it produces BTech/BTech/01.... structure instead of BTech/01. So no image is found when running training, because it expects to find images in BTech/01 Also the fix works only for the category : '01'. File "/data/home/epi/anomalib/anomalib/data/btech.py", line 99, in make_btech_dataset It does not work neither for the category : '03' File "/data/home/epi/anomalib/anomalib/data/btech.py", line 247, in getitem thanks |
Beta Was this translation helpful? Give feedback.
-
I've added a fix in #162. You might want to remove the BTech dataset from your file system since the new script converts bmp files to png after downloading the dataset. Let me know if you encounter any issues. Cheers |
Beta Was this translation helpful? Give feedback.
Hi @brm738, the data section in the
config.yaml
file would be as follows:For instance, if you set the above configurations in
anomalib/models/patchcore/config.yaml
, and runpython tools/train.py --model patchcore
, you could train BTech dataset.I've noticed that it throws an err…