Metadata-Version: 2.4
Name: niyya-face-detector
Version: 1.2.1
Summary: Module de détection faciale pour la modération de contenu
Author-email: Saad RAFIQUL <saad.rafiqul1@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Saad RAFIQUL
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/Saadiinho/niyya-face-detection
Project-URL: Bug Tracker, https://github.com/Saadiinho/niyya-face-detection/issues
Project-URL: Documentation, https://saadiinho.github.io/niyya-face-detection/
Project-URL: Repository, https://github.com/Saadiinho/niyya-face-detection.git
Keywords: face-detection,computer-vision,opencv,ai,moderation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python-headless>=4.8.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: Pillow>=9.5.0
Requires-Dist: insightface>=0.7.3
Requires-Dist: onnxruntime>=1.16.0
Provides-Extra: dev
Requires-Dist: pytest>=7.3.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: sphinx>=7.0.0; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "dev"
Dynamic: license-file

# Niyya Face Detector

[![PyPI](https://img.shields.io/pypi/v/niyya-face-detector.svg)](https://pypi.org/project/niyya-face-detector/)
[![Python Versions](https://img.shields.io/pypi/pyversions/niyya-face-detector.svg)](https://pypi.org/project/niyya-face-detector/)
[![License](https://img.shields.io/pypi/l/niyya-face-detector.svg)](https://github.com/Saadiinho/niyya-face-detector/blob/main/LICENSE)

> Module de détection faciale pour la modération de contenu image.  
> Supporte Haar Cascades, DNN et RetinaFace via une interface unifiée.

---

## 🚀 Installation

```bash
# Installation de base
pip install niyya-face-detector

```

### Prérequis système (Linux)

```bash
# Pour OpenCV
sudo apt-get install -y libgl1-mesa-glx libglib2.0-0
```

---

## 📖 Usage Rapide

### Détection depuis un fichier

```python
from face_detection.detector import FaceDetector

# Initialisation
detector = FaceDetector(model_type="retinaface")  # ou "haar", "dnn"

# Analyse d'une image
result = detector.analyze("photo.jpg")

print(f"Visage détecté: {result['has_face']}")
print(f"Nombre de visages: {result['face_count']}")
print(f"Confiance: {result['confidence']:.2%}")

```


### Analyse depuis des bytes (pour API)

```python
with open("photo.jpg", "rb") as f:
    image_bytes = f.read()

result = detector.analyze_bytes(image_bytes)
```

---

## ⚙️ Modèles Disponus

| Modèle                            | Précision | Vitesse | Usage Recommandé |
|-----------------------------------|-----------|---------|-----------------|
| `haar`                            | ⭐⭐ | ⚡⚡ | Tests rapides, prototype |
| `dnn` (en cours d'implémentation) | ⭐⭐⭐⭐ | ⚡⚡ | Production légère |
| `retinaface`                      | ⭐⭐⭐⭐⭐ | ⚡ | Hijab, occlusions, production |

> **Conseil** : Pour une détection optimale sur des visages avec occlusions partielles, utilisez le modèle `retinaface`.

---

## 📦 Options d'Installation

```bash
# Développement
pip install niyya-face-detector[dev]

# Documentation
pip install niyya-face-detector[docs]

# Tout en un
pip install niyya-face-detector[all]
```

---

## 🧪 Tests

```bash
# Installer les dépendances de test
pip install niyya-face-detector[dev]

# Lancer les tests
pytest tests/ -v
```

---

## 📚 Documentation Complète

La documentation complète est disponible sur :  
🔗 https://saadiinho.github.io/niyya-face-detector/

---

## 🤝 Contributing

Les contributions sont les bienvenues !

1. Fork le projet
2. Crée une branche feature (`git checkout -b feature/amazing-feature`)
3. Commit tes changements (`git commit -m 'Add amazing feature'`)
4. Push vers la branche (`git push origin feature/amazing-feature`)
5. Ouvre une Pull Request

---

## 📄 Licence

Distribué sous la licence MIT. Voir [`LICENSE`](LICENSE) pour plus d'informations.

---

## 🙏 Remerciements

- [OpenCV](https://opencv.org/) pour la vision par ordinateur
- [InsightFace](https://github.com/deepinsight/insightface) pour RetinaFace
- La communauté Niyya Women pour les retours et tests

---

## 📞 Contact

Saad RAFIQUL - [@Saadiinho](https://github.com/Saadiinho) - saad.rafiqul1@gmail.com

Projet : https://github.com/Saadiinho/niyya-face-detector
