{"id":13625776,"url":"https://github.com/williamfzc/stagesepx","last_synced_at":"2025-05-15T01:06:36.765Z","repository":{"id":37735558,"uuid":"196534475","full_name":"williamfzc/stagesepx","owner":"williamfzc","description":"detect stages in video automatically","archived":false,"fork":false,"pushed_at":"2025-03-01T14:14:29.000Z","size":625,"stargazers_count":440,"open_issues_count":28,"forks_count":126,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-09T08:00:36.469Z","etag":null,"topics":["app","image-classification","keras","lightweight","performance","python","ssim","stage","svm","video","video-to-images"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/williamfzc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-12T07:51:38.000Z","updated_at":"2025-04-01T11:23:52.000Z","dependencies_parsed_at":"2022-07-12T16:44:02.470Z","dependency_job_id":"d0cd19cc-5736-4c58-9851-97f222dd8977","html_url":"https://github.com/williamfzc/stagesepx","commit_stats":{"total_commits":601,"total_committers":4,"mean_commits":150.25,"dds":0.008319467554076532,"last_synced_commit":"d363187b1aeb3d54ef632e9977404a7f2d04c4ca"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfzc%2Fstagesepx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfzc%2Fstagesepx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfzc%2Fstagesepx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamfzc%2Fstagesepx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williamfzc","download_url":"https://codeload.github.com/williamfzc/stagesepx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253860160,"owners_count":21975223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","image-classification","keras","lightweight","performance","python","ssim","stage","svm","video","video-to-images"],"created_at":"2024-08-01T21:02:01.610Z","updated_at":"2025-05-15T01:06:31.744Z","avatar_url":"https://github.com/williamfzc.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./docs/pics/brand.svg\"\u003e\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003estage sep(aration) x\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003edetect stages in video automatically\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n\n| Type                 | Status                                                                                                                                                                                                                                                                           |\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| package version      | [![PyPI version](https://badge.fury.io/py/stagesepx.svg)](https://badge.fury.io/py/stagesepx)                                                                                                                                                                                    |\n| python version       | ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/stagesepx)                                                                                                                                                                                                       |\n| auto test            | ![CI Status](https://github.com/williamfzc/stagesepx/workflows/smoketest/badge.svg)                                                                                                                                                                                              |\n| code maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/ef27756ce9a4f7f4ba94/maintainability)](https://codeclimate.com/github/williamfzc/stagesepx/maintainability)                                                                                                            |\n| code coverage        | [![codecov](https://codecov.io/gh/williamfzc/stagesepx/branch/master/graph/badge.svg)](https://codecov.io/gh/williamfzc/stagesepx)                                                                                                                                               |\n| code style           | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)                                                                                                                                                                 |\n| stat                 | [![Downloads](https://pepy.tech/badge/stagesepx)](https://pepy.tech/project/stagesepx)  [![Downloads](https://pepy.tech/badge/stagesepx/month)](https://pepy.tech/project/stagesepx) [![Downloads](https://pepy.tech/badge/stagesepx/week)](https://pepy.tech/project/stagesepx) |\n\n\n---\n\n\u003e 2022/08/13：在 0.18.0 之后，ffmpeg 以 [imageio_ffmpeg](https://github.com/imageio/imageio-ffmpeg) 方式内置（请自行评估其LICENSE影响）。此版本为解决opencv版本及M1芯片的限制，并不再需要额外安装ffmpeg。详见 [#178](https://github.com/williamfzc/stagesepx/issues/178)。\n\u003e\n\u003e 2022/03/30：官方不维护任何诸如微信群、QQ群的多人群组，所有信息请通过issue公开交流。不需要任何捐赠支持，如遇到涉及金钱相关的信息请不要相信。\n\u003e \n\u003e 2021/12/15：在 0.16.0 之后，stagesepx 将开始提供部分功能测试的支持，详见 [#158](https://github.com/williamfzc/stagesepx/issues/158)\n\u003e \n\u003e 2020/05/21：目前，该项目已经达到一个较为稳定的状态，并顺利在多家头部公司、团队落地，作为正式工具存在。Bug跟踪与建议请优先通过 [issue](https://github.com/williamfzc/stagesepx/issues) 联系我，感谢所有支持过这个项目的人。欢迎有心优化的同学、落地成功的团队共同建设：）\n\n---\n\n\u003e [English README here](./README_en.md)\n\n这段视频展示了一个应用的完整启动过程：\n\n![video_readme.gif](https://i.loli.net/2019/09/01/tXRhB6ai9jAZFmc.gif)\n\n将视频传递给 stagesepx，它将自动分析拆解，得到视频中所有的阶段。包括变化的过程及其耗时，以及在稳定的阶段停留的时长：\n\n![taobao_startup.png](https://i.loli.net/2019/11/23/Cio39V4AhmWOyFL.png)\n\n你可以据此得到每个阶段对应的精确耗时。\n\n### 跨端运作\n\n当然，它是天然跨端的，例如web端。甚至，任何端：\n\n![sugar.gif](https://i.loli.net/2019/11/23/BCjI8PiJrgmxQUt.gif)\n\n![sugar](https://i.loli.net/2019/11/23/DCpbdlNftcQ3v2w.png)\n\n### 高准确度\n\n与视频一致的高准确度。以秒表为例：\n\n![accuracy.png](https://i.loli.net/2019/10/02/Cboj743UwRQmgPS.png)\n\n可以看到，与秒表的表现几乎没有差异。**请注意，这里的准确度指的是 stagesepx 能够精确还原视频本身的数据与表现。而对于现象（例如某某时间点出现什么状态）而言，准确度很大程度上取决于视频本身，如fps/分辨率等。**\n\n### 彻底解耦 \u0026 可编程\n\n如果比起报告，更希望亲自处理原始数据，进而进行二次开发，你可以直接将 report 部分去除。如此做，你将得到一个 python 对象供你随意使用。它提供了大量的API，例如转换成字典：\n\n```text\n{\n\t\"data\": [{\n\t\t\"data\": null,\n\t\t\"frame_id\": 1,\n\t\t\"stage\": \"0\",\n\t\t\"timestamp\": 0.0,\n\t\t\"video_path\": \"../demo.mp4\"\n\t}, {\n\t\t\"data\": null,\n\t\t\"frame_id\": 2,\n\t\t\"stage\": \"0\",\n\t\t\"timestamp\": 0.04,\n\t\t\"video_path\": \"../demo.mp4\"\n\t}, {\n\t\t\"data\": null,\n\t\t\"frame_id\": 3,\n\t\t\"stage\": \"0\",\n\t\t\"timestamp\": 0.08,\n\t\t\"video_path\": \"../demo.mp4\"\n\t}, {\n\t\n  ...\n```\n\n从这个字典中我们可以知道，每一帧分别对应的：\n\n- 被分类到哪一个类别\n- 时间戳\n- 帧编号\n- ...\n\n用户可以随意处理这些数据，无论是保存或是交给下一段代码。\n\n### 完整自动化支持 \u0026 规模化\n\n- 既然它是可编程的，那么它必然是朝着彻底替代人力的方向演进的。这也是它最强大的特性；\n- 它允许用户利用自己的训练集进行模型训练，利用神经网络进行规模化、全自动化的特定阶段耗时计算；\n- 此方案能够被广泛应用到各类业务迭代中，与持续集成配合，有效降低人力消耗；\n- 一些方向参考：\n    - 为你的应用建立高频次的性能回归测试，形成benchmark\n    - 对模型进行补足，为一系列同类应用（如小程序、小游戏，etc.）构建巡检能力\n    - ...\n\n具体可参见 [将 stagesepx 应用到实际业务中](https://github.com/williamfzc/work_with_stagesepx)。\n\n---\n\n- 标准模式下无需前置训练与学习\n- 更少的代码需要\n- 高度可配置化，适应不同场景\n- 支持与其他框架结合，融入你的业务\n- 所有你需要的，只是一个视频\n\n## 开始\n\n### 正式使用\n\n\u003e 在正式落地时，推荐使用 完整的python脚本 而不是命令行，以保证更高的可编程性。完整的落地例子另外单独开了一个 repo 存放，[传送门](https://github.com/williamfzc/work_with_stagesepx)。\n\u003e 请一定配合 [这篇文章](https://blog.csdn.net/wsc106/article/details/107351675) 使用，基本能解决90%的问题。\n\n- 配置：\n    - [用30行代码快速跑一个demo](example/mini.py)\n    - [30行代码怎么没有注释](example/stable.py)\n    - [还有更多配置吗](example/cut_and_classify.py)\n- 应用：\n    - [我想结合真实场景理解这个项目的原理](https://github.com/150109514/stagesepx_with_keras)\n    - [我想看看实际落地方案，最好有把饭喂嘴里的例子](https://github.com/williamfzc/work_with_stagesepx)\n    - [我们的app很复杂，能搞定吗](https://testerhome.com/topics/22215)\n    - [太麻烦了，有没有开箱即用、简单配置下可以落地的工具](https://github.com/williamfzc/sepmachine)\n- 其他：\n    - [我有问题要问](https://github.com/williamfzc/stagesepx/issues/new)\n    - [（使用时请参考上面的其他链接，此文档更新不及时）官方文档](https://williamfzc.github.io/stagesepx/)\n\n### 命令行\n\n你也可以直接通过命令行使用，而无需编写脚本：\n\n```bash\nstagesepx analyse your_video.mp4 report.html\n```\n\n基于此，你可以非常方便地利用 shell 建立工作流。以 android 为例：\n\n```bash\nadb shell screenrecord --time-limit 10 /sdcard/demo.mp4\nadb pull /sdcard/demo.mp4 .\nstagesepx analyse demo.mp4 report.html\n```\n\n关于结果不准确的问题请参考 [#46](https://github.com/williamfzc/stagesepx/issues/46)。\n\n### 配置化运行（0.15.0）\n\n当然，通常因为场景差异，我们需要对参数进行修改使其达到更好的效果。这使得用户需要投入一些精力在脚本编写上。在 0.15.0 之后，配置化运行的加入使用户能够在不需要编写脚本的情况下直接使用所有能力，大大降低了接入门槛。\n\n```json\n{\n  \"output\": \".\",\n  \"video\": {\n    \"path\": \"./PATH_TO_YOUR/VIDEO.mp4\",\n    \"fps\": 30\n  }\n}\n```\n\n命令行运行：\n\n```bash\nstagesepx run YOUR_CONFIG.json\n```\n\n即可达到与脚本相同的效果。其他的配置项可以参考：[work_with_stagesepx](https://github.com/williamfzc/work_with_stagesepx/tree/master/run_with_config)\n\n## 安装\n\n标准版（pypi）\n\n```bash\npip install stagesepx\n```\n\n预览版（github）：\n\n```bash\npip install --upgrade git+https://github.com/williamfzc/stagesepx.git\n```\n\n## 常见问题\n\n最终我还是决定通过 issue 面板维护所有的 Q\u0026A ，毕竟问题的提出与回复是一个强交互过程。如果在查看下列链接之后你的问题依旧没有得到解答：\n\n- 请 [新建issue](https://github.com/williamfzc/stagesepx/issues/new)\n- 或在相关的 issue 下进行追问与补充\n- 你的提问将不止帮助到你一个人 :)\n\n问题列表：\n\n- [安装过程遇到问题？](https://github.com/williamfzc/stagesepx/issues/80)\n- [如何根据图表分析得出app启动的时间？](https://github.com/williamfzc/stagesepx/issues/73)\n- [日志太多了，如何关闭或者导出成文件？](https://github.com/williamfzc/stagesepx/issues/58)\n- [我的视频有 轮播图 或 干扰分类 的区域](https://github.com/williamfzc/stagesepx/issues/55)\n- [分类结果如何定制？](https://github.com/williamfzc/stagesepx/issues/48)\n- [算出来的结果不准确 / 跟传统方式有差距](https://github.com/williamfzc/stagesepx/issues/46)\n- [出现 OutOfMemoryError](https://github.com/williamfzc/stagesepx/issues/86)\n- [工具没法满足我的业务需要](https://github.com/williamfzc/stagesepx/issues/93)\n- [为什么报告中的时间戳跟实际不一样？](https://github.com/williamfzc/stagesepx/issues/75)\n- [自定义模型的分类结果不准确，跟我提供的训练集对不上](https://github.com/williamfzc/stagesepx/issues/100)\n- ...\n\n不仅是问题，如果有任何建议与交流想法，同样可以通过 issue 面板找到我。我们每天都会查看 issue 面板，无需担心跟进不足。\n\n## 相关文章\n\n- [图像分类、AI 与全自动性能测试](https://testerhome.com/topics/19978)\n- [全自动化的抖音启动速度测试](https://testerhome.com/topics/22215)\n- [(MTSC2019) 基于图像分类的下一代速度类测试解决方案](https://testerhome.com/topics/21874)\n\n## 架构\n\n![structure](./docs/pics/stagesepx.svg)\n\n## 参与项目\n\n### 规划\n\n在 1.0版本 之前，我们接下来的工作主要分为下面几个部分：\n\n#### 标准化\n\n随着越来越多的业务落地，我们开始思考它是否能够作为行业级别的方案。\n\n- [x] 基于实验室数据的准确度对比（未公开）\n- [x] [规范且适合落地的例子](https://github.com/williamfzc/work_with_stagesepx)\n- [ ] 边界情况下的确认\n- [x] 代码覆盖率 95%+\n- [ ] API参数相关文档\n\n#### 新需求的收集与开发\n\n该部分由 issue 面板管理。\n\n### 贡献代码\n\n欢迎感兴趣的同学为这个项目添砖加瓦，三个必备步骤：\n\n- 请在开始编码前留个 issue 告知你想完成的功能，因为可能这个功能已经在开发中或者已有；\n- commit规范我们严格遵守 [约定式提交](https://www.conventionalcommits.org/zh-hans/)；\n- 该repo有较为完善的单测与CI以保障整个项目的质量，在过去的迭代中发挥了巨大的作用。所以请为你新增的代码同步新增单元测试（具体写法请参考 tests 中的已有用例）。\n\n### 联系我们\n\n- 邮箱：`fengzc@vip.qq.com`\n- QQ：`178894043`\n\n## Changelog / History\n\nsee [CHANGELOG.md](CHANGELOG.md)\n\n## Thanks\n\nThank you [JetBrains](https://www.jetbrains.com/) for supporting the project with free product licenses.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfzc%2Fstagesepx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamfzc%2Fstagesepx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfzc%2Fstagesepx/lists"}