This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
require face_recognition, tqdm, pillow, pigeon-jupyter, jupyter | |
access_key = 'HYDRUS_ACCESS_KEY' | |
fa = FaceAnnotation(access_key) | |
annotations = fa.annotate('tag request', ['option1', 'option2]) | |
""" | |
import io | |
import os | |
import face_recognition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""hydrus face recognition knn | |
modified from https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py | |
""" | |
import re | |
import io | |
from hydrus import Client | |
import face_recognition | |
from tqdm import tqdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from tempfile import NamedTemporaryFile | |
from typing import List | |
import logging | |
from PIL import Image, ImageStat # type: ignore | |
from tqdm import tqdm # type: ignore | |
import animeface as af # type: ignore | |
import click | |
import face_recognition as fr # type: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""" | |
this script will replace hydrus namespace based on given parameter and hydrus tag count | |
tag file is hydrus tag with count number | |
example: | |
$ # replace 'https' namespace with 'url' | |
$ # "https://example.com" -> 'url:https://example.com' | |
$ hydrus_script.py replace-namespace --access_key 1234_acces_key --tag_file hydrus.txt 'https' 'url:https:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import json | |
from bs4 import BeautifulSoup | |
def parse(html_file): | |
"""parse youtube watch later html source. | |
>>> html_file = "youtube_wl.html" | |
>>> parse(html_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""based on this article | |
https://www.pyimagesearch.com/2017/06/19/image-difference-with-opencv-and-python/ | |
tested on python 3.6.2, ubuntu 18.10 with following package | |
imutils==0.5.2 | |
matplotlib==3.0.2 | |
opencv-python==3.4.3.18 | |
scikit-image==0.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""simple script for download youtube mp3 and add to beets. | |
workflow | |
- search title/artist or both from beets | |
- search youtube query | |
- choose and download youtube video | |
- import to beets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[58, "yiff.party api parser", 2, ["yiff.party api parser", "1d2b9ef06c1906b4c0de3d948caf7a06d48db8d4c656f0b9f732991bb061b084", [55, 1, [[], "https://yiff.party/2885342.json"]], [[[31, 1, [["posts", null], 1, [51, 1, [3, "", null, null, "example string"]], [55, 1, [[], "parsed information"]]]], [58, "posts", 2, ["posts", "5e0b0fe24397f162858602daf41ba8130443d220524d70c344d11f82f5862b94", [55, 1, [[], "example string"]], [[[31, 1, [["attachments", null], 1, [51, 1, [3, "", null, null, "example string"]], [55, 1, [[], "parsed information"]]]], [58, "attachments parser", 2, ["attachments parser", "b2d5a4f20f4bb9b05696df1623a31dbfe58cde6e77e10130972a8e221971b01f", [55, 1, [[], "example string"]], [], [26, 1, [[30, 2, ["attachment file url", 7, [31, 1, [["file_url"], 0, [51, 1, [3, "", null, null, "example string"]], [55, 1, [[], "parsed information"]]]], [2, 0]]], [30, 2, ["attachment filename tag", 0, [31, 1, [["file_name"], 0, [51, 1, [3, "", null, null, "example string"]], [55, 1, [[[9, ["\\.[^.]+$", ""]]], "1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# part 1 import | |
import inspect | |
import os | |
from gallery_dl import extractor as gallery_dl_extractor | |
from gallery_dl.job import Job | |
from yapsy.PluginManager import PluginManager | |
import structlog | |
############################################################################### | |
# part 2 import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from urllib.parse import urljoin | |
import json | |
import bs4 | |
import click | |
import aiohttp | |
import asyncio | |
import async_timeout |
NewerOlder