Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E Tests: ImageManip node and better checks. #140

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions tests/end_to_end/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,32 @@
device.close()
exit(8)

image_type = (
dai.ImgFrame.Type.BGR888i
if device.getPlatform().name == "RVC4"
else dai.ImgFrame.Type.BGR888p
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set the type based on ˙dai_type˙ field in the NNArchive if present otherwise use this as default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be addressed in the future because dai has not yet implemented it.

manip = None

if input_size[0] % 2 != 0 or input_size[1] % 2 != 0:
print(
f"We only support even numbers for resolution sizes. Got {input_size[0]}x{input_size[1]}."
)
device.close()
exit(8)
manip = pipeline.create(dai.node.ImageManipV2)
manip.initialConfig.addResize(input_size[0], input_size[1])
large_input_shape = (input_size[0] * 2, input_size[1] * 2)

if input_size[0] < 128 and input_size[1] < 128:
print("Input size is too small for the device.")
device.close()
exit(8)
manip = pipeline.create(dai.node.ImageManipV2)
manip.initialConfig.addResize(input_size[0], input_size[1])
large_input_shape = (input_size[0] * 4, input_size[1] * 4)

nn_w_parser = pipeline.create(ParsingNeuralNetwork).build(camera_node, nn_archive)
if manip:
camera_node.requestOutput(large_input_shape, type=image_type).link(
manip.inputImage
)
nn_w_parser = pipeline.create(ParsingNeuralNetwork).build(manip.out, nn_archive)
else:
nn_w_parser = pipeline.create(ParsingNeuralNetwork).build(
camera_node, nn_archive
)

head_indices = nn_w_parser._parsers.keys()

Expand Down
Loading