# bugsbunnydev2000/analysis-of-body-language-and-speech-in-video architecture

> Architecture diagram of the GitHub repository bugsbunnydev2000/analysis-of-body-language-and-speech-in-video, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bugsbunnydev2000/analysis-of-body-language-and-speech-in-video
- Repository: https://github.com/bugsbunnydev2000/analysis-of-body-language-and-speech-in-video

## Overview

##### Main Components Identification

a. Input Layer:
- Video Input Handler (MP4 files)
- Configuration Management (API keys, paths)

b. Processing Pipeline:
- Video-to-Audio Converter
- Speech-to-Text Processor (Whisper)
- Text Analysis Engine (Gemini)
- Body Language Analysis Engine (Gemini)

c. Output Layer:
- Results Storage
- GUI Interface

**[Input] → [Processing Pipeline] → [Output]**

##### Detailed Component Representation

**[Video Input] → [Video-to-Audio Converter]**
- ↓
**[Audio File] → [Whisper API] → [Text Transcription]**
- ↓
**[Transcribed Text] → [Gemini API] → [Text Analysis]**
- ↓
**[Video Frames] → [Gemini API] → [Body Language Analysis]**
- ↓
**[GUI Display] ← [Combined Results]**

##### Important Elements

a. Data Flow Annotations:
- MP4 → MP3 conversion
- Audio transcription process
- Text analysis pipeline
- Body language analysis pipeline

b. External Services:
- OpenAI Whisper API connection
- Google Gemini API integration

c. File Storage:
- Sample directory for test files
- Output directory for results

##### Technical Details to Highlight

Specific technical aspects:
- Python-based implementation
- API key configuration requirements
- File format transformations
- Parallel processing capabilities (if any)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        VI[Video Input]
        CF[Configuration]
    end

    subgraph Processing
        VAC[Video-to-Audio Converter]
        STT[Speech-to-Text Processor]
        TAE[Text Analysis Engine]
        BLA[Body Language Analysis Engine]
    end

    subgraph External_APIs
        WH[Whisper API]
        GM[Gemini API]
    end

    subgraph Storage
        AF[Audio File]
        TT[Text Transcription]
        TAR[Text Analysis Results]
        BAR[Body Language Results]
    end

    subgraph Output
        GUI[GUI Interface]
        CR[Combined Results]
    end

    %% Connections
    VI --> VAC
    CF -.-> VAC
    VAC --> AF
    AF --> STT
    STT --> WH
    WH --> TT
    TT --> TAE
    TAE --> GM
    GM --> TAR
    VI --> BLA
    BLA --> GM
    GM --> BAR
    TAR --> CR
    BAR --> CR
    CR --> GUI

    %% Click Events
    click VI "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/sample/Test-1.MP4"
    click AF "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/sample/Test-1.MP3"
    click TT "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/sample/transcription-audio-to-text.txt"
    click TAE "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/test/text-speach-analysis.py"
    click BLA "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/test/Body-language-Gemeni.py"
    click TAR "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/sample/Text-analysis-test-1.txt"
    click BAR "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/sample/body-analysis-test-1.txt"
    click CR "https://github.com/Bugsbunnydev2000/Analysis-of-body-language-and-speech-in-video/blob/main/main.py"

    %% Styling
    classDef input fill:#a8d1ff
    classDef processing fill:#90EE90
    classDef api fill:#FFE5B4
    classDef storage fill:#E6E6E6
    classDef output fill:#a8d1ff

    class VI,CF input
    class VAC,STT,TAE,BLA processing
    class WH,GM api
    class AF,TT,TAR,BAR storage
    class GUI,CR output

    %% Legend
    subgraph Legend
        L1[Input/Output]:::input
        L2[Processing]:::processing
        L3[External APIs]:::api
        L4[Storage]:::storage
        L5["--> Data Flow"]
        L6["-.-> Config Flow"]
    end
```
