- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Feature/add UI #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            LiteObject
  wants to merge
  17
  commits into
  master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
feature/add-ui
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            17 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      d761606
              
                Add real-time web dashboard and event broadcasting system
              
              
                LiteObject 56a8da5
              
                Enhance UI dashboard to support background processing and improve log…
              
              
                LiteObject 2e42080
              
                Add tests for background service detection, log formatting, and argum…
              
              
                LiteObject 91a5ff2
              
                Remove obsolete test files for background service detection, log form…
              
              
                LiteObject 13abc95
              
                Enhance async image processing and resource management in RTSP servic…
              
              
                LiteObject c9b0a45
              
                Refactor Google broadcast functions to support asynchronous operation…
              
              
                LiteObject 7485f5e
              
                Enhance EventBroadcaster to support event persistence; implement load…
              
              
                LiteObject 81bc11c
              
                Remove events.json from .gitignore to allow event file tracking in ve…
              
              
                LiteObject 3498f87
              
                Refactor UI dashboard for improved readability and maintainability; e…
              
              
                LiteObject 2767044
              
                Enhance synchronous wrappers for Chromecast functions to support asyn…
              
              
                LiteObject 0574c1d
              
                Add comprehensive README updates for real-time event broadcasting, da…
              
              
                LiteObject 2d41eef
              
                Update README to clarify features and requirements for RTSP processin…
              
              
                LiteObject cdc3168
              
                Refactor RTSP processing to support graceful shutdown; enhance loggin…
              
              
                LiteObject 671902e
              
                Refactor UI dashboard for improved readability and maintainability; e…
              
              
                LiteObject 8c8150c
              
                Refactor google_broadcast.py for improved structure and readability; …
              
              
                LiteObject d0a13f3
              
                Refactor UI dashboard for improved readability and maintainability; e…
              
              
                LiteObject f59fd79
              
                Update README to enhance feature descriptions and improve clarity on …
              
              
                LiteObject File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -78,3 +78,4 @@ Desktop.ini | |
| images/ | ||
| logs/ | ||
| temp/ | ||
| events.json | ||
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # README Updates for Recent Changes | ||
|  | ||
| ## New Sections to Add: | ||
|  | ||
| ### Real-time Event Broadcasting (Add after "Configuration" section) | ||
| ```markdown | ||
| ## Event Broadcasting System | ||
|  | ||
| The system includes a sophisticated cross-process event broadcasting system for real-time UI updates: | ||
|  | ||
| ### Features | ||
| - **Cross-Process Sync**: Events from background service instantly appear in UI dashboard | ||
| - **Persistent Storage**: Events stored in `events.json` for reliability | ||
| - **Thread-Safe**: Concurrent access from multiple processes handled safely | ||
| - **Auto-Cleanup**: Events automatically pruned to prevent file growth (max 100 events) | ||
| - **Real-time Updates**: UI dashboard reflects live activity immediately | ||
|  | ||
| ### Event Types | ||
| - **Detection Events**: YOLO detections, LLM confirmations, person status | ||
| - **Image Events**: Image captures and file operations | ||
| - **Notification Events**: TTS and Google Hub broadcast results | ||
|  | ||
| ### Usage | ||
| Events are automatically broadcasted - no manual intervention needed: | ||
| ```python | ||
| # Events are emitted automatically by the service | ||
| # UI dashboard automatically displays them in real-time | ||
| ``` | ||
|  | ||
| The event system ensures the UI dashboard always shows current activity, even when background processing runs in a separate process. | ||
| ``` | ||
|  | ||
| ### Updated Dashboard Features (Replace existing section) | ||
| ```markdown | ||
| **Dashboard Features:** | ||
| - 📊 **Live Metrics** - Real-time detection counts, image captures, persons confirmed | ||
| - 📸 **Image Gallery** - Latest captures with person detection highlights | ||
| - 📋 **Event Stream** - Live detection events and notifications with friendly 12-hour timestamps | ||
| - 📄 **System Logs** - Live log tail with user-friendly time formatting | ||
| - 🔄 **Auto-refresh** - Updates every 2 seconds with cross-process event synchronization | ||
| - 🎯 **Accurate Counters** - Metrics reflect actual background service activity | ||
| ``` | ||
|  | ||
| ### Troubleshooting Section (Add before "Contributing") | ||
| ```markdown | ||
| ## Troubleshooting | ||
|  | ||
| ### UI Dashboard Issues | ||
|  | ||
| **Dashboard shows zero counts despite background processing:** | ||
| - Ensure you're using `--with-ui` flag: `python -m src.app --with-ui` | ||
| - Check that `events.json` exists in the project root after processing starts | ||
| - Verify background service is running by checking logs: `tail -f logs/rtsp_processing.log` | ||
| - Events should appear in real-time as the service processes frames | ||
|  | ||
| **Time formatting inconsistency:** | ||
| - All timestamps now use friendly 12-hour format (e.g., "6:45:30 PM") | ||
| - System logs and Live Events use consistent formatting | ||
|  | ||
| ### Google Hub Notification Issues | ||
|  | ||
| **"asyncio.run() cannot be called from a running event loop" error:** | ||
| - This has been resolved in recent versions | ||
| - Google Hub broadcasting now works from both sync and async contexts | ||
| - No manual intervention needed - the system auto-detects the context | ||
|  | ||
| **Google Hub not responding:** | ||
| - Verify device IP in `.env` file: `GOOGLE_DEVICE_IP=192.168.x.x` | ||
| - Ensure device and computer are on same WiFi network | ||
| - Test connection: `python -m src.google_broadcast` | ||
|  | ||
| ### Performance Issues | ||
|  | ||
| **Slow processing or memory issues:** | ||
| - Check `MAX_IMAGES` setting in `.env` (default: 100) | ||
| - Verify `CAPTURE_INTERVAL` is appropriate (default: 10 seconds) | ||
| - Monitor log file size in `logs/` directory | ||
| - Ensure proper cleanup by checking for old images in `images/` directory | ||
| ``` | ||
|  | ||
| ### Updated Dependencies (Replace in requirements section) | ||
| ```markdown | ||
| **Key dependencies:** | ||
| - `zeroconf>=0.47.0` - Async device discovery and networking | ||
| - `pyttsx3` - Cross-platform text-to-speech engine | ||
| - `opencv-python` - Image processing and RTSP capture | ||
| - `ultralytics` - YOLOv8 object detection | ||
| - `openai` - Vision API for image analysis | ||
| - `pychromecast` - Google Hub/Chromecast communication with async support | ||
| - `streamlit` - Real-time web dashboard with live event updates | ||
| ``` | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate streamlit entry in the dependencies list. One line says 'with live event updates' and the next says '(optional UI)'.