Skip to content

Commit 20dcce7

Browse files
authored
Minor fixes (#358)
* Update readme * Fix py 3.13 compatibility in data preparation script * Make cpp keep_ratio preprocessing graph identical to python
1 parent 18feb87 commit 20dcce7

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

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

66
<!-- markdownlint-disable MD042 -->
77

8-
[![openvino](https://img.shields.io/badge/openvino-2025.1-purple)]()
8+
[![openvino](https://img.shields.io/badge/openvino-2025.2-purple)]()
99

1010
<!-- markdownlint-enable MD042 -->
1111

src/cpp/utils/src/image_utils.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ Output<Node> resizeImageGraph(const ov::Output<ov::Node>& input,
7171
auto w_ratio = std::make_shared<opset10::Divide>(opset10::Constant::create(element::f32, Shape{1}, {float(w)}), iw);
7272
auto h_ratio = std::make_shared<opset10::Divide>(opset10::Constant::create(element::f32, Shape{1}, {float(h)}), ih);
7373
auto scale = std::make_shared<opset10::Minimum>(w_ratio, h_ratio);
74-
auto nw = std::make_shared<opset10::Convert>(std::make_shared<opset10::Multiply>(iw, scale), element::i32);
75-
auto nh = std::make_shared<opset10::Convert>(std::make_shared<opset10::Multiply>(ih, scale), element::i32);
74+
auto nw = std::make_shared<opset10::Convert>(
75+
std::make_shared<opset10::Round>(std::make_shared<opset10::Multiply>(iw, scale),
76+
opset10::Round::RoundMode::HALF_TO_EVEN),
77+
element::i32);
78+
auto nh = std::make_shared<opset10::Convert>(
79+
std::make_shared<opset10::Round>(std::make_shared<opset10::Multiply>(ih, scale),
80+
opset10::Round::RoundMode::HALF_TO_EVEN),
81+
element::i32);
7682
auto new_size = std::make_shared<opset10::Concat>(OutputVector{nh, nw}, 0);
7783

7884
auto scales = opset10::Constant::create(element::f32, Shape{2}, {0.0f, 0.0f});

tests/python/accuracy/prepare_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ async def download_images(data_dir):
2020
image = await client.get(
2121
"https://raw.githubusercontent.com/Shenggan/BCCD_Dataset/master/BCCD/JPEGImages/BloodImage_00007.jpg"
2222
)
23-
with data_dir / "BloodImage_00007.jpg" as im:
24-
im.write_bytes(image.content)
23+
with open(data_dir / "BloodImage_00007.jpg", "wb") as im:
24+
im.write(image.content)
2525

2626

2727
async def stream_file(client, url, filename):

0 commit comments

Comments
 (0)