make fail_names a flag
@@ -11,20 +11,31 @@ To make nicely labeled plots formatted to fit the page / column of a
publication, you should probably write your own script that calls some
of the same plotting commands.
"""
-import sys
-
from matplotlib import pyplot
-
+import tensorflow as tf
+from cleverhans.utils_tf import silence
+silence()
+# silence call must precede this imports. pylint doesn't like that
+# pylint: disable=C0413
+from cleverhans.compat import flags
+from cleverhans.plot.success_fail import DEFAULT_FAIL_NAMES
from cleverhans.plot.success_fail import plot_report_from_path
+FLAGS=flags.FLAGS
-if __name__ == "__main__":
- report_paths = sys.argv[1:]
+def main(argv=None):
+ report_paths = argv[1:]
+
+ fail_names = FLAGS.fail_names.split(',')
for report_path in report_paths:
- plot_report_from_path(report_path, label=report_path)
+ plot_report_from_path(report_path, label=report_path, fail_names=fail_names)
pyplot.legend()
pyplot.xlim(-.01, 1.)
pyplot.ylim(0., 1.)
pyplot.show()
+
+if __name__ == '__main__':
+ flags.DEFINE_string('fail_names', ','.join(DEFAULT_FAIL_NAMES), 'Names of adversarial datasets for failure rate')
+ tf.app.run()
