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

Error in expected data structure Python Streaming code #328

Open
mgreiner79 opened this issue Dec 9, 2024 · 3 comments
Open

Error in expected data structure Python Streaming code #328

mgreiner79 opened this issue Dec 9, 2024 · 3 comments

Comments

@mgreiner79
Copy link

mgreiner79 commented Dec 9, 2024

in this code here
https://github.com/hailo-ai/Hailo-Application-Code-Examples/blob/main/runtime/python/streaming/yolox_stream_inference.py

on line 67 there is this statement
layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}
This throws an error because the data type of infer_results[key] is a list (not a numpy array).

Actually, I dont get what this is supposed to do.
It is going to return a dictionary where they keys are the tensor shape, and the values are the model name (in this case "yolox_s_leaky/yolox_nms_postprocess"). It iterates over all the keys, but there is only one key in infer_results
image

Given that there is only one key in infer_results, I dont see how the code

endnodes = [infer_results[layer_from_shape[1, 80, 80, 4]],  # stride 8 
                    infer_results[layer_from_shape[1, 80, 80, 1]],  # stride 8 ...

is supposed to work.

Maybe the .hef file has been changes since this code was written (???). I am using the .hef file specified in the get_resource.sh file
("https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.6.1/yolox_s_leaky.hef")
@nina-vilela : Do you have any idea what's wrong here?

@nina-vilela
Copy link
Contributor

Hi @mgreiner79,

As written in the example's README, this code is only guaranteed to work on HailoRT v4.16.0. If you are using a newer HailoRT version, this may explain the issue, as we've had many changes since that HailoRT version.

@mgreiner79
Copy link
Author

Thanks @nina-vilela ,
Are there any up-to-date examples published, that you can direct me to?

@nina-vilela
Copy link
Contributor

@mgreiner79 you can take our object detection example and alter it to work with a video input using opencv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants