mb-rag 1.0.130__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.
- {mb_rag-1.0.130 → mb_rag-1.0.131}/PKG-INFO +1 -1
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/utils/bounding_box.py +10 -3
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/version.py +1 -1
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag.egg-info/PKG-INFO +1 -1
- {mb_rag-1.0.130 → mb_rag-1.0.131}/README.md +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/__init__.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/chatbot/__init__.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/chatbot/basic.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/chatbot/chains.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/chatbot/prompts.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/rag/__init__.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/rag/embeddings.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/utils/__init__.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag/utils/extra.py +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag.egg-info/SOURCES.txt +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag.egg-info/dependency_links.txt +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag.egg-info/requires.txt +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/mb_rag.egg-info/top_level.txt +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/pyproject.toml +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/setup.cfg +0 -0
- {mb_rag-1.0.130 → mb_rag-1.0.131}/setup.py +0 -0
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|