michaelsalerno No! Don't do that
Starting Depthai Viewer
I do not know what I am doing.
I had these functional and it took a lot of people to help me make this possible
Now everything is lost because of the codes that you sent me.
I NEED YOUR HELP TO FIX THIS
If the code above is fixed than I am able to make it through my field demo and research
PLEASE HELP ME MAKE THIS CODE FUNCTION
My field demo is tomorrow,
I just need the code to stop crashing and to reduce the lag time between the display and the camera
If that is done than it should be enough for the time to get me through what I need to get through
(venv) C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-tracker>python3 main.p
Traceback (most recent call last):
File "C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-tracker\main.py", line 10, in <module>
with dai.OakCamera(pipeline, maxUsbSpeed=dai.UsbSpeed.HIGH) as oak:
AttributeError: module 'depthai' has no attribute 'OakCamera'
(venv) C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-trackerpython3 main.py
C:\Users\sale4088\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\depthai_sdk\oak_camera.py:219: UsbWarning: Device connected in USB2 mode! This might cause some issues. In such case, please try using a (different) USB3 cable, or force USB2 mode 'with OakCamera(usbSpeed=depthai.UsbSpeed.HIGH)'
warnings.warn("Device connected in USB2 mode! This might cause some issues. "
Closing OAK camera
[18443010F141790E00] [1.7] [1723829068.552] [host] [warning] Device crashed, but no crash dump could be extracted.
Above I attached the errors and issues that are displayed to me after the system crashes
How can I fix the code with the error messages
You mentioned many people have helped you to make this work before? Can you go back to the previous answers and put something together? You did it once, so you can do it again
I can't, those people are not around me and won't be around me for some time.
Those people are also not experts with the system that I am using, but you are and I am hoping that it should not be a difficult issue.
I am not a computer scientist and I have never had formal training as one
These issues took a while to figure out and I do not have the paper work or documentation since they were all in the same files that were deleted when I tried to install the codes you sent
Can you help me?
I sent you the code as well as the error messages
Are you able to figure out why?
It seems to be because it is going through a USB2? But I do not know how to place the code properly so it can run on that.
The code just needs to display, I do not care if the video file saves
The code just needs to open the display and have it run so it does not crash and so it runs through my computer
Please help me
The full code and the full error messages are sent above
Can you please help or forward me to someone on your team who can help.
This is urgent
Does this work:
#!/usr/bin/env python3
from depthai_sdk import OakCamera, TrackerPacket, Visualizer, TextPosition
import depthai as dai
from people_tracker import PeopleTracker
import cv2
pt = PeopleTracker()
with OakCamera(replay='people-tracking-above-03') as oak:
color_cam = oak.create_camera('color')
tracker = oak.create_nn('person-detection-retail-0013', color_cam, tracker=True)
tracker.config_nn(conf_threshold=0.6)
tracker.config_tracker(tracker_type=dai.TrackerType.ZERO_TERM_COLOR_HISTOGRAM, track_labels=[1])
def cb(packet: TrackerPacket, vis: Visualizer):
left, right, up, down = pt.calculate_tracklet_movement(packet.daiTracklets)
vis.add_text(f"Up: {up}, Down: {down}", position=TextPosition.TOP_LEFT, size=1)
vis.draw(packet.frame)
cv2.imshow('People Tracker', packet.frame)
oak.visualize(tracker.out.tracker, callback=cb)
oak.start(blocking=True)
michaelsalerno
This, and the script you ran to get the error are different. Please send the actual script you are running
#!/usr/bin/env python3
from depthai_sdk import OakCamera, TrackerPacket, Visualizer, TextPositionimport depthai as daifrom people_tracker import PeopleTrackerimport cv2
pt = PeopleTracker()
with OakCamera() as oak: color_cam = oak.create_camera('color') tracker = oak.create_nn('person-detection-retail-0013', color_cam, tracker=True) tracker.config_nn(conf_threshold=0.6) tracker.config_tracker(tracker_type=dai.TrackerType.ZERO_TERM_COLOR_HISTOGRAM, track_labels=[1])
def cb(packet: TrackerPacket, vis: Visualizer): left, right, up, down = pt.calculate_tracklet_movement(packet.daiTracklets)
vis.add_text(f"Up: {up}, Down: {down}", position=TextPosition.TOP_LEFT, size=1) vis.draw(packet.frame)
cv2.imshow('People Tracker', packet.frame)
oak.visualize(tracker.out.tracker, callback=cb) oak.start(blocking=True)
The script that I ran is the script that you sent, But I removed the replay feature from the oakcamera(replay=…) because that would only replay a video that was from the github.
Try to change this:
with dai.OakCamera(pipeline, maxUsbSpeed=dai.UsbSpeed.HIGH) as oak:
To with dai.Device(pipeline, maxUsbSpeed=dai.UsbSpeed.HIGH) as oak:
The problem I think is partly due to it being ran through a USB2, I just need the lag time for this to be reduced and for the device to stop crashing.
It seems to crash pretty quickly once a person is in front of the camera
But also, please send the contents of this file:
C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-tracker\main.py
(venv) C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-trackerpython3 main.py
Traceback (most recent call last):
File "C:\Users\sale4088\AppData\Local\Programs\Depthai2\depthai-viewer\scripts\depthai-experiments\gen2-people-tracker\main.py", line 10, in <module>
with dai.Device(pipeline, maxUsbSpeed=dai.UsbSpeed.HIGH) as oak:
NameError: name 'pipeline' is not defined
I have been sending the contents of that file, the folder is the same as the tab in the github, I cloned that github and have been editing from the exact files that are in it.
Can I set it to medium? Would that reduce the stress on the camera and maybe increase the frames?