$ show ack00gar/FunGen-AI-Powered-Funscript-Generator
FunGen is a desktop application for generating funscripts (motion scripts for interactive haptic devices) from video content using AI-based computer vision. It provides a full GUI built with Dear ImGui, supporting video playback via mpv, real-time and offline object detection (YOLO), optical flow analysis, and a plugin system for funscript transformations. The application integrates device control for hardware like The Handy, OSR, and Buttplug.io, and includes batch processing, watched folders, and a WebSocket API. The codebase is large and well-structured with many reusable components (plugin architecture, async YOLO worker, undo/redo system, checkpointing, theme management), but the project is explicitly deprecated in favor of a native binary rewrite (FunGen 2). The repository is kept for reference and no longer actively developed, leading to high technical drift and potential compatibility issues with current dependencies.
The LLM identified 7 files worth highlighting for reuse:
Implements a Result type (similar to Rust's Result) for explicit success/failure handling without exceptions. Provides Ok and Err variants with map, unwrap, and error propagation methods. Self-contained and reusable across any Python project.
Defines a BackgroundJob class that runs a callable in a separate thread with progress callbacks, cancellation support, and error handling. Uses threading.Event for clean shutdown. Reusable for any long-running task that needs UI progress updates.
Provides RateLimiter and SpeedLimiter classes for controlling call frequency and data throughput. Uses time-based windows and token bucket patterns. Self-contained and applicable to API rate limiting, UI debouncing, or stream processing.
Collection of reusable Dear ImGui helper functions: tooltip_if_hovered, centered window positioning, disabled scope context manager, primary/destructive button styles, and section card wrappers. Reduces boilerplate and ensures consistent UI patterns across the application.
Implements a section_card context manager that wraps ImGui child windows with a header, optional collapse/expand, and consistent styling. Provides a reusable UI pattern for grouping related controls in settings panels.
Defines the abstract base class for funscript transformation plugins with parameter schema validation, preview generation, and a global PluginRegistry singleton. Demonstrates a clean plugin system that can be extracted for other transformation pipelines.
Implements an asynchronous YOLO inference worker with a bounded queue, background thread, callback-based result delivery, and automatic batch size probing. Handles model warmup and fallback. Reusable for any real-time object detection pipeline that needs non-blocking inference.