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.1.tar.gz (54.2 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.1-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gfram-2.0.1.tar.gz
  • Upload date:
  • Size: 54.2 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.1.tar.gz
Algorithm Hash digest
SHA256 c8576bfb4207f3b9a546a02441296d60447506c632b891cc894820da0c76844e
MD5 111e415d006d3fa560c380d42cbe66f3
BLAKE2b-256 546889fbba90998be7a4d6cfbfb21c0db978e60d26b40e4ac033caacc66579b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gfram-2.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f5f91ba5ac13142f84d368c80999e8475cea8a53f3c47509bb0fe6124f5ba37
MD5 ba771a5e9f33e88b9628e51ad796e9d5
BLAKE2b-256 4fc3fb5e8fbe1c4a88ba6f322d2c1b5428a56f6ddc647aaa702426d637070bf7

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