2022-08-08
Tweening For Object Focus, Zoom To Object, Zoom To Video Roi

focus on person only, crop video and leave only human region untouched:

https://github.com/ConceptCodes/portal-zoomer

focus/zoom on given object using pytweening, a easing/tweening function collection.

to tell you, pytweening is initially developed for pyautogui (by the same author at least), probably for evading AI detection, passing captcha or somehow, but it could also be used in animation rendering.

or just use ffmpeg. you need to handcraft those formulas anyway.

does vidpy/mltframework and some other libs supports that? requires investigation.

Read More

2022-08-07
Opennlp, Fastai And Other Machine Learning Platforms

jax

docs

autograd and xla (Accelerated Linear Algebra)

With its updated version of Autograd, JAX can automatically differentiate native Python and NumPy functions. It can differentiate through loops, branches, recursion, and closures, and it can take derivatives of derivatives of derivatives. It supports reverse-mode differentiation (a.k.a. backpropagation) via grad as well as forward-mode differentiation, and the two can be composed arbitrarily to any order.

XLA (Accelerated Linear Algebra) is a domain-specific compiler for linear algebra that can accelerate TensorFlow models with potentially no source code changes.

pyro

probabilistic programming

getting started

examples

sample code

numpyro

getting started

pyro implementation in numpy, alpha stage

scikit-learn

machine learning in python

libsvm

install official python bindings:

1
2
pip install -U libsvm-official

third-party python libsvm package installed by:

1
2
pip install libsvm

opennlp

hands-on docs

model zoo

opennlp uses onnx runtime(maybe?), may support m1 inference.

opennlp is written in java. after installing openjdk on macos with homebrew, run this to ensure openjdk is detected:

1
2
sudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

opennlp has a language detector for 103 languages, including chinese. opennlp has a sentence detector (separator) which could be trained on chinese (maybe?)

in order to use opennlp with less code written, here’s how to invoke java from kotlin

dl4j

found on mannings article about better search engine suggestions. in this example it is used with lucene, which has image retrieval (LIRE) capability. lucene is also avaliable as lucene.net in dotnet/c#.

to install lucene.net:

1
2
dotnet add package Lucene.Net --prerelease

deep learning library for java

xgboost

gradient boost is used to train decision trees and classification models.

lightgbm

Light Gradient Boosting Machine

have official commandline tools. installation on macos:

1
2
brew install lightgbm

install python package on macos:

1
2
3
brew install cmake
pip3 install lightgbm

pymc

examples

if want to enable jax sampling, install numpyro or blackjax via pip

difference between pymc3 (old) and pymc (pymc4):

pymc is optimized and faster than pymc3

pymc3 use theano as backend while pymc use aesara (forked theano)

docs with live demo of pymc

PyMC is a probabilistic programming library for Python that allows users to build Bayesian models with a simple Python API and fit them using Markov chain Monte Carlo (MCMC) methods.

fastai

a high level torch wrapper including “out of the box” support for vision, text, tabular, and collab (collaborative filtering) models.

docs

courses

on the twitter list related to opennlp shown up on its official website, fastai has been spotted.

fastai does not support macos. or is it? fastai is on top of pytorch. initial support starts with 2.7.8 and now it is currently 2.7.9

searching ‘samoyed’ like this in github we get a dataset for pets classification called imagewoof from fastai 2020 tutorial series. more image classes like subcategories of cats may be found in imagenet.

Read More

2022-07-14
复读机 Chatbot

利用带时间戳的QQ消息 提取和天气有关的内容 根据历史天气预报推断群友位置

根据聊天记录推断群友位置

测试聊天机器人的方式就是对聊 测试自媒体可以用自动测试 假数据进行测试

带二维码的图片 二维码对比度要低 避免被qq管家撤回

classify bilibili video which users recommend, then train the model against recent chats and topics with video tags

for our potential viewers, you may send them popular/hot things, place trackers (短链接统计) on those links, guess their favourites.

you may fool bilibili trackers, official parameter-based trackers.

对于qq上面聊骚的可以发a片给他们

get bilibili user email address by asking them from chat. if they give the email address, send setu as gift (regularly?)

of course you need to pass uid to us. either by parameters or by asking.

建立用户画像 cache足够多的信息 总结出来足够精确的话题 标签

发点啥吸引人的 提供某种服务 不然就会被踢

大晚上的不要说话 大家都睡觉 说话容易被踢

一般被引用的图片 发图之后被回复 图片下面比较激烈的回复代表着图片质量比较好 要取决于图片具体内容进行分类

note: in order to install libraries and dependencies, you need ubuntu inside termux. create shortcuts and alias to launch ubuntu. link files and directories to ububtu proot filesystem. also never attempt to update kali since that will break shit, especially for bumping python versions.

时序数据库

tdengine stream processing

influxdb python client

智能问答

智能问答与深度学习 附带代码

近义词

use wordnet to find hyponyms and antonyms

find antonyms for chinese with wordnet

中文近义词 以及如何扩充词库

话题建模 句向量

10 nlp libraries

gensim word2vec

word embedding using word2vec

gensym word2vec complete guide

go-cqhttp 自定义合并转发消息 生成不存在的合并转发消息

  • 渐进式领红包 对于某个群 先是两分钟(左右)之后领一次 领不到就时间减半下一次再领 如果领到了就不减半 最快6秒领 不能再减了 防止某些群为了检测机器人而发红包

  • 处理信息不要流水线处理 放在messagepool里面 要有重要度排序 相关性排序

  • QQ漂流瓶机器人 捡漂流瓶API

  • 改回群昵称 总有些脑瘫喜欢给我乱起名 一天检查一次 模仿其他人的群昵称 看看有没有能用的马甲

  • mitm Chatbot

chatbot frameworks:

convai-bot 1337 the best hybrid convai bot

omeglemiddleman

chatterbot able to learn while having conversation

qary: nlpia-bot a hybrid framework for developing chatbot by mannings

mitm-omegle watch strangers talk

ai chatbot framework

  • 用sentence bert做search based dialog 替代levenshtein 最好是asymetrical semantic search

  • 有人有测试红包外挂的红包 可能有“test”、“测试”、“别抢”、“不要”之类的字眼 这种红包不要抢 抢了飞机票

  • 群聊的下一句话不一定是上一句话的回答 训练模型寻找句子相关性 计算相关度 以及句子顺序

  • 对接小冰

  • 管理员/群主在的时候 或者管理员经常出现的群里面 不要冒泡 不然容易被封

转发的图片 至少要在之前一小时以内或更长时间内没有被重复发送才行 同一个信息内也不能出现重复图片 否则不发送这个信息(很有可能是广告)

有二维码不发送 有网址不发送

图片里面的文字要是有广告也是不能要的

文字信息不要广告 用简单分类器

个性化搜索推荐 elasticsearch

按照老毛的思想 要一边造谣一边辟谣 一边承认一边否定 同样的话颠三倒四可以说无数遍 也可以选择不说 这样可以和很多的类似故事杂交

  • 处理私聊信息 每回复一个人就清除他的所有历史发言 每隔一段时间处理其中的一个人 不会相互挤占 只有在不闲聊的时候处理私聊信息 特定的人不能进行私聊

  • 白天聊天 收集数据 晚上离线训练 (此逻辑可以推广到任意的机器学习驱动的平台)

  • 增加训练数据的context 不要只是一问一答 总语句数量要增加

  • 占用系统显卡训练的时候 需要专门acquire一个filelock 表示大量资源被占用 系统忙

  • 选取质量好有情感的聊天样本 长短适中 不要广告不要偏激违禁词 去掉表情包 去掉链接 清洗数据 同时模型用于对话的时候不要输入输出一些违禁词 可以通过话题建模进一步细分归类对话数据之间的联系

schedule the training on minute basis first for complete test, then schedule it on fixed time per day.

for qq client: dump 500 continual sentences when adding one new while holding the filelock, do not block or stop running if GPT not responding

for gpt2 server: (where to train? how to prevent maching from burning? for how long?)

rename the dataset while holding the filelock

always keep the latest 2 models, remove those not readable first, then delete older ones.

if train on CPU, still need to limit training time, sleep while doing so. GPU for sure we need sleep during training, and do not use VRAM for other applications.

  • 把”汪汪”翻译成表情包 同时可以随机添加其他表情

  • 根据实时群聊数据训练gpt2

  • 根据离线群聊数据训练gpt2

自动骂人

https://github.com/liuke-wuhan/ZuAnBot

  • 添加一个FileLock在gpt2 main server里面 不要让多个对话同时进行处理

  • 在人多的群里面少说话 具体表现为每次说话的时间间隔变长 次数变少 同时要注意 聊天内容过于严肃 专业的群尽量不要水

dialogpt documentation

闲聊chitchat dialog bot training framework by facebook:

https://github.com/facebookresearch/ParlAI

debug the consecutive group reply thresholding protocol

reply according to individual description and group description

  • 同时推广自己和别人的视频或者内容 收集推荐反馈 同时逐步减小推荐别人视频或者内容的频率

  • 推广视频的时候可以加入别人的视频高赞评论 动态的GIF 音频 或者是短视频 然后再发送xml

  • 增加复读图片的功能 增加chatlocal返回图片的功能

  • 增加反馈功能 根据发言之后群里面的回复来确定发言是否有益

  • 用txtai或者其他information retrieval (semantic search, smart search)语义查找工具来代替levenshtein的history based reply logic 查找时要包括上下文

  • 复读机不能使得死群活起来 但是主动推送可以 推送长的 自言自语的对话到群里面 不能是同一个群 主题要相关 filter out too negative ones

  • 拉人到别的群里面来 最好是多个号不共享群但是话题有交集的人

  • add involution option, allow to append unqualified replies to input message, separated by space.

  • add extend conversation option, allow to reply more than one sentence at a time (proper delay needed) -> could be achieved by using GPT2 alike generation model

  • 可以给群友点赞

  • 可以发语音

每次对话输入的context不能太小 不然看起来假

  • 添加复读原句子的功能 触发条件为sentiment

往群里面发b站视频广告的话 最好和群聊主题相关 和最近接收到的消息相关 同时频率不能太高 要设置全局的counter 群聊每发送一条消息trigger一次counter counter mod period == 0 的时候就执行发广告命令 同时可以考虑渲染任务 和发广告的逻辑要解耦合 同时访问一片数据 比如redis 根据最近聊到的内容制作和上传视频 不能在同一个群里面以太快的频率发送相同视频 相同的视频必须间隔一段时间再往其他群发送 最好用schedule库实现 方法内部要实现delay或者放弃schedule的效果

如果群聊被踢 可以考虑换头像 换昵称 更改个人资料 然后重新申请 同样可以考虑更改b站的信息 用外网网红信息来填充自己的信息 更改资料频率和申请频率都需要控制 需要单独设置每天的quota quota保存在文件里面 申请的信息最好用ai生成 或者paraphrase一下 或者到网上搜索 收集相关内容 先训练一下 头像可以全网到处爬 可以选择二次元头像(动漫头识别)对比度高的 可以是类似头像 不能是系统默认头像不然太过无聊 可以和群聊主题相关 资料抄别人的 别的群里面的 抄该群群成员的资料 或者别的群的资料 不能是管理员资料

  • 根据模板生成下一句 不要直接生成 素材可以是群公告 群主题 接收到的信息

模板生成要和新词发现结合

模板生成 paraphraser可以和chatlocal或者repeater结合

1
2
3
4
5
6
7
8
9
10
11
>>> import re
>>> re.split(r"(abc|acd)","aaabcaaacdaaa")
['aa', 'abc', 'aa', 'acd', 'aaa']
>>> word="aaabcaaacdaaa"
>>> word="aaabcaaacdaaa"
>>> re.escape("abc")
'abc'
>>> re.escape("efgh")
'efgh'
>>>

可以拆分句子为列表

  • 去除经常生成的话语 比如你好之类的

挑选levenshtein距离大于0(不能是它本身)的上一句,排序 选择10句 根据情绪激烈程度(正负皆可 去掉过于负面的)排序 输出第一名 选择下一句作为回答 然后记录这个回答在机器人的回答历史中

句子如果是取同一个group里面的 不能太recent 起码距离要有50个句子的距离

文字 图片 视频 都可以搜索百度 搜狗 中文搜索api 根据相关度和情绪来排序 (语种一致)回答文字或者多媒体

拆分大句子为小句子 依次放入 注意要过滤掉广告 一般广告比较长 有链接?

  • 输入的内容不能有违禁词否则不回答

  • 输出内容的时候不能有违禁词语 放进来的可以违禁 或者用拼音或者拆字转换这些违禁词语 保证上下文一致性 文本审查

bad chinese -> letter(pinyin initials) -> leetspeek

下一次挑选的时候自动过滤掉这些下一句在历史回答里面的句子对

那个lock 要限制自身的读取/删除操作以及新消息的append操作

  • 关于情绪激烈程度 如何提高生成器的情绪激烈度 做一个鉴别器 可以选择性的不去back propagate情绪不激烈的生成结果 或者直接用鉴别器筛选输入的语料
Read More

2022-07-14
Chatbot, Self-Hosted Model, Cloud Deploy, Cloud Services, Free Website Hosting Service

vercel hosts frontend only apps, could be useful if you want.

可以提取关键词然后到百度必应上面搜索 获取相关内容 注意语种一致性

search huggingface with julia or python:

huggingface_hub(python)

可以用huggingface的api来翻译 对接英文的chatbot (blenderbot, dialo-gpt)

add timeout to these api requests

可以把训练好的中文chatbot放到huggingface上面去 用kaggle放

https://github.com/yangjianxin1/GPT2-chitchat

could use this method to generate title for videos. i mean generally.

could host the model on huggingface, or baidu aistudio, heroku or your own machine

configure accelerated inference on huggingface (free for cpu, paid gpu):

https://huggingface.co/docs/api-inference/quicktour

huggingface inference apis:

https://huggingface.co/inference-api

huggingface conversational (chatbot) models:

https://huggingface.co/models?pipeline_tag=conversational&sort=downloads

heroku, use fastapi as interface:

https://fastapi.tiangolo.com

https://www.kaggle.com/getting-started/208405

https://signup.heroku.com

heroku alternatives:

back4app, google app engine

aistudio api, maybe you need to train or find a paddpepaddle based chatbot:

https://ai.baidu.com/ai-doc/AISTUDIO/bk3e382cq#创建在线api服务

一个项目可以创建至多五个沙盒服务, 并选择其中一个沙盒服务部署为线上服务.

沙盒服务如果连续超过24小时无调用将自动调整为暂停状态.

线上服务如果连续超过14天无调用将自动调整为暂停状态.

paddlenlp

https://aistudio.baidu.com/aistudio/projectdetail/3723144?channelType=0&channel=0

paddlepaddle chat model:

plato2

https://github.com/PaddlePaddle/Knover

https://github.com/PaddlePaddle/Knover/tree/develop/projects/PLATO-2

https://aistudio.baidu.com/aistudio/projectdetail/1886227?channelType=0&channel=0

中文chatbot:

https://github.com/zhaoyingjun/chatbot

https://github.com/Dimsmary/Ossas_ChatBot

教程

https://github.com/lcdevelop/ChatBotCourse

https://github.com/fendouai/Awesome-Chatbot

语料库

https://github.com/codemayq/chinese_chatbot_corpus

Read More

2022-07-14
Seo 蓝海词 竞争度

SEO 蓝海词 飙升词 竞争度 搜索人气 转化率 成交价(视频长度)

we need suggestion, related topics, also search results.

can be used in title generation.

title/message as query (-> keyword -> suggested query) -> search results -> extract response/title

suggestion, trending topics/keywords

black hat seo, https://www.blackhatworld.com/forums/black-hat-seo.28/

paste your link ‘elsewhere’, submit your link to search engine somehow, visit your link from search engine somehow

seo without website

write a blog on github?

create short links and submit them to search engine

get query count, perform n-gram analysis

https://www.aeripret.com/ngrams-analysis-seo/

https://www.pemavor.com/seo-keyword-clustering-with-python/

i have bookmarked links for further use on macbook chrome.

advertools is a professional SEO library, productivity & analysis tools to scale your online marketing

可以用分析股价的方法分析搜索关键词 其中股价对应搜索频率(实时) 播放量对应成交量(实时)也可能不对 反正这个模型肯定要先收集数据然后再建模 画k线 当然也不必完全拘泥于全盘还原 收集到的数据能反映实际情况 得到最优解 也就是发个视频预估播放量最大就行 用深度学习模型

寻找潜在爆款话题 标签

快排参数 上首页

https://github.com/sopify-bot/seo

分为主动点击 换IP点击

以及优化自身关键词 被动优化两种方式

蓝海词可以从零开始做 可以由现有词语延伸 可以寻找已有的蓝海词

蓝海词是产品关键词的一种,又被称为“零少词”、“长尾词”。具体是指前台具备一定买家搜索热度,但供应商发布产品较少,通常该词下对应的精确匹配产品数量不超过3页,因而同行竞争度较低的关键词。一旦供应商能准确使用这些词语,并能结合信息质量发布一条合格的产品信息,将获得曝光和点击的快速提升

红海泛指竞争相当激烈的市场。在红海中,产业边界是明晰和确定的,游戏的竞争规则是已知的。身处红海的企业试图表现得超过竞争对手,以攫取已知需求下的更大市场份额

淘宝标题撰写技巧:标题流量的3架马车,飙升词+蓝海词+销量卡位词

什么是飙升词?就是在短时间内热度迅速攀升,并且持续上升的词!

蓝海词就是那些搜索热度非常高,但这个词下面的在线产品却很少的词。

这种词可以让我们避免和红海大词竞争,获取很多隐藏流量!

淘宝界面除了能够综合排序之外,我们还能通过销量来排序。

关键词卡位就是 寻找点击量和你差不多的视频 商品所拥有的关键词语 标签 这样按照播放量排序的时候就会排到这些视频中间

Read More

2022-07-13
Topic Generation 话题发现 趋势发现 热点发现

Read More

2022-07-13
Powerpoint 比较视频制作方法 Animation Software Oss Scriptable Flipcard

  • 看看别人的数据来源是什么

知乎神回答 知乎同类回答 排行榜 github排行榜 同类内容

比较视频可以用段落总结关键词来做

free open source animation software for linux, by sourceforge.net

three.js javascript 3d library

typed.js imitate typing animation

anime.js javascript animation engine

synfig 2d vector based animation library

countup.js animate counting up to a number

vivus.js drawing animation imitator

Libreoffice Impress或者其他的动画工具 制作视频 比如synfig blender three.js

https://ask.libreoffice.org/t/convert-impress-presentation-to-video/33952

https://ask.libreoffice.org/t/how-to-turn-libreoffice-impress-into-video-mp4-format/20589

同样的 可以制作冷知识问答的动画视频 通过收集百度 bing搜索相关词语 如果是问句 问题 就拿来搜索 如果出现了放大版本的句子就收集下来 就是回答

Read More

2022-07-10
Advanced Ass Subtitle Karaoke Effects

Advanced ASS Subtitle Karaoke Effects

library collection and guide on how to create karakoe effects programmatically

lrc files

crop music that does not sing too early? maybe no need.

we need to sort them out by time! prevent serious issues.

skip empty lines?

lrc files only have start time but no end time.

we group parallel lyrics by time, if they are close enough we make it into a group.

groups act as time separators. no two group share the same time. also group have maximum span time, minimum span time calculated by content, and group should always in bound.

should apply the same min-max rule when selecting my video clips

all ass file tags, for custom karaoke effects creation

my karaoke effect:

1
2
3
{\k-50\K400}
{\k-<initial offset>\K<total duration>}

play ass file with mpv on demo video, full screen, no audio:

1
2
3
rootpath=/Users/jamesbrown/desktop/works/pyjom_remote/
mpv --fs --no-audio --sub-file="$rootpath/tests/karaoke_effects/pyonfx_test/examples/2 - Beginner/Output.ass" "$rootpath/samples/video/karaoke_effects_source.mp4"

create karaoke effects

https://github.com/Kagu-chan/FXSpindle

karaoke effects

https://github.com/Youka/NyuFX

pyonfx code

recommend to use effect 2 beginners -> 3 variants in examples, while 3 advanced -> 2 testing pixels as reference (more advanced but incomplete, and might be very intensive)

pyonfx documentation

https://github.com/logarrhythmic/karaOK

aegisub and its plugins

https://github.com/Myaamori/aegisub-cli

https://github.com/qwe7989199/Lyric-Importer-for-Aegisub

https://github.com/qwe7989199/aegisub_scripts

https://github.com/lyger/Aegisub_automation_scripts

http://www.aegisub.org/

eyecandy create karaoke ass files:

https://github.com/Alquimista/Eyecandy-py

create karaoke effects subtitle with lrc file, support chinese

https://github.com/DYY-Studio/lrc2ass_py3

Read More

2022-07-10
Video Editors

Read More

2022-07-10
Beautify 美颜

opencv bilateral filter python

1
2
3
4
5
import cv2 as cv
img = cv.imread('image.jpg')
bilateral = cv.bilateralFilter(img, 15, 75, 75)
cv2.imwrite('img_bilateral.jpg', bilateral)

https://github.com/xujingzhou/VideoBeautify

python美颜瘦脸

https://github.com/Sharpiless/opencv-pyqt-makeup-software

https://github.com/geeklili/Opencv_PIL

https://github.com/PerpetualSmile/BeautyCamera

JavaScript 美颜

https://github.com/KikyoMiao/beauty

Read More