ãã¼ã«ã«GPUã§Watermarkãæ¶ãPython Codeãè¦ä»ãã¾ããã
ããããã¡ããã¨GPUãã¾ããã¾ãã
ã§ããã¤ã¡ã¼ã¸ãã¡ã¤ã«ãä¸ã¤ã¥ã¤æå®ããªãã¨ãããªãã®ã§ã¡ãã£ã¨ä¸ä¾¿ã
for x in in/*.jpg; do python3 remwm.py in/$x out/$x; done
ãããªæãã«ããã°ãã¾ããåããã©ãèµ·åæã®ãªã¼ãã¼ãããã大ããæ°ãããDeathã
def main(): # Parse command line arguments + from pathlib import Path import argparse parser = argparse.ArgumentParser(description='Watermark Remover')
pathlibãå ¥ãã¦
input_image_path = args.input_image output_image_path = args.output_image + input_image_list = [input_image_path,] + output_image_list = [output_image_path,] # Check if input image exists if not os.path.exists(input_image_path): print(f"Input image {input_image_path} does not exist.") sys.exit(1) ! if os.path.isdir(input_image_path): ! items = sorted([str(x).split('/')[-1] for x in Path(input_image_path).glob('*')]) ! input_image_list = ['/'.join([input_image_path,x]) for x in items] ! output_image_list = ['/'.join([output_image_path,x]) for x in items] ! ! for input_image_path, output_image_path in zip(input_image_list, output_image_list): ! # Load the image
liståãã¦ãinããã©ã«ãã ã£ããoutããã©ã«ãã¨è¦ãªãã¦ç»åãã¡ã¤ã«ã®listãä½ã£ã¦ "# Load the image" 以éãã¤ã³ãã³ããã¦ãããã°ããã©ã«ãã®å é¨ãã¾ãã£ã¨å¤æã§ãã¾ããoutå´ã¯mkdirã ããã¦ããã°ãªãã±ã¼deathã
python3 remwm.py in out
ãããGPUã絶è³æ´»ç¨ä¸ï¼ï¼
ãã ãçæ³ã®çµæã«ãªãã¨ã¯éãã¾ããã®ã§æªããããDEATHï¼ï¼