depthai-experiments/gen2-cumulative-object-counting at master · luxonis/depthai-experiments · GitHub

Hi community,

I am working on this project. in the main.py, What are the parts of the code executed inside the RVC2 of the camera and what are the parts executed in the host device ? because I can see the use of opencv so I think that some of the code needs to be executed by the host.
I am asking this question because I am creating my own tracking function and I want to know if it will be executed in the RVC2 or in the host device ?

  • jakaskerl replied to this.
  • Hi MahdiMseddi
    The TrackerObject is a class used to hold information (the count and such) to further display it in the final image frame. But this is run on the host machine since it has nothing to do with depthai and is pure python logic.
    Tracking is done fully on the device (see tracker node). The tracklets then get sent back to the host so they can be displayed.
    In standalone mode there is no host present, meaning everything runs on the device (inside the script node). This is why the host.py only contains the logic to receive the data and to display it properly.

    Hope this helps,
    Jaka

    Hi MahdiMseddi
    Anything that uses the depthai library is executed on the device, everything else runs on the host (namely cv2 and some image parsing). In this case, the whole TrackableObject class runs on host.
    Cameras, detections, tracking and their links all run on the device.

    Thanks,
    Jaka

      jakaskerl Thank you very much for your kind reply.

      1- "the whole TrackableObject class runs on host" and "tracking and their links all run on the device". Do you mean that the creation of the objectTracker is done on the device and the process of tracking and execution is done on the host computer ?
      2- I implemented my own tracking function. The execution time is different from host mode to standalone mode. Is this explained by the fact that in host mode it runs on the computer but in standalone it runs on the RVC2 ?

      Thank you for your support

        Hi MahdiMseddi
        The TrackerObject is a class used to hold information (the count and such) to further display it in the final image frame. But this is run on the host machine since it has nothing to do with depthai and is pure python logic.
        Tracking is done fully on the device (see tracker node). The tracklets then get sent back to the host so they can be displayed.
        In standalone mode there is no host present, meaning everything runs on the device (inside the script node). This is why the host.py only contains the logic to receive the data and to display it properly.

        Hope this helps,
        Jaka

          jakaskerl Thank you for making it clear.
          "In standalone mode there is no host present, meaning everything runs on the device (inside the script node). This is why the host.py only contains the logic to receive the data and to display it properly." Yes I clearly understand. but If I run my custom tracking function in the host mode like the main.py , the tracking will be executed on the host machine and not on the camera, is this correct ?

          Thanks

            Hi MahdiMseddi
            If you put the code inside a script node, the code will be executed on the device, otherwise it will be executed on the host machine.

            Thanks,
            Jaka