ImagePRO-Python 1.1.0__py3-none-any.whl → 1.2.1__py3-none-any.whl

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.
@@ -1,11 +1,20 @@
1
1
  from __future__ import annotations
2
2
 
3
- import cv2
4
- import mediapipe as mp
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
5
11
 
6
12
  from ImagePRO.utils.image import Image
7
13
  from ImagePRO.utils.result import Result
8
14
 
15
+ import cv2
16
+ import mediapipe as mp
17
+
9
18
  # Constants
10
19
  mp_pose = mp.solutions.pose
11
20
  TOTAL_LANDMARKS = 33
@@ -1,11 +1,20 @@
1
1
  from __future__ import annotations
2
2
 
3
- import cv2
4
- import mediapipe as mp
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
5
11
 
6
12
  from ImagePRO.utils.image import Image
7
13
  from ImagePRO.utils.result import Result
8
14
 
15
+ import cv2
16
+ import mediapipe as mp
17
+
9
18
  # Constants
10
19
  mp_hands = mp.solutions.hands
11
20
  DEFAULT_MAX_HANDS = 2
@@ -1,12 +1,21 @@
1
1
  from __future__ import annotations
2
2
 
3
- import cv2
4
- import mediapipe as mp
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
5
11
 
6
12
  from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
7
13
  from ImagePRO.utils.image import Image
8
14
  from ImagePRO.utils.result import Result
9
15
 
16
+ import cv2
17
+ import mediapipe as mp
18
+
10
19
  # Constants
11
20
  mp_face_mesh = mp.solutions.face_mesh
12
21
  DEFAULT_MIN_CONFIDENCE = 0.7
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import os
4
13
 
5
14
  import cv2
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
  import mediapipe as mp
5
14
  import numpy as np
@@ -1,11 +1,20 @@
1
1
  from __future__ import annotations
2
2
 
3
- import cv2
4
- import mediapipe as mp
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
5
11
 
6
12
  from ImagePRO.utils.image import Image
7
13
  from ImagePRO.utils.result import Result
8
14
 
15
+ import cv2
16
+ import mediapipe as mp
17
+
9
18
  # Constants
10
19
  mp_face_mesh = mp.solutions.face_mesh
11
20
  mp_drawing_utils = mp.solutions.drawing_utils
@@ -1,12 +1,21 @@
1
1
  from __future__ import annotations
2
2
 
3
- import cv2
4
- import mediapipe as mp
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[3] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
5
11
 
6
12
  from ImagePRO.human_analysis.face_analysis.face_mesh_analysis import analyze_face_mesh
7
13
  from ImagePRO.utils.image import Image
8
14
  from ImagePRO.utils.result import Result
9
15
 
16
+ import cv2
17
+ import mediapipe as mp
18
+
10
19
  # Constants
11
20
  mp_face_mesh = mp.solutions.face_mesh
12
21
  DEFAULT_MAX_FACES = 1
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  from ultralytics import YOLO
4
13
 
5
14
  from ImagePRO.utils.image import Image
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
 
5
14
  from ImagePRO.utils.image import Image
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
 
5
14
  from ImagePRO.utils.image import Image
@@ -1,5 +1,13 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
3
11
 
4
12
  from ImagePRO.utils.image import Image
5
13
  from ImagePRO.utils.result import Result
@@ -1,16 +1,24 @@
1
1
  from __future__ import annotations
2
2
 
3
- import random
4
- import time
3
+ import sys
5
4
  from pathlib import Path
6
5
 
7
- import cv2
8
- import mediapipe as mp
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
9
11
 
10
12
  from ImagePRO.human_analysis.face_analysis.face_detection import detect_faces
11
13
  from ImagePRO.pre_processing import blur, grayscale, rotate, sharpen, resize
12
14
  from ImagePRO.utils.image import Image
13
15
 
16
+ import random
17
+ import time
18
+
19
+ import cv2
20
+ import mediapipe as mp
21
+
14
22
  # Constants
15
23
  DEFAULT_NUM_IMAGES = 200
16
24
  DEFAULT_START_INDEX = 0
@@ -37,9 +45,12 @@ def capture_bulk_pictures(
37
45
  ) -> None:
38
46
  """Generate a dataset by capturing faces from webcam.
39
47
 
40
- Captures frames and saves preprocessed face images.
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
+
41
52
  Processing pipeline (if enabled):
42
- median blur → laplacian sharpen → grayscale → resize → random rotate
53
+ average blur → laplacian sharpen → grayscale → resize → random rotate
43
54
 
44
55
  Args:
45
56
  folder_path: Base directory for dataset.
@@ -72,7 +83,7 @@ def capture_bulk_pictures(
72
83
  FileExistsError: If output folder exists
73
84
  RuntimeError: If camera access fails
74
85
  """
75
- # Validate numeric parameters
86
+ # Validate numeric parameters to ensure safe operation
76
87
  if not isinstance(num_images, int) or num_images <= 0:
77
88
  raise ValueError("'num_images' must be a positive integer")
78
89
 
@@ -85,20 +96,23 @@ def capture_bulk_pictures(
85
96
  if not isinstance(delay, (int, float)) or delay < 0:
86
97
  raise ValueError("'delay' must be a non-negative number")
87
98
 
88
- # Setup output directory
99
+ # Setup output directory structure
89
100
  base_dir = Path(folder_path)
90
101
  face_folder = base_dir / str(face_id)
91
102
 
103
+ # Create output folder (fail if exists to prevent accidental overwrites)
92
104
  try:
93
105
  face_folder.mkdir(parents=True, exist_ok=False)
94
106
  except FileExistsError as e:
95
107
  raise FileExistsError(f"Output folder already exists: {face_folder}") from e
96
108
 
97
- # Initialize camera and face detector
109
+ # Initialize camera capture
98
110
  cap = cv2.VideoCapture(camera_index)
99
111
  if not cap.isOpened():
100
112
  raise RuntimeError(f"Cannot access camera (index={camera_index})")
101
113
 
114
+ # Initialize MediaPipe face mesh detector for face detection
115
+ # Using face_mesh instead of face_detection for better accuracy
102
116
  face_mesh = mp.solutions.face_mesh.FaceMesh(
103
117
  max_num_faces=1,
104
118
  min_detection_confidence=min_confidence,
@@ -115,36 +129,40 @@ def capture_bulk_pictures(
115
129
  print("Failed to capture frame, skipping...")
116
130
  continue
117
131
 
118
- # Apply preprocessing pipeline
132
+ # Apply preprocessing pipeline in sequence
133
+ # Each step transforms the image and passes it to the next step
119
134
  processed = frame
120
135
 
121
136
  if apply_blur:
122
- # Reduce noise while keeping facial features
137
+ # Reduce noise while preserving facial features
123
138
  processed = blur.apply_average_blur(
124
139
  image=Image.from_array(processed),
125
140
  filter_size=3
126
141
  ).image
127
142
 
128
143
  if apply_sharpen:
129
- # Enhance edges with gentle sharpening
144
+ # Enhance edges with gentle sharpening for better feature detection
130
145
  processed = sharpen.apply_laplacian_sharpening(
131
146
  image=Image.from_array(processed),
132
147
  coefficient=1.0
133
148
  ).image
134
149
 
135
150
  if apply_grayscale:
151
+ # Convert to single-channel for reduced storage and faster processing
136
152
  processed = grayscale.convert_to_grayscale(
137
153
  image=Image.from_array(processed)
138
154
  ).image
139
155
 
140
156
  if apply_resize is not False:
157
+ # Resize to consistent dimensions (e.g., 224x224 for ML models)
141
158
  processed = resize.resize_image(
142
159
  image=Image.from_array(processed),
143
160
  new_size=apply_resize
144
161
  ).image
145
162
 
146
163
  if apply_rotate:
147
- # Apply random rotation with scaling
164
+ # Apply random rotation with scaling for data augmentation
165
+ # Rotation range: -45° to +45° with random scale factors
148
166
  angle = float(random.randint(-45, 45))
149
167
  scale = random.choice([1.0, 1.1, 1.2, 1.3])
150
168
  processed = rotate.rotate_image_custom(
@@ -153,11 +171,12 @@ def capture_bulk_pictures(
153
171
  scale=scale
154
172
  ).image
155
173
 
156
- # Save processed face image
174
+ # Detect and crop face from processed frame
157
175
  filename = f"{start_index + saved_count:04d}.jpg"
158
176
  output_path = face_folder / filename
159
177
 
160
178
  try:
179
+ # Detect face and crop to face region only
161
180
  result = detect_faces(
162
181
  image=Image.from_array(processed),
163
182
  max_faces=1,
@@ -165,18 +184,20 @@ def capture_bulk_pictures(
165
184
  face_mesh_obj=face_mesh
166
185
  )
167
186
 
187
+ # Save cropped face image
168
188
  result.save_as_img(str(output_path))
169
189
  saved_count += 1
170
190
 
191
+ # Add delay between captures to allow subject movement
171
192
  if delay > 0:
172
193
  time.sleep(delay)
173
194
 
174
195
  except ValueError:
175
- # Skip frames with no detected faces
196
+ # Skip frames with no detected faces (silent failure)
176
197
  continue
177
198
 
178
199
  finally:
179
- # Clean up resources
200
+ # Clean up resources: release camera and close OpenCV windows
180
201
  cap.release()
181
202
  cv2.destroyAllWindows()
182
203
 
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
 
5
14
  from ImagePRO.utils.image import Image
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
  import matplotlib.pyplot as plt
5
14
 
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
 
5
14
  from ImagePRO.utils.image import Image
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
  import numpy as np
5
14
 
@@ -1,5 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ # Add src directory to path for absolute imports
7
+ _file_path = Path(__file__).resolve()
8
+ _src_path = _file_path.parents[2] # Go up to src directory
9
+ if str(_src_path) not in sys.path:
10
+ sys.path.insert(0, str(_src_path))
11
+
3
12
  import cv2
4
13
  import numpy as np
5
14
 
ImagePRO/utils/result.py CHANGED
@@ -144,7 +144,22 @@ class Result:
144
144
  return self
145
145
 
146
146
  def flatten_rows(data):
147
- """Flatten any nested lists/tuples into rows suitable for CSV writing."""
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.1
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,31 @@
1
+ ImagePRO/__init__.py,sha256=LUqZaUWVUISpR6bm5K2cO6KjiVP3ZDPADZGZW051xGk,998
2
+ ImagePRO/human_analysis/__init__.py,sha256=uSU0lM1p1HM6TNGv6u0nPHWy9QY505v43lqTkhClddM,190
3
+ ImagePRO/human_analysis/body_analysis/__init__.py,sha256=czQoJJIrDAWz0UUY0h0mwxymSQ6L6CaZYYHhYFHyf4U,203
4
+ ImagePRO/human_analysis/body_analysis/body_pose_estimation.py,sha256=69ybYkrbFl9EkuAc4ejCu2TW4m9TFLTn2Ae5fm_92lE,5549
5
+ ImagePRO/human_analysis/body_analysis/hand_tracking.py,sha256=T7yM_VZN6mBZsDFJV6C-amCVzgklatvsZrtgcBrzVSg,6869
6
+ ImagePRO/human_analysis/face_analysis/__init__.py,sha256=dKVZ6pq-0aQHL9vhMSt0BHs3WV_cTW65QPLJGnSiUgM,405
7
+ ImagePRO/human_analysis/face_analysis/eye_status_analysis.py,sha256=9ydxEj4EhVCNf954gdFBQemS1uRNA-XGCMzyliI2AsQ,7126
8
+ ImagePRO/human_analysis/face_analysis/face_comparison.py,sha256=RU-eSjFwpRIrV-QX8po8Mr-RhGwYEsCo3_Nt-IiA5Us,4315
9
+ ImagePRO/human_analysis/face_analysis/face_detection.py,sha256=__s-lI6Egf-JgruncL_MfAkmwCq8Oe3F5Vvk9x9S_2Q,3897
10
+ ImagePRO/human_analysis/face_analysis/face_mesh_analysis.py,sha256=8kLyEEnhMfdEALteltSHu2L2zbiFSNfzC73EuV0I5iQ,7964
11
+ ImagePRO/human_analysis/face_analysis/head_pose_estimation.py,sha256=IidB4U0lQryw9T4J4_T-QmC-DgANUEgueto06RkKi2Q,7336
12
+ ImagePRO/object_analysis/__init__.py,sha256=pj1vjY8uVUqeVONpaCacWufUzHF7rS5-nmy_C5IfI2w,148
13
+ ImagePRO/object_analysis/object_detection.py,sha256=ZhxOpX5Zkiu-gq-2CRYPNzSo7ai1PRFZ3qopQeODIkQ,2890
14
+ ImagePRO/pre_processing/__init__.py,sha256=nXUhE8RnDyW7T93fKsSDPfqzGHIW50OvgQvznY5UH0E,417
15
+ ImagePRO/pre_processing/blur.py,sha256=zPWUKLEoKiL6kYwnZOtGRWBHM-dgEQ8WWdDt8_wGc0s,7961
16
+ ImagePRO/pre_processing/contrast.py,sha256=XG69VsX3EKWIPDcQYm4D9qT7sA_BSP-sppSAa8qRUhA,5247
17
+ ImagePRO/pre_processing/crop.py,sha256=p0esuZcn4-YsqcniDUmsVfPoWasxVH1OqzNBra8Pw4M,2442
18
+ ImagePRO/pre_processing/dataset_generator.py,sha256=ekd_TnyflWKjJ6sYCiWc3vN2Q14cKiwZ1InOCslxoFM,7653
19
+ ImagePRO/pre_processing/grayscale.py,sha256=MRCsFRIaL45sYVHzhuNyZBXsP7PF-yorn0Wt7xONvpY,1781
20
+ ImagePRO/pre_processing/histogram.py,sha256=t1ykGUwB9ZbvO6J3bGPh4fDvrk4AJua1dN2BWzHIRIQ,2888
21
+ ImagePRO/pre_processing/resize.py,sha256=GH3ObPe67ypPQG3a7ncrNR5WNDqGibXebAiuRXr6L10,1760
22
+ ImagePRO/pre_processing/rotate.py,sha256=wqV2Qm7mIyvKTSFdwzr1tNAGnMG7rl5M3BRqC5m2oZE,4185
23
+ ImagePRO/pre_processing/sharpen.py,sha256=C5AOxQNBL80JenkztlyRBV7yuCHqxG5dTGbRhtVRT9M,3544
24
+ ImagePRO/utils/__init__.py,sha256=McVd-o9KtKOpAVYbLi19KxsatPPFFF-Qbt0gdgY3Ln8,170
25
+ ImagePRO/utils/image.py,sha256=x93cBNycNOgET20a__TxZ9ZQo_2G84uB7QjXjBo9f8M,3973
26
+ ImagePRO/utils/result.py,sha256=rGZX0FJ-dpA4v_m_GUO6ni0kCfcNJRnOjztbyRX9d88,6065
27
+ imagepro_python-1.2.1.dist-info/licenses/LICENSE,sha256=sehkHN7dbe5umrINZJyJjIf9VTemZSgTfJlq6iIsbJQ,1069
28
+ imagepro_python-1.2.1.dist-info/METADATA,sha256=KVaRtAoER1Ss2HS1R8w6YrIrfwt8zH5bw5u_29sMjGA,8513
29
+ imagepro_python-1.2.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
30
+ imagepro_python-1.2.1.dist-info/top_level.txt,sha256=UOuPzsoWrVKXgUupOSI96shJ6wE8Fhz-8bm8oMlLC3s,9
31
+ imagepro_python-1.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (82.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,35 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ImagePRO-Python
3
- Version: 1.1.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.10
17
- Classifier: License :: OSI Approved :: MIT License
18
- Classifier: Operating System :: OS Independent
19
- Classifier: Topic :: Scientific/Engineering :: Image Processing
20
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Requires-Python: ==3.10.*
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: numpy<2.0,>=1.24
26
- Requires-Dist: opencv-python<5.0,>=4.8
27
- Requires-Dist: matplotlib<3.9.0,>=3.7.0
28
- Provides-Extra: yolo
29
- Requires-Dist: ultralytics<9.0,>=8.2.0; extra == "yolo"
30
- Provides-Extra: mediapipe
31
- Requires-Dist: mediapipe<1.0,>=0.10.0; extra == "mediapipe"
32
- Provides-Extra: insightface
33
- Requires-Dist: insightface<1.0,>=0.7; extra == "insightface"
34
- Requires-Dist: onnxruntime<2.0,>=1.16; extra == "insightface"
35
- Dynamic: license-file
@@ -1,31 +0,0 @@
1
- ImagePRO/__init__.py,sha256=LUqZaUWVUISpR6bm5K2cO6KjiVP3ZDPADZGZW051xGk,998
2
- ImagePRO/human_analysis/__init__.py,sha256=uSU0lM1p1HM6TNGv6u0nPHWy9QY505v43lqTkhClddM,190
3
- ImagePRO/human_analysis/body_analysis/__init__.py,sha256=czQoJJIrDAWz0UUY0h0mwxymSQ6L6CaZYYHhYFHyf4U,203
4
- ImagePRO/human_analysis/body_analysis/body_pose_estimation.py,sha256=5VGB-muRNV9pOVszJInxqs7v_ci-z-kGHCVjgmo6oLo,5290
5
- ImagePRO/human_analysis/body_analysis/hand_tracking.py,sha256=v1N_-PAA227wvzmf3yW1NT2m-TablueqOafoRFl6sw4,6610
6
- ImagePRO/human_analysis/face_analysis/__init__.py,sha256=dKVZ6pq-0aQHL9vhMSt0BHs3WV_cTW65QPLJGnSiUgM,405
7
- ImagePRO/human_analysis/face_analysis/eye_status_analysis.py,sha256=pkJjhSGuMml_xvvCYme27S4O_9UXg7VyZR8dRC1q6Ew,6867
8
- ImagePRO/human_analysis/face_analysis/face_comparison.py,sha256=20-Sqtpmr5loWaUF6k363nHOIGXOz8KEO3_sRCO9FuA,4056
9
- ImagePRO/human_analysis/face_analysis/face_detection.py,sha256=3xSdl4uf3ynFgNa7pn-5tg0Eeil8xaD9OT8zKOkIMwY,3638
10
- ImagePRO/human_analysis/face_analysis/face_mesh_analysis.py,sha256=Qr5AO8mqOXRTH2j7kMsFSo0LyBmdCSrAP0V6dypP6ZY,7705
11
- ImagePRO/human_analysis/face_analysis/head_pose_estimation.py,sha256=WbQHJGwhryWQ_YXnoVCNAwzl5pGLmMGfRWX3K_218uA,7077
12
- ImagePRO/object_analysis/__init__.py,sha256=pj1vjY8uVUqeVONpaCacWufUzHF7rS5-nmy_C5IfI2w,148
13
- ImagePRO/object_analysis/object_detection.py,sha256=pgs7DVvREnyILnyWGy91Tku_P01J0I57_ly6WyV0lYI,2631
14
- ImagePRO/pre_processing/__init__.py,sha256=nXUhE8RnDyW7T93fKsSDPfqzGHIW50OvgQvznY5UH0E,417
15
- ImagePRO/pre_processing/blur.py,sha256=B3zF0VBUyM4__edV-SBR1LMZrep4zLSdeKEz00kFh6A,7702
16
- ImagePRO/pre_processing/contrast.py,sha256=64PL626Gxe_y8ZK1vKH7WQXfr0dW2bTNTAOHTXWrfTU,4988
17
- ImagePRO/pre_processing/crop.py,sha256=qrx-Kl5LO3udGrZaAlNVaR-MuCXpsMZfR1pTSOOMbjk,2184
18
- ImagePRO/pre_processing/dataset_generator.py,sha256=kvu0m71HHOEqviQ6tDpKK3lVCBORUUa6cHl7Bsitih8,6391
19
- ImagePRO/pre_processing/grayscale.py,sha256=IjMCvH7z4q1NCS8pm7S8A4hVigbLQbsjwvjfDQWmthY,1522
20
- ImagePRO/pre_processing/histogram.py,sha256=NyP9d8OV2q7s67x4oeb-T4UthICCImpRpEKLm32wUoM,2629
21
- ImagePRO/pre_processing/resize.py,sha256=BGGLGao_1uc8B1kZFa5MVYcTzaeeP1qkjFei6M_eIZc,1501
22
- ImagePRO/pre_processing/rotate.py,sha256=kdauqCpn71Yube351o1tmQFyxcj2cjTs0ZJflxsoet8,3926
23
- ImagePRO/pre_processing/sharpen.py,sha256=kW9KVXvQ77qezBfUWH7loqstQqJ2QvK7s0gtwoxR4EI,3285
24
- ImagePRO/utils/__init__.py,sha256=McVd-o9KtKOpAVYbLi19KxsatPPFFF-Qbt0gdgY3Ln8,170
25
- ImagePRO/utils/image.py,sha256=x93cBNycNOgET20a__TxZ9ZQo_2G84uB7QjXjBo9f8M,3973
26
- ImagePRO/utils/result.py,sha256=DAFaFZ5jZZ7C2YrhRs6h2PAei6Mbv1Mu8xX_2NQ7c6Y,5605
27
- imagepro_python-1.1.0.dist-info/licenses/LICENSE,sha256=sehkHN7dbe5umrINZJyJjIf9VTemZSgTfJlq6iIsbJQ,1069
28
- imagepro_python-1.1.0.dist-info/METADATA,sha256=DEzqs1EVVnaE4V5UmzrOkwZIYY3WJMw03nAd957i4yA,1658
29
- imagepro_python-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- imagepro_python-1.1.0.dist-info/top_level.txt,sha256=UOuPzsoWrVKXgUupOSI96shJ6wE8Fhz-8bm8oMlLC3s,9
31
- imagepro_python-1.1.0.dist-info/RECORD,,