Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking about "import Comparative_models.CE as CE" #3

Open
yobrepus opened this issue Sep 9, 2022 · 7 comments
Open

Asking about "import Comparative_models.CE as CE" #3

yobrepus opened this issue Sep 9, 2022 · 7 comments

Comments

@yobrepus
Copy link

yobrepus commented Sep 9, 2022

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.

@Julian-Wyatt
Copy link
Owner

Julian-Wyatt commented Sep 9, 2022

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

@yobrepus
Copy link
Author

yobrepus commented Sep 9, 2022

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

@Julian-Wyatt
Copy link
Owner

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
Copy link
Owner

Closing due to no responses

@mingqing666
Copy link

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?

@lwtgithublwt
Copy link

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

@Julian-Wyatt
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants