import os


patch_dir_list = ['generated_patch/vgg19_EoT*/ImageNet',
                  'generated_patch/vgg19_EoT*/ensemble'
                  ]
model = 'vgg19' #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 3'

        out = proxy_data +'.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 &




patch_dir_list = ['generated_patch/vgg19_EoT_Restarts/ImageNet',
                  'generated_patch/vgg19_EoT_Restarts/ensemble'
                  ]
model = 'vgg19' #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 3'

        out = proxy_data +'.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 &