mala-lab / InCTRL

Official implementation of CVPR'24 paper 'Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Prompts'.
Apache License 2.0
83 stars 12 forks source link

How is x.pt file generated with the extension python test.py --few_shot_dir #7

Closed hejinsome closed 3 months ago

hejinsome commented 3 months ago

Thank you for doing a great job. I have a question here: First, I use my own few-shot normal sample training to verify defect detection. I need x.pt format file for the parameter --few_shot_dir in Python test.py. I don't know how to convert a normal sample to. pt?

few_shot_path = os.path.join(cfg.few_shot_dir, cfg.category+".pt") normal_list = torch.load(few_shot_path)

Please give me help. thanks.

Diana1026 commented 3 months ago

Hi, you can use torch.save() to generate .pt file for your own few-shot samples.