ImagePRO-Python 1.0.4__tar.gz → 1.0.5__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.
Files changed (34) hide show
  1. {imagepro_python-1.0.4/src/ImagePRO_Python.egg-info → imagepro_python-1.0.5}/PKG-INFO +1 -1
  2. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/pyproject.toml +1 -1
  3. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/utils/image.py +12 -3
  4. {imagepro_python-1.0.4 → imagepro_python-1.0.5/src/ImagePRO_Python.egg-info}/PKG-INFO +1 -1
  5. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/LICENSE +0 -0
  6. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/setup.cfg +0 -0
  7. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/__init__.py +0 -0
  8. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/__init__.py +0 -0
  9. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/body_analysis/__init__.py +0 -0
  10. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/body_analysis/body_pose_estimation.py +0 -0
  11. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/body_analysis/hand_tracking.py +0 -0
  12. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/__init__.py +0 -0
  13. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/eye_status_analysis.py +0 -0
  14. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/face_comparison.py +0 -0
  15. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/face_detection.py +0 -0
  16. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/face_mesh_analysis.py +0 -0
  17. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/human_analysis/face_analysis/head_pose_estimation.py +0 -0
  18. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/object_analysis/__init__.py +0 -0
  19. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/object_analysis/object_detection.py +0 -0
  20. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/__init__.py +0 -0
  21. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/blur.py +0 -0
  22. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/contrast.py +0 -0
  23. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/crop.py +0 -0
  24. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/dataset_generator.py +0 -0
  25. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/grayscale.py +0 -0
  26. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/resize.py +0 -0
  27. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/rotate.py +0 -0
  28. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/pre_processing/sharpen.py +0 -0
  29. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/utils/__init__.py +0 -0
  30. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO/utils/result.py +0 -0
  31. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO_Python.egg-info/SOURCES.txt +0 -0
  32. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO_Python.egg-info/dependency_links.txt +0 -0
  33. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO_Python.egg-info/requires.txt +0 -0
  34. {imagepro_python-1.0.4 → imagepro_python-1.0.5}/src/ImagePRO_Python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ImagePRO-Python
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
5
5
  Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
6
6
  License: MIT
@@ -7,7 +7,7 @@ where = ["src"]
7
7
 
8
8
  [project]
9
9
  name = "ImagePRO-Python"
10
- version = "1.0.4"
10
+ version = "1.0.5"
11
11
  description = "Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration."
12
12
  readme = "README.md"
13
13
  requires-python = "==3.10.*"
@@ -33,7 +33,7 @@ class Image:
33
33
 
34
34
  Example:
35
35
  >>> # Load from file (default BGR)
36
- >>> img = Image.from_path('input.jpg')
36
+ >>> img = Image.from_path('input.jpg', colorspace="BGR")
37
37
  >>> print(img.shape) # (H, W, 3)
38
38
  >>>
39
39
  >>> # Or wrap a NumPy array
@@ -46,13 +46,19 @@ class Image:
46
46
  source_type: SourceType = "array"
47
47
 
48
48
  @classmethod
49
- def from_path(cls, path: str | Path) -> Image:
49
+ def from_path(
50
+ cls,
51
+ path: str | Path,
52
+ colorspace: Colorspace = "BGR"
53
+ ) -> Image:
50
54
  """
51
55
  Create an Image instance from a file path.
52
56
 
53
57
  Args:
54
58
  path (str | Path):
55
59
  Path to the image file.
60
+ colorspace (Colorspace, optional):
61
+ Colorspace of the image array in that path ("BGR", "RGB", or "GRAY"). Defaults to "BGR".
56
62
 
57
63
  Returns:
58
64
  Image: New Image instance loaded from disk.
@@ -60,13 +66,16 @@ class Image:
60
66
  Raises:
61
67
  TypeError: If path is not str or Path.
62
68
  ValueError: If image cannot be loaded.
69
+ ValueError: If colorspace is invalid.
63
70
  """
64
71
  if not isinstance(path, (str, Path)):
65
72
  raise TypeError("'path' must be a string or pathlib.Path.")
66
73
  np_image = cv2.imread(str(path))
67
74
  if np_image is None:
68
75
  raise ValueError(f"Failed to load image from {path}")
69
- return cls(_data=np_image, path=Path(path), colorspace="BGR", source_type="path")
76
+ if colorspace not in ("BGR", "RGB", "GRAY"):
77
+ raise ValueError("'colorspace' must be one of 'BGR', 'RGB', 'GRAY'.")
78
+ return cls(_data=np_image, path=Path(path), colorspace=colorspace, source_type="path")
70
79
 
71
80
  @classmethod
72
81
  def from_array(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ImagePRO-Python
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
5
5
  Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
6
6
  License: MIT
File without changes