import os

a = 'GoogLeNet'

patch_dir_list = ['generated_patch/' + a + '/ImageNet',
                    'generated_patch/' + a + '/uniform',
                    'generated_patch/' + a + '/black',
                  'generated_patch/' + a + '/white',
                  'generated_patch/' + a + '/ensemble',
                  'generated_patch/' + a + '/KITTI',
                   'generated_patch/' + a + '/MSCOCO',
                  ]
model = a #ensure the consistency of the model with the patch dir


for patch_dir in patch_dir_list:
        proxy_data = patch_dir.split('/')[-1]

        p = ' --patch-dir ' +'\'' + patch_dir +'\''

        m = ' --model '+ '\'' + model +'\''

        g = ' --GPU-device 2'

        out = a+'_'+proxy_data +'_fooling_rate_test.txt'

        print('==========================================='+
                'CURRENT COMMEND: '+'python -u fooling_rate.py' + p + m + g +' >'+out
              +'===========================================')

        os.system('python -u fooling_rate.py' + p + m  + g + ' >' + out)

        print('==========================================='+
                patch_dir + ' '  + ' is done!'
              +'===========================================')

        #python - u fooling_rate.py - -model 'vgg19' - -GPU - device 2 - -patch-dir 'generated_patch/vgg19/ensemble' > ensemble.txt &
