Skip to content

Instantly share code, notes, and snippets.

View Sg4Dylan's full-sized avatar
🐱

SgDylan Sg4Dylan

🐱
View GitHub Profile
@Sg4Dylan
Sg4Dylan / README.md
Last active January 27, 2022 13:53
Sync Voicemeeter's gain control to Windows volume control

Install

pip install psutil pycaw future toml
git clone https://github.com/Freemanium/voicemeeter-remote-python
cd voicemeeter-remote-python
pip install .

Modify line 16 of voicemeeter/remote.py

@Sg4Dylan
Sg4Dylan / ascii2d_batch_match.py
Created July 19, 2020 08:23
使用 Ascii2D 批量匹配可能存在于 Pixiv 的 Twitter 图片
import os
import re
import json
import urllib
import requests
import wget
from tqdm import tqdm
from bs4 import BeautifulSoup
# 执行推理用
import numpy as np
@Sg4Dylan
Sg4Dylan / NginxAutoindexExporter.js
Last active September 15, 2021 14:35
配合 phuslu 的 autoindex,实现 nginx 自动列目录导出到 aria2
// ==UserScript==
// @name NginxAutoindexExporter
// @namespace http://tampermonkey.net/
// @version 20180915(0.2)
// @description Export link from nginx autoindex to aria2
// @author SgDylan
// @match https://example.com/*
// @grant none
// ==/UserScript==
@Sg4Dylan
Sg4Dylan / silk-v3-decoder-compile-on-raspberry-pi.md
Last active August 15, 2021 16:32
silk-v3-decoder 树莓派编译手记

不要汇编优化

修改 Makefile

CC     = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX) -DNO_ASM
CXX    = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX) -DNO_ASM

要汇编优化

特别适用于 ArchLinux ARM 选手,其他发行版需稍作修改

@Sg4Dylan
Sg4Dylan / gfwlist2unbound.py
Created May 8, 2020 01:19
将 gfwlist 转换为 Unbound 的 forward-zone 格式
# -*- coding:utf-8 -*-
"""
Convert https://raw.githubusercontent.com/petronny/gfwlist2pac/master/gfwlist.pac for unbound.
"""
import re
with open("gfwlist.conf", 'w') as wp:
for line in open("gfwlist.pac"):
@Sg4Dylan
Sg4Dylan / zansei.py
Last active June 18, 2021 15:53
「残声」概念验证
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 06/18/2021
import numpy as np
from scipy import signal
from scipy.io.wavfile import write
import librosa
import resampy
@Sg4Dylan
Sg4Dylan / GoHFS-Exporter.user.js
Created October 18, 2020 04:08
配合 codeskyblue/gohttpserver 使用,aria2 直接下载目录并保持结构
// ==UserScript==
// @name GoHFS-Exporter
// @namespace http://tampermonkey.net/
// @version 2020.10.18(0.1)
// @description Export link from Go HFS to aria2
// @author SgDylan
// @match https://example.com/*
// ==/UserScript==
let downloadFileUrl = [];
@Sg4Dylan
Sg4Dylan / opti.py
Last active November 24, 2020 06:50
Export ESRGAN model to ONNX format
import onnx
import onnxoptimizer as optimizer
onnxfile = 'ONNX_FILE_NAME'
onnx_model = onnx.load(f'{onnxfile}.onnx')
inputs = onnx_model.graph.input
name_to_input = {}
for input in inputs:
name_to_input[input.name] = input
@Sg4Dylan
Sg4Dylan / pixiv-file-rename.py
Last active November 13, 2020 13:53
给 Pixiv 下载的图片重命名
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 12/31/2018
# ==========================================
# Pixiv 图片重命名
# ==========================================
# 使用方法: 把待处理的「文件夹」拖放到脚本上
@Sg4Dylan
Sg4Dylan / continual_learning_metric_calc.py
Created November 10, 2020 10:40
OpenLORIS 指标计算
import csv
'''
suit for lifelong-robotic-vision/OpenLORIS-Object 's csv format result
every line of csv contains accuracy of every task on test set after training a single task
'''
raw_result = []
with open('openloris.csv', newline='') as csvfile:
spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')