marco-rudolph / differnet

This is the official repository to the WACV 2021 paper "Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows" by Marco Rudolph, Bastian Wandt and Bodo Rosenhahn.
217 stars 68 forks source link

How to train a model for several classes? #33

Closed volkov-maxim closed 3 years ago

volkov-maxim commented 3 years ago

Hi, Marco!

I want to train a model for defect detection on several kinds of surfaces/objects (one model - several surfaces). Instruction from the docs:

Set the variables dataset_path and class_name in config.py to run experiments on a dataset of your choice.

  1. Can I set class_name equal to a list of classes or something else?
  2. Would you tell me how to train a model for several classes of surfaces/objects?
marco-rudolph commented 3 years ago

Hi,

  1. No, the code is not designed for such a case.
  2. The easiest way I can think of to do this is to merge the data beforehand so that it is combined into one class, i.e. one folder. Alternatively, a custom dataset class or dataloader class would have to be written.
volkov-maxim commented 3 years ago

Thank you for the advice! 🙋🏽‍♂️