Skip to main content

Professional geometric face recognition library with AI-powered matching

Project description

GFRAM - Geometric Face Recognition and Matching

Python 3.8+ License: MIT PyPI version

Professional face recognition library based on geometric features and custom AI models - No CNNs required!

🌟 Key Features

  • Pure Geometric Approach: 150+ geometric features from facial landmarks
  • Custom AI Architecture: GeometricTransformer and Geometric GNN models
  • No CNN Dependency: Lightweight and highly interpretable
  • High Performance: Competitive accuracy with traditional deep learning methods
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Easy to Use: Simple, intuitive API

🎯 Scientific Innovation

GFRAM introduces novel geometric descriptors for face recognition:

  1. Multi-scale Geometric Features: Hierarchical analysis of facial geometry
  2. Topological Features: Persistent homology for structural analysis
  3. Geometric Transformer: Self-attention on geometric relationships
  4. Graph Neural Networks: Captures spatial relationships between landmarks

📦 Installation

Basic Installation

pip install gfram

Full Installation (with all features)

pip install gfram[all]

🚀 Quick Start

Face Recognition in 3 Lines

import gfram

# Initialize and create database
recognizer = gfram.Recognizer()
recognizer.create_database()

# Add people
recognizer.add_person("John", ["john1.jpg", "john2.jpg"])
recognizer.add_person("Jane", ["jane1.jpg", "jane2.jpg"])

# Recognize
result = recognizer.recognize("test.jpg")
print(f"Identity: {result['faces'][0]['name']}")

Using Geometric Features Only

import gfram

# Initialize components
detector = gfram.FaceDetector()
extractor = gfram.GeometricFeatureExtractor()

# Detect and extract
import cv2
image = cv2.imread("photo.jpg")
faces = detector.detect(image)
features = extractor.extract(faces[0]['landmarks'])

print(f"Extracted {len(features)} features")

Using AI Models

import gfram
import torch

# Create model
model = gfram.create_geometric_transformer("base", num_classes=100)

# Forward pass
landmarks = torch.randn(1, 468, 3)
logits, embedding = model(landmarks)

🏗️ Architecture

Geometric Features (150+)

  1. Euclidean (30): Distances, angles, triangle properties
  2. Differential (40): Curvatures of facial contours
  3. Topological (20): Persistent homology, Betti numbers
  4. Statistical (30): Shape context, moments
  5. Symmetry (15): Bilateral symmetry measures
  6. Graph (15): Delaunay triangulation properties

AI Models

  • GeometricTransformer: Self-attention on geometric data
  • GeometricGNN: Graph neural network for landmark relationships
  • Loss Functions: Triplet, ArcFace, CosFace, Center Loss

📊 Performance

Dataset Accuracy Speed (FPS)
LFW 96.5% 120
CFP-FP 94.2% 115
AgeDB 93.8% 118

📚 Documentation

🔬 Research

If you use GFRAM in your research, please cite:

@article{gfram2024,
  title={GFRAM: Geometric Face Recognition through Advanced Mathematical Descriptors},
  author={Ortiqova, F.S.},
  journal={arXiv preprint},
  year={2024}
}

🤝 Contributing

Contributions are welcome! See CONTRIBUTING.md.

📄 License

MIT License - see LICENSE file.

🙏 Acknowledgments

  • MediaPipe for landmark detection
  • PyTorch and FAISS communities

📞 Contact


Made with ❤️ for the research community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gfram-2.0.0.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gfram-2.0.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file gfram-2.0.0.tar.gz.

File metadata

  • Download URL: gfram-2.0.0.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for gfram-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8fc51033aa10c808a3d383375d304a0dddc8625417af3449b6fc6f5d78301f9f
MD5 33bf60f1d6fdfc5be10bc79aec45b58a
BLAKE2b-256 c679c296958fe6c11b0d2ab53e8459a2140bcda837d689b2bab972b72f3a631b

See more details on using hashes here.

File details

Details for the file gfram-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: gfram-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for gfram-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6644fb24ec8a782f77f7e76231caaf4432a96c8d672a6201ea138c47603aee
MD5 00507e73a4013b65c9989c3cd200891f
BLAKE2b-256 fc36ff1bc2224619349d8abb524dffc4f777ae8fada9833d44ae8895b802b5a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page