From 55bfe256fb77dd083ab7283d795f8932938e73f1 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 4 Oct 2020 01:49:36 +0100 Subject: fixed bug where pixiv links 403'd --- utils.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'utils.py') diff --git a/utils.py b/utils.py index bdb9eb2..ce3f3b9 100644 --- a/utils.py +++ b/utils.py @@ -26,30 +26,6 @@ def draw_with_border(x, y, message, color_fill, color_border, font, draw): draw.text((x, y), message, fill=color_fill, font=font) - -def detect(filename): - result = subprocess.run( - [ - "conda", - "activate", - "detection", - "&&", - "python", - "anime-face-detector/main.py ", - "-i", - filename, - "-o", - "output.json", - ], - shell=True, - stdout=subprocess.DEVNULL, - ) - with open("output.json", "r") as f: - output = json.load(f) - print(output) - return [f["bbox"] for f in output[filename]] - - def set_font(image, message, font_name="fonts/Caveat-Bold.ttf"): # keep increasing font size until the font area is 1/5th the size of image font_size = 10 @@ -137,3 +113,4 @@ def get_quote(p): with open(p, "r", encoding="utf-8") as f: lines = f.read().splitlines() return random.choice(lines) + -- cgit v1.2.3