Skip to content
Proyek

Vizcexex/ai-video-analysis-system

Lihat di GitHub

Tentang

本地轻量级 AI 视频上传、预览与整段分析系统 | Local lightweight AI video upload, preview and whole-video analysis

Desain dan media

Cara angka ini diukur

Yang dapat Anda lakukan

  • Drag-and-drop or file-picker upload with real progress reporting.
  • In-browser playback with HTTP range requests and seeking.
  • Background whole-video frame sampling with live status and progress.
  • Media metadata extraction, including resolution, frame rate, duration, and codec.

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

AI 视频数据分析系统 | AI Video Analysis System

一个在 Windows 本机运行的轻量级 AI 视频分析 Web 应用,提供视频上传、浏览器预览、整段抽帧分析、任务进度跟踪和检测事件回看。

A lightweight AI video analysis web application that runs locally on Windows, with video upload, in-browser preview, whole-video frame sampling, progress tracking, and timestamped event review.

中文 · English

中文介绍

已实现功能

  • 拖放或选择视频文件,并显示真实上传进度。
  • 在浏览器中播放已上传视频,支持分段请求和拖动定位。
  • 后台执行整段视频抽帧分析,持续返回任务状态、进度和采样数量。
  • 读取视频分辨率、帧率、时长和编码等基础媒体信息。
  • 可选连接本地 YOLO 或 RF-DETR 检测模型,记录类别、置信度、目标框和时间点。
  • 未连接模型时仍可完成媒体分析,且不会生成虚构检测结果。
  • 点击检测事件可跳转到视频对应时间回看。
  • 服务重启后保留上传记录和已完成的分析结果。
  • 支持删除视频及其本地记录。

当前主流程:

选择视频 → 自动上传 → 整段抽帧分析 → 查看进度 → 点击事件回看

支持 MP4、MOV、AVI、MKV、WebM、M4V、MPEG 和 MPG。默认单文件上限为 2 GiB,全部已存视频合计上限为 20 GiB、200 个文件,可通过环境变量调整。

系统要求

  • Windows 10 或 Windows 11。
  • Python 3.10 或更高版本,并确保 python 或 py 命令可用。
  • 首次启动需要联网安装媒体分析组件;之后可离线运行基础分析。
  • Node.js 只用于运行开发检查,使用应用本身不需要 Node.js。

快速启动

下载或克隆项目后,双击根目录中的:

一键启动轻量版.cmd

也可以在项目根目录的 PowerShell 中运行:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\deploy.ps1

首次启动会自动把媒体分析依赖安装到 runtime/dependencies/python,不会改动系统 Python 环境。默认访问地址为:

http://127.0.0.1:8787/

如果端口 8787 已被占用,启动脚本会选择附近的空闲端口,并显示实际地址。停止服务:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\stop_local.ps1

安全提示:这是单机应用,只允许监听本机回环地址。请勿把服务直接暴露到局域网或公网。

可选本地模型

模型不是应用启动条件。没有模型时,系统仍会完成整段采样和媒体信息读取,只是不生成检测事件。

需要目标检测时,请先阅读 本地模型说明。模型权重不会随仓库提供,也不会被自动下载。默认模型接口为:

http://127.0.0.1:22001/v1/detect

为保护视频隐私,检测接口默认只允许回环地址。抽取的视频帧会发送给所配置的模型接口;只有理解并接受数据流向时,才应显式允许远程模型端点。

项目结构

  • backend/:Python HTTP 服务、媒体分析和本地模型适配。
  • prototype/:原生 HTML、CSS 和 JavaScript 前端。
  • tools/:Windows 启停、依赖安装和检查脚本。
  • config/:环境变量示例、模型清单和依赖锁定文件。
  • runtime/:本地上传文件、运行状态、模型和项目内依赖;生成内容默认不进入 Git。

API

方法 路径 用途
GET /api/health 查询服务状态
GET /api/uploads 查询最近上传和分析摘要
POST /api/uploads?filename=文件名 上传视频二进制内容
GET /api/uploads/{id}/content 播放或读取视频,支持分段请求
POST /api/uploads/{id}/analyze 启动整段分析任务
GET /api/uploads/{id}/analysis 查询任务进度和完整结果
DELETE /api/uploads/{id} 删除视频和对应记录

详细接口说明见 后端说明,前端说明见 前端说明。

本地数据与开发检查

runtime/uploads/                已上传视频
runtime/lightweight/state.json  上传记录和分析结果
logs/                           运行日志和进程信息

运行数据、模型权重、本地依赖和输出文件均通过 .gitignore 排除。

安装 Node.js 后可运行完整开发检查:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\run_checks.ps1

当前范围

当前版本是单机轻量应用。多用户、局域网/公网服务、结果导出、复杂筛选、多文件队列、视频地址导入和摄像头接入尚未包含。后续方向见 路线图。

English

Implemented features

  • Drag-and-drop or file-picker upload with real progress reporting.
  • In-browser playback with HTTP range requests and seeking.
  • Background whole-video frame sampling with live status and progress.
  • Media metadata extraction, including resolution, frame rate, duration, and codec.
  • Optional local YOLO or RF-DETR detector integration with timestamps, labels, confidence scores, and bounding boxes.
  • Media-only analysis when no model is connected, without fabricated events.
  • One-click seeking from an event to its matching video timestamp.
  • Persistent upload records and completed results across service restarts.
  • Local deletion of videos and their stored records.

Main workflow:

Select a video → Upload automatically → Analyze sampled frames → Track progress → Review detected events

Supported formats include MP4, MOV, AVI, MKV, WebM, M4V, MPEG, and MPG. Defaults are 2 GiB per file, 20 GiB total storage, and 200 stored files; environment variables can adjust these limits.

Requirements

  • Windows 10 or Windows 11.
  • Python 3.10 or later, available through the python or py command.
  • An internet connection on first launch to install the small media runtime; basic analysis can run offline afterward.
  • Node.js is only needed for development checks, not for using the application.

Quick start

After downloading or cloning the repository, double-click:

一键启动轻量版.cmd

Or run this from PowerShell in the project directory:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\deploy.ps1

On first launch, the media packages are installed into runtime/dependencies/python without modifying the system Python environment. Open the address printed by the script; the default is:

http://127.0.0.1:8787/

If port 8787 is occupied, the launcher selects a nearby available port. To stop the service:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\stop_local.ps1

Security note: this is a single-machine application and only binds to loopback. Do not expose it directly to a LAN or the public internet.

Optional local detector

The application does not require a model. Without one, it still completes frame sampling and media metadata extraction, but produces no detection events.

See the local model guide to enable YOLO or RF-DETR. Model weights are not included or downloaded automatically. The default detector endpoint is:

http://127.0.0.1:22001/v1/detect

For video privacy, detector endpoints are limited to loopback by default. Sampled JPEG frames are sent to the configured detector; explicitly enable a remote endpoint only when you understand and accept that data flow.

Project structure

  • backend/: Python HTTP service, media analysis, and local model adapters.
  • prototype/: Vanilla HTML, CSS, and JavaScript frontend.
  • tools/: Windows startup, dependency bootstrap, shutdown, and verification scripts.
  • config/: Environment examples, model manifests, and dependency lock files.
  • runtime/: Local uploads, state, models, and project-local dependencies; generated data is ignored by Git.

API

Method Path Purpose
GET /api/health Read service health
GET /api/uploads List upload and analysis summaries
POST /api/uploads?filename=name Upload video bytes
GET /api/uploads/{id}/content Stream video content with range support
POST /api/uploads/{id}/analyze Start whole-video analysis
GET /api/uploads/{id}/analysis Read task progress and complete results
DELETE /api/uploads/{id} Delete a video and its record

See backend/README.md for API details and prototype/README.md for frontend behavior.

Local data and development checks

Uploads, runtime state, logs, model weights, local dependencies, and generated outputs are excluded from Git.

With Node.js installed, run the complete development checks with:

powershell -NoProfile -ExecutionPolicy Bypass -File tools\run_checks.ps1

Current scope

This is a lightweight single-machine application. Multi-user access, LAN/public hosting, result export, advanced filtering, multi-file queues, URL-based imports, and camera ingestion are not included. See ROADMAP.md for possible next steps.

License

This project is licensed under the MIT License. Third-party packages and optional model frameworks retain their own licenses; see THIRD_PARTY_NOTICES.md.

Jelajahi proyek terkait

Memuat…