Skip to content

MarcusWegener/Fun-o-Meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fun-o-Meter

⚠️ Disclaimer:
This is a learning and demo project. It was created for the joy of learning and experimenting with real-time data processing, emotion recognition, and dashboarding.
There is no claim to correctness or completeness, and no liability is accepted for any damage that may occur from using this code.


🎯 Project Idea

This project was born out of the motivation to present a live Power BI / Fabric dashboard filled with real-time data during the data:unplugged event.
🎥 You can watch the original presentation on YouTube: https://youtu.be/kKY_eJJMldo

As passionate fans of both Power BI / Microsoft Fabric and gaming, we initially considered capturing gameplay data via camera or HDMI capture and analyzing it using OCR – a kind of digital retrofit approach.

However, during a session at the TDWI Barcamp, someone pointed out:

“These values are already visible in-game – there's little added value.”

💡 This shifted our perspective: Instead of focusing on game data, why not analyze the players themselves?

Inspired by platforms like Twitch, where viewers enjoy watching others play – especially reacting emotionally – we had a new idea:

👉 Let’s analyze the facial emotions of the players in real time and integrate this into a live dashboard.

A large part of the inspiration and input for this idea came during discussions at the TDWI Barcamp with Dr. Kerem Ciftci.
We are very grateful for his valuable insights and suggestions!
🔗 Connect with Dr. Kerem Ciftci on LinkedIn


🧭 Architecture Overview

The following diagram summarizes the data flow from gameplay to dashboard visualization:

Architecture Overview


✨ What's New Compared to the Previous Version

  • Configuration Externalization:
    The Azure Event Hub connection string is now loaded from an external config.json file instead of being hardcoded.

  • Timezone-Aware UTC Timestamps:
    Event timestamps are now generated timezone-aware (datetime.now(timezone.utc).isoformat()), improving compatibility with real-time systems.

  • Additional Player Data:
    Besides detecting the dominant emotion, the system now also captures age and gender (with a confidence score) per player.

  • Enhanced Visualization:
    The live camera feed now displays the player's dominant emotion, age, and gender next to their face.

  • Detailed Console Output:
    Instead of a generic "JSON sent" message, the console now prints detailed player information.

  • Stricter Face Detection:
    The enforce_detection=True setting ensures that only valid faces are analyzed.

  • New Dashboard by Artur:
    Thanks to Artur (LinkedIn Profile), the new StreamingOfFun.pbit dashboard template was added. It visualizes the player data captured in the Kusto table!


🧠 Tech Stack & Tools

Thanks to powerful Python modules and a helpful push from ChatGPT, this idea quickly became a working prototype.

Used Technologies:

  • Python 3
  • DeepFace for facial emotion analysis
  • OpenCV for webcam input
  • Azure Event Hub to stream real-time data
  • Power BI / Microsoft Fabric for dashboarding

🚀 Getting Started

⚠️ I’m not (yet) a Python expert – but here’s how I got it running:

1. Install Python

You can install Python directly from the Microsoft Store.
Microsoft Store Python


2. Use Visual Studio Code + Python Extension

I recommend using Visual Studio Code with the official Python extension.
VS Code Python Extension


3. Create a Virtual Environment

Use separate environments for each Python project. The VS Code extension helps you create one easily:
Create Environment
Venv Setup
Interpreter Path
Install Requirements


4. Manually Install Missing Modules

Not all modules were installed from requirements.txt, so I activated the venv and manually installed the missing ones:

.venv\Scripts\activate
pip install deepface
pip install azure-eventhub
pip install tf-keras

5. Connect to Azure Event Hub

To stream the analyzed emotions into Microsoft Fabric, you need a connection string from an Azure Event Hub.
You can configure it as a custom endpoint in an eventstream.
➡️ Microsoft Learn: Add custom endpoint or app source to Eventstream


6. Use the StreamingOfFun Dashboard

Thanks to Artur, a Power BI Template File (StreamingOfFun.pbit) is provided to visualize the player data from a Kusto table.

To configure the dashboard, you need to set the following parameters:

  • Kusto Cluster
  • Kusto Database
  • Kusto Table
  • Timezone (used to convert the UTC timestamp into your local time)

Example of the parameter settings:
PBIT Kusto Parameter


🙌 Acknowledgments

This project was inspired by a mix of:

  • A spontaneous idea at a community event
  • The creative feedback from the TDWI Barcamp
  • The valuable insights from Dr. Kerem Ciftci
  • The amazing work done by the Python open-source community
  • The fantastic dashboard contribution by Artur
  • The magic of experimenting with new tech just for fun

🧪 What’s Next?

This is just the beginning! You’re welcome to:

  • Fork, modify, and extend this project
  • Connect it with your own dashboards
  • Combine it with game mechanics or streaming platforms

Have fun exploring and experimenting!


📬 Contact

Feel free to reach out on LinkedIn or GitHub if you want to exchange ideas or contribute.

Happy learning! 🚀

About

Realtime Emotion-to-Dashboard Demo using Python, DeepFace, Azure Event Hub and Microsoft Fabric – built for fun, learning and live gaming scenarios.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages