gaobb / OneNIP

[ECCV 2024] Learning to Detect Multi-class Anomalies with Just One Normal Image Prompt
https://csgaobb.github.io/Pub_files/ECCV2024_OneNIP_CR_Full_0725_Mobile.pdf
24 stars 1 forks source link

关于自建数据集 #3

Open yoho131 opened 2 months ago

yoho131 commented 2 months ago

作者你好 如果我想要在我自己的数据集(类MVTec)上运行代码,应该如何创建train.json,train10.json,test.json等文件呢?

gaobb commented 2 months ago

hi, @yoho131

You can automatically generate train.json and test.json for your dataset. Please refer to this script.

The *.json files share the basic data structure below:

{
"clsname":  str,  // object or texture category, e.g., "candle" 
"label":  int,  // `1` means anomaly image and `0` means normal image
"filename":  str,  // image path, e.g., "candle/Data/Images/Anomaly/000.JPG"
"maskname":  str,  // mask path, e.g., "candle/Data/Masks/Anomaly/000.png"
"label_name":  str,  // `good` for normal images and `defective` for anomaly images
}
yoho131 commented 2 months ago

Thank you for the help provided by the author! I have now trained the model on my dataset. I would like to ask if the code you provided includes functionality for visualizing the detection results?

gaobb commented 2 months ago

Hi,@yoho131

This repo has included the visualization function for detection results. Please refer to L413-L429 in ./tools/train_val.py.

Thank you for the help provided by the author! I have now trained the model on my dataset. I would like to ask if the code you provided includes functionality for visualizing the detection results?