help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
face-recognition
RSK World
face-recognition
Face Recognition Dataset - Face Recognition + Face Verification + Biometric Authentication + Computer Vision
face-recognition
  • __pycache__
  • data
  • images
  • models
  • scripts
  • .gitignore657 B
  • FEATURES.md5.9 KB
  • GITHUB_RELEASE_INSTRUCTIONS.md5.1 KB
  • INDEX.md4.5 KB
  • INSTALLATION_GUIDE.md3.4 KB
  • ISSUES_FIXED.md2.7 KB
  • LICENSE1.3 KB
  • PROJECT_INFO.txt3.5 KB
  • PROJECT_SUMMARY.md5.7 KB
  • QUICKSTART.md2.1 KB
  • README.md5 KB
  • RELEASE_NOTES.md5.4 KB
  • advanced_demo.py9.1 KB
  • check_errors.py5 KB
  • config.py1.5 KB
  • create_sample_data.py3.8 KB
  • demo.py5.7 KB
  • example_usage.py5 KB
  • index.html41.2 KB
  • project_metadata.json1.4 KB
  • requirements.txt440 B
  • setup_dataset.py2 KB
  • test_system.py10.1 KB
  • train_model.py2.1 KB
check_errors.pycreate_sample_data.py
check_errors.py
Raw Download
Find: Go to:
"""
Error Checker for Face Recognition Project

This script checks for common errors in all project files.

Project Information:
- Project ID: 22
- Title: Face Recognition Dataset
- Category: Image Data
- Technologies: PNG, JPG, NumPy, OpenCV, Face Recognition

Contact Information:
RSK World
Founder: Molla Samser
Designer & Tester: Rima Khatun
Email: help@rskworld.in
Phone: +91 93305 39277
Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
Website: https://rskworld.in/
Year: 2026
"""

import os
import sys
import ast
import importlib.util


def check_syntax(filepath):
    """Check Python file syntax."""
    try:
        with open(filepath, 'r', encoding='utf-8') as f:
            code = f.read()
        ast.parse(code)
        return True, None
    except SyntaxError as e:
        return False, str(e)
    except Exception as e:
        return False, str(e)


def check_imports(filepath):
    """Check if imports are valid (basic check)."""
    try:
        with open(filepath, 'r', encoding='utf-8') as f:
            code = f.read()
        
        # Check for common import issues
        issues = []
        
        # Check for COLOR_RGB2RGB typo (exclude this checker file itself)
        if 'COLOR_RGB2RGB' in code and 'check_errors.py' not in filepath:
            issues.append("Found invalid COLOR_RGB2RGB (should be COLOR_BGR2RGB or no conversion needed)")
        
        # Check for missing try-except around optional imports
        if 'from scripts.advanced_features import' in code and 'try:' not in code:
            # This is okay, just a note
            pass
        
        return len(issues) == 0, issues
    except Exception as e:
        return False, [str(e)]


def check_file_structure():
    """Check if required files and directories exist."""
    required_files = [
        'config.py',
        'requirements.txt',
        'README.md',
        'train_model.py',
        'scripts/__init__.py',
        'scripts/load_dataset.py',
        'scripts/preprocess.py',
        'scripts/recognize_faces.py',
    ]
    
    required_dirs = [
        'data',
        'data/train',
        'scripts',
        'models',
    ]
    
    missing_files = []
    missing_dirs = []
    
    for file in required_files:
        if not os.path.exists(file):
            missing_files.append(file)
    
    for dir in required_dirs:
        if not os.path.exists(dir):
            missing_dirs.append(dir)
    
    return missing_files, missing_dirs


def main():
    """Run all checks."""
    print("=" * 60)
    print("Face Recognition Project - Error Checker")
    print("=" * 60)
    print(f"Project: Face Recognition Dataset (ID: 22)")
    print(f"RSK World - https://rskworld.in/")
    print("=" * 60)
    print()
    
    errors_found = False
    
    # Check file structure
    print("Checking file structure...")
    missing_files, missing_dirs = check_file_structure()
    
    if missing_files:
        print(f"[ERROR] Missing files: {', '.join(missing_files)}")
        errors_found = True
    else:
        print("[OK] All required files present")
    
    if missing_dirs:
        print(f"[ERROR] Missing directories: {', '.join(missing_dirs)}")
        errors_found = True
    else:
        print("[OK] All required directories present")
    
    print()
    
    # Check Python files
    print("Checking Python files...")
    python_files = []
    
    for root, dirs, files in os.walk('.'):
        # Skip hidden directories
        dirs[:] = [d for d in dirs if not d.startswith('.') and d != '__pycache__']
        
        for file in files:
            if file.endswith('.py'):
                filepath = os.path.join(root, file)
                python_files.append(filepath)
    
    syntax_errors = []
    import_issues = []
    
    for filepath in python_files:
        # Check syntax
        is_valid, error = check_syntax(filepath)
        if not is_valid:
            syntax_errors.append((filepath, error))
            errors_found = True
        
        # Check imports
        is_valid, issues = check_imports(filepath)
        if not is_valid:
            import_issues.append((filepath, issues))
            errors_found = True
    
    if syntax_errors:
        print("[ERROR] Syntax errors found:")
        for filepath, error in syntax_errors:
            print(f"  {filepath}: {error}")
    else:
        print("[OK] No syntax errors")
    
    if import_issues:
        print("[ERROR] Import issues found:")
        for filepath, issues in import_issues:
            print(f"  {filepath}: {', '.join(issues)}")
    else:
        print("[OK] No import issues")
    
    print()
    
    # Summary
    print("=" * 60)
    if errors_found:
        print("[ERROR] Some issues were found. Please review above.")
        return 1
    else:
        print("[OK] All checks passed! No errors found.")
        return 0


