GithubHelp home page GithubHelp logo

Comments (5)

pataxis avatar pataxis commented on September 4, 2024

Hi @QLinhHub ,

yes the send_event example shows how to declare your own custom event and sounds like an option for occasional detections.

I think that you would need to adapt the event declaration as well as the function sending the event to your data, probably updating Value field in the .c-file. Then of course also add some functionality that reads the detection results in the C-code, preferably directly instead of indirectly(like reading a log file). There is a helper script to help you confirm that your event got declared, see axevent README.

Hopefully the axevent API documentation can be of some help in the adaptation.

Then it's a question to read the events from your server(laptop), could the ONVIF documentation chapter 9 be of any help to do this?

from acap-native-sdk-examples.

QLinhHub avatar QLinhHub commented on September 4, 2024

Hello @pataxis

Thanks a lot for your answer!

I tried the send_event example (I read the log file but of course I will change this approach in the future). In general, it works but there is the problem of the send time.

For the timer to declare event, the minimum value I can put here is 3 seconds. And for time for fetching event, it is 4 seconds. So it takes some time (about 7 seconds) for each event to be sent. Do you think this is because I am reading the detection results indirectly from the log file? And if I can do it directly, do you think the latency will be significantly improved?

Furthermore, the axevent library is designed to be used with the GLib library. An application using the axevent library must have a running GMainLoop (according to axevent.h), which makes integration with the object detection code (an infinite loop through the video frames) somewhat difficult.

I look forward to hearing your suggestions and ideas !

Thanks in advance!

Here are some detection results I got from the camera to my laptop (in a jupyter notebook):
Screenshot from 2022-07-28 11-05-01

from acap-native-sdk-examples.

pataxis avatar pataxis commented on September 4, 2024

Hi,
sounds great that it's up and running.

The API documentation says:

A note on callback functions
The callback functions registered with the AXEventHandler will be called from the GMainLoop thread in the default context. This means that the client may not prevent callback functions from returning, nor should any lengthy processing be made in the callback functions. Failure to comply with this convention will prevent the event system from, or delay it in, sending or delivering any more events to the calling application.

Reading a log file sounds like it could be "lengthy processing" and I would expect that at least the 4 seconds should be possible to reduce if you move this handling directly to the C-code. This might also affect the callback time, i.e. the minimum 3 seconds you can set, if the event system gets blocked.

Another option to axevent could be to build a third party library like mosquitto which sends MQTT events. This library has functions like mosquitto_loop that works similar to GMainLoop in the send_event example application.

from acap-native-sdk-examples.

QLinhHub avatar QLinhHub commented on September 4, 2024

Hello @pataxis

Thank you very much for your response !

I managed to send an event from my camera to my laptop ! Thanks again !

Actually, I try to integrate yolov5s (tflite) into my camera and I get the error from larod: "setupLarod: Unable to load model: Could not allocate tensors".

I haven't found the solution yet. But I think maybe the yolov5s is too big for my camera (ARTPEC-7 chip, 1GB RAM) or maybe there are some layers in the yolov5s that larod does not support (larod custom layers).

Please let me know your ideas, it would be very helpful !

Thanks in advance !

from acap-native-sdk-examples.

pataxis avatar pataxis commented on September 4, 2024

Hi, great, then I will close this issue.

For the larod question it's better to open a new issue. It makes searching for Q/A easier for other developers.

from acap-native-sdk-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.