sjtuplayer / anomalydiffusion

[AAAI 2024] AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model
MIT License
160 stars 25 forks source link

Codes implementation questions with my own Datasets #64

Closed jmlee99o closed 2 months ago

jmlee99o commented 2 months ago

Dear Author

Hi Author! thanks for your codes distributions. I am Graduated student of Korea. I'm studying & researching about Generating Defective industrial images to take metrology & inspection. I have some questions about your codes implementation part.

  1. In Paper's supplementary documents, you employ 'Data Augmentation' during training. But in codes, there are no any other codes related 'Data Augmentation', so I think I have to augment my own dataset(defect images & defect masks.) in this section, in paper you take 'random cropping', 'translation', and 'rotation'. I'm curious about the detail things in them. for example, you could crop the train data to 224, and so on. plz let me know about the detail things about 'Data Augmentation'. --- > I find that codes from utils.py !

  2. When I'm looking your codes, the codes are fitted at the 'MVTec datasets'. ('run-mvtec.py') Can I revise the codes about that to fit my datasets?

  3. What I want to proceed about your model is generate appropriate a lot of types 'Defective Industrial Images'. My datasets : Normal images / Defective images / Defect masks(it will generate with labelme.) In my thinking, I will train Defective images & Defect masks, and then inference with my normal images, so finally When I input my normal images, they will generate randomly generated Defect (by train defect) involved defective images. Is it a possible process in your opinion?

Thanks for reading my descriptions! I'll wait for your comment.

jmlee

sjtuplayer commented 2 months ago

Dear Author

Hi Author! thanks for your codes distributions. I am Graduated student of Korea. I'm studying & researching about Generating Defective industrial images to take metrology & inspection. I have some questions about your codes implementation part.

  1. In Paper's supplementary documents, you employ 'Data Augmentation' during training. But in codes, there are no any other codes related 'Data Augmentation', so I think I have to augment my own dataset(defect images & defect masks.) in this section, in paper you take 'random cropping', 'translation', and 'rotation'. I'm curious about the detail things in them. for example, you could crop the train data to 224, and so on. plz let me know about the detail things about 'Data Augmentation'. --- > I find that codes from utils.py !
  2. When I'm looking your codes, the codes are fitted at the 'MVTec datasets'. ('run-mvtec.py') Can I revise the codes about that to fit my datasets?
  3. What I want to proceed about your model is generate appropriate a lot of types 'Defective Industrial Images'. My datasets : Normal images / Defective images / Defect masks(it will generate with labelme.) In my thinking, I will train Defective images & Defect masks, and then inference with my normal images, so finally When I input my normal images, they will generate randomly generated Defect (by train defect) involved defective images. Is it a possible process in your opinion?

Thanks for reading my descriptions! I'll wait for your comment.

jmlee

Thanks for your attention. For your questions:

  1. The data augmentation is only implemented in training the anomaly generation model, rather than the anomaly detection UNet. You can find it in https://github.com/sjtuplayer/anomalydiffusion/blob/7687f91618f2f6731d5f773732716e326b3d0680/utils.py#L53.
  2. You can change to your own dataset. Just keep the dataset structure the same as MVTec and design your own name-anomaly.txt according to your dataset.
  3. You are right. It is a feasible way.
jmlee99o commented 2 months ago

Thanks for your answers!