Skip to content
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

New🌟Add ultralytics analytics dashboard (Beta) 💙 #10039

Closed
wants to merge 18 commits into from

Conversation

RizwanMunawar
Copy link
Member

@RizwanMunawar RizwanMunawar commented Apr 14, 2024

Key Features

  • Added support for line graphs
  • Implemented class-wise bar plots
  • Introduced counting display feature

CLI Command for Dashboard

# Build a dashboard with an ultralytics demo video
yolo dashboard

# Build dashboard with custom configuration
yolo dashboard "path/to/template.yaml"

Python Code for Dashboard

from ultralytics.cfg import handle_dashboard
        
# Build a dashboard with an ultralytics demo video
handle_dashboard()

# Build dashboard with custom configuration
handle_dashboard("path/to/template.yaml")

@glenn-jocher

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Introducing Ultralytics Analytics Dashboard: A Real-time Visualization and Analysis Tool for Object Detection.

📊 Key Changes

  • New Documentation: Added comprehensive documentation for the analytics dashboard, explaining its configuration, custom settings, and usage.
  • Dashboard Configuration: Simplified dashboard setup with a customizable YAML configuration file, supporting modes like predict, count, and track, and accommodating custom videos and model types (e.g., yolov8s, yolov8m, yolov8l).
  • Dynamic Visuals: Real-time display of detection, tracking, and analytics through various visual representations including line graphs, bar plots, and object counting metrics within a user-friendly interface.
  • Extensible Analytics Framework: The system's modular design ensures easy updates and the addition of new features in the future.

🎯 Purpose & Impact

  • Enhanced Monitoring: Enables users to closely monitor and understand object detection and tracking activities, providing valuable insights into performance and trends.
  • Increased Accessibility: Offers a straightforward and interactive way for both technical and non-technical users to visualize complex data generated by computer vision models.
  • Custom Visualization: Supports custom configuration, allowing users to tailor the dashboard according to specific project requirements, thus enhancing the overall analysis experience.

This update makes deep learning analytics more accessible and interpretable, potentially benefiting a wide range of applications from retail analytics to traffic monitoring. 🚀🔍

Copy link

codecov bot commented Apr 14, 2024

Codecov Report

Attention: Patch coverage is 0.88496% with 112 lines in your changes are missing coverage. Please review.

Project coverage is 70.42%. Comparing base (6803113) to head (6813026).

Files Patch % Lines
ultralytics/utils/analytics_utils.py 0.00% 110 Missing ⚠️
ultralytics/cfg/__init__.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10039      +/-   ##
==========================================
- Coverage   70.92%   70.42%   -0.50%     
==========================================
  Files         123      124       +1     
  Lines       15563    15676     +113     
==========================================
+ Hits        11038    11040       +2     
- Misses       4525     4636     +111     
Flag Coverage Δ
Benchmarks 35.41% <0.88%> (-0.26%) ⬇️
GPU 37.19% <0.88%> (-0.27%) ⬇️
Tests 66.50% <0.88%> (-0.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RizwanMunawar RizwanMunawar added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 14, 2024
Copy link
Member

@Burhan-Q Burhan-Q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mess around with anything custom, just tested as is on Windows and Linux. Ran well overall, a few quick comments added as suggestions.

import time

import cv2
from flask import Flask, Response, jsonify, render_template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may want to use the check_requirements function to do the flask imports.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah got it, you mean as we did for solution modules?

yaml_filepath (str): dashboard configuration YAML path
"""
LOGGER.info("Ultralytics dashboard ... 😍")
subprocess.run(["python", ROOT / "analytics/dashboard.py", yaml_filepath])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using subprocess.run([f"{sys.executable}", ROOT / "analytics/dashboard.py", yaml_filepath]) might be a better choice. Since I have multiple python installs on my Windows PC, the current line doesn't work since it's not using my local venv and probably not the correct version of python. The current implementation did work on Linux.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, make sense, I will update it :)

@Burhan-Q
Copy link
Member

One additional idea, not sure how feasible it is, but wondering if there could be a more graceful way to terminate the example? Like adding a "Stop" or "Shutdown" example that would gracefully halt the program and cleanly exit.

@RizwanMunawar
Copy link
Member Author

Ah, I got it @Burhan-Q Thanks for the updates :)

Yes definitely your suggested changes make sense, I am working on the streamlit side, and once done I will adjust these changes in that :)

@glenn-jocher glenn-jocher added the TODO Items that needs completing label May 6, 2024
@glenn-jocher glenn-jocher removed the TODO Items that needs completing label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants