diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2020-10-04 01:49:36 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2020-10-04 01:49:36 +0100 |
commit | 55bfe256fb77dd083ab7283d795f8932938e73f1 (patch) | |
tree | 29cb800c82dd0d68ebeeb63f6442ff7dbde2d64e /utils.py | |
parent | b4817b94bd6d4c1e177fe55201bf0da0f335de75 (diff) | |
download | yaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.tar.gz yaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.zip |
fixed bug where pixiv links 403'd
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -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)
+
|