if __name__ == "__main__":
    sys.exit(main())

187 lines•5 KB
python
create_sample_data.py
Raw Download
Find: Go to:
"""
Create Sample Data for Face Recognition Dataset

This script creates sample data using publicly available resources for educational purposes.

Project Information:
- Project ID: 22
- Title: Face Recognition Dataset
- Category: Image Data
- Technologies: PNG, JPG, NumPy, OpenCV, Face Recognition

Contact Information:
RSK World
Founder: Molla Samser
Designer & Tester: Rima Khatun
Email: help@rskworld.in
Phone: +91 93305 39277
Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
Website: https://rskworld.in/
Year: 2026
"""

import os
import cv2
import numpy as np
import requests
from io import BytesIO
from PIL import Image
import config


def create_synthetic_faces():
    """
    Create synthetic face images for testing.
    Uses OpenCV to generate simple face-like patterns for educational purposes.
    """
    os.makedirs(config.TRAIN_DIR, exist_ok=True)
    
    # Create sample identities
    identities = ['person_001', 'person_002', 'person_003', 'person_004', 'person_005']
    
    print("Creating sample face images...")
    print("-" * 60)
    
    for person_id in identities:
        person_dir = os.path.join(config.TRAIN_DIR, person_id)
        os.makedirs(person_dir, exist_ok=True)
        
        # Create 5 variations per person
        for i in range(5):
            # Create a simple face-like pattern
            img = np.zeros((200, 200, 3), dtype=np.uint8)
            
            # Face shape (oval)
            cv2.ellipse(img, (100, 100), (80, 100), 0, 0, 360, (220, 180, 140), -1)
            
            # Eyes
            cv2.circle(img, (75, 80), 10, (0, 0, 0), -1)
            cv2.circle(img, (125, 80), 10, (0, 0, 0), -1)
            
            # Nose
            cv2.ellipse(img, (100, 110), (5, 15), 0, 0, 360, (180, 140, 100), -1)
            
            # Mouth
            cv2.ellipse(img, (100, 140), (20, 10), 0, 0, 180, (100, 50, 50), 2)
            
            # Add some variation
            noise = np.random.randint(-20, 20, (200, 200, 3), dtype=np.int16)
            img = np.clip(img.astype(np.int16) + noise, 0, 255).astype(np.uint8)
            
            # Add slight rotation variation
            if i > 0:
                angle = np.random.uniform(-5, 5)
                h, w = img.shape[:2]
                center = (w // 2, h // 2)
                M = cv2.getRotationMatrix2D(center, angle, 1.0)
                img = cv2.warpAffine(img, M, (w, h), borderMode=cv2.BORDER_REPLICATE)
            
            # Save image
            filename = f"{person_id}_{i+1:02d}.jpg"
            filepath = os.path.join(person_dir, filename)
            cv2.imwrite(filepath, img)
            print(f"Created: {filepath}")
    
    print("\n" + "=" * 60)
    print("Sample data created successfully!")
    print(f"Created {len(identities)} identities with 5 images each")
    print("=" * 60)


def download_sample_images():
    """
    Download sample images from publicly available sources.
    Uses placeholder images for educational purposes.
    """
    # Note: In a real scenario, you would download from a public dataset
    # For educational purposes, we'll create synthetic data instead
    print("Using synthetic data generation for educational purposes...")
    create_synthetic_faces()


if __name__ == "__main__":
    print("=" * 60)
    print("Face Recognition Dataset - Sample Data Creator")
    print("=" * 60)
    print(f"Project: Face Recognition Dataset (ID: 22)")
    print(f"RSK World - https://rskworld.in/")
    print("=" * 60)
    print()
    
    # Create sample data
    create_synthetic_faces()
    
    print("\nNext steps:")
    print("1. Run: python train_model.py")
    print("2. Run: python example_usage.py")
    print("3. Run: python demo.py")

119 lines•3.8 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer