新算法利用 peakutils.baseline 和 peakutil.indexes,总体来看很不行,总是漏掉关键帧(漏得非常严重,更别说精确判定歌词显现/消失了),还不如原 smooth+argrelextrma 算法
新算法在 diff 确定上是 grayscale + subtract + countNonZero ,统计上是 smooth+argrelextrama+subtract(it, 1)
老算法是所有通道的 absdiff sum ,统计上是 peakutils.baseline 和 peakutils.indexes
in solveFrameDiffernces:
in solveValidFrames:
新算法在 diff 确定上是 grayscale + subtract + countNonZero ,统计上是 smooth+argrelextrama+subtract(it, 1)
老算法是所有通道的 absdiff sum ,统计上是 peakutils.baseline 和 peakutils.indexes
in solveFrameDiffernces:
postprocess = lambda mat: grayscale(self.postprocessUMat(self.cropUMat(mat, crop)))
diff = cv2.subtract(curr_frame, prev_frame)
#vs. diff = cv2.absdiff(curr_frame, prev_frame)
yield Frame(index, curr_frame, cv2.countNonZero(diff) ) in solveValidFrames:
diffs = array(frame_diffs)
base = peak.baseline(diffs, 2)
indices = peak.indexes(diffs-base, 0.9, min_dist=1)
return (base, map(frames.__getitem__, indices))#tech #dev #statement 🤔 关于这个 ParserKt 有没有创新嘛……
其实作为一个整体来看,ParserKt 的确是创新的(但换到每一个具体的技术来看,其实也没什么新东西),当然对于所有同类库来讲,它们也是有自己的“私货”。
比如 ParserKt 的 read/show,其实就是 unparsing,再比如 ParserKt 的 one-pass,其实所有 pure 的 parser combinator 都是 one-pass 的(而且不得不说,在类似字符串组合的情况下这类 parserc 的定义会更好看)
ParserKt 作为一个解析组合子,本身在算法上也没什么亮点(因为许多解析组合子的亮点都不在算法,而在于它们的便利性,少许利用 codegen/macro/inline 的解析组合子才更倾向算法)
包括现在的可变 Pattern 以及 LayoutPattern/InfixPattern,其实也都是运用不那么广泛的组合而已,本质上没太大更新。
想想看 Kotlin 其实也是这样的,multiplatform 早就不是什么新概念了(Haskell 和 Scala 都有官方 JS 后端,C 都有 WebAssembly)
只能说是 Kotlin 加了许多私货,不是什么新东西,只不过其它老东西都没它那么好用而已……
其实作为一个整体来看,ParserKt 的确是创新的(但换到每一个具体的技术来看,其实也没什么新东西),当然对于所有同类库来讲,它们也是有自己的“私货”。
比如 ParserKt 的 read/show,其实就是 unparsing,再比如 ParserKt 的 one-pass,其实所有 pure 的 parser combinator 都是 one-pass 的(而且不得不说,在类似字符串组合的情况下这类 parserc 的定义会更好看)
ParserKt 作为一个解析组合子,本身在算法上也没什么亮点(因为许多解析组合子的亮点都不在算法,而在于它们的便利性,少许利用 codegen/macro/inline 的解析组合子才更倾向算法)
包括现在的可变 Pattern 以及 LayoutPattern/InfixPattern,其实也都是运用不那么广泛的组合而已,本质上没太大更新。
想想看 Kotlin 其实也是这样的,multiplatform 早就不是什么新概念了(Haskell 和 Scala 都有官方 JS 后端,C 都有 WebAssembly)
只能说是 Kotlin 加了许多私货,不是什么新东西,只不过其它老东西都没它那么好用而已……
#PL https://github.com/samshadwell/TrumpScript#mission
The is and are keywords are used both to check for equality, and for assignment. To use for assignment, say something like
The is and are keywords are used both to check for equality, and for assignment. To use for assignment, say something like
Trump is great or Democrats are dumb. To use to check for equality, do the same but append a ?. For example, you may need to ask yourself Trump is "the best"? (although we all know that would evaluate to fact anyway)GitHub
GitHub - samshadwell/TrumpScript: Make Python great again
Make Python great again. Contribute to samshadwell/TrumpScript development by creating an account on GitHub.
Forwarded from dnaugsuz
本群有没有大佬知道 OpenCV 怎么做 keyframe extraction 🌚
Forwarded from dnaugsuz
我想做精确的字幕时轴提取,但加上 bandpass filter 后 keyframe 还是那副德性,不能精准提取到整个 subtitle 的 duration,往往不是 start 晚了就是 end 早了
GitHub 上居然没能抄到什么代码
GitHub 上居然没能抄到什么代码
https://github.com/cypherix/keyframe-detection/blob/master/keyframe.ipynb
🤔 感觉先 grayscale 然后直接 ratio thres 可能会比较 acceptable,但不是很学术
🤔 感觉先 grayscale 然后直接 ratio thres 可能会比较 acceptable,但不是很学术
GitHub
cypherix/keyframe-detection
Use this script to get key frames out of a video. Contribute to cypherix/keyframe-detection development by creating an account on GitHub.
Forwarded from 层叠 - The Cascading
中国著名的科技企业华为疑似将浏览器端 IDE 开源项目 code-server 贴牌发布,称其为「华为云CloudIDE」,并使用误导性用词(「源于华为云的全栈技术实力」)意图使用户认为此产品由华为研发。
#华而不实
src: https://mp.weixin.qq.com/s/K1XEWZFASspMpNppaM2g_A
seealso: https://www.zhihu.com/question/383168806
seealso: https://github.com/cdr/code-server
#华而不实
src: https://mp.weixin.qq.com/s/K1XEWZFASspMpNppaM2g_A
seealso: https://www.zhihu.com/question/383168806
seealso: https://github.com/cdr/code-server
Weixin Official Accounts Platform
华为云CloudIDE,云时代的精创利器
华为云CloudIDE,面向云原生的轻量级WebIDE!
https://github.com/Rachel030219/STFW.info/blob/master/av-bv/index.html
设计亮点:
row(align(V_CENTER)) { col(textInput) }
row(align(V_CENTER)) { col(textOutput); col(btnCopy) }
}
🤔 ^不好的表达方式
设计亮点:
<html lang="en">还有主要控件
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="A tool to help convert AV to / from BV codes, avoiding bilibili's ">
<meta name="author" content="Rachel030219">
<div class="mdui-valign" style="height: 90vh;">verticalLayout(align(V_CENTER), height(900.vh)) {
<div class="mdui-container">
<div class="mdui-row mdui-valign">
<div class="mdui-textfield mdui-textfield-floating-label mdui-center mdui-col-sm-6 mdui-col-xs-12 mdui-col-md-4">
<i class="mdui-icon material-icons">sync</i>
<label class="mdui-textfield-label" id="convert-label">Input AV/BV code(like av10492):</label>
<input class="mdui-textfield-input" id="convert-input"></input>
</div>
</div>
<div class="mdui-row mdui-valign mdui-center" style="visibility: hidden;" id="output">
<p class="mdui-col-xs-5 mdui-col-offset-xs-3" id="output-text" style="text-align: center;"></p>
<button class="mdui-btn mdui-btn-raised mdui-color-theme-accent mdui-col-xs-1" id="output-copy" onclick="copy()" disabled>Copy</button>
</div>
</div>
</div>
row(align(V_CENTER)) { col(textInput) }
row(align(V_CENTER)) { col(textOutput); col(btnCopy) }
}
🤔 ^不好的表达方式
outputButton.setAttribute("disabled", true)
outputButton.removeAttribute("disabled")
function copy(text) {
var ta = document.createElement("textarea");
//document.body.append(ta);
ta.value = text;
ta.select();
document.execCommand("copy");
//document.body.removeChild(ta);
mdui.snackbar({ message: "Copied" })
}GitHub
Rachel030219/STFW.info
The web page, STFW.info. Contribute to Rachel030219/STFW.info development by creating an account on GitHub.
./timeline_ops.py merge frames/timeline_SomethingNew.mp4.txt 0.25
./timeline_ops.py to-lrc 29.97 srt 这里有两张图,上面一张是带 smooth filter 的,下面一张是不带的,新特性 (--use-sharp)上面是
--use-sharp 版本的,下面是 smooth 版本的,在实际输出中可以发现 sharp 版找到的峰值更多,但也更精细,配合 --chunk-size 的调整应该就可以做时轴提取了