AnoDDPM icon indicating copy to clipboard operation
AnoDDPM copied to clipboard

Asking about "import Comparative_models.CE as CE"

Open yobrepus opened this issue 2 years ago • 7 comments

In the file "detection.py," I found "import Comparative_models.CE as CE" on line 466. How I can get this package? Moreover, I want to run your model based on the dataset "MVTec". Would you please advise me on how I can reproduce the result? What the configuration file should look like and the steps to reproduce the result.

yobrepus avatar Sep 09 '22 10:09 yobrepus

That first module is the context encoder used to generate comparative statistics for the paper. I wasn't planning on uploading that but I can do if you'd still like it? So I ran the model on the leather subset of MVTec so you should be able to use the MTec Dataset class and load in the model that way - although when instantiating and using the model throughout I've referred to it as "leather", but you should be able to edit those sections and run it ok - the config file I used looks like (changing the noise_fn for simplex for that model):

{
  "img_size": [256,256],
  "Batch_Size": 1,
  "EPOCHS": 3000,
  "T": 1000,
  "base_channels": 128,
  "beta_schedule": "linear",
  "channel_mults": "",
  "loss-type": "l2",
  "loss_weight": "none",
  "train_start": true,
  "lr": 1e-4,
  "random_slice": true,
  "sample_distance": 600,
  "weight_decay": 0.0,
  "save_imgs":false,
  "save_vids":true,
  "dropout":0,
  "attention_resolutions":"16,8",
  "num_heads":2,
  "num_head_channels":-1,
  "noise_fn":"gauss",
  "dataset":"leather"
}

Let me know if this helps and get back in touch if not

Julian-Wyatt avatar Sep 09 '22 12:09 Julian-Wyatt

Thank you very much for your advice. Now I can train the model. By the way, Can you explain in detail how to evaluate the model ? I don't know how to use detection.py

yobrepus avatar Sep 09 '22 14:09 yobrepus

Firstly, you must ensure the function you want to run is selected at the bottom of the file and linked under the arg file provided. Since you're running the model on MVTec, the anomalous_metric_calculation function will loop over the leather dataset and record various relevant metrics to a file. This is the primary function used for evaluation.

Alternatively, if you want to reproduce the graphs for example, then the roc_data and graph_data functions sort this however they would need to be adapted for your dataset and remove redundant comparative models.

Let me know whether this helps

Julian-Wyatt avatar Sep 10 '22 14:09 Julian-Wyatt

Closing due to no responses

Julian-Wyatt avatar Feb 05 '23 15:02 Julian-Wyatt

Thank you very much for your advice. Now I can train the model. By the way, Can you explain in detail how to evaluate the model ? I don't know how to use detection.py

Hello, I am also facing the issue with "import Comparitive_models.CE as CE". I checked this thread but couldn't find the uploaded Comparitive_models. Have you found a solution to it?

mingqing666 avatar Aug 04 '23 07:08 mingqing666

In the file "detection.py," I found "import Comparative_models.CE as CE" on line 466. How I can get this package? Moreover, I want to run your model based on the dataset "MVTec". Would you please advise me on how I can reproduce the result? What the configuration file should look like and the steps to reproduce the result.

Import Comparative_ Models CE as CE, how did you solve it

lwtgithublwt avatar Dec 05 '23 12:12 lwtgithublwt

Thank you very much for your advice. Now I can train the model. By the way, Can you explain in detail how to evaluate the model ? I don't know how to use detection.py

Hello, I am also facing the issue with "import Comparitive_models.CE as CE". I checked this thread but couldn't find the uploaded Comparitive_models. Have you found a solution to it?

I don't believe I have access to that file anymore, just delete the references to it as it is just required for comparing models.

Julian-Wyatt avatar Dec 12 '23 12:12 Julian-Wyatt