Skip to content

Latest commit

 

History

1,268 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文

logo
HachimiDX

🐱 Maimai auto rechart tool 🐱


A tool for the rhythm game maimai that converts chart confirmation videos into simai format (maidata.txt).


🔗 GitHub Repo  •  📥︎ Download Release  •  ▶️ Tutorial Video

Run into issues, want to report bugs, share suggestions, or talk development? Join our QQ group chat 868888361.


✨ Highlights

  • Powerful recharting capabilities

    • Supports recognition and duration inference for all note types: tap slide touch hold touch-hold.
    • Supports all note variants classification: ex break ex-break.
    • Supports all simai slide movement syntax: - V >< pq ppqq sz v.
  • Custom vision models

    • Optimized specifically for maimai gameplay, with robust performance in complex scenes.
  • GUI-first design

    • Everything is done through a visual interface — no CLI commands required.
  • Built-in editors

  • Built-in BPM measurement tool

    • Integrates Bpm-Measurer, a handy tool for measuring a song's BPM.
  • Flexible inference backends

    • Supports ONNX / NCNN Vulkan / NVIDIA TensorRT inference backends for compatibility with a range of hardware.
  • Handy multimedia tools

    • Trim videos, sync audio, convert formats, adjust arcade timing, etc.

💻 System Requirements

  • OS: Windows 10 / 11 (x64) only
  • GPU VRAM: at least 3 GB (no VRAM requirement if using CPU-only inference)
  • RAM: at least 4 GB available
  • Disk: at least 7 GB free

🚧 Known Issues

  • Touch / Touch-Hold Fireworks effects (f) are not supported.

  • Fake jumps (`) are not supported.

  • Camera-captured footage (off-screen recordings) may suffer from skew, color shift, abnormal exposure, or ghosting, which may reduce recharting accuracy.

  • When multiple slides exist simultaneously and some trajectories overlap or intersect, they may fail to be recognized (e.g., 1v6[8:1]/3v6[8:1]).

  • Slide notes with non-standard startup waiting time are not supported.

🎯 Model Training

All training data was collected in-house:

  • Automated labeling

    • A Mod captures raw game data, and a script automatically generates annotations. Coordinates and categories are highly accurate. This makes dataset construction efficient and scalable, enabling large volumes of high-quality samples on demand.
  • Task-specific training

    • Each model uses a dedicated dataset and is optimized for its own task.
    • train_detect — identifies tap/slide/touch/touch-hold notes
    • train_obb — identifies hold notes
    • train_detect_touch_hold — identifies touch-hold progress.
    • train_classify — determines variants such as ex and break

🧩 Technical Architecture

Code lives in src/, organized in three layers. The middle layer drives the core algorithms via subprocess workers, isolating heavy computation from the GUI to keep it responsive.

  • UI layer (src/app) — GUI built with PyQt6
    • QSharedMemory single-instance
    • Feature pages: Majdata editor, auto rechart, task queue, media tools, app settings
    • A shared widget library (src/app/widgets) keeps the visual style consistent across pages.
    • Embedded video player that syncs with the chart editor for preview.
    • UI scaling and multi-language (i18n, EN/ZH).
  • Middle layer (src/services) — service lifecycle and task scheduling
    • Two-phase initialization: uniformly manages services: paths → settings → i18n → sync server → pipeline initialization.
    • Task scheduler: manages queues, controls per-type concurrency, and pushes task-status snapshots to the UI.
    • Process manager: owns all QProcess instances, assigns runner IDs, merges output, and flushes periodically.
    • Standalone pipelines (AutoRechartPipeline / MediaPipeline): validate params with pydantic, assemble CLI argv, and submit tasks to the scheduler.
    • Subtasks run as separate worker subprocesses (rechart, audio alignment, model conversion, hardware checks, etc), scheduled by the process manager.
    • Video sync server: receives commands from MajdataEdit / MajdataView over UDP and drives the embedded player.
    • Watchdog: a subprocess cleans up orphaned Majdata processes on exit.
    • Built-in GitHub Releases update checker.
  • Core layer (src/core) — the auto-rechart pipeline runs in three stages, standardize → detect → analyze:
    • Video standardization
      • OpenCV detects the outer circle and computes perspective-correction params.
      • FFmpeg performs the crop, resolution normalization, and re-encoding.
    • Detection & tracking:
      • Object Detection: YOLO (ultralytics) runs detect and obb models as parallel multiprocess streaming workers.
      • Variant classification: ex / break classification uses a producer-consumer pipeline (decode thread + GPU inference, double-buffered) for CPU/GPU overlap.
      • Path tracking: uses BOTSORT and custom OCSort for notes tracking.
    • Note analysis: per-type preprocess → speed estimation → timing/duration inference (tap / touch / hold / touch-hold / slide) → slide movement syntax analyze.
    • simai conversion: outputs maidata.txt.
    • Audio processing: librosa + scipy cross-correlation audio matching & sync, confirmation-click detection, arcade-timing inference.
    • BPM measurement: connects to the external Bpm-Measurer.
    • Data models: pydantic schemas for config and data models.
    • Error handling: Rust-style OpResult (ok / err) uniformly wraps every operation result.

🏃 Running from Source

1. Set up the Python environment

  • Follow this guide to create a python/ folder in the project root, then use ./python/python.exe to run scripts.

2. Extract resource files

  • Extract all .zip files from models/ into data/models/.
  • Extract ffmpeg into src/resources/ffmpeg/.
  • (Optional) Compile the launcher and place it in the project root.

3. Obtain Majdata Editor & Viewer

Compile MajdataEdit & MajdataView and place the outputs into src/resources/majdata.

Obtain SFX and Skin from other sources and put them in the folder.

4. Obtain BPM Measurer

Compile Bpm-Measurer and place the output into src/resources/Bpm Measurer/.

5. Install & launch

Run install/script/install.py to install dependencies.
Run src/main.py to launch the application.

💖 Donate

If this project helps you, feel free to support it with a donation! ❤️

WeChat donation QR code

About

No description, website, or topics provided.

Resources

Stars

153 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages