Claude/clash royale ai coach 2 e smq#21
Open
justicehamilton35-hue wants to merge 8 commits into
Open
Conversation
Transform the real-time bot into an AI coaching system similar to Stockfish for chess. Major Features: - Video processing for screen recordings (mobile-friendly) - AI analysis engine using trained DQN model - Move-by-move evaluation with Q-values - Move quality classification (Brilliant, Good, Inaccuracy, Mistake, Blunder) - Comprehensive mistake detection system - Performance ratings (elixir, placement, defensive, offensive) - Multiple report formats (HTML, JSON, text) - FastAPI web server for mobile uploads - Mobile-friendly web interface - CLI tool for local analysis Components Added: - video_processor.py: Extract game state from recordings - clashfish_engine.py: DQN-based move evaluation - mistake_detector.py: Identify specific error types - report_generator.py: Create formatted reports - api_server.py: Web API for uploads and analysis - clashfish.py: Command-line interface - frontend/index.html: Mobile upload interface - Documentation: README, setup guide, design doc - requirements_clashfish.txt: Python dependencies Usage: 1. Web: python api_server.py (mobile uploads) 2. CLI: python clashfish.py analyze video.mp4 3. Batch: python clashfish.py batch ./replays/ This transforms the bot from "plays the game" to "analyzes your gameplay and helps you improve"
- Detects actions from elixir decreases - Falls back to time-based estimation - Uses available card data when possible - Ensures minimum 10-20 actions detected - Works even when Roboflow fails
- Creates annotated replays showing mistakes and optimal plays
- Visual markers for each move (colored by quality)
- Shows AI's suggested optimal placement (magenta circles)
- Displays evaluation loss percentages
- Stats panel with overall accuracy and ratings
- Info panel showing card played and quality
- Integrated into API server workflow
- Updated frontend with video player
- Endpoint: /video/{job_id}
- Add dotenv loading to api_server.py - Pass Roboflow credentials from .env to VideoProcessor - Add debug logging to verify credentials are loaded - Fixes 'No Roboflow API key provided' warning
- Changed from http://localhost:9001 to https://detect.roboflow.com - Fixes connection refused errors during video processing - API key is now properly passed to cloud service
- Use numeric constants instead of named constants - Fixes AttributeError: module 'cv2' has no attribute 'CAP_PROP_WIDTH' - Works with all OpenCV versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.