Skip to content

Instantly share code, notes, and snippets.

View Sg4Dylan's full-sized avatar
🐱

SgDylan Sg4Dylan

🐱
View GitHub Profile
@Sg4Dylan
Sg4Dylan / font_deobfs.ipynb
Created September 28, 2020 02:44
对抗字体反爬的深度学习实践
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sg4Dylan
Sg4Dylan / dain_ncnn_vulkan_instance.ipynb
Last active September 8, 2020 04:20
dain-ncnn-vulkan@colaboratory
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sg4Dylan
Sg4Dylan / vmaf_for_image.py
Created June 7, 2020 03:07
使用 VMAF 测量图片质量
import os
import shutil
from PIL import Image
def check_size(image_a, image_b):
global i_size
w_a, h_a = Image.open(image_a).size
w_b, h_b = Image.open(image_b).size
if w_a == w_b and h_a == h_b:
@Sg4Dylan
Sg4Dylan / convert_model.bat
Created May 8, 2020 01:24
优化 PyTorch 输出 ONNX 模型并转换为 NCNN 模型
@ECHO OFF & CD/D "%~dp0"
::save as CRLF/ANSI format
::usage: drag ONNX model to .bat to start processing
:start
IF "%~1"=="" GOTO :END
:proc
python -m onnxsim "%~nx1" "%~nx1.sim.onnx"
@Sg4Dylan
Sg4Dylan / regnet.ipynb
Created May 8, 2020 01:14
RegNet 模型使用/导出ONNX - Colab 版本
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sg4Dylan
Sg4Dylan / utorrent_autoban.py
Last active May 6, 2020 23:20
uTorrent 自动屏蔽迅雷
import re
import os
import json
import time
import base64
import requests
ipfilter_path = r'D:\Program Files (x86)\uTorrent\ipfilter.dat' # ipfilter.dat 路径
remote_url = 'http://127.0.0.1:23333/gui/' # uTorrent 使用的 WebUI 地址
username = b'admin' # WebUI 使用的用户名
@Sg4Dylan
Sg4Dylan / EhTagTranslatorWrapper.py
Created January 5, 2019 04:10
E绅士翻译注射器💉Wiki 解析实现
'''
E绅士翻译注射器💉Wiki 解析实现
直接用 EhTagBuilder 就能拿到 JSON 格式的数据库
本脚本是为方便集成做的简易版解析实现
参考了 EhTagTranslator 的实现过程
'''
import re
import json
import requests
@Sg4Dylan
Sg4Dylan / batch_img_convert.py
Created September 28, 2018 06:43
图片原地批量转换
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 9/28/2018
# ==========================================
# Any>WEBP Any>JPEG 图片原地批量转换
# ==========================================
# 使用方法: 把待转换的文件夹拖放到脚本上
import os
@Sg4Dylan
Sg4Dylan / getLiveComment.py
Last active February 14, 2018 05:04
简单的Bilibili直播弹幕抓取实现
#!/usr/bin/env python
import socket
import binascii
import threading
import time
import json
reconnect_flag = 0
@Sg4Dylan
Sg4Dylan / AutoSrunWebAuth.py
Last active December 4, 2017 11:03
模拟深澜Srun系统认证(Python/Shell)
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Purpose: A simple script to complete srun's webauth
# Created: 03/01/2017
# 配合 crontab 使用
# */5 6-22 * * * /usr/bin/python3 /pathtoyourscript/LoginSrunWebAuth.py
import requests