Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
Project description
ImagePRO
Professional & Modular Image Processing Library in Python
ImagePRO is a clean, modular, and easy-to-use Python library for image processing tasks, built with OpenCV, MediaPipe, YOLO, and InsightFace. Designed to be extensible for developers, ImagePRO provides a consistent API across all modules with comprehensive error handling and professional-grade documentation.
Whether you're working on computer vision pipelines, preprocessing images for AI models, or simply automating batch image edits — ImagePRO gives you powerful tools with minimal effort.
✨ Features
Image I/O & Management
- Flexible input/output handling (file paths or numpy arrays)
- Batch processing capabilities
- Multiple format support (JPEG, PNG, CSV, etc.)
Pre-processing & Enhancement
- Basic Operations: Resize, crop, rotate (90°, 180°, 270°, custom angles), grayscale conversion
- Filtering: Blur filters (average, Gaussian, median, bilateral), sharpening filters (Laplacian, Unsharp Masking)
- Enhancement: Contrast enhancement (CLAHE, GHE, stretching)
- Dataset Generation: Automated image capture with preprocessing pipeline
Human Analysis
- Face Analysis: 468-point mesh, head pose estimation, eye status detection, face comparison, face cropping
- Body Analysis: Pose estimation, hand tracking (21 landmarks)
- Real-time Processing: Live webcam analysis for all modules
Object Detection
- YOLO Integration: Multiple accuracy levels (nano to extra-large)
- Flexible Models: Pre-trained or custom model support
- Batch Processing: Efficient handling of multiple images
🚀 Installation
From PyPI
pip install ImagePRO-Python
From Source
git clone https://github.com/parsasafaie/ImagePRO.git
cd ImagePRO
python -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
# Base dependencies
pip install -r requirements/base.txt
# Optional dependencies
# For YOLO object detection
pip install -r requirements/yolo.txt
# For MediaPipe human analysis
pip install -r requirements/mediapipe.txt
# For InsightFace advanced face analysis
pip install -r requirements/insightface.txt
# Or install everything
pip install -r requirements/full.txt
See the Directory Structure section in PROJECT_STRUCTURE.md for details on which modules need which requirements.
📖 Quick Start
from ImagePRO.pre_processing.blur import apply_average_blur
from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
from ImagePRO.human_analysis.body_analysis.body_pose_estimation import detect_body_pose
from ImagePRO.object_analysis.object_detection import detect_objects
from ImagePRO.utils.image import Image
# Load an image
image = Image.from_path("person_and_objects.jpg")
# Or from numpy array: image = Image.from_array(np_array)
# Apply average blur
blur_result = apply_average_blur(image=image)
blur_result.save_as_img("blurred_output.jpg")
# Analyze face mesh (468 landmarks)
face_mesh_result = analyze_face_mesh(image=image)
print(f"Detected {len(face_mesh_result.data)} face landmarks")
face_mesh_result.save_as_csv("face_landmarks.csv")
# Detect body pose (33 landmarks)
body_pose_result = detect_body_pose(image=image)
print(f"Body pose data: {body_pose_result.data}")
# Detect objects with YOLO
object_detection_result = detect_objects(
image=image,
accuracy_level=3, # 1=nano, 2=small, 3=medium, 4=large, 5=extra-large
confidence=0.5
)
print(f"Detected {len(object_detection_result.data)} objects")
object_detection_result.save_as_img("detections.jpg")
Note: These are basic examples. Each module contains many more functions with extensive customization options. Explore the module-specific README files for detailed documentation.
📚 Documentation
Each module includes comprehensive documentation with detailed examples:
- Pre-processing: Image manipulation, filtering, and enhancement
- Human Analysis: Face and body analysis tools
- Face Analysis: Face mesh, pose estimation, eye status, comparison
- Body Analysis: Body pose and hand tracking
- Object Analysis: YOLO-based object detection
- Utils: Shared utilities and I/O handling
For detailed project structure and development guidelines, see PROJECT_STRUCTURE.md.
🏗️ Architecture
ImagePRO is built with a modular architecture designed for extensibility and maintainability:
- Clean Separation of Concerns: Each module handles a specific domain
- Consistent API Patterns: All functions follow the same input/output conventions
- Shared Utilities: Common
ImageandResultclasses for unified I/O - Professional Error Handling: Comprehensive validation with clear error messages
- Type Safety: Full type hints throughout the codebase
- Documentation: Google-style docstrings for all functions
Key Design Principles
- Immutable Design: Image objects are immutable, operations return new instances
- Functional Style: Stateless functions that can be easily composed
- Result Objects: Unified return type containing image, data, and metadata
- Keyword Arguments: All optional parameters use keyword-only syntax
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
- Fork the repository
- Create a virtual environment:
python -m venv .venv - Install dependencies:
pip install -r requirements/full.txt - Follow the coding standards outlined in PROJECT_STRUCTURE.md
- Add tests for new features
- Update documentation as needed
Reporting Issues
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository with:
- Description of the problem or feature request
- Steps to reproduce (for bugs)
- Expected vs. actual behavior
- Environment details (OS, Python version, etc.)
📄 License
This project is licensed under the MIT License – see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imagepro_python-1.2.1.tar.gz.
File metadata
- Download URL: imagepro_python-1.2.1.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
027639c9328b1588317a8795154f7d2aaeff88a837f9d617e6fccc456542b307
|
|
| MD5 |
819486d66c489275e9a8ce854377cc0b
|
|
| BLAKE2b-256 |
86c40ee3abb495d20bda3dff115a09eccbb2011e01327c95e20ce0fa8ef682b3
|
Provenance
The following attestation bundles were made for imagepro_python-1.2.1.tar.gz:
Publisher:
publish.yml on parsasafaie/ImagePRO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imagepro_python-1.2.1.tar.gz -
Subject digest:
027639c9328b1588317a8795154f7d2aaeff88a837f9d617e6fccc456542b307 - Sigstore transparency entry: 953219904
- Sigstore integration time:
-
Permalink:
parsasafaie/ImagePRO@137bcbc871d488ee8e241250ddde10e7351f09e1 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/parsasafaie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@137bcbc871d488ee8e241250ddde10e7351f09e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file imagepro_python-1.2.1-py3-none-any.whl.
File metadata
- Download URL: imagepro_python-1.2.1-py3-none-any.whl
- Upload date:
- Size: 42.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffc0246e62683b7df7f8bbae72f771d3bfe4aa6238ad52e84d2ac58e45500f8f
|
|
| MD5 |
19d0786132cf91ef8f7398068938f0dc
|
|
| BLAKE2b-256 |
4a321b4f8f347bc53f7e6ff3635a11e93bd2bc9f3285fc4969033c8d856e4d50
|
Provenance
The following attestation bundles were made for imagepro_python-1.2.1-py3-none-any.whl:
Publisher:
publish.yml on parsasafaie/ImagePRO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imagepro_python-1.2.1-py3-none-any.whl -
Subject digest:
ffc0246e62683b7df7f8bbae72f771d3bfe4aa6238ad52e84d2ac58e45500f8f - Sigstore transparency entry: 953219906
- Sigstore integration time:
-
Permalink:
parsasafaie/ImagePRO@137bcbc871d488ee8e241250ddde10e7351f09e1 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/parsasafaie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@137bcbc871d488ee8e241250ddde10e7351f09e1 -
Trigger Event:
release
-
Statement type: