Skip to content

Commit f67f756

Browse files
authored
Merge pull request #349 from aperture-data/release-0.4.15
Release 0.4.15
2 parents 27a9317 + e9ceb10 commit f67f756

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

aperturedb/Images.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,25 +268,22 @@ def __retrieve_bounding_boxes(self, index):
268268
"labels": True
269269
}
270270
}]
271-
271+
uniqueid_str = str(uniqueid)
272+
self.images_bboxes[uniqueid_str] = {}
272273
try:
273274
res, images = self.db_connector.query(query)
274-
275275
bboxes = []
276276
tags = []
277-
for bbox in res[1]["FindBoundingBox"]["entities"]:
278-
bboxes.append(bbox["_coordinates"])
279-
tags.append(bbox[self.bbox_label_prop])
280-
281-
uniqueid_str = str(uniqueid)
282-
self.images_bboxes[uniqueid_str] = {}
277+
if "entities" in res[1]["FindBoundingBox"]:
278+
for bbox in res[1]["FindBoundingBox"]["entities"]:
279+
bboxes.append(bbox["_coordinates"])
280+
tags.append(bbox[self.bbox_label_prop])
281+
except:
282+
logger.warn(f"Cannot retrieve bounding boxes for image {uniqueid}")
283+
finally:
283284
self.images_bboxes[uniqueid_str]["bboxes"] = bboxes
284285
self.images_bboxes[uniqueid_str]["tags"] = tags
285286

286-
except:
287-
print(self.db_connector.get_last_response_str())
288-
raise
289-
290287
def total_results(self) -> int:
291288
"""
292289
**Returns the total number of images that matched the query**

aperturedb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
logger = logging.getLogger(__name__)
99

10-
__version__ = "0.4.14"
10+
__version__ = "0.4.15"
1111

1212
# set log level
1313
logger.setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)