Skip to content

Commit 856b3bf

Browse files
authored
Merge branch 'main' into fix/read_image_as_pil_chw_format
2 parents 16a2d97 + 8b62abc commit 856b3bf

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
os: [ubuntu-latest, macos-latest, windows-latest]
3838
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
3939
steps:
40-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
40+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4141
- name: Setup uv python package manager
4242
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
4343
with:

.github/workflows/mmdet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
matrix:
6868
python-version: ["3.11"] # Only test on Python 3.11
6969
steps:
70-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
70+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
7171
- name: Setup uv python package manager
7272
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
7373
with:

.github/workflows/publish_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
python-version: ["3.12"]
3030
steps:
3131
- name: 📥 Checkout the repository
32-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3333
with:
3434
fetch-depth: 0
3535

.github/workflows/publish_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
11+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1212
- name: Setup uv python package manager
1313
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
1414
with:

.github/workflows/ruff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
ruff:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2424
- name: Set up Python
2525
uses: actions/setup-python@v6
2626
with:

sahi/annotation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def get_expanded_box(self, ratio: float = 0.1, max_x: int | None = None, max_y:
9292

9393
w = self.maxx - self.minx
9494
h = self.maxy - self.miny
95-
y_mar = int(w * ratio)
96-
x_mar = int(h * ratio)
95+
y_mar = int(h * ratio)
96+
x_mar = int(w * ratio)
9797
maxx = min(max_x, self.maxx + x_mar) if max_x else self.maxx + x_mar
9898
minx = max(0, self.minx - x_mar)
9999
maxy = min(max_y, self.maxy + y_mar) if max_y else self.maxy + y_mar

tests/test_annotation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def test_bounding_box(self):
1717
shifted_bbox = bbox.get_shifted_box()
1818

1919
# compare
20-
assert expanded_bbox.to_xywh() == [18, 23, 94, 134]
21-
assert expanded_bbox.to_xyxy() == [18, 23, 112, 157]
22-
assert shifted_bbox.to_xyxy() == [80, 70, 150, 190]
20+
assert expanded_bbox.to_xywh() == [23.0, 18.0, 84.0, 144.0]
21+
assert expanded_bbox.to_xyxy() == [23.0, 18.0, 107.0, 162.0]
22+
assert shifted_bbox.to_xyxy() == [80.0, 70.0, 150.0, 190.0]
2323

2424
def test_bounding_box_immutability(self):
2525
import dataclasses

tests/test_high_level_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def test_bounding_box(self):
1212
shifted_bbox = bbox.get_shifted_box()
1313

1414
# compare
15-
assert expanded_bbox.to_xywh() == [18, 23, 94, 134]
16-
assert expanded_bbox.to_xyxy() == [18, 23, 112, 157]
17-
assert shifted_bbox.to_xyxy() == [80, 70, 150, 190]
15+
assert expanded_bbox.to_xywh() == [23.0, 18.0, 84.0, 144.0]
16+
assert expanded_bbox.to_xyxy() == [23.0, 18.0, 107.0, 162.0]
17+
assert shifted_bbox.to_xyxy() == [80.0, 70.0, 150.0, 190.0]
1818

1919
def test_category(self):
2020
from sahi import Category

0 commit comments

Comments
 (0)