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.1.0.tar.gz (60.7 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.1.0-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gfram-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e793cbcafe9fa599dc78137a46cfa392226207b76e03a9b14ae517d8705be4ea
MD5 c8fee4fdad7fddf513fa47f8d6a0dc41
BLAKE2b-256 83c921378b263abc767b845d3f65e8484db8c3f43b7061bfb72021fabd8c1e6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gfram-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0ae24e3ce1c3970e274dd572f29bcd0180a25cd08c5f2abc1c3734afaadf8d
MD5 45d8b31d1ff46245a2a6686e66a127d8
BLAKE2b-256 83e24476187dad74de8a222932730dc5f80aab0947583b61bb0a91c7fadaa3b8

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