From 238b02185e699f7c06f9d44f96de80d8f5eaffb6 Mon Sep 17 00:00:00 2001 From: qT2DyV <> Date: Sun, 21 Jul 2019 21:06:08 +0100 Subject: [PATCH] Added --autoclose argument --- config.py | 5 ++++- decensor.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 0c27bbc..84a00df 100644 --- a/config.py +++ b/config.py @@ -29,8 +29,11 @@ def get_args(): parser.add_argument('--mask_color', dest='mask_color', default=[0,255,0], type=str2floatarr, help='rgb color of the mask, comma seperated.') parser.add_argument('--is_mosaic', dest='is_mosaic', default='False', type=str2bool, help='true if image has mosaic censoring, false otherwise') + #Misc settings + parser.add_argument('--autoclose', dest='autoclose', default='False', type=str2bool, help='true will close the program when it finishes') + args = parser.parse_args() return args if __name__ == '__main__': - get_args() \ No newline at end of file + get_args() diff --git a/decensor.py b/decensor.py index a720e59..29a3fcf 100644 --- a/decensor.py +++ b/decensor.py @@ -95,7 +95,8 @@ class Decensor: print("--------------------------------------------------------------------------") if(self.files_removed is not None): file.error_messages(None, self.files_removed) - input("\nPress anything to end...") + if(self.args.autoclose == False): + input("\nPress anything to end...") #decensors one image at a time #TODO: decensor all cropped parts of the same image in a batch (then i need input for colored an array of those images and make additional changes)