Merge pull request #158 from qT2DyV/master

Added --autoclose argument
This commit is contained in:
deeppomf 2019-08-06 13:50:05 -04:00 committed by GitHub
commit 1ae8cf99cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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()
get_args()

View File

@ -96,10 +96,11 @@ class Decensor:
print("--------------------------------------------------------------------------")
if(self.files_removed is not None):
file.error_messages(None, self.files_removed)
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)
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)
def decensor_image(self, ori, colored, file_name=None):
width, height = ori.size
# save the alpha channel if the image has an alpha channel