Skip to content

Commit

Permalink
Merge pull request #37 from pylabel-project/dev
Browse files Browse the repository at this point in the history
Version .34
  • Loading branch information
alexheat authored Mar 16, 2022
2 parents ae489c3 + 598d033 commit c88ddf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions pylabel/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@ def ShowBoundingBoxes(self, img_id:int=0, img_filename:str="") -> Image:
bboxes = []

for index, row in df_single_img_annots.iterrows():
labels.append(row['cat_name'])
bboxes.append([int(row['ann_bbox_xmin']),int(row['ann_bbox_ymin']),int(row['ann_bbox_xmax']),int(row['ann_bbox_ymax'])])
# If there are no annotations, then skip because there are no boxes to draw
if row["ann_bbox_xmin"] != "":
labels.append(row["cat_name"])
bboxes.append(
[
int(row["ann_bbox_xmin"]),
int(row["ann_bbox_ymin"]),
int(row["ann_bbox_xmax"]),
int(row["ann_bbox_ymax"]),
]
)

img_with_boxes = bbv.draw_multiple_rectangles(img, bboxes)
img_with_boxes = bbv.add_multiple_labels(img_with_boxes, labels, bboxes)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setup(
name="pylabel",
packages=["pylabel"],
version="0.1.33",
version="0.1.34",
description="Transform, analyze, and visualize computer vision annotations.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c88ddf4

Please sign in to comment.