Skip to content

Qoom-Internship/raspberry-DMG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LifeEcho: Life's Echo Returns to Loved Ones

LifeEcho is a digital memorial system that automatically plays memorial videos through face recognition. It provides an interactive memorial space where uploaded memorial videos automatically play when a user stays in front of the camera for 5 seconds.

🎯 Key Features

πŸ“Έ Real-time Face Recognition

  • Real-time face detection using OpenCV
  • Automatic video playback after 5 seconds of continuous face recognition
  • Automatic camera connection and reconnection functionality

πŸ“ Memorial Information Management

  • Photo and video upload functionality
  • Input for name, birth date, death date, epitaph, and last words
  • Intuitive editing interface

🎬 Automatic Video Playback

  • 3-second countdown before automatic playback
  • Memorial information overlay display
  • Automatic return to main page after video ends

πŸ“± Responsive Design

  • Desktop and mobile optimization
  • Intuitive user interface
  • Smooth animation effects

πŸ›  Technology Stack

Backend

  • Flask: Python web framework
  • OpenCV: Computer vision and face recognition
  • PIL: Image processing
  • Werkzeug: File upload handling

Frontend

  • HTML5: Web page structure
  • CSS3: Styling and animations
  • JavaScript: Dynamic interactions
  • MJPEG Streaming: Real-time video streaming

Hardware

  • Raspberry Pi: Main server
  • USB Webcam: Face recognition camera

πŸ“ Project Structure

raspberry-DMG/
β”œβ”€β”€ app.py                 # Flask main application
β”œβ”€β”€ templates/             # HTML templates
β”‚   β”œβ”€β”€ index.html        # Main page (face recognition)
β”‚   β”œβ”€β”€ edit.html         # Memorial information edit page
β”‚   └── video.html        # Video playback page
β”œβ”€β”€ static/               # Static files
β”‚   β”œβ”€β”€ style.css         # Main stylesheet
β”‚   β”œβ”€β”€ script.js         # Main page JavaScript
β”‚   β”œβ”€β”€ edit.js           # Edit page JavaScript
β”‚   β”œβ”€β”€ video.js          # Video page JavaScript
β”‚   └── uploads/          # Uploaded files
β”‚       β”œβ”€β”€ photos/       # Uploaded photos
β”‚       └── videos/       # Uploaded videos
β”œβ”€β”€ memorial_data.json    # Memorial information data
└── README.md            # Project documentation

πŸš€ Installation and Setup

1. Install Required Packages

# Create Python virtual environment
python -m venv lifeecho_env

# Activate virtual environment
# Windows:
lifeecho_env\Scripts\activate
# macOS/Linux:
source lifeecho_env/bin/activate

# Install required packages
pip install flask opencv-python ffmpeg-python requests Pillow numpy werkzeug

2. Hardware Setup

  • Connect Raspberry Pi 5
  • Connect USB webcam
  • Power supply (USB-C, 5V 5A)

3. Run Application

# Run main application
python app.py

The application runs at http://localhost:3002.

πŸ“– Usage Guide

1. Enter Memorial Information

  1. Access http://localhost:3002/edit in browser
  2. Upload photo (required)
  3. Upload video (required)
  4. Enter name, birth date, death date, epitaph, and last words
  5. Click save button

2. Face Recognition and Video Playback

  1. Position yourself in front of the camera on the main page (http://localhost:3002)
  2. After 5 seconds of continuous face recognition, automatically move to video page
  3. 3-second countdown before automatic memorial video playback
  4. Automatic return to main page after video ends

3. System Controls

  • ESC Key: Immediate return to main page during video playback
  • Double-click: Immediate return to main page during video playback
  • Edit Icon: Navigate to memorial information edit page

πŸ”§ Main API Endpoints

Face Recognition Related

  • GET /video_feed: Real-time camera stream (MJPEG)
  • GET /api/state: Current face recognition status
  • POST /api/reset_detection: Reset face recognition system

Memorial Information Management

  • GET /api/memorial_data: Retrieve saved memorial information
  • POST /api/save_memorial: Save memorial information
  • POST /upload: Upload photo/video files

Page Routing

  • GET /: Main page (face recognition)
  • GET /edit: Memorial information edit page
  • GET /video: Video playback page

🎨 UI/UX Features

Main Page

  • Real-time camera feed display
  • Face recognition progress indicator
  • Memorial information overlay
  • Responsive layout

Edit Page

  • Drag and drop file upload
  • Real-time form validation
  • Preview functionality
  • Intuitive interface

Video Page

  • Fullscreen video playback
  • 3-second countdown animation
  • Memorial information overlay
  • Mute control

πŸ”’ Security and Stability

File Upload Security

  • Only allowed file formats can be uploaded
  • Secure filename generation (with timestamp)
  • File size limitations

Camera Management

  • Automatic camera detection and connection
  • Automatic reconnection on connection failure
  • Resource cleanup and memory management

Error Handling

  • File upload failure handling
  • Camera connection failure handling
  • Video playback error handling

πŸ› Troubleshooting

Camera Not Recognized

  1. Check if USB webcam is properly connected
  2. Check if camera is being used by another program
  3. Check if camera drivers are installed

File Upload Fails

  1. Check if file format is supported (photos: png, jpg, jpeg, gif / videos: mp4, avi, mov)
  2. Check if file size exceeds limits
  3. Check if there's sufficient storage space

Video Won't Play

  1. Check if video file is not corrupted
  2. Check if browser supports HTML5 video
  3. Check if video file path is correct

πŸ“ License

This project is developed for educational purposes.

🀝 Contributing

Suggestions for project improvement or bug reports are always welcome.

πŸ“ž Contact

Please feel free to contact us with any questions about the project.


LifeEcho - Life's Echo Returns to Loved Ones
Preserving memories digitally, forever

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published