|
@@ -16,7 +16,7 @@ |
|
|
import numpy as np |
|
|
import numpy as np |
|
|
import matplotlib.image as mp |
|
|
import matplotlib.image as mp |
|
|
from mindspore import context |
|
|
from mindspore import context |
|
|
import AFR |
|
|
|
|
|
|
|
|
import adversarial_attack |
|
|
|
|
|
|
|
|
context.set_context(mode=context.GRAPH_MODE, device_target="GPU") |
|
|
context.set_context(mode=context.GRAPH_MODE, device_target="GPU") |
|
|
|
|
|
|
|
@@ -25,11 +25,11 @@ context.set_context(mode=context.GRAPH_MODE, device_target="GPU") |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
|
|
|
|
|
|
inputs = AFR.load_data('photos/input/') |
|
|
|
|
|
targets = AFR.load_data('photos/target/') |
|
|
|
|
|
|
|
|
inputs = adversarial_attack.load_data('photos/input/') |
|
|
|
|
|
targets = adversarial_attack.load_data('photos/target/') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
adversarial = AFR.FaceAdversarialAttack(inputs[0], targets[0]) |
|
|
|
|
|
|
|
|
adversarial = adversarial_attack.FaceAdversarialAttack(inputs[0], targets[0]) |
|
|
|
|
|
|
|
|
attack_method = "target_attack" |
|
|
attack_method = "target_attack" |
|
|
|
|
|
|
|
|