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

json generation fails #22

Open unit-0002 opened 4 days ago

unit-0002 commented 4 days ago

Dear InCTRL-Team @GuansongPang @Diana1026,

I wanted to set up your project on my own machine but bumped into an error. When using your command in the Terminal python gen_val_json.py --dataset_root=./visa_anomaly_detection/visa --dataset_name=candle It says that the argument is not found. Quick look into the code and there is no dataset_name argument there. What is the fix to my problem?

Best regards

Diana1026 commented 3 days ago

Hi, the --dataset_name is in lines 12-13 of gen_val_json.py, please check it.

baraa-m commented 3 days ago

Dear InCTRL-Team @GuansongPang @Diana1026,

I wanted to set up your project on my own machine but bumped into an error. When using your command in the Terminal python gen_val_json.py --dataset_root=./visa_anomaly_detection/visa --dataset_name=candle It says that the argument is not found. Quick look into the code and there is no dataset_name argument there. What is the fix to my problem?

Best regards

For me I had to change --dataset_root and use --dataset_dir instead.

unit-0002 commented 3 days ago

When I change it to --data_dir it throws an error: FileNotFoundErrpr: [Errno 2] No such file or directory: './datasets/AD_json/candle_val_normal.json

What should i do next? @baraa-m

Diana1026 commented 3 days ago

Dear InCTRL-Team @GuansongPang @Diana1026, I wanted to set up your project on my own machine but bumped into an error. When using your command in the Terminal python gen_val_json.py --dataset_root=./visa_anomaly_detection/visa --dataset_name=candle It says that the argument is not found. Quick look into the code and there is no dataset_name argument there. What is the fix to my problem? Best regards

For me I had to change --dataset_root and use --dataset_dir instead.

Yes, thank you for your reminder. I have fixed the command.

baraa-m commented 3 days ago

Dear InCTRL-Team @GuansongPang @Diana1026, I wanted to set up your project on my own machine but bumped into an error. When using your command in the Terminal python gen_val_json.py --dataset_root=./visa_anomaly_detection/visa --dataset_name=candle It says that the argument is not found. Quick look into the code and there is no dataset_name argument there. What is the fix to my problem? Best regards

For me I had to change --dataset_root and use --dataset_dir instead.

Yes, thank you for your reminder. I have fixed the command.

@Diana1026 You are welcome :) I hope you can answer my question about : how to test your model on one image , i tried different methods but I was unable to do it :(

baraa-m commented 3 days ago

When I change it to --data_dir it throws an error: FileNotFoundErrpr: [Errno 2] No such file or directory: './datasets/AD_json/candle_val_normal.json

What should i do next? @baraa-m

If it's not the case, you have to execute : python convert_visa.py --dataset_root=./AD_json/visa before doing: python gen_val_json.py --dataset_dir=./visa_anomaly_detection/visa --dataset_name=candle

You can also add the argument --output_dir to choose where to generate the json file