Open Jialiang123 opened 1 year ago
Code was made to be used only with provided examples. To train on your own data code will require some modifications.
This is a fast solution, not for production usage
run
> if save_segmentation_images
before patchcore.utils.plot_segmentation_images
add code:
image_save_path = os.path.join(
run_save_path, "segmentation_images", dataset_name
)
os.makedirs(image_save_path, exist_ok=True)
This will allow you to save segmented images.
python bin/run_patchcore.py --gpu 0 --seed 0 --save_segmentation_images "results_path" patch_core -b wideresnet50 -le layer2 -le layer3 --faiss_on_gpu --pretrain_embed_dimension 1024 --target_embed_dimension 1024 --anomaly_scorer_num_nn 1 --patchsize 3 sampler -p 0.1 approx_greedy_coreset dataset --resize 224 --imagesize 224 -d "your_train_dataset" mvtec "mvtec_anomaly_detection"
"results_path" - path to place where you will save training results "mvtec_anomaly_detection" - path to place where you keep mvtec datasets (you dataset must be with them) "your_train_dataset" - name of your dataset (name of your folder in mvtec folder)
However it's a fast solution, for testing purpose. Patchcore requires a lot of work before it could be used on production.
Why didn't I find the mvtec folder? Where should I put my own dataset folder and where to change parameters
Thanks,How to train my own data and implement reasoning on a single graph or multiple graphs?