mb-rag 1.0.129__tar.gz → 1.0.131__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.

Potentially problematic release.


This version of mb-rag might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mb_rag
3
- Version: 1.0.129
3
+ Version: 1.0.131
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
@@ -102,7 +102,8 @@ class BoundingBoxProcessor:
102
102
 
103
103
  def generate_bounding_boxes(self,
104
104
  image_path: str,
105
- prompt: Optional[str] = None) -> Any:
105
+ prompt: Optional[str] = None
106
+ ) -> Any:
106
107
  """
107
108
  Generate bounding boxes for an image
108
109
  Args:
@@ -126,7 +127,9 @@ class BoundingBoxProcessor:
126
127
  color: Tuple[int, int, int] = (0, 0, 255),
127
128
  thickness: int = 4,
128
129
  font_scale: float = 1.0,
129
- show: bool = False) -> Any:
130
+ show: bool = False,
131
+ google_bb= False
132
+ ) -> Any:
130
133
  """
131
134
  Add bounding boxes to an image
132
135
  Args:
@@ -145,7 +148,7 @@ class BoundingBoxProcessor:
145
148
  raise ValueError("bounding_boxes must be a dictionary")
146
149
 
147
150
  try:
148
- img = self._cv2.imread(image_path)
151
+ img = self._cv2.imread(image_path)
149
152
  if img is None:
150
153
  raise ValueError(f"Failed to load image: {image_path}")
151
154
 
@@ -153,6 +156,10 @@ class BoundingBoxProcessor:
153
156
  if not isinstance(value, list) or len(value) != 4:
154
157
  raise ValueError(f"Invalid bounding box format for key {key}. Expected [ymin, xmin, ymax, xmax]")
155
158
 
159
+ if google_bb:
160
+ value = [int(value[0] * img.shape[0] * 0.001), int(value[1] * img.shape[1]* 0.001),
161
+ int(value[2] * img.shape[0] * 0.001), int(value[3] * img.shape[1] * 0.001)]
162
+
156
163
  self._cv2.rectangle(
157
164
  img=img,
158
165
  pt1=(value[1], value[0]), # xmin, ymin
@@ -1,5 +1,5 @@
1
1
  MAJOR_VERSION = 1
2
2
  MINOR_VERSION = 0
3
- PATCH_VERSION = 129
3
+ PATCH_VERSION = 131
4
4
  version = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
5
5
  __all__ = ['MAJOR_VERSION', 'MINOR_VERSION', 'PATCH_VERSION', 'version']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mb_rag
3
- Version: 1.0.129
3
+ Version: 1.0.131
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes