tSchlegl / f-AnoGAN

Code for reproducing f-AnoGAN training and anomaly scoring
MIT License
248 stars 64 forks source link

run #2

Open lzzlxxlsz opened 5 years ago

lzzlxxlsz commented 5 years ago

what should I do for this project? which code should I run ?and What is the order of this code?

alexofficial commented 5 years ago

Hey, @lzzlxxlsz. You can run f-Anogan as follows:

Step1: Set image paths

Step2: run python wgangp_64x64.py

Step3: Open the python file z_encoding_izif.py and add at the end of the file the path of the trained model. Example:

train_enc_izi("./f-AnoGAN/wganTrain/wgangp_64x64_changed_normal_crIt5_2019-05-22-1043/checkpoints/", 7, loss_type='MSE', kappa=1.0)

Step 4: run python z_encoding_izif.py. After that, you will be able to see a folder named wganTrain-iter7

Step 5: Do the same for anomaly_detection.py. Example:

anomaly_scoring("../f-AnoGAN/wganTrain-iter7/wgangp_64x64_changed_normal_crIt5_2019-05-06-1943-enc_iter50000_2019-05-07-0912/z_encoding_izif_changed-MSE-k1.00_tanh_fc/checkpoints", 200)

Step 6: run python anomaly_detection.py. Then you can find inside: wganTrain-iter7/../../_dil folder, a subfolder ( _dil) which contains the final results.

lzzlxxlsz commented 5 years ago

have you run the code? and the what is the dataset of yours?

alexofficial commented 5 years ago

have you run the code? and the what is the dataset of yours?

Yes, I have my own dataset (64x64 pixel images). You have just to modify _imgloader.py and set the paths.

lzzlxxlsz commented 5 years ago

How does the result?

lzzlxxlsz commented 5 years ago

in the step3, add the trained model.does the model need to be download?

alexofficial commented 5 years ago

in the step3, add the trained model.does the model need to be download?

No, you do not need to download anything. After running python wgangp_64_64.py you will see a folder named wganTrain. Then, you just set the path of checkpoints folder which is located inside wganTrain.

lzzlxxlsz commented 5 years ago

my conmputer environment is cpu ,does this code suit it?thanks a lot

tSchlegl commented 5 years ago

Hi @lzzlxxlsz! I strongly suggest to use a GPU for the sake of runtime.

@alexofficial, thanks for assisting lzzlxxlsz

lzzlxxlsz commented 5 years ago

thank you very much .and how does your result? does it find the abnomal area? and how about your dataset ? is there difference between them? my dataset is a little complex,just like the cat,but each picture is different but they are long to cat kind

lzzlxxlsz commented 5 years ago

excuse me ,I just want to ask you that my copmter environment is cpu ,and do I need change the setting of the code?

lzzlxxlsz commented 5 years ago

Hi @lzzlxxlsz! I strongly suggest to use a GPU for the sake of runtime.

@alexofficial, thanks for assisting lzzlxxlsz

sorry,I have some questions ,the frst stage ,modify the image_loder.py,my dataset is 496x496,do I need modify the size?

lzzlxxlsz commented 5 years ago

Hey, @lzzlxxlsz. You can run f-Anogan as follows:

Step1: Set image paths

Step2: run python wgangp_64x64.py

Step3: Open the python file z_encoding_izif.py and add at the end of the file the path of the trained model. Example:

train_enc_izi("./f-AnoGAN/wganTrain/wgangp_64x64_changed_normal_crIt5_2019-05-22-1043/checkpoints/", 7, loss_type='MSE', kappa=1.0)

Step 4: run python z_encoding_izif.py. After that, you will be able to see a folder named wganTrain-iter7

Step 5: Do the same for anomaly_detection.py. Example:

anomaly_scoring("../f-AnoGAN/wganTrain-iter7/wgangp_64x64_changed_normal_crIt5_2019-05-06-1943-enc_iter50000_2019-05-07-0912/z_encoding_izif_changed-MSE-k1.00_tanh_fc/checkpoints", 200)

Step 6: run python anomaly_detection.py. Then you can find inside: wganTrain-iter7/../../_dil folder, a subfolder ( _dil) which contains the final results. Can I add you up?my wechat is 18731186906 ,I have some questions and need your help,thanks a lot

choiwooyeon1 commented 3 years ago

Are u ok with cpu? If u see this comment, Plz answer me That will help me a lot