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

Adding example for unix domain events-based integration #50

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

OriNachum
Copy link

@OriNachum OriNachum commented Oct 3, 2024

Currently, in order to integrate Hailo in my app, I need to take an example, and bring my code to it.
It means I need to use the customized setup, etc.

This example allows for setting up Hailo as a separate app, then listen on its events stream and react.

This is an initial, working example

(Copying disclaimer from another PR)
Disclaimer:
I am not the owner or maintainer of this project.
I'm open to feedback and further modifications if needed.
This PR comes to address growing need by developers for a clean and smooth integration between their existing app and Hailo.

@OriNachum
Copy link
Author

OriNachum commented Oct 6, 2024

Should I revert the events on changes, or keep the new library? (DeepDiff)

@OriNachum
Copy link
Author

OriNachum commented Oct 19, 2024

Steps to set up integration from hailo side:

  1. Import event emitter and define event location:
from unix_domain_socket_server import UnixDomainSocketServer

# Path for the Unix Domain Socket
SOCKET_PATH = "/tmp/gst_detection.sock"

  1. Set up event emitter:
    socket_server = UnixDomainSocketServer(SOCKET_PATH)
    socket_server.start()
    user_data.socket_server = socket_server

3. Fire events on app_callback end:
# Call events server to fire event of a new detection
user_data.socket_server.send_event(labels)

@OriNachum OriNachum marked this pull request as draft October 19, 2024 20:01
@OriNachum OriNachum marked this pull request as ready for review October 19, 2024 20:02
@giladnah
Copy link
Contributor

giladnah commented Nov 7, 2024

Hi @OriNachum,
I very much appreciate your contribution, and want to get contributions from the community.
I want, however, to make sure that we do have some stable and simple examples and installation flows which are tested and verified.

I will add a new "community examples" directory in which you will be able to add your code. This way it will be much simple for me to approve your PR without worrying that it breaks something else.
Give me some time to define the flow.
I think it should include a simple README with installation instruction and a seperate requirements.txt file to handle your specific dependencies.
I would be very happy to integrate your example as the first Community example and to get you inputs and thoughts about the flow.
Thanks,
Gilad

@OriNachum
Copy link
Author

Thank you!

I appreciate the time and thought put into this.
I think that's a great solution, and I am looking forward to test the "community examples" flow.

@OriNachum
Copy link
Author

I see you have added community project (NeoPixel).
I'm making the pipeline more robust (Low-light conditions), and when I see it's ready, I'll adapt the PR to fit the new location.

@OriNachum OriNachum marked this pull request as draft November 29, 2024 21:11
@OriNachum OriNachum marked this pull request as ready for review December 24, 2024 22:40
@OriNachum
Copy link
Author

@giladnah, I moved all code and docs to the relevant folder.
Can you review the structure and skim the PR?

I still need to re-run everything and validate all again, but if you have some basic requirements, special tests or docs structure you expect - I can add.

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

Successfully merging this pull request may close these issues.

2 participants