2
0
mirror of https://github.com/Shawn-Shan/fawkes.git synced 2024-12-22 07:09:33 +05:30

update param;

This commit is contained in:
Shawn-Shan 2020-08-02 15:43:25 -05:00
parent 3c91395e97
commit 2b08b3ec8e

View File

@ -208,10 +208,17 @@ def main(*argv):
image_paths = [path for path in image_paths if "_cloaked" not in path.split("/")[-1]] image_paths = [path for path in image_paths if "_cloaked" not in path.split("/")[-1]]
protector = Fawkes(args.feature_extractor, args.gpu, args.batch_size) protector = Fawkes(args.feature_extractor, args.gpu, args.batch_size)
protector.run_protection(image_paths, mode=args.mode, th=args.th, sd=args.sd, lr=args.lr, if args.mode == 'all':
max_step=args.max_step, for mode in ['min', 'low', 'mid', 'high']:
batch_size=args.batch_size, format=args.format, protector.run_protection(image_paths, mode=mode, th=args.th, sd=args.sd, lr=args.lr,
separate_target=args.separate_target, debug=args.debug, no_align=args.no_align) max_step=args.max_step,
batch_size=args.batch_size, format=args.format,
separate_target=args.separate_target, debug=args.debug, no_align=args.no_align)
else:
protector.run_protection(image_paths, mode=args.mode, th=args.th, sd=args.sd, lr=args.lr,
max_step=args.max_step,
batch_size=args.batch_size, format=args.format,
separate_target=args.separate_target, debug=args.debug, no_align=args.no_align)
if __name__ == '__main__': if __name__ == '__main__':