duangsues.is_a? SaltedFish
60 subscribers
609 photos
6 videos
91 files
562 links
🌶🐔🐟 duangsuse 的日常
尤其喜欢发些奇奇怪怪的东西
和转载别人的东西
Download Telegram
Forwarded from dnaugsuz
做…什么? extract subtitle 还是 text montage 生成
Forwarded from 任桑 今天开始做魔王
图片转aa
Forwarded from 任桑 今天开始做魔王
自定义字库阿,上html整配色阿
Forwarded from dnaugsuz
这个不支持 HTML,后端是 PIL ImageDraw.text 但总体抽象还好,是通过 solveLayout / solveItemColors 可以算出 (x, y, color) 的 Iterable

自定义字库因为 PIL 是支持的,但一般绘制效率不怎么样,只有 14fps 左右
提升效率比较困难,因为 OpenCV 不支持自定义字体,所以只能 C++ 再加上 freetype 之类的栅格化库来弄
Forwarded from 任桑 今天开始做魔王
输出text的时候加一下标签就好了
Forwarded from dnaugsuz
感觉没太大意义
Forwarded from 任桑 今天开始做魔王
一般来说,大概思路大概是
(x, y, color, entropy)
Forwarded from viking mew
现在流行用啥?gan还是啥?不太懂
Forwarded from 任桑 今天开始做魔王
然后entropy=>word
Forwarded from dnaugsuz
GAN 就是人工智能方面的了……
Forwarded from 任桑 今天开始做魔王
大概做法是按分辨率区间,把图片转存一个二维矩阵,然后计算每个元素的熵,从熵匹配到文字
Forwarded from 雪梨
识别视频关键帧?
Forwarded from dnaugsuz
是的,但我没做这方面的工作,都是 scipy.signal.argrelextrma 直接拿 indices 的
peakutils 也可以用,不过我测试了效果不好
Forwarded from 任桑 今天开始做魔王
自己做一个熵到字的对应表就好了
Forwarded from dnaugsuz
总体来看关键帧提取效果还可以,只不过经常提取多了,一些死嵌字幕的视频不至于漏掉起止点的程度
Forwarded from 任桑 今天开始做魔王
于是就能作出各种效果的aa
Forwarded from dnaugsuz
支持先自动提取关键帧,然后再自动合并,手工分拣,再自动 unpack 回多文件的模式
这个模式不需要提取关键帧因为早就提取好了

./vcat_subtitle_imgs.py
Usage: dst src... | unpack dst


./extract_subtitles.py -h
……
--only-images use frame images from --crop-debug as input
Forwarded from dnaugsuz
我们这个是给定一个 seq: iter,然后手动 next(seq) 的
目的大概是允许对抽象的「可给一个位置、颜色在图像上画的东西」都能被使用

至于是否能直接对色块,提取绘制项目的话还是不行的(目前是只能提取绘制颜色,我用这个特效实现不绘制背景色)
不过实现也很简单啊,毕竟只用修改 drawTextMontage(img, areas, font, draw_color) 就好了
t0 = time()
t1 = None

def nextPitch():
try: return next(pitchz)
except StopIteration: raise NonlocalReturn("done")
def doSplit():
synth.noteSwitch(nextPitch())
def giveSegment():
nonlocal t1
t2 = time()
reducer.accept( (t1-t0, t2-t0, synth.last_pitch) )
t1 = t2 #< new start

def onEvent(event):
nonlocal t1
if event.type == pygame.KEYDOWN:
key = chr(event.key)
if key == 'a':
t1 = time()
doSplit()
elif key == 's': giveSegment(); doSplit()
elif event.type == pygame.KEYUP:
key = chr(event.key)
if key == 'a':
synth.noteoff()
giveSegment()
elif key == ' ': onPausePlay()
#Python #code