目前为止,全网也就只有一个博主写到过这样动态显示 subtitle 的文章。传送门(关键词:js, 后加载) 但是嘞,该博写的不怎么详细,17 年底写的。 稍作调整后如下: 修改站点配置文件,主要修改 subtitle subtitle: 不怕万人阻挡,只怕自己投降。W 你如何回忆,决定你是一个怎样的人!W 这是一个句子。W 这是另一个句子。 = "{{config.subtitle}}"; var mytitle = subtitle.split("W"); var max = mytitle.length-1; {% if subtitle %} {% if theme.seo %}
正在加载今日诗词 ....
上面这些不符合 B 站运营 KPI 的功能,显然不是 B 站官方会推出的产品,好在开源项目 IndieKKY/bilibili-subtitle 替我们做了偷懒的工作,上面的功能它都有。 首先是将视频分章节,生成带有时间轴的要点:You are a helpful assistant that summarize key points of video subtitle.Summarize You are a helpful assistant that summarize video subtitle.Summarize in language '中文简体'.Answer in markdown 【时间分片内的所有内容】'以及,输出视频的主要观点:You are a helpful assistant that summarize key points of video subtitle.Summarize 日统计字数: 5242字阅读时间: 11分钟阅读本文链接: https://soulteary.com/2024/01/10/bilibili-browser-ai-assistant-bilibili-subtitle.html
而开源项目video-subtitle-remover(VSR),则直接把问题拉到了“AI视频修复”的维度:用深度学习模型自动检测字幕区域,再通过图像修复算法把文字“擦掉”,并用背景自然填补。 支持多种GPU加速(CUDA/DirectML等)提供多种修复算法(STTNLaMaProPainter)项目地址:GitHub:https://github.com/YaoFANGUK/video-subtitle-remover 【turn4fetch0】(国内镜像可在GitCode搜索video-subtitle-remover)二、VSR整体架构:从“检测”到“修复”的闭环先用一张结构图把整体流程串起来,再逐块拆解。 SUBTITLE_AREA_DEVIATION_PIXEL:放大掩码范围,避免文字边缘残留。 activate#Linux/macOS或Windows:videoEnv\Scripts\activate安装依赖:bashgitclonehttps://github.com/YaoFANGUK/video-subtitle-remover.gitcdvideo-subtitle-removerpipinstall-rrequirements.txt
: "Subtitle", buttonColor: null, disabled: true }; function createOption(someObject) { someObject.title = someObject.title || "Default Title"; someObject.subTitle = someObject.subTitle || "Default Subtitle someObject } console.log(createOption(someObject)); // Output be like // {title: 'Default Title', subTitle : 'Subtitle', buttonColor: 'blue', disabled: true} 这种方法看起来更好: const someObject = { title: null, subTitle = Object.assign({ title: "Default Title", subTitle: "Default Subtitle", buttonColor: "blue"
报错信息: Traceback (most recent call last): File "/home/nutzer/projects-2022-04-06/subtitle2go/subtitle2go_env = fetch_val_for_key(self.fullname, File "/home/nutzer/projects-2022-04-06/subtitle2go/subtitle2go_env from theano.scan_module import scan_opt File "/home/nutzer/projects-2022-04-06/subtitle2go/subtitle2go_env theano.tensor import blas File "/home/nutzer/projects-2022-04-06/subtitle2go/subtitle2go_env/lib/ if not config.blas.ldflags: File "/home/nutzer/projects-2022-04-06/subtitle2go/subtitle2go_env/lib
; constructor(title: string, subTitle: string, image: Resource) { this.title = title; this.subTitle = subTitle; this.image = image; }}1.2 类的职责封装轮播项数据提供数据初始化方法确保数据完整性2. 属性详解2.1 title属性title: string;类型:字符串用途:显示轮播项的主标题特点:必填项2.2 subTitle属性subTitle: string;类型:字符串用途:显示轮播项的副标题特点 ; this.subTitle = subTitle; this.image = image;}3.2 参数说明title:主标题字符串subTitle:副标题字符串image:图片资源引用 最佳实践5.1 数据验证constructor(title: string, subTitle: string, image: Resource) { // 添加数据验证 if (!
"), S("light_editor_subtitle_addsubtitlebutton"), T("light_editor_subtitle_editbutton"), U("light_editor_subtitle_replace"), V("light_editor_subtitle_edit"), W("light_editor_subtitle_font "), X("light_editor_subtitle_copy"), Y("light_editor_subtitle_delete"), Z("light_editor_subtitle_drag "), ab("light_editor_subtitle_preview_edit"), ac("light_editor_subtitle_preview_delete"), "), ag("light_editor_subtitle_effect_all"), ah("light_editor_subtitle_effect_yes"), ai
'] data=self.format_subtitle(subtitle_from,subtitle_to,content,i) def format_subtitle(self,subtitle_from,subtitle_to,content,i): """ 格式化成srt文件, =round(subtitle_from,3) #四舍五入为三位小数 subtitle_to=round (subtitle_to,3) begin=time.strftime("%H:%M:%S",time.gmtime(subtitle_from))+','+self.rectify(subtitle_from ) end=time.strftime("%H:%M:%S",time.gmtime(subtitle_to))+','+self.rectify(subtitle_to
如将下面的:
, en_subtitle_path, index) 增加了 _guess_eng_subtitle_index 方法来确定英文字幕的 index,这是因为虽然大多数视频都的字幕 tags 还是比较规范的 =3000): subtitle_base = os.path.splitext(fixed_subtitle)[0] video_base = os.path.splitext(subtitle_base )[0] if zh_subtitle is None: zh_subtitle = video_base + ".zh-fixed.vtt" if os.path.exists (zh_subtitle): print(f"zh subtitle {zh_subtitle} already translated, skip to translate.") = chunk_size) srtp.save(zh_subtitle) return zh_subtitle 这个逻辑比较简单,读取英文字幕,使用 get_subtitle_text_with_index
/image/icon_mine_balance.png')}, {title: '抵用券', subtitle: '63', image: require('. /image/icon_mine_voucher.png')}, {title: '会员卡', subtitle: '2', image: require('. /image/icon_mine_service.png')}, {title: '关于美团', subtitle: '我要合作', image: require /image/icon_mine_balance.png')}, {title: '抵用券', subtitle: '63', image: require('. /image/icon_mine_voucher.png')}, {title: '会员卡', subtitle: '2', image: require('.
">当日:100
JSON 将dict转为JSON,这里利用包json import json aItem = {} aItem["id"] = "2203" aItem["title"] = "title" aItem["subTitle "] = "sub title" bItem = {} bItem["id"] = "2842" bItem["title"] = "b标题" bItem["subTitle"] = "b副标题" bItem ) print(aJson) print(bJson) 涉及到中文字符的时候,需要指定ensure_ascii=False 输出: {'id': '2203', 'title': 'title', 'subTitle ': 'sub title'} {"id": "2203", "title": "title", "subTitle": "sub title"} {"id": "2842", "title": "b标题 ", "subTitle": "b副标题", "content": "内容", "list": ["a", "a 2", "b", "bb"]} 二、list 转为JSON 接上面的代码 jsonList
将dict转为JSON,这里利用包json import json aItem = {} aItem["id"] = "2203" aItem["title"] = "title" aItem["subTitle "] = "sub title" bItem = {} bItem["id"] = "2842" bItem["title"] = "b标题" bItem["subTitle"] = "b副标题" bItem print(aJson) print(bJson) 涉及到中文字符的时候,需要指定ensure_ascii=False 输出: {'id': '2203', 'title': 'title', 'subTitle ': 'sub title'} {"id": "2203", "title": "title", "subTitle": "sub title"} {"id": "2842", "title": "b标题 ", "subTitle": "b副标题", "content": "内容", "list": ["a", "a 2", "b", "bb"]} list 转为JSON 接上面的代码 jsonList
"Example of bayestestR::Highest Density Interval function", subtitle color = "black", size = 20, margin = margin(t = 1, b = 12)), plot.subtitle title = "Example of bayestestR::Support Interval function", subtitle title = "Example of effectsize::equivalence_test function", subtitle title = "Example of modelbased::estimate_means function", subtitle
整个结构是父组件调用红框子组件,子组件有一个title 是父组件传过来的属性,另一个subtitle 是一个state 按钮是刷新这个state 。 , setSubTitle] = useState('subTitle'); useEffect(() => { console.log('初始化加载'); return () `); return () => { console.log(`清除上次${subTitle}渲染`); }; }, [subTitle]); useEffect 刷新subtitle </Button>
+ labs( title = "Example of add P values in ggpubr", subtitle color = "black", size = 20, margin = margin(t = 1, b = 12)), plot.subtitle labs( title = "Example of add P.adj values in ggpubr", subtitle labs( title = "Example of add P.custom values in ggpubr", subtitle labs( title = "Example of add P.signif values in ggpubr", subtitle
: "Subtitle", buttonColor: null, disabled: true }; function createOption(someObject) { someObject.title = someObject.title || "Default Title"; someObject.subTitle = someObject.subTitle || "Default Subtitle : 'Subtitle', buttonColor: 'blue', disabled: true} 这种方法看起来更好: const someObject = { title: null, subTitle: "Subtitle", buttonColor: null, disabled: true }; function creteOption(someObject) { const newObject = Object.assign({ title: "Default Title", subTitle: "Default Subtitle", buttonColor
", ylab = "Y-axis Subtitle") 现在需要为现有的柱状图添加一组对比数据,并且灰色有些单调,还需要为柱状图添加一些鲜艳的颜色: > data2 <- c(0.7921935, ", ylab = "Y-axis <em>Subtitle</em>", beside = TRUE, col = colors) 现在的柱状图变得稍微美观了一些,但两组数据的对比似乎还缺少图例: > legends ", ylab = "Y-axis Subtitle", beside = TRUE, col = colors) > legend("bottom", legend = legends, fill = ", ylab = "Y-axis Subtitle", col = colors[1], lty = ltys[1], pch = pchs[1], cex = 1.2, lwd = 2, type ", ylab = "Y1-axis Subtitle", type = "o", col = "blue", pch = 15, axes = FALSE) # 绘制第一条线 > axis(side
, size = 20, margin = margin(t = 1, b = 12)), plot.subtitle , size = 20, margin = margin(t = 1, b = 12)), plot.subtitle , size = 20, margin = margin(t = 1, b = 12)), plot.subtitle , size = 20, margin = margin(t = 1, b = 12)), plot.subtitle , size = 20, margin = margin(t = 1, b = 12)), plot.subtitle