flicker-detector-cpu 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ # Wheel/sdist: launcher package + bin/ (stage exes with publish.bat). No server Python sources.
2
+ include README-PyPI.md
3
+ graft flicker_detector_bundle
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: flicker-detector-cpu
3
+ Version: 1.0.5
4
+ Summary: Windows CPU build: bundled cpu-flicker-detector*.exe (CLI/web/client), no C++/TS/web source in the package.
5
+ Author: internal
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3 :: Only
8
+ Classifier: Environment :: Console
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Topic :: Multimedia :: Video
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ Provides-Extra: web
14
+ Requires-Dist: fastapi>=0.110; extra == "web"
15
+ Requires-Dist: uvicorn[standard]>=0.27; extra == "web"
16
+ Requires-Dist: python-multipart>=0.0.9; extra == "web"
17
+ Requires-Dist: pydantic>=2.6; extra == "web"
18
+ Requires-Dist: pyinstaller>=6.0; extra == "web"
19
+
20
+ # flicker-detector-cpu(Windows CPU 后端)
21
+
22
+ 本发行版是 **`flicker-detector[cpu]`** 的 **CPU 后端**:PyPI 项目名为 **`flicker-detector-cpu`**(名称里不能写方括号 `[]`)。捆绑 **`cpu-flicker-detector.exe`**、**`cpu-flicker-detector-server.exe`**、**`cpu-flicker-detector-client.exe`**,由包内薄启动器 `execv` 调用(**不含** C++ / 前端 / 服务端 Python 源码)。控制台命令名仍为 **`flicker-detector`** / **`flicker-detector-server`** / **`flicker-detector-client`**。
23
+
24
+ - **要求**:Python **≥ 3.10**,操作系统 **Windows 64 位**。
25
+
26
+ ## 推荐安装(与命令名一致)
27
+
28
+ ```powershell
29
+ py -m pip install "flicker-detector[cpu]"
30
+ ```
31
+
32
+ 会安装 **`flicker-detector`**(元包)与 **`flicker-detector-cpu`**(本 wheel)。仅要后端、不要元包时:
33
+
34
+ ```powershell
35
+ py -m pip install flicker-detector-cpu
36
+ ```
37
+
38
+ 安装后可直接使用下列命令(与 `python -m pip show -f flicker-detector-cpu` 中 `flicker_detector_bundle\bin\` 下 exe 等价)。
39
+
40
+ **GPU 后端**:在 PyPI 上存在 **`flicker-detector-gpu`** 时,可安装 **`flicker-detector[gpu]`**(元包已声明该 extra),命令名仍为下面三个。**请勿同时安装 `[cpu]` 与 `[gpu]`**(脚本会冲突)。
41
+
42
+ ---
43
+
44
+ ## 1. `flicker-detector` — 本地命令行检测
45
+
46
+ 在**本机**对图片目录、视频或多张图片路径(有序序列)做闪屏/异常画面检测,输出 **JSON**。
47
+
48
+ ```text
49
+ flicker-detector --type <dir|video|sequence> --input <路径> [--input <路径>...] --output <结果.json>
50
+ ```
51
+
52
+ - **`--type`**:`dir`(图片目录,不递归)、`video`(单个视频)、`sequence`(至少两个 `--input`,每张图为图片路径,顺序即时间序)。
53
+ - 可选门限、JSON 配置等见帮助:
54
+
55
+ ```text
56
+ flicker-detector --help
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 2. `flicker-detector-server` — Web 服务与浏览器界面
62
+
63
+ 启动 **HTTP 服务**,在浏览器里上传素材、查看检测结果并可做**人工反馈**;任务与记录默认落在 exe 旁的 **`flicker_detector_web_data`**(可用环境变量改写)。若仍使用旧目录名,可设置 `FLICKER_DETECTOR_WEB_DATA` 或沿用 `FLASH_DETECTOR_WEB_DATA` 指向原路径。
64
+
65
+ 默认在浏览器打开:
66
+
67
+ **http://127.0.0.1:8765**
68
+
69
+ ### 2.1 页面与功能
70
+
71
+ | 区域 | 作用 |
72
+ |------|------|
73
+ | **工作台** | 上传**视频**、**文件夹(整目录图片)**或**多张图片**;查看任务进度、统计、**findings** 列表;点开单条可预览起止帧、时间范围;可对每条结果标记 **人工确认(正确 / 错误)**。 |
74
+ | **检测记录** | 历史任务表格:支持按时间范围、状态、输入类型、客户端 IP、检出数量、**故障类型**、是否已反馈等筛选;行可展开查看与工作台类似的详情;点击任务可在新标签打开单任务页。 |
75
+ | **趋势图(检测记录页上方)** | **请求量 / 检出量** 按时间粒度(分钟〜月)统计。 |
76
+ | **反馈趋势图(单独一块)** | **用户反馈率**、**反馈正确率**;可按 **故障类型(flash_type)** 筛选,默认**全部类型**。 |
77
+
78
+ ### 2.2 常用环境变量
79
+
80
+ 优先读取 **`FLICKER_*`**;未设置时仍接受旧名 **`FLASH_*`** / **`IMAGE_FLASH_DETECTOR_EXE`**(便于升级)。
81
+
82
+ | 变量(新) | 旧名(仍有效) | 含义 |
83
+ |------------|----------------|------|
84
+ | `FLICKER_DETECTOR_EXE` | `IMAGE_FLASH_DETECTOR_EXE` | 检测程序路径(可选) |
85
+ | `FLICKER_DETECTOR_BIND` | `FLASH_DETECTOR_BIND` | 监听地址,默认 `127.0.0.1` |
86
+ | `FLICKER_DETECTOR_PORT` | `FLASH_DETECTOR_PORT` | 端口,默认 `8765` |
87
+ | `FLICKER_DETECTOR_WEB_DATA` | `FLASH_DETECTOR_WEB_DATA` | SQLite 与上传缓存目录 |
88
+ | `FLICKER_DETECTOR_MAX_UPLOAD_MB` | `FLASH_DETECTOR_MAX_UPLOAD_MB` | 单次上传总大小上限(MB) |
89
+ | `FLICKER_DETECTOR_MAX_CONCURRENT_JOBS` | `FLASH_DETECTOR_MAX_CONCURRENT_JOBS` | 并发检测任务数 |
90
+ | `FLICKER_DETECTOR_JOB_TIMEOUT_SEC` | `FLASH_DETECTOR_JOB_TIMEOUT_SEC` | 单任务子进程超时(秒) |
91
+ | `FLICKER_DETECTOR_TRUST_PROXY` | `FLASH_DETECTOR_TRUST_PROXY` | 设为 `1` 时从 `X-Forwarded-For` 取客户端 IP |
92
+
93
+ 示例:
94
+
95
+ ```powershell
96
+ $env:FLICKER_DETECTOR_PORT = "9000"
97
+ flicker-detector-server
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 3. `flicker-detector-client` — 远程提交检测(B/S)
103
+
104
+ 在**任意能访问服务地址**的机器上,把本地视频或图片**上传到已在运行的 `flicker-detector-server`**,由**服务端**调用检测 exe;**不需要**在客户端安装检测主程序。
105
+
106
+ ```text
107
+ flicker-detector-client --mode <video|sequence|folder> --url <服务根地址> [选项] <路径...>
108
+ ```
109
+
110
+ | `--mode` | 含义 | 路径参数 |
111
+ |----------|------|----------|
112
+ | `video` | 单个视频 | 恰好一个视频文件 |
113
+ | `sequence` | 有序图片序列 | 至少两张图 |
114
+ | `folder` | 图片目录(会遍历子目录中的图片) | 恰好一个目录 |
115
+
116
+ 常用选项(完整列表见 `flicker-detector-client --help`):
117
+
118
+ - `--url`:服务地址,如 `http://192.168.1.10:8765`
119
+ - `--output`:将最终任务 JSON 写入文件;不写则打印到标准输出
120
+ - `--poll`:轮询间隔(秒)
121
+ - `--timeout` / `--http-timeout` / `--upload-timeout`:超时控制
122
+ - `--quiet`:少打印进度
123
+ - `--skip-health`:跳过启动前健康检查
124
+
125
+ 示例:
126
+
127
+ ```powershell
128
+ flicker-detector-client --mode video --url http://127.0.0.1:8765 clip.mp4
129
+ flicker-detector-client --mode sequence --url http://127.0.0.1:8765 .\a.png .\b.png .\c.png
130
+ flicker-detector-client --mode folder --url http://192.168.1.10:8765 --output result.json D:\shots\seq1
131
+ ```
132
+
133
+ **退出码**:`0` 成功;`1` 任务失败;`2` 网络/HTTP/解析错误;`3` 参数或本地路径错误;`4` 等待超时。
134
+
135
+ ---
136
+
137
+ ## 4. 其他说明
138
+
139
+ - 若命令提示缺少捆绑 exe,请从 **PyPI** 重新安装 **`win_amd64`** wheel(项目名 **`flicker-detector-cpu`**,或通过 **`flicker-detector[cpu]`**)。
140
+ - 算法细节、自编译、源码级 Web 开发见 **GitHub** 仓库 **`flicker-detector-cpu`** 中的主 `README.md`(本页仅说明 **pip 安装后的三个入口与界面**)。
@@ -0,0 +1,121 @@
1
+ # flicker-detector-cpu(Windows CPU 后端)
2
+
3
+ 本发行版是 **`flicker-detector[cpu]`** 的 **CPU 后端**:PyPI 项目名为 **`flicker-detector-cpu`**(名称里不能写方括号 `[]`)。捆绑 **`cpu-flicker-detector.exe`**、**`cpu-flicker-detector-server.exe`**、**`cpu-flicker-detector-client.exe`**,由包内薄启动器 `execv` 调用(**不含** C++ / 前端 / 服务端 Python 源码)。控制台命令名仍为 **`flicker-detector`** / **`flicker-detector-server`** / **`flicker-detector-client`**。
4
+
5
+ - **要求**:Python **≥ 3.10**,操作系统 **Windows 64 位**。
6
+
7
+ ## 推荐安装(与命令名一致)
8
+
9
+ ```powershell
10
+ py -m pip install "flicker-detector[cpu]"
11
+ ```
12
+
13
+ 会安装 **`flicker-detector`**(元包)与 **`flicker-detector-cpu`**(本 wheel)。仅要后端、不要元包时:
14
+
15
+ ```powershell
16
+ py -m pip install flicker-detector-cpu
17
+ ```
18
+
19
+ 安装后可直接使用下列命令(与 `python -m pip show -f flicker-detector-cpu` 中 `flicker_detector_bundle\bin\` 下 exe 等价)。
20
+
21
+ **GPU 后端**:在 PyPI 上存在 **`flicker-detector-gpu`** 时,可安装 **`flicker-detector[gpu]`**(元包已声明该 extra),命令名仍为下面三个。**请勿同时安装 `[cpu]` 与 `[gpu]`**(脚本会冲突)。
22
+
23
+ ---
24
+
25
+ ## 1. `flicker-detector` — 本地命令行检测
26
+
27
+ 在**本机**对图片目录、视频或多张图片路径(有序序列)做闪屏/异常画面检测,输出 **JSON**。
28
+
29
+ ```text
30
+ flicker-detector --type <dir|video|sequence> --input <路径> [--input <路径>...] --output <结果.json>
31
+ ```
32
+
33
+ - **`--type`**:`dir`(图片目录,不递归)、`video`(单个视频)、`sequence`(至少两个 `--input`,每张图为图片路径,顺序即时间序)。
34
+ - 可选门限、JSON 配置等见帮助:
35
+
36
+ ```text
37
+ flicker-detector --help
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 2. `flicker-detector-server` — Web 服务与浏览器界面
43
+
44
+ 启动 **HTTP 服务**,在浏览器里上传素材、查看检测结果并可做**人工反馈**;任务与记录默认落在 exe 旁的 **`flicker_detector_web_data`**(可用环境变量改写)。若仍使用旧目录名,可设置 `FLICKER_DETECTOR_WEB_DATA` 或沿用 `FLASH_DETECTOR_WEB_DATA` 指向原路径。
45
+
46
+ 默认在浏览器打开:
47
+
48
+ **http://127.0.0.1:8765**
49
+
50
+ ### 2.1 页面与功能
51
+
52
+ | 区域 | 作用 |
53
+ |------|------|
54
+ | **工作台** | 上传**视频**、**文件夹(整目录图片)**或**多张图片**;查看任务进度、统计、**findings** 列表;点开单条可预览起止帧、时间范围;可对每条结果标记 **人工确认(正确 / 错误)**。 |
55
+ | **检测记录** | 历史任务表格:支持按时间范围、状态、输入类型、客户端 IP、检出数量、**故障类型**、是否已反馈等筛选;行可展开查看与工作台类似的详情;点击任务可在新标签打开单任务页。 |
56
+ | **趋势图(检测记录页上方)** | **请求量 / 检出量** 按时间粒度(分钟〜月)统计。 |
57
+ | **反馈趋势图(单独一块)** | **用户反馈率**、**反馈正确率**;可按 **故障类型(flash_type)** 筛选,默认**全部类型**。 |
58
+
59
+ ### 2.2 常用环境变量
60
+
61
+ 优先读取 **`FLICKER_*`**;未设置时仍接受旧名 **`FLASH_*`** / **`IMAGE_FLASH_DETECTOR_EXE`**(便于升级)。
62
+
63
+ | 变量(新) | 旧名(仍有效) | 含义 |
64
+ |------------|----------------|------|
65
+ | `FLICKER_DETECTOR_EXE` | `IMAGE_FLASH_DETECTOR_EXE` | 检测程序路径(可选) |
66
+ | `FLICKER_DETECTOR_BIND` | `FLASH_DETECTOR_BIND` | 监听地址,默认 `127.0.0.1` |
67
+ | `FLICKER_DETECTOR_PORT` | `FLASH_DETECTOR_PORT` | 端口,默认 `8765` |
68
+ | `FLICKER_DETECTOR_WEB_DATA` | `FLASH_DETECTOR_WEB_DATA` | SQLite 与上传缓存目录 |
69
+ | `FLICKER_DETECTOR_MAX_UPLOAD_MB` | `FLASH_DETECTOR_MAX_UPLOAD_MB` | 单次上传总大小上限(MB) |
70
+ | `FLICKER_DETECTOR_MAX_CONCURRENT_JOBS` | `FLASH_DETECTOR_MAX_CONCURRENT_JOBS` | 并发检测任务数 |
71
+ | `FLICKER_DETECTOR_JOB_TIMEOUT_SEC` | `FLASH_DETECTOR_JOB_TIMEOUT_SEC` | 单任务子进程超时(秒) |
72
+ | `FLICKER_DETECTOR_TRUST_PROXY` | `FLASH_DETECTOR_TRUST_PROXY` | 设为 `1` 时从 `X-Forwarded-For` 取客户端 IP |
73
+
74
+ 示例:
75
+
76
+ ```powershell
77
+ $env:FLICKER_DETECTOR_PORT = "9000"
78
+ flicker-detector-server
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 3. `flicker-detector-client` — 远程提交检测(B/S)
84
+
85
+ 在**任意能访问服务地址**的机器上,把本地视频或图片**上传到已在运行的 `flicker-detector-server`**,由**服务端**调用检测 exe;**不需要**在客户端安装检测主程序。
86
+
87
+ ```text
88
+ flicker-detector-client --mode <video|sequence|folder> --url <服务根地址> [选项] <路径...>
89
+ ```
90
+
91
+ | `--mode` | 含义 | 路径参数 |
92
+ |----------|------|----------|
93
+ | `video` | 单个视频 | 恰好一个视频文件 |
94
+ | `sequence` | 有序图片序列 | 至少两张图 |
95
+ | `folder` | 图片目录(会遍历子目录中的图片) | 恰好一个目录 |
96
+
97
+ 常用选项(完整列表见 `flicker-detector-client --help`):
98
+
99
+ - `--url`:服务地址,如 `http://192.168.1.10:8765`
100
+ - `--output`:将最终任务 JSON 写入文件;不写则打印到标准输出
101
+ - `--poll`:轮询间隔(秒)
102
+ - `--timeout` / `--http-timeout` / `--upload-timeout`:超时控制
103
+ - `--quiet`:少打印进度
104
+ - `--skip-health`:跳过启动前健康检查
105
+
106
+ 示例:
107
+
108
+ ```powershell
109
+ flicker-detector-client --mode video --url http://127.0.0.1:8765 clip.mp4
110
+ flicker-detector-client --mode sequence --url http://127.0.0.1:8765 .\a.png .\b.png .\c.png
111
+ flicker-detector-client --mode folder --url http://192.168.1.10:8765 --output result.json D:\shots\seq1
112
+ ```
113
+
114
+ **退出码**:`0` 成功;`1` 任务失败;`2` 网络/HTTP/解析错误;`3` 参数或本地路径错误;`4` 等待超时。
115
+
116
+ ---
117
+
118
+ ## 4. 其他说明
119
+
120
+ - 若命令提示缺少捆绑 exe,请从 **PyPI** 重新安装 **`win_amd64`** wheel(项目名 **`flicker-detector-cpu`**,或通过 **`flicker-detector[cpu]`**)。
121
+ - 算法细节、自编译、源码级 Web 开发见 **GitHub** 仓库 **`flicker-detector-cpu`** 中的主 `README.md`(本页仅说明 **pip 安装后的三个入口与界面**)。
@@ -0,0 +1,14 @@
1
+ """Bundled Windows executables (detector, web server, HTTP client) for distribution wheels."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__ = ["package_version"]
6
+
7
+
8
+ def package_version() -> str:
9
+ try:
10
+ from importlib.metadata import version
11
+
12
+ return version("flicker-detector-cpu")
13
+ except Exception: # pragma: no cover
14
+ return "0.0.0"
@@ -0,0 +1,60 @@
1
+ """Console entry points: exec bundled native exes with forwarded argv (Windows)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import sys
7
+ from pathlib import Path
8
+
9
+
10
+ def _bin_dir() -> Path:
11
+ return Path(__file__).resolve().parent / "bin"
12
+
13
+
14
+ def _require_win() -> None:
15
+ if sys.platform != "win32":
16
+ print("launcher: bundled executables are Windows-only.", file=sys.stderr)
17
+ raise SystemExit(2)
18
+
19
+
20
+ def _exec_exe(exe: Path) -> None:
21
+ if not exe.is_file():
22
+ print(f"launcher: missing bundled executable: {exe}", file=sys.stderr)
23
+ print("Run publish.bat (or copy exes into flicker_detector_bundle/bin) before uv build.", file=sys.stderr)
24
+ raise SystemExit(2)
25
+ argv = [str(exe)] + sys.argv[1:]
26
+ try:
27
+ os.execv(str(exe), argv)
28
+ except OSError as e:
29
+ print(f"launcher: failed to start {exe}: {e}", file=sys.stderr)
30
+ raise SystemExit(1) from e
31
+
32
+
33
+ def main_detector() -> None:
34
+ _require_win()
35
+ _exec_exe(_bin_dir() / "cpu-flicker-detector.exe")
36
+
37
+
38
+ def main_server() -> None:
39
+ """PyInstaller server expects cwd near the one-file exe for data/static sidecars."""
40
+ _require_win()
41
+ exe = _bin_dir() / "cpu-flicker-detector-server.exe"
42
+ if not exe.is_file():
43
+ print(f"launcher: missing bundled executable: {exe}", file=sys.stderr)
44
+ raise SystemExit(2)
45
+ try:
46
+ os.chdir(exe.parent)
47
+ except OSError as e:
48
+ print(f"launcher: chdir failed: {e}", file=sys.stderr)
49
+ raise SystemExit(1) from e
50
+ argv = [str(exe)] + sys.argv[1:]
51
+ try:
52
+ os.execv(str(exe), argv)
53
+ except OSError as e:
54
+ print(f"launcher: failed to start {exe}: {e}", file=sys.stderr)
55
+ raise SystemExit(1) from e
56
+
57
+
58
+ def main_client() -> None:
59
+ _require_win()
60
+ _exec_exe(_bin_dir() / "cpu-flicker-detector-client.exe")
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: flicker-detector-cpu
3
+ Version: 1.0.5
4
+ Summary: Windows CPU build: bundled cpu-flicker-detector*.exe (CLI/web/client), no C++/TS/web source in the package.
5
+ Author: internal
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3 :: Only
8
+ Classifier: Environment :: Console
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Topic :: Multimedia :: Video
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ Provides-Extra: web
14
+ Requires-Dist: fastapi>=0.110; extra == "web"
15
+ Requires-Dist: uvicorn[standard]>=0.27; extra == "web"
16
+ Requires-Dist: python-multipart>=0.0.9; extra == "web"
17
+ Requires-Dist: pydantic>=2.6; extra == "web"
18
+ Requires-Dist: pyinstaller>=6.0; extra == "web"
19
+
20
+ # flicker-detector-cpu(Windows CPU 后端)
21
+
22
+ 本发行版是 **`flicker-detector[cpu]`** 的 **CPU 后端**:PyPI 项目名为 **`flicker-detector-cpu`**(名称里不能写方括号 `[]`)。捆绑 **`cpu-flicker-detector.exe`**、**`cpu-flicker-detector-server.exe`**、**`cpu-flicker-detector-client.exe`**,由包内薄启动器 `execv` 调用(**不含** C++ / 前端 / 服务端 Python 源码)。控制台命令名仍为 **`flicker-detector`** / **`flicker-detector-server`** / **`flicker-detector-client`**。
23
+
24
+ - **要求**:Python **≥ 3.10**,操作系统 **Windows 64 位**。
25
+
26
+ ## 推荐安装(与命令名一致)
27
+
28
+ ```powershell
29
+ py -m pip install "flicker-detector[cpu]"
30
+ ```
31
+
32
+ 会安装 **`flicker-detector`**(元包)与 **`flicker-detector-cpu`**(本 wheel)。仅要后端、不要元包时:
33
+
34
+ ```powershell
35
+ py -m pip install flicker-detector-cpu
36
+ ```
37
+
38
+ 安装后可直接使用下列命令(与 `python -m pip show -f flicker-detector-cpu` 中 `flicker_detector_bundle\bin\` 下 exe 等价)。
39
+
40
+ **GPU 后端**:在 PyPI 上存在 **`flicker-detector-gpu`** 时,可安装 **`flicker-detector[gpu]`**(元包已声明该 extra),命令名仍为下面三个。**请勿同时安装 `[cpu]` 与 `[gpu]`**(脚本会冲突)。
41
+
42
+ ---
43
+
44
+ ## 1. `flicker-detector` — 本地命令行检测
45
+
46
+ 在**本机**对图片目录、视频或多张图片路径(有序序列)做闪屏/异常画面检测,输出 **JSON**。
47
+
48
+ ```text
49
+ flicker-detector --type <dir|video|sequence> --input <路径> [--input <路径>...] --output <结果.json>
50
+ ```
51
+
52
+ - **`--type`**:`dir`(图片目录,不递归)、`video`(单个视频)、`sequence`(至少两个 `--input`,每张图为图片路径,顺序即时间序)。
53
+ - 可选门限、JSON 配置等见帮助:
54
+
55
+ ```text
56
+ flicker-detector --help
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 2. `flicker-detector-server` — Web 服务与浏览器界面
62
+
63
+ 启动 **HTTP 服务**,在浏览器里上传素材、查看检测结果并可做**人工反馈**;任务与记录默认落在 exe 旁的 **`flicker_detector_web_data`**(可用环境变量改写)。若仍使用旧目录名,可设置 `FLICKER_DETECTOR_WEB_DATA` 或沿用 `FLASH_DETECTOR_WEB_DATA` 指向原路径。
64
+
65
+ 默认在浏览器打开:
66
+
67
+ **http://127.0.0.1:8765**
68
+
69
+ ### 2.1 页面与功能
70
+
71
+ | 区域 | 作用 |
72
+ |------|------|
73
+ | **工作台** | 上传**视频**、**文件夹(整目录图片)**或**多张图片**;查看任务进度、统计、**findings** 列表;点开单条可预览起止帧、时间范围;可对每条结果标记 **人工确认(正确 / 错误)**。 |
74
+ | **检测记录** | 历史任务表格:支持按时间范围、状态、输入类型、客户端 IP、检出数量、**故障类型**、是否已反馈等筛选;行可展开查看与工作台类似的详情;点击任务可在新标签打开单任务页。 |
75
+ | **趋势图(检测记录页上方)** | **请求量 / 检出量** 按时间粒度(分钟〜月)统计。 |
76
+ | **反馈趋势图(单独一块)** | **用户反馈率**、**反馈正确率**;可按 **故障类型(flash_type)** 筛选,默认**全部类型**。 |
77
+
78
+ ### 2.2 常用环境变量
79
+
80
+ 优先读取 **`FLICKER_*`**;未设置时仍接受旧名 **`FLASH_*`** / **`IMAGE_FLASH_DETECTOR_EXE`**(便于升级)。
81
+
82
+ | 变量(新) | 旧名(仍有效) | 含义 |
83
+ |------------|----------------|------|
84
+ | `FLICKER_DETECTOR_EXE` | `IMAGE_FLASH_DETECTOR_EXE` | 检测程序路径(可选) |
85
+ | `FLICKER_DETECTOR_BIND` | `FLASH_DETECTOR_BIND` | 监听地址,默认 `127.0.0.1` |
86
+ | `FLICKER_DETECTOR_PORT` | `FLASH_DETECTOR_PORT` | 端口,默认 `8765` |
87
+ | `FLICKER_DETECTOR_WEB_DATA` | `FLASH_DETECTOR_WEB_DATA` | SQLite 与上传缓存目录 |
88
+ | `FLICKER_DETECTOR_MAX_UPLOAD_MB` | `FLASH_DETECTOR_MAX_UPLOAD_MB` | 单次上传总大小上限(MB) |
89
+ | `FLICKER_DETECTOR_MAX_CONCURRENT_JOBS` | `FLASH_DETECTOR_MAX_CONCURRENT_JOBS` | 并发检测任务数 |
90
+ | `FLICKER_DETECTOR_JOB_TIMEOUT_SEC` | `FLASH_DETECTOR_JOB_TIMEOUT_SEC` | 单任务子进程超时(秒) |
91
+ | `FLICKER_DETECTOR_TRUST_PROXY` | `FLASH_DETECTOR_TRUST_PROXY` | 设为 `1` 时从 `X-Forwarded-For` 取客户端 IP |
92
+
93
+ 示例:
94
+
95
+ ```powershell
96
+ $env:FLICKER_DETECTOR_PORT = "9000"
97
+ flicker-detector-server
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 3. `flicker-detector-client` — 远程提交检测(B/S)
103
+
104
+ 在**任意能访问服务地址**的机器上,把本地视频或图片**上传到已在运行的 `flicker-detector-server`**,由**服务端**调用检测 exe;**不需要**在客户端安装检测主程序。
105
+
106
+ ```text
107
+ flicker-detector-client --mode <video|sequence|folder> --url <服务根地址> [选项] <路径...>
108
+ ```
109
+
110
+ | `--mode` | 含义 | 路径参数 |
111
+ |----------|------|----------|
112
+ | `video` | 单个视频 | 恰好一个视频文件 |
113
+ | `sequence` | 有序图片序列 | 至少两张图 |
114
+ | `folder` | 图片目录(会遍历子目录中的图片) | 恰好一个目录 |
115
+
116
+ 常用选项(完整列表见 `flicker-detector-client --help`):
117
+
118
+ - `--url`:服务地址,如 `http://192.168.1.10:8765`
119
+ - `--output`:将最终任务 JSON 写入文件;不写则打印到标准输出
120
+ - `--poll`:轮询间隔(秒)
121
+ - `--timeout` / `--http-timeout` / `--upload-timeout`:超时控制
122
+ - `--quiet`:少打印进度
123
+ - `--skip-health`:跳过启动前健康检查
124
+
125
+ 示例:
126
+
127
+ ```powershell
128
+ flicker-detector-client --mode video --url http://127.0.0.1:8765 clip.mp4
129
+ flicker-detector-client --mode sequence --url http://127.0.0.1:8765 .\a.png .\b.png .\c.png
130
+ flicker-detector-client --mode folder --url http://192.168.1.10:8765 --output result.json D:\shots\seq1
131
+ ```
132
+
133
+ **退出码**:`0` 成功;`1` 任务失败;`2` 网络/HTTP/解析错误;`3` 参数或本地路径错误;`4` 等待超时。
134
+
135
+ ---
136
+
137
+ ## 4. 其他说明
138
+
139
+ - 若命令提示缺少捆绑 exe,请从 **PyPI** 重新安装 **`win_amd64`** wheel(项目名 **`flicker-detector-cpu`**,或通过 **`flicker-detector[cpu]`**)。
140
+ - 算法细节、自编译、源码级 Web 开发见 **GitHub** 仓库 **`flicker-detector-cpu`** 中的主 `README.md`(本页仅说明 **pip 安装后的三个入口与界面**)。
@@ -0,0 +1,16 @@
1
+ MANIFEST.in
2
+ README-PyPI.md
3
+ pyproject.toml
4
+ setup.cfg
5
+ flicker_detector_bundle/__init__.py
6
+ flicker_detector_bundle/launch.py
7
+ flicker_detector_bundle/bin/.gitkeep
8
+ flicker_detector_bundle/bin/cpu-flicker-detector-client.exe
9
+ flicker_detector_bundle/bin/cpu-flicker-detector-server.exe
10
+ flicker_detector_bundle/bin/cpu-flicker-detector.exe
11
+ flicker_detector_cpu.egg-info/PKG-INFO
12
+ flicker_detector_cpu.egg-info/SOURCES.txt
13
+ flicker_detector_cpu.egg-info/dependency_links.txt
14
+ flicker_detector_cpu.egg-info/entry_points.txt
15
+ flicker_detector_cpu.egg-info/requires.txt
16
+ flicker_detector_cpu.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ flicker-detector = flicker_detector_bundle.launch:main_detector
3
+ flicker-detector-client = flicker_detector_bundle.launch:main_client
4
+ flicker-detector-server = flicker_detector_bundle.launch:main_server
@@ -0,0 +1,7 @@
1
+
2
+ [web]
3
+ fastapi>=0.110
4
+ uvicorn[standard]>=0.27
5
+ python-multipart>=0.0.9
6
+ pydantic>=2.6
7
+ pyinstaller>=6.0
@@ -0,0 +1 @@
1
+ flicker_detector_bundle
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "flicker-detector-cpu"
7
+ version = "1.0.5"
8
+ description = "Windows CPU build: bundled cpu-flicker-detector*.exe (CLI/web/client), no C++/TS/web source in the package."
9
+ readme = { file = "README-PyPI.md", content-type = "text/markdown" }
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "internal" }]
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3 :: Only",
15
+ "Environment :: Console",
16
+ "Operating System :: Microsoft :: Windows",
17
+ "Topic :: Multimedia :: Video",
18
+ ]
19
+ dependencies = []
20
+
21
+ [project.scripts]
22
+ flicker-detector = "flicker_detector_bundle.launch:main_detector"
23
+ flicker-detector-server = "flicker_detector_bundle.launch:main_server"
24
+ flicker-detector-client = "flicker_detector_bundle.launch:main_client"
25
+
26
+ [project.optional-dependencies]
27
+ web = [
28
+ "fastapi>=0.110",
29
+ "uvicorn[standard]>=0.27",
30
+ "python-multipart>=0.0.9",
31
+ "pydantic>=2.6",
32
+ "pyinstaller>=6.0",
33
+ ]
34
+
35
+ [dependency-groups]
36
+ dev = [
37
+ "fastapi>=0.110",
38
+ "uvicorn[standard]>=0.27",
39
+ "python-multipart>=0.0.9",
40
+ "pydantic>=2.6",
41
+ "pyinstaller>=6.0",
42
+ ]
43
+
44
+ [tool.setuptools.packages.find]
45
+ where = ["."]
46
+ include = ["flicker_detector_bundle*"]
47
+
48
+ [tool.setuptools.package-data]
49
+ flicker_detector_bundle = ["bin/*"]
@@ -0,0 +1,7 @@
1
+ [bdist_wheel]
2
+ plat_name = win_amd64
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+