ImagePRO-Python 1.2.0__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imagepro_python-1.2.2/PKG-INFO +200 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/pyproject.toml +13 -14
- imagepro_python-1.2.2/readme.md +156 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/dataset_generator.py +25 -12
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/utils/result.py +16 -1
- imagepro_python-1.2.2/src/ImagePRO_Python.egg-info/PKG-INFO +200 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO_Python.egg-info/SOURCES.txt +1 -0
- imagepro_python-1.2.2/src/ImagePRO_Python.egg-info/requires.txt +19 -0
- imagepro_python-1.2.0/PKG-INFO +0 -44
- imagepro_python-1.2.0/src/ImagePRO_Python.egg-info/PKG-INFO +0 -44
- imagepro_python-1.2.0/src/ImagePRO_Python.egg-info/requires.txt +0 -19
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/LICENSE +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/setup.cfg +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/body_analysis/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/body_analysis/body_pose_estimation.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/body_analysis/hand_tracking.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/eye_status_analysis.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/face_comparison.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/face_detection.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/face_mesh_analysis.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/human_analysis/face_analysis/head_pose_estimation.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/object_analysis/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/object_analysis/object_detection.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/blur.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/contrast.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/crop.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/grayscale.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/histogram.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/resize.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/rotate.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/sharpen.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/utils/__init__.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/utils/image.py +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO_Python.egg-info/dependency_links.txt +0 -0
- {imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO_Python.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ImagePRO-Python
|
|
3
|
+
Version: 1.2.2
|
|
4
|
+
Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
|
|
5
|
+
Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/parsasafaie/ImagePRO
|
|
8
|
+
Project-URL: Repository, https://github.com/parsasafaie/ImagePRO.git
|
|
9
|
+
Project-URL: Documentation, https://github.com/parsasafaie/ImagePRO#readme
|
|
10
|
+
Project-URL: Issues, https://github.com/parsasafaie/ImagePRO/issues
|
|
11
|
+
Keywords: opencv,mediapipe,computer-vision,face,pose,yolo,image-processing
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: <3.13,>=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy<2.1.0,>=1.24
|
|
29
|
+
Requires-Dist: opencv-python<5.0,>=4.8
|
|
30
|
+
Requires-Dist: matplotlib<4.0,>=3.7
|
|
31
|
+
Provides-Extra: yolo
|
|
32
|
+
Requires-Dist: ultralytics<9.0,>=8.2; extra == "yolo"
|
|
33
|
+
Provides-Extra: mediapipe
|
|
34
|
+
Requires-Dist: mediapipe<=0.10.11,>=0.10.0; extra == "mediapipe"
|
|
35
|
+
Provides-Extra: insightface
|
|
36
|
+
Requires-Dist: insightface<0.8,>=0.7; extra == "insightface"
|
|
37
|
+
Requires-Dist: onnxruntime<2.0,>=1.16; extra == "insightface"
|
|
38
|
+
Provides-Extra: full
|
|
39
|
+
Requires-Dist: mediapipe<=0.10.11,>=0.10.0; extra == "full"
|
|
40
|
+
Requires-Dist: ultralytics<9.0,>=8.2; extra == "full"
|
|
41
|
+
Requires-Dist: insightface<0.8,>=0.7; extra == "full"
|
|
42
|
+
Requires-Dist: onnxruntime<2.0,>=1.16; extra == "full"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# ImagePRO
|
|
46
|
+
|
|
47
|
+
> **Professional & Modular Image Processing Library in Python**
|
|
48
|
+
|
|
49
|
+
**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.
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
## ✨ Features
|
|
54
|
+
|
|
55
|
+
### **Image I/O & Management**
|
|
56
|
+
- Flexible input/output handling (file paths or numpy arrays)
|
|
57
|
+
- Batch processing capabilities
|
|
58
|
+
- Multiple format support (JPEG, PNG, CSV, etc.)
|
|
59
|
+
|
|
60
|
+
### **Pre-processing & Enhancement**
|
|
61
|
+
- **Basic Operations**: Resize, crop, rotate (90°, 180°, 270°, custom angles), grayscale conversion
|
|
62
|
+
- **Filtering**: Blur filters (average, Gaussian, median, bilateral), sharpening filters (Laplacian, Unsharp Masking)
|
|
63
|
+
- **Enhancement**: Contrast enhancement (CLAHE, GHE, stretching)
|
|
64
|
+
- **Dataset Generation**: Automated image capture with preprocessing pipeline
|
|
65
|
+
|
|
66
|
+
### **Human Analysis**
|
|
67
|
+
- **Face Analysis**: 468-point mesh, head pose estimation, eye status detection, face comparison, face cropping
|
|
68
|
+
- **Body Analysis**: Pose estimation, hand tracking (21 landmarks)
|
|
69
|
+
- **Real-time Processing**: Live webcam analysis for all modules
|
|
70
|
+
|
|
71
|
+
### **Object Detection**
|
|
72
|
+
- **YOLO Integration**: Multiple accuracy levels (nano to extra-large)
|
|
73
|
+
- **Flexible Models**: Pre-trained or custom model support
|
|
74
|
+
- **Batch Processing**: Efficient handling of multiple images
|
|
75
|
+
|
|
76
|
+
## 🚀 Installation
|
|
77
|
+
|
|
78
|
+
### From PyPI
|
|
79
|
+
```bash
|
|
80
|
+
pip install ImagePRO-Python
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### From Source
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/parsasafaie/ImagePRO.git
|
|
86
|
+
cd ImagePRO
|
|
87
|
+
|
|
88
|
+
python -m venv .venv
|
|
89
|
+
|
|
90
|
+
source .venv/bin/activate # macOS/Linux
|
|
91
|
+
.venv\Scripts\activate # Windows
|
|
92
|
+
|
|
93
|
+
# Base dependencies
|
|
94
|
+
pip install -r requirements/base.txt
|
|
95
|
+
|
|
96
|
+
# Optional dependencies
|
|
97
|
+
# For YOLO object detection
|
|
98
|
+
pip install -r requirements/yolo.txt
|
|
99
|
+
|
|
100
|
+
# For MediaPipe human analysis
|
|
101
|
+
pip install -r requirements/mediapipe.txt
|
|
102
|
+
|
|
103
|
+
# For InsightFace advanced face analysis
|
|
104
|
+
pip install -r requirements/insightface.txt
|
|
105
|
+
|
|
106
|
+
# Or install everything
|
|
107
|
+
pip install -r requirements/full.txt
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See the [Directory Structure](/PROJECT_STRUCTURE.md#directory-structure) section in [PROJECT_STRUCTURE.md](/PROJECT_STRUCTURE.md) for details on which modules need which requirements.
|
|
111
|
+
|
|
112
|
+
## 📖 Quick Start
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from ImagePRO.pre_processing.blur import apply_average_blur
|
|
116
|
+
from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
|
|
117
|
+
from ImagePRO.human_analysis.body_analysis.body_pose_estimation import detect_body_pose
|
|
118
|
+
from ImagePRO.object_analysis.object_detection import detect_objects
|
|
119
|
+
from ImagePRO.utils.image import Image
|
|
120
|
+
|
|
121
|
+
# Load an image
|
|
122
|
+
image = Image.from_path("person_and_objects.jpg")
|
|
123
|
+
# Or from numpy array: image = Image.from_array(np_array)
|
|
124
|
+
|
|
125
|
+
# Apply average blur
|
|
126
|
+
blur_result = apply_average_blur(image=image)
|
|
127
|
+
blur_result.save_as_img("blurred_output.jpg")
|
|
128
|
+
|
|
129
|
+
# Analyze face mesh (468 landmarks)
|
|
130
|
+
face_mesh_result = analyze_face_mesh(image=image)
|
|
131
|
+
print(f"Detected {len(face_mesh_result.data)} face landmarks")
|
|
132
|
+
face_mesh_result.save_as_csv("face_landmarks.csv")
|
|
133
|
+
|
|
134
|
+
# Detect body pose (33 landmarks)
|
|
135
|
+
body_pose_result = detect_body_pose(image=image)
|
|
136
|
+
print(f"Body pose data: {body_pose_result.data}")
|
|
137
|
+
|
|
138
|
+
# Detect objects with YOLO
|
|
139
|
+
object_detection_result = detect_objects(
|
|
140
|
+
image=image,
|
|
141
|
+
accuracy_level=3, # 1=nano, 2=small, 3=medium, 4=large, 5=extra-large
|
|
142
|
+
confidence=0.5
|
|
143
|
+
)
|
|
144
|
+
print(f"Detected {len(object_detection_result.data)} objects")
|
|
145
|
+
object_detection_result.save_as_img("detections.jpg")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
> **Note**: These are basic examples. Each module contains many more functions with extensive customization options. Explore the module-specific README files for detailed documentation.
|
|
149
|
+
|
|
150
|
+
## 📚 Documentation
|
|
151
|
+
|
|
152
|
+
Each module includes comprehensive documentation with detailed examples:
|
|
153
|
+
|
|
154
|
+
- **[Pre-processing](src/ImagePRO/pre_processing/README.md)**: Image manipulation, filtering, and enhancement
|
|
155
|
+
- **[Human Analysis](src/ImagePRO/human_analysis/README.md)**: Face and body analysis tools
|
|
156
|
+
- [Face Analysis](src/ImagePRO/human_analysis/face_analysis/README.md): Face mesh, pose estimation, eye status, comparison
|
|
157
|
+
- [Body Analysis](src/ImagePRO/human_analysis/body_analysis/README.md): Body pose and hand tracking
|
|
158
|
+
- **[Object Analysis](src/ImagePRO/object_analysis/README.md)**: YOLO-based object detection
|
|
159
|
+
- **[Utils](src/ImagePRO/utils/README.md)**: Shared utilities and I/O handling
|
|
160
|
+
|
|
161
|
+
For detailed project structure and development guidelines, see [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md).
|
|
162
|
+
|
|
163
|
+
## 🏗️ Architecture
|
|
164
|
+
|
|
165
|
+
ImagePRO is built with a modular architecture designed for extensibility and maintainability:
|
|
166
|
+
|
|
167
|
+
- **Clean Separation of Concerns**: Each module handles a specific domain
|
|
168
|
+
- **Consistent API Patterns**: All functions follow the same input/output conventions
|
|
169
|
+
- **Shared Utilities**: Common `Image` and `Result` classes for unified I/O
|
|
170
|
+
- **Professional Error Handling**: Comprehensive validation with clear error messages
|
|
171
|
+
- **Type Safety**: Full type hints throughout the codebase
|
|
172
|
+
- **Documentation**: Google-style docstrings for all functions
|
|
173
|
+
|
|
174
|
+
### Key Design Principles
|
|
175
|
+
- **Immutable Design**: Image objects are immutable, operations return new instances
|
|
176
|
+
- **Functional Style**: Stateless functions that can be easily composed
|
|
177
|
+
- **Result Objects**: Unified return type containing image, data, and metadata
|
|
178
|
+
- **Keyword Arguments**: All optional parameters use keyword-only syntax
|
|
179
|
+
|
|
180
|
+
## 🤝 Contributing
|
|
181
|
+
|
|
182
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
183
|
+
|
|
184
|
+
### Development Setup
|
|
185
|
+
1. Fork the repository
|
|
186
|
+
2. Create a virtual environment: `python -m venv .venv`
|
|
187
|
+
3. Install dependencies: `pip install -r requirements/full.txt`
|
|
188
|
+
4. Follow the coding standards outlined in [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md)
|
|
189
|
+
5. Add tests for new features
|
|
190
|
+
6. Update documentation as needed
|
|
191
|
+
|
|
192
|
+
### Reporting Issues
|
|
193
|
+
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository with:
|
|
194
|
+
- Description of the problem or feature request
|
|
195
|
+
- Steps to reproduce (for bugs)
|
|
196
|
+
- Expected vs. actual behavior
|
|
197
|
+
- Environment details (OS, Python version, etc.)
|
|
198
|
+
|
|
199
|
+
## 📄 License
|
|
200
|
+
This project is licensed under the MIT License – see the [LICENSE](LICENSE) file for details.
|
|
@@ -7,9 +7,9 @@ where = ["src"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "ImagePRO-Python"
|
|
10
|
-
version = "1.2.
|
|
10
|
+
version = "1.2.2"
|
|
11
11
|
description = "Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration."
|
|
12
|
-
readme = "
|
|
12
|
+
readme = "readme.md"
|
|
13
13
|
requires-python = ">=3.9,<3.13"
|
|
14
14
|
license = { text = "MIT" }
|
|
15
15
|
|
|
@@ -36,7 +36,6 @@ classifiers = [
|
|
|
36
36
|
"Programming Language :: Python :: 3.10",
|
|
37
37
|
"Programming Language :: Python :: 3.11",
|
|
38
38
|
"Programming Language :: Python :: 3.12",
|
|
39
|
-
"Programming Language :: Python :: 3.13",
|
|
40
39
|
"License :: OSI Approved :: MIT License",
|
|
41
40
|
"Operating System :: OS Independent",
|
|
42
41
|
"Topic :: Scientific/Engineering :: Image Processing",
|
|
@@ -45,30 +44,30 @@ classifiers = [
|
|
|
45
44
|
]
|
|
46
45
|
|
|
47
46
|
dependencies = [
|
|
48
|
-
"numpy>=1.24,<
|
|
49
|
-
"opencv-python>=4.8,<
|
|
47
|
+
"numpy>=1.24,<2.1.0",
|
|
48
|
+
"opencv-python>=4.8,<5.0",
|
|
50
49
|
"matplotlib>=3.7,<4.0"
|
|
51
50
|
]
|
|
52
51
|
|
|
53
52
|
[project.optional-dependencies]
|
|
54
53
|
yolo = [
|
|
55
|
-
"ultralytics>=8.2,<
|
|
54
|
+
"ultralytics>=8.2,<9.0"
|
|
56
55
|
]
|
|
57
56
|
|
|
58
57
|
mediapipe = [
|
|
59
|
-
"mediapipe>=0.10
|
|
58
|
+
"mediapipe>=0.10.0,<=0.10.11"
|
|
60
59
|
]
|
|
61
60
|
|
|
62
61
|
insightface = [
|
|
63
|
-
"insightface>=0.7,<
|
|
64
|
-
"onnxruntime>=1.16,<
|
|
62
|
+
"insightface>=0.7,<0.8",
|
|
63
|
+
"onnxruntime>=1.16,<2.0"
|
|
65
64
|
]
|
|
66
65
|
|
|
67
66
|
full = [
|
|
68
|
-
"mediapipe>=0.10
|
|
69
|
-
"ultralytics>=8.2,<
|
|
70
|
-
"insightface>=0.7,<
|
|
71
|
-
"onnxruntime>=1.16,<
|
|
67
|
+
"mediapipe>=0.10.0,<=0.10.11",
|
|
68
|
+
"ultralytics>=8.2,<9.0",
|
|
69
|
+
"insightface>=0.7,<0.8",
|
|
70
|
+
"onnxruntime>=1.16,<2.0"
|
|
72
71
|
]
|
|
73
72
|
|
|
74
73
|
[project.urls]
|
|
@@ -78,4 +77,4 @@ Documentation = "https://github.com/parsasafaie/ImagePRO#readme"
|
|
|
78
77
|
Issues = "https://github.com/parsasafaie/ImagePRO/issues"
|
|
79
78
|
|
|
80
79
|
[tool.hatch.build.targets.wheel]
|
|
81
|
-
packages = ["
|
|
80
|
+
packages = ["ImagePRO"]
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# ImagePRO
|
|
2
|
+
|
|
3
|
+
> **Professional & Modular Image Processing Library in Python**
|
|
4
|
+
|
|
5
|
+
**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.
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
### **Image I/O & Management**
|
|
12
|
+
- Flexible input/output handling (file paths or numpy arrays)
|
|
13
|
+
- Batch processing capabilities
|
|
14
|
+
- Multiple format support (JPEG, PNG, CSV, etc.)
|
|
15
|
+
|
|
16
|
+
### **Pre-processing & Enhancement**
|
|
17
|
+
- **Basic Operations**: Resize, crop, rotate (90°, 180°, 270°, custom angles), grayscale conversion
|
|
18
|
+
- **Filtering**: Blur filters (average, Gaussian, median, bilateral), sharpening filters (Laplacian, Unsharp Masking)
|
|
19
|
+
- **Enhancement**: Contrast enhancement (CLAHE, GHE, stretching)
|
|
20
|
+
- **Dataset Generation**: Automated image capture with preprocessing pipeline
|
|
21
|
+
|
|
22
|
+
### **Human Analysis**
|
|
23
|
+
- **Face Analysis**: 468-point mesh, head pose estimation, eye status detection, face comparison, face cropping
|
|
24
|
+
- **Body Analysis**: Pose estimation, hand tracking (21 landmarks)
|
|
25
|
+
- **Real-time Processing**: Live webcam analysis for all modules
|
|
26
|
+
|
|
27
|
+
### **Object Detection**
|
|
28
|
+
- **YOLO Integration**: Multiple accuracy levels (nano to extra-large)
|
|
29
|
+
- **Flexible Models**: Pre-trained or custom model support
|
|
30
|
+
- **Batch Processing**: Efficient handling of multiple images
|
|
31
|
+
|
|
32
|
+
## 🚀 Installation
|
|
33
|
+
|
|
34
|
+
### From PyPI
|
|
35
|
+
```bash
|
|
36
|
+
pip install ImagePRO-Python
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### From Source
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/parsasafaie/ImagePRO.git
|
|
42
|
+
cd ImagePRO
|
|
43
|
+
|
|
44
|
+
python -m venv .venv
|
|
45
|
+
|
|
46
|
+
source .venv/bin/activate # macOS/Linux
|
|
47
|
+
.venv\Scripts\activate # Windows
|
|
48
|
+
|
|
49
|
+
# Base dependencies
|
|
50
|
+
pip install -r requirements/base.txt
|
|
51
|
+
|
|
52
|
+
# Optional dependencies
|
|
53
|
+
# For YOLO object detection
|
|
54
|
+
pip install -r requirements/yolo.txt
|
|
55
|
+
|
|
56
|
+
# For MediaPipe human analysis
|
|
57
|
+
pip install -r requirements/mediapipe.txt
|
|
58
|
+
|
|
59
|
+
# For InsightFace advanced face analysis
|
|
60
|
+
pip install -r requirements/insightface.txt
|
|
61
|
+
|
|
62
|
+
# Or install everything
|
|
63
|
+
pip install -r requirements/full.txt
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
See the [Directory Structure](/PROJECT_STRUCTURE.md#directory-structure) section in [PROJECT_STRUCTURE.md](/PROJECT_STRUCTURE.md) for details on which modules need which requirements.
|
|
67
|
+
|
|
68
|
+
## 📖 Quick Start
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from ImagePRO.pre_processing.blur import apply_average_blur
|
|
72
|
+
from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
|
|
73
|
+
from ImagePRO.human_analysis.body_analysis.body_pose_estimation import detect_body_pose
|
|
74
|
+
from ImagePRO.object_analysis.object_detection import detect_objects
|
|
75
|
+
from ImagePRO.utils.image import Image
|
|
76
|
+
|
|
77
|
+
# Load an image
|
|
78
|
+
image = Image.from_path("person_and_objects.jpg")
|
|
79
|
+
# Or from numpy array: image = Image.from_array(np_array)
|
|
80
|
+
|
|
81
|
+
# Apply average blur
|
|
82
|
+
blur_result = apply_average_blur(image=image)
|
|
83
|
+
blur_result.save_as_img("blurred_output.jpg")
|
|
84
|
+
|
|
85
|
+
# Analyze face mesh (468 landmarks)
|
|
86
|
+
face_mesh_result = analyze_face_mesh(image=image)
|
|
87
|
+
print(f"Detected {len(face_mesh_result.data)} face landmarks")
|
|
88
|
+
face_mesh_result.save_as_csv("face_landmarks.csv")
|
|
89
|
+
|
|
90
|
+
# Detect body pose (33 landmarks)
|
|
91
|
+
body_pose_result = detect_body_pose(image=image)
|
|
92
|
+
print(f"Body pose data: {body_pose_result.data}")
|
|
93
|
+
|
|
94
|
+
# Detect objects with YOLO
|
|
95
|
+
object_detection_result = detect_objects(
|
|
96
|
+
image=image,
|
|
97
|
+
accuracy_level=3, # 1=nano, 2=small, 3=medium, 4=large, 5=extra-large
|
|
98
|
+
confidence=0.5
|
|
99
|
+
)
|
|
100
|
+
print(f"Detected {len(object_detection_result.data)} objects")
|
|
101
|
+
object_detection_result.save_as_img("detections.jpg")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> **Note**: These are basic examples. Each module contains many more functions with extensive customization options. Explore the module-specific README files for detailed documentation.
|
|
105
|
+
|
|
106
|
+
## 📚 Documentation
|
|
107
|
+
|
|
108
|
+
Each module includes comprehensive documentation with detailed examples:
|
|
109
|
+
|
|
110
|
+
- **[Pre-processing](src/ImagePRO/pre_processing/README.md)**: Image manipulation, filtering, and enhancement
|
|
111
|
+
- **[Human Analysis](src/ImagePRO/human_analysis/README.md)**: Face and body analysis tools
|
|
112
|
+
- [Face Analysis](src/ImagePRO/human_analysis/face_analysis/README.md): Face mesh, pose estimation, eye status, comparison
|
|
113
|
+
- [Body Analysis](src/ImagePRO/human_analysis/body_analysis/README.md): Body pose and hand tracking
|
|
114
|
+
- **[Object Analysis](src/ImagePRO/object_analysis/README.md)**: YOLO-based object detection
|
|
115
|
+
- **[Utils](src/ImagePRO/utils/README.md)**: Shared utilities and I/O handling
|
|
116
|
+
|
|
117
|
+
For detailed project structure and development guidelines, see [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md).
|
|
118
|
+
|
|
119
|
+
## 🏗️ Architecture
|
|
120
|
+
|
|
121
|
+
ImagePRO is built with a modular architecture designed for extensibility and maintainability:
|
|
122
|
+
|
|
123
|
+
- **Clean Separation of Concerns**: Each module handles a specific domain
|
|
124
|
+
- **Consistent API Patterns**: All functions follow the same input/output conventions
|
|
125
|
+
- **Shared Utilities**: Common `Image` and `Result` classes for unified I/O
|
|
126
|
+
- **Professional Error Handling**: Comprehensive validation with clear error messages
|
|
127
|
+
- **Type Safety**: Full type hints throughout the codebase
|
|
128
|
+
- **Documentation**: Google-style docstrings for all functions
|
|
129
|
+
|
|
130
|
+
### Key Design Principles
|
|
131
|
+
- **Immutable Design**: Image objects are immutable, operations return new instances
|
|
132
|
+
- **Functional Style**: Stateless functions that can be easily composed
|
|
133
|
+
- **Result Objects**: Unified return type containing image, data, and metadata
|
|
134
|
+
- **Keyword Arguments**: All optional parameters use keyword-only syntax
|
|
135
|
+
|
|
136
|
+
## 🤝 Contributing
|
|
137
|
+
|
|
138
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
139
|
+
|
|
140
|
+
### Development Setup
|
|
141
|
+
1. Fork the repository
|
|
142
|
+
2. Create a virtual environment: `python -m venv .venv`
|
|
143
|
+
3. Install dependencies: `pip install -r requirements/full.txt`
|
|
144
|
+
4. Follow the coding standards outlined in [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md)
|
|
145
|
+
5. Add tests for new features
|
|
146
|
+
6. Update documentation as needed
|
|
147
|
+
|
|
148
|
+
### Reporting Issues
|
|
149
|
+
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository with:
|
|
150
|
+
- Description of the problem or feature request
|
|
151
|
+
- Steps to reproduce (for bugs)
|
|
152
|
+
- Expected vs. actual behavior
|
|
153
|
+
- Environment details (OS, Python version, etc.)
|
|
154
|
+
|
|
155
|
+
## 📄 License
|
|
156
|
+
This project is licensed under the MIT License – see the [LICENSE](LICENSE) file for details.
|
{imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/pre_processing/dataset_generator.py
RENAMED
|
@@ -45,9 +45,12 @@ def capture_bulk_pictures(
|
|
|
45
45
|
) -> None:
|
|
46
46
|
"""Generate a dataset by capturing faces from webcam.
|
|
47
47
|
|
|
48
|
-
Captures frames
|
|
48
|
+
Captures frames from the webcam, detects faces, applies optional preprocessing,
|
|
49
|
+
and saves cropped face images to disk. This function is useful for creating
|
|
50
|
+
face recognition datasets with data augmentation.
|
|
51
|
+
|
|
49
52
|
Processing pipeline (if enabled):
|
|
50
|
-
|
|
53
|
+
average blur → laplacian sharpen → grayscale → resize → random rotate
|
|
51
54
|
|
|
52
55
|
Args:
|
|
53
56
|
folder_path: Base directory for dataset.
|
|
@@ -80,7 +83,7 @@ def capture_bulk_pictures(
|
|
|
80
83
|
FileExistsError: If output folder exists
|
|
81
84
|
RuntimeError: If camera access fails
|
|
82
85
|
"""
|
|
83
|
-
# Validate numeric parameters
|
|
86
|
+
# Validate numeric parameters to ensure safe operation
|
|
84
87
|
if not isinstance(num_images, int) or num_images <= 0:
|
|
85
88
|
raise ValueError("'num_images' must be a positive integer")
|
|
86
89
|
|
|
@@ -93,20 +96,23 @@ def capture_bulk_pictures(
|
|
|
93
96
|
if not isinstance(delay, (int, float)) or delay < 0:
|
|
94
97
|
raise ValueError("'delay' must be a non-negative number")
|
|
95
98
|
|
|
96
|
-
# Setup output directory
|
|
99
|
+
# Setup output directory structure
|
|
97
100
|
base_dir = Path(folder_path)
|
|
98
101
|
face_folder = base_dir / str(face_id)
|
|
99
102
|
|
|
103
|
+
# Create output folder (fail if exists to prevent accidental overwrites)
|
|
100
104
|
try:
|
|
101
105
|
face_folder.mkdir(parents=True, exist_ok=False)
|
|
102
106
|
except FileExistsError as e:
|
|
103
107
|
raise FileExistsError(f"Output folder already exists: {face_folder}") from e
|
|
104
108
|
|
|
105
|
-
# Initialize camera
|
|
109
|
+
# Initialize camera capture
|
|
106
110
|
cap = cv2.VideoCapture(camera_index)
|
|
107
111
|
if not cap.isOpened():
|
|
108
112
|
raise RuntimeError(f"Cannot access camera (index={camera_index})")
|
|
109
113
|
|
|
114
|
+
# Initialize MediaPipe face mesh detector for face detection
|
|
115
|
+
# Using face_mesh instead of face_detection for better accuracy
|
|
110
116
|
face_mesh = mp.solutions.face_mesh.FaceMesh(
|
|
111
117
|
max_num_faces=1,
|
|
112
118
|
min_detection_confidence=min_confidence,
|
|
@@ -123,36 +129,40 @@ def capture_bulk_pictures(
|
|
|
123
129
|
print("Failed to capture frame, skipping...")
|
|
124
130
|
continue
|
|
125
131
|
|
|
126
|
-
# Apply preprocessing pipeline
|
|
132
|
+
# Apply preprocessing pipeline in sequence
|
|
133
|
+
# Each step transforms the image and passes it to the next step
|
|
127
134
|
processed = frame
|
|
128
135
|
|
|
129
136
|
if apply_blur:
|
|
130
|
-
# Reduce noise while
|
|
137
|
+
# Reduce noise while preserving facial features
|
|
131
138
|
processed = blur.apply_average_blur(
|
|
132
139
|
image=Image.from_array(processed),
|
|
133
140
|
filter_size=3
|
|
134
141
|
).image
|
|
135
142
|
|
|
136
143
|
if apply_sharpen:
|
|
137
|
-
# Enhance edges with gentle sharpening
|
|
144
|
+
# Enhance edges with gentle sharpening for better feature detection
|
|
138
145
|
processed = sharpen.apply_laplacian_sharpening(
|
|
139
146
|
image=Image.from_array(processed),
|
|
140
147
|
coefficient=1.0
|
|
141
148
|
).image
|
|
142
149
|
|
|
143
150
|
if apply_grayscale:
|
|
151
|
+
# Convert to single-channel for reduced storage and faster processing
|
|
144
152
|
processed = grayscale.convert_to_grayscale(
|
|
145
153
|
image=Image.from_array(processed)
|
|
146
154
|
).image
|
|
147
155
|
|
|
148
156
|
if apply_resize is not False:
|
|
157
|
+
# Resize to consistent dimensions (e.g., 224x224 for ML models)
|
|
149
158
|
processed = resize.resize_image(
|
|
150
159
|
image=Image.from_array(processed),
|
|
151
160
|
new_size=apply_resize
|
|
152
161
|
).image
|
|
153
162
|
|
|
154
163
|
if apply_rotate:
|
|
155
|
-
# Apply random rotation with scaling
|
|
164
|
+
# Apply random rotation with scaling for data augmentation
|
|
165
|
+
# Rotation range: -45° to +45° with random scale factors
|
|
156
166
|
angle = float(random.randint(-45, 45))
|
|
157
167
|
scale = random.choice([1.0, 1.1, 1.2, 1.3])
|
|
158
168
|
processed = rotate.rotate_image_custom(
|
|
@@ -161,11 +171,12 @@ def capture_bulk_pictures(
|
|
|
161
171
|
scale=scale
|
|
162
172
|
).image
|
|
163
173
|
|
|
164
|
-
#
|
|
174
|
+
# Detect and crop face from processed frame
|
|
165
175
|
filename = f"{start_index + saved_count:04d}.jpg"
|
|
166
176
|
output_path = face_folder / filename
|
|
167
177
|
|
|
168
178
|
try:
|
|
179
|
+
# Detect face and crop to face region only
|
|
169
180
|
result = detect_faces(
|
|
170
181
|
image=Image.from_array(processed),
|
|
171
182
|
max_faces=1,
|
|
@@ -173,18 +184,20 @@ def capture_bulk_pictures(
|
|
|
173
184
|
face_mesh_obj=face_mesh
|
|
174
185
|
)
|
|
175
186
|
|
|
187
|
+
# Save cropped face image
|
|
176
188
|
result.save_as_img(str(output_path))
|
|
177
189
|
saved_count += 1
|
|
178
190
|
|
|
191
|
+
# Add delay between captures to allow subject movement
|
|
179
192
|
if delay > 0:
|
|
180
193
|
time.sleep(delay)
|
|
181
194
|
|
|
182
195
|
except ValueError:
|
|
183
|
-
# Skip frames with no detected faces
|
|
196
|
+
# Skip frames with no detected faces (silent failure)
|
|
184
197
|
continue
|
|
185
198
|
|
|
186
199
|
finally:
|
|
187
|
-
# Clean up resources
|
|
200
|
+
# Clean up resources: release camera and close OpenCV windows
|
|
188
201
|
cap.release()
|
|
189
202
|
cv2.destroyAllWindows()
|
|
190
203
|
|
|
@@ -144,7 +144,22 @@ class Result:
|
|
|
144
144
|
return self
|
|
145
145
|
|
|
146
146
|
def flatten_rows(data):
|
|
147
|
-
"""
|
|
147
|
+
"""
|
|
148
|
+
Flatten nested lists/tuples into rows suitable for CSV writing.
|
|
149
|
+
|
|
150
|
+
Recursively processes nested data structures to create a flat list of rows
|
|
151
|
+
that can be written to a CSV file. Handles mixed nesting levels gracefully.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
data: Nested list/tuple structure containing data to flatten.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
list[list[Any]]: Flattened list of rows, where each row is a list of values.
|
|
158
|
+
|
|
159
|
+
Example:
|
|
160
|
+
>>> flatten_rows([[1, 2], [3, [4, 5]]])
|
|
161
|
+
[[1, 2], [3, 4, 5]]
|
|
162
|
+
"""
|
|
148
163
|
rows = []
|
|
149
164
|
for item in data:
|
|
150
165
|
if isinstance(item, (list, tuple)):
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ImagePRO-Python
|
|
3
|
+
Version: 1.2.2
|
|
4
|
+
Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
|
|
5
|
+
Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/parsasafaie/ImagePRO
|
|
8
|
+
Project-URL: Repository, https://github.com/parsasafaie/ImagePRO.git
|
|
9
|
+
Project-URL: Documentation, https://github.com/parsasafaie/ImagePRO#readme
|
|
10
|
+
Project-URL: Issues, https://github.com/parsasafaie/ImagePRO/issues
|
|
11
|
+
Keywords: opencv,mediapipe,computer-vision,face,pose,yolo,image-processing
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: <3.13,>=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy<2.1.0,>=1.24
|
|
29
|
+
Requires-Dist: opencv-python<5.0,>=4.8
|
|
30
|
+
Requires-Dist: matplotlib<4.0,>=3.7
|
|
31
|
+
Provides-Extra: yolo
|
|
32
|
+
Requires-Dist: ultralytics<9.0,>=8.2; extra == "yolo"
|
|
33
|
+
Provides-Extra: mediapipe
|
|
34
|
+
Requires-Dist: mediapipe<=0.10.11,>=0.10.0; extra == "mediapipe"
|
|
35
|
+
Provides-Extra: insightface
|
|
36
|
+
Requires-Dist: insightface<0.8,>=0.7; extra == "insightface"
|
|
37
|
+
Requires-Dist: onnxruntime<2.0,>=1.16; extra == "insightface"
|
|
38
|
+
Provides-Extra: full
|
|
39
|
+
Requires-Dist: mediapipe<=0.10.11,>=0.10.0; extra == "full"
|
|
40
|
+
Requires-Dist: ultralytics<9.0,>=8.2; extra == "full"
|
|
41
|
+
Requires-Dist: insightface<0.8,>=0.7; extra == "full"
|
|
42
|
+
Requires-Dist: onnxruntime<2.0,>=1.16; extra == "full"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# ImagePRO
|
|
46
|
+
|
|
47
|
+
> **Professional & Modular Image Processing Library in Python**
|
|
48
|
+
|
|
49
|
+
**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.
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
## ✨ Features
|
|
54
|
+
|
|
55
|
+
### **Image I/O & Management**
|
|
56
|
+
- Flexible input/output handling (file paths or numpy arrays)
|
|
57
|
+
- Batch processing capabilities
|
|
58
|
+
- Multiple format support (JPEG, PNG, CSV, etc.)
|
|
59
|
+
|
|
60
|
+
### **Pre-processing & Enhancement**
|
|
61
|
+
- **Basic Operations**: Resize, crop, rotate (90°, 180°, 270°, custom angles), grayscale conversion
|
|
62
|
+
- **Filtering**: Blur filters (average, Gaussian, median, bilateral), sharpening filters (Laplacian, Unsharp Masking)
|
|
63
|
+
- **Enhancement**: Contrast enhancement (CLAHE, GHE, stretching)
|
|
64
|
+
- **Dataset Generation**: Automated image capture with preprocessing pipeline
|
|
65
|
+
|
|
66
|
+
### **Human Analysis**
|
|
67
|
+
- **Face Analysis**: 468-point mesh, head pose estimation, eye status detection, face comparison, face cropping
|
|
68
|
+
- **Body Analysis**: Pose estimation, hand tracking (21 landmarks)
|
|
69
|
+
- **Real-time Processing**: Live webcam analysis for all modules
|
|
70
|
+
|
|
71
|
+
### **Object Detection**
|
|
72
|
+
- **YOLO Integration**: Multiple accuracy levels (nano to extra-large)
|
|
73
|
+
- **Flexible Models**: Pre-trained or custom model support
|
|
74
|
+
- **Batch Processing**: Efficient handling of multiple images
|
|
75
|
+
|
|
76
|
+
## 🚀 Installation
|
|
77
|
+
|
|
78
|
+
### From PyPI
|
|
79
|
+
```bash
|
|
80
|
+
pip install ImagePRO-Python
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### From Source
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/parsasafaie/ImagePRO.git
|
|
86
|
+
cd ImagePRO
|
|
87
|
+
|
|
88
|
+
python -m venv .venv
|
|
89
|
+
|
|
90
|
+
source .venv/bin/activate # macOS/Linux
|
|
91
|
+
.venv\Scripts\activate # Windows
|
|
92
|
+
|
|
93
|
+
# Base dependencies
|
|
94
|
+
pip install -r requirements/base.txt
|
|
95
|
+
|
|
96
|
+
# Optional dependencies
|
|
97
|
+
# For YOLO object detection
|
|
98
|
+
pip install -r requirements/yolo.txt
|
|
99
|
+
|
|
100
|
+
# For MediaPipe human analysis
|
|
101
|
+
pip install -r requirements/mediapipe.txt
|
|
102
|
+
|
|
103
|
+
# For InsightFace advanced face analysis
|
|
104
|
+
pip install -r requirements/insightface.txt
|
|
105
|
+
|
|
106
|
+
# Or install everything
|
|
107
|
+
pip install -r requirements/full.txt
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See the [Directory Structure](/PROJECT_STRUCTURE.md#directory-structure) section in [PROJECT_STRUCTURE.md](/PROJECT_STRUCTURE.md) for details on which modules need which requirements.
|
|
111
|
+
|
|
112
|
+
## 📖 Quick Start
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from ImagePRO.pre_processing.blur import apply_average_blur
|
|
116
|
+
from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
|
|
117
|
+
from ImagePRO.human_analysis.body_analysis.body_pose_estimation import detect_body_pose
|
|
118
|
+
from ImagePRO.object_analysis.object_detection import detect_objects
|
|
119
|
+
from ImagePRO.utils.image import Image
|
|
120
|
+
|
|
121
|
+
# Load an image
|
|
122
|
+
image = Image.from_path("person_and_objects.jpg")
|
|
123
|
+
# Or from numpy array: image = Image.from_array(np_array)
|
|
124
|
+
|
|
125
|
+
# Apply average blur
|
|
126
|
+
blur_result = apply_average_blur(image=image)
|
|
127
|
+
blur_result.save_as_img("blurred_output.jpg")
|
|
128
|
+
|
|
129
|
+
# Analyze face mesh (468 landmarks)
|
|
130
|
+
face_mesh_result = analyze_face_mesh(image=image)
|
|
131
|
+
print(f"Detected {len(face_mesh_result.data)} face landmarks")
|
|
132
|
+
face_mesh_result.save_as_csv("face_landmarks.csv")
|
|
133
|
+
|
|
134
|
+
# Detect body pose (33 landmarks)
|
|
135
|
+
body_pose_result = detect_body_pose(image=image)
|
|
136
|
+
print(f"Body pose data: {body_pose_result.data}")
|
|
137
|
+
|
|
138
|
+
# Detect objects with YOLO
|
|
139
|
+
object_detection_result = detect_objects(
|
|
140
|
+
image=image,
|
|
141
|
+
accuracy_level=3, # 1=nano, 2=small, 3=medium, 4=large, 5=extra-large
|
|
142
|
+
confidence=0.5
|
|
143
|
+
)
|
|
144
|
+
print(f"Detected {len(object_detection_result.data)} objects")
|
|
145
|
+
object_detection_result.save_as_img("detections.jpg")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
> **Note**: These are basic examples. Each module contains many more functions with extensive customization options. Explore the module-specific README files for detailed documentation.
|
|
149
|
+
|
|
150
|
+
## 📚 Documentation
|
|
151
|
+
|
|
152
|
+
Each module includes comprehensive documentation with detailed examples:
|
|
153
|
+
|
|
154
|
+
- **[Pre-processing](src/ImagePRO/pre_processing/README.md)**: Image manipulation, filtering, and enhancement
|
|
155
|
+
- **[Human Analysis](src/ImagePRO/human_analysis/README.md)**: Face and body analysis tools
|
|
156
|
+
- [Face Analysis](src/ImagePRO/human_analysis/face_analysis/README.md): Face mesh, pose estimation, eye status, comparison
|
|
157
|
+
- [Body Analysis](src/ImagePRO/human_analysis/body_analysis/README.md): Body pose and hand tracking
|
|
158
|
+
- **[Object Analysis](src/ImagePRO/object_analysis/README.md)**: YOLO-based object detection
|
|
159
|
+
- **[Utils](src/ImagePRO/utils/README.md)**: Shared utilities and I/O handling
|
|
160
|
+
|
|
161
|
+
For detailed project structure and development guidelines, see [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md).
|
|
162
|
+
|
|
163
|
+
## 🏗️ Architecture
|
|
164
|
+
|
|
165
|
+
ImagePRO is built with a modular architecture designed for extensibility and maintainability:
|
|
166
|
+
|
|
167
|
+
- **Clean Separation of Concerns**: Each module handles a specific domain
|
|
168
|
+
- **Consistent API Patterns**: All functions follow the same input/output conventions
|
|
169
|
+
- **Shared Utilities**: Common `Image` and `Result` classes for unified I/O
|
|
170
|
+
- **Professional Error Handling**: Comprehensive validation with clear error messages
|
|
171
|
+
- **Type Safety**: Full type hints throughout the codebase
|
|
172
|
+
- **Documentation**: Google-style docstrings for all functions
|
|
173
|
+
|
|
174
|
+
### Key Design Principles
|
|
175
|
+
- **Immutable Design**: Image objects are immutable, operations return new instances
|
|
176
|
+
- **Functional Style**: Stateless functions that can be easily composed
|
|
177
|
+
- **Result Objects**: Unified return type containing image, data, and metadata
|
|
178
|
+
- **Keyword Arguments**: All optional parameters use keyword-only syntax
|
|
179
|
+
|
|
180
|
+
## 🤝 Contributing
|
|
181
|
+
|
|
182
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
183
|
+
|
|
184
|
+
### Development Setup
|
|
185
|
+
1. Fork the repository
|
|
186
|
+
2. Create a virtual environment: `python -m venv .venv`
|
|
187
|
+
3. Install dependencies: `pip install -r requirements/full.txt`
|
|
188
|
+
4. Follow the coding standards outlined in [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md)
|
|
189
|
+
5. Add tests for new features
|
|
190
|
+
6. Update documentation as needed
|
|
191
|
+
|
|
192
|
+
### Reporting Issues
|
|
193
|
+
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository with:
|
|
194
|
+
- Description of the problem or feature request
|
|
195
|
+
- Steps to reproduce (for bugs)
|
|
196
|
+
- Expected vs. actual behavior
|
|
197
|
+
- Environment details (OS, Python version, etc.)
|
|
198
|
+
|
|
199
|
+
## 📄 License
|
|
200
|
+
This project is licensed under the MIT License – see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
numpy<2.1.0,>=1.24
|
|
2
|
+
opencv-python<5.0,>=4.8
|
|
3
|
+
matplotlib<4.0,>=3.7
|
|
4
|
+
|
|
5
|
+
[full]
|
|
6
|
+
mediapipe<=0.10.11,>=0.10.0
|
|
7
|
+
ultralytics<9.0,>=8.2
|
|
8
|
+
insightface<0.8,>=0.7
|
|
9
|
+
onnxruntime<2.0,>=1.16
|
|
10
|
+
|
|
11
|
+
[insightface]
|
|
12
|
+
insightface<0.8,>=0.7
|
|
13
|
+
onnxruntime<2.0,>=1.16
|
|
14
|
+
|
|
15
|
+
[mediapipe]
|
|
16
|
+
mediapipe<=0.10.11,>=0.10.0
|
|
17
|
+
|
|
18
|
+
[yolo]
|
|
19
|
+
ultralytics<9.0,>=8.2
|
imagepro_python-1.2.0/PKG-INFO
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ImagePRO-Python
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
|
|
5
|
-
Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/parsasafaie/ImagePRO
|
|
8
|
-
Project-URL: Repository, https://github.com/parsasafaie/ImagePRO.git
|
|
9
|
-
Project-URL: Documentation, https://github.com/parsasafaie/ImagePRO#readme
|
|
10
|
-
Project-URL: Issues, https://github.com/parsasafaie/ImagePRO/issues
|
|
11
|
-
Keywords: opencv,mediapipe,computer-vision,face,pose,yolo,image-processing
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Intended Audience :: Science/Research
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
22
|
-
Classifier: Operating System :: OS Independent
|
|
23
|
-
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
24
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
-
Requires-Python: <3.13,>=3.9
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
License-File: LICENSE
|
|
29
|
-
Requires-Dist: numpy<3.0,>=1.24
|
|
30
|
-
Requires-Dist: opencv-python<6.0,>=4.8
|
|
31
|
-
Requires-Dist: matplotlib<4.0,>=3.7
|
|
32
|
-
Provides-Extra: yolo
|
|
33
|
-
Requires-Dist: ultralytics<10.0,>=8.2; extra == "yolo"
|
|
34
|
-
Provides-Extra: mediapipe
|
|
35
|
-
Requires-Dist: mediapipe<1.0,>=0.10; extra == "mediapipe"
|
|
36
|
-
Provides-Extra: insightface
|
|
37
|
-
Requires-Dist: insightface<1.0,>=0.7; extra == "insightface"
|
|
38
|
-
Requires-Dist: onnxruntime<3.0,>=1.16; extra == "insightface"
|
|
39
|
-
Provides-Extra: full
|
|
40
|
-
Requires-Dist: mediapipe<1.0,>=0.10; extra == "full"
|
|
41
|
-
Requires-Dist: ultralytics<10.0,>=8.2; extra == "full"
|
|
42
|
-
Requires-Dist: insightface<1.0,>=0.7; extra == "full"
|
|
43
|
-
Requires-Dist: onnxruntime<3.0,>=1.16; extra == "full"
|
|
44
|
-
Dynamic: license-file
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ImagePRO-Python
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
|
|
5
|
-
Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/parsasafaie/ImagePRO
|
|
8
|
-
Project-URL: Repository, https://github.com/parsasafaie/ImagePRO.git
|
|
9
|
-
Project-URL: Documentation, https://github.com/parsasafaie/ImagePRO#readme
|
|
10
|
-
Project-URL: Issues, https://github.com/parsasafaie/ImagePRO/issues
|
|
11
|
-
Keywords: opencv,mediapipe,computer-vision,face,pose,yolo,image-processing
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Intended Audience :: Science/Research
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
22
|
-
Classifier: Operating System :: OS Independent
|
|
23
|
-
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
24
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
-
Requires-Python: <3.13,>=3.9
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
License-File: LICENSE
|
|
29
|
-
Requires-Dist: numpy<3.0,>=1.24
|
|
30
|
-
Requires-Dist: opencv-python<6.0,>=4.8
|
|
31
|
-
Requires-Dist: matplotlib<4.0,>=3.7
|
|
32
|
-
Provides-Extra: yolo
|
|
33
|
-
Requires-Dist: ultralytics<10.0,>=8.2; extra == "yolo"
|
|
34
|
-
Provides-Extra: mediapipe
|
|
35
|
-
Requires-Dist: mediapipe<1.0,>=0.10; extra == "mediapipe"
|
|
36
|
-
Provides-Extra: insightface
|
|
37
|
-
Requires-Dist: insightface<1.0,>=0.7; extra == "insightface"
|
|
38
|
-
Requires-Dist: onnxruntime<3.0,>=1.16; extra == "insightface"
|
|
39
|
-
Provides-Extra: full
|
|
40
|
-
Requires-Dist: mediapipe<1.0,>=0.10; extra == "full"
|
|
41
|
-
Requires-Dist: ultralytics<10.0,>=8.2; extra == "full"
|
|
42
|
-
Requires-Dist: insightface<1.0,>=0.7; extra == "full"
|
|
43
|
-
Requires-Dist: onnxruntime<3.0,>=1.16; extra == "full"
|
|
44
|
-
Dynamic: license-file
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
numpy<3.0,>=1.24
|
|
2
|
-
opencv-python<6.0,>=4.8
|
|
3
|
-
matplotlib<4.0,>=3.7
|
|
4
|
-
|
|
5
|
-
[full]
|
|
6
|
-
mediapipe<1.0,>=0.10
|
|
7
|
-
ultralytics<10.0,>=8.2
|
|
8
|
-
insightface<1.0,>=0.7
|
|
9
|
-
onnxruntime<3.0,>=1.16
|
|
10
|
-
|
|
11
|
-
[insightface]
|
|
12
|
-
insightface<1.0,>=0.7
|
|
13
|
-
onnxruntime<3.0,>=1.16
|
|
14
|
-
|
|
15
|
-
[mediapipe]
|
|
16
|
-
mediapipe<1.0,>=0.10
|
|
17
|
-
|
|
18
|
-
[yolo]
|
|
19
|
-
ultralytics<10.0,>=8.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO/object_analysis/object_detection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{imagepro_python-1.2.0 → imagepro_python-1.2.2}/src/ImagePRO_Python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|