I want to compare the performance of two cameras (Intel L515 and D455) with the nuitrack SDK. Is it possible to run nuitrack.get_skeleton() in python on a recording (.bag file) made with each camera?
Hi @a.bragin,
I modified the code for python and added the set_config_value line above. This looks like it works, but then it cannot access most of the main loop,
nuitrack.set_config_value("Realsense2Module.FileRecord", "C:/Users/etc")
nuitrack.run()
Then I start the while loop
The waitkey works in the loop but then the loop suddenly exits at nuitrack.update() or at nuitrak.get_skeleton() if I remove the update().
Thanks!
btw I am new to this kind of platform so let me know if I can improve my answers/syntax
Make sure you set correct path to your bag file and you use nuitrack.set_config_value right after nuitrack.init, i.e.
# snippet from official example
...
def draw_skeleton(image):
point_color = (59, 164, 0)
for skel in data.skeletons:
for el in skel[1:]:
x = (round(el.projection[0]), round(el.projection[1]))
cv2.circle(image, x, 8, point_color, -1)
nuitrack = py_nuitrack.Nuitrack()
nuitrack.init()
nuitrack.set_config_value("Realsense2Module.FileRecord", "C:/Users/alexey/Desktop/test/test.bag")
# ---enable if you want to use face tracking---
# nuitrack.set_config_value("Faces.ToUse", "true")
# nuitrack.set_config_value("DepthProvider.Depth2ColorRegistration", "true")
devices = nuitrack.get_device_list()
...
Make sure you’ve activated Trial license. Recordings (bag/oni) work either w/o license (for 3sec)
or with Trial license (for 3min)
Thanks the technique worked, I didnt realize I needed a device even though I was reading from a file!
The nuitrack.update() function takes a bit more than 2 seconds to run while everything else in the loop runs in <20 milliseconds. Is this something inherent to .bag files or is there a way to make it faster?
Update is absolutely necessary as it fetches data from Nuitrack modules, but it should not take more than 33 ms, as it is designed to work in real time.
Do you use our sample or your own modification? If you provide a faulty piece of code with could investigate the problem
Hi Alexey,
Sorry for the delay I was out of office. It’s good to know that it should take 33ms, I will evaluate the code and will send you a faulty piece of code if I can’t figure it out.
Thank you!