depthai icon indicating copy to clipboard operation
depthai copied to clipboard

How to use callbacks.py

Open iam-shanmukha opened this issue 3 years ago • 9 comments

Hi, I am unable to get output from callbacks.py. I modified callbacks.py and run depthai_demo.py. Demo is running but I am getting no output/prints I placed in callbacks.py . Please provide an use case. This is how my callbacks.py looks like

def onNewFrame(frame, source):
    print("-------------on new frame----------")


def onShowFrame(frame, source):
    print("-------------onShowFrame----------")


def onNn(nn_packet):
    print("-------------onNn----------")


def onReport(report):
    print("-------------onReport----------")


def onSetup(*args, **kwargs):
    print("-------------onSetup----------")


def onTeardown(*args, **kwargs):
    print("-------------onTeardown----------")


def onIter(*args, **kwargs):
    print("-------------oniter----------")

iam-shanmukha avatar May 27 '22 04:05 iam-shanmukha

Hello @iam-shanmukha, I tried running python3 depthai_demo.py -cb callbacks.py after editing the callbacks.py file and it started printing to the terminal. Are you specifying the callback file? Thanks, Erik

Erol444 avatar May 30 '22 12:05 Erol444

Hi @Erol444. Yeah I am specifying callbacks.py. Even though I am not getting. Below is the output

python3 depthai_demo.py -cb callbacks.py
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Using depthai module from:  /home/nvidia/.local/lib/python3.6/site-packages/depthai.cpython-36m-aarch64-linux-gnu.so
Depthai version installed:  2.15.2.0
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Setting up demo...
Available devices:
[0] 10.42.0.37 [X_LINK_BOOTLOADER]
Enabling low-bandwidth mode due to connection mode... (protocol: XLinkProtocol.X_LINK_TCP_IP)
Setting PoE video quality to 50 to reduce latency...
qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 186, resource id: 0, major code: 140 (Unknown), minor code: 20

Debug output

DEPTHAI_LEVEL=debug python3 depthai_demo.py -cb callbacks.py
[2022-05-31 08:45:50.846] [debug] Python bindings - version: 2.15.2.0 from 2022-03-30 20:42:40 +0300 build: 2022-03-30 19:08:03 +0000
[2022-05-31 08:45:50.846] [debug] Library information - version: 2.15.2, commit: ec14f9a98670f685a2ff21f4c33eb1bc18ce836f from 2022-03-30 20:37:33 +0300, build: 2022-03-30 19:03:00 +0000
[2022-05-31 08:45:50.848] [debug] Initialize - finished
[2022-05-31 08:45:51.036] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.17.tar.xz' open: 5ms, archive read: 184ms
[2022-05-31 08:45:51.909] [debug] Resources - Archive 'depthai-device-fwp-afe8d00c868344c73ee897e26278f80a444b9763.tar.xz' open: 5ms, archive read: 1057ms
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Using depthai module from:  /home/nvidia/.local/lib/python3.6/site-packages/depthai.cpython-36m-aarch64-linux-gnu.so
Depthai version installed:  2.15.2.0
[2022-05-31 08:45:54.355] [debug] Python bindings - version: 2.15.2.0 from 2022-03-30 20:42:40 +0300 build: 2022-03-30 19:08:03 +0000
[2022-05-31 08:45:54.355] [debug] Library information - version: 2.15.2, commit: ec14f9a98670f685a2ff21f4c33eb1bc18ce836f from 2022-03-30 20:37:33 +0300, build: 2022-03-30 19:03:00 +0000
[2022-05-31 08:45:54.357] [debug] Initialize - finished
[2022-05-31 08:45:54.563] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.17.tar.xz' open: 5ms, archive read: 201ms
[2022-05-31 08:45:55.364] [debug] Resources - Archive 'depthai-device-fwp-afe8d00c868344c73ee897e26278f80a444b9763.tar.xz' open: 5ms, archive read: 1002ms
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Setting up demo...
Available devices:
[0] 10.42.0.37 [X_LINK_BOOTLOADER]
[2022-05-31 08:45:58.098] [debug] Device - OpenVINO version: 2021.4
[2022-05-31 08:45:58.098] [debug] Device - BoardConfig: {"gpio":[],"uart":[],"usb":{"flashBootedPid":63037,"flashBootedVid":999,"maxSpeed":4,"pid":63035,"vid":999},"watchdogInitialDelayMs":null,"watchdogTimeoutMs":null} 
libnop:
0000: b9 05 b9 05 81 e7 03 81 3b f6 81 e7 03 81 3d f6 04 be be bb 00 bb 00
[2022-05-31 08:45:59.623] [debug] Booting FW with Bootloader. Version 0.0.16, Time taken: 1017ms
[2022-05-31 08:45:59.623] [debug] DeviceBootloader about to be closed...
[2022-05-31 08:45:59.624] [debug] XLinkResetRemote of linkId: (0)
[2022-05-31 08:46:00.216] [debug] DeviceBootloader closed, 592
[10.42.0.37] [30.155] [system] [info] Memory Usage - DDR: 0.12 / 339.99 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.84 / 78.28 MiB, LeonRT Heap: 2.88 / 41.54 MiB
[10.42.0.37] [30.155] [system] [info] Temperatures - Average: 44.81 °C, CSS: 45.55 °C, MSS 44.41 °C, UPA: 44.87 °C, DSS: 44.41 °C
[10.42.0.37] [30.155] [system] [info] Cpu Usage - LeonOS 6.10%, LeonRT: 0.57%
Enabling low-bandwidth mode due to connection mode... (protocol: XLinkProtocol.X_LINK_TCP_IP)
Setting PoE video quality to 50 to reduce latency...
[10.42.0.37] [31.157] [system] [info] Memory Usage - DDR: 0.12 / 339.99 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.84 / 78.28 MiB, LeonRT Heap: 2.88 / 41.54 MiB
[10.42.0.37] [31.157] [system] [info] Temperatures - Average: 44.75 °C, CSS: 45.77 °C, MSS 44.41 °C, UPA: 44.64 °C, DSS: 44.18 °C
[10.42.0.37] [31.157] [system] [info] Cpu Usage - LeonOS 1.59%, LeonRT: 0.06%
[2022-05-31 08:46:05.427] [debug] Schema dump: {"connections":[{"node1Id":4,"node1Output":"preview","node1OutputGroup":"","node2Id":12,"node2Input":"inputImage","node2InputGroup":""},{"node1Id":7,"node1Output":"depth","node1OutputGroup":"","node2Id":10,"node2Input":"inputDepth","node2InputGroup":""},{"node1Id":12,"node1Output":"out","node1OutputGroup":"","node2Id":10,"node2Input":"in","node2InputGroup":""},{"node1Id":10,"node1Output":"out","node1OutputGroup":"","node2Id":11,"node2Input":"in","node2InputGroup":""},{"node1Id":3,"node1Output":"out","node1OutputGroup":"","node2Id":2,"node2Input":"inputControl","node2InputGroup":""},{"node1Id":7,"node1Output":"disparity","node1OutputGroup":"","node2Id":9,"node2Input":"in","node2InputGroup":""},{"node1Id":1,"node1Output":"out","node1OutputGroup":"","node2Id":0,"node2Input":"inputControl","node2InputGroup":""},{"node1Id":8,"node1Output":"out","node1OutputGroup":"","node2Id":7,"node2Input":"inputConfig","node2InputGroup":""},{"node1Id":0,"node1Output":"out","node1OutputGroup":"","node2Id":7,"node2Input":"left","node2InputGroup":""},{"node1Id":2,"node1Output":"out","node1OutputGroup":"","node2Id":7,"node2Input":"right","node2InputGroup":""},{"node1Id":4,"node1Output":"preview","node1OutputGroup":"","node2Id":5,"node2Input":"in","node2InputGroup":""},{"node1Id":6,"node1Output":"out","node1OutputGroup":"","node2Id":4,"node2Input":"inputControl","node2InputGroup":""}],"globalProperties":{"calibData":null,"cameraTuningBlobSize":null,"cameraTuningBlobUri":"","leonCssFrequencyHz":700000000.0,"leonMssFrequencyHz":700000000.0,"pipelineName":null,"pipelineVersion":null,"xlinkChunkSize":-1},"nodes":[[5,{"id":5,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,5,99,111,108,111,114,0]}],[4,{"id":4,"ioInfo":[[["","video"],{"blocking":false,"group":"","name":"video","queueSize":8,"type":0,"waitForMessage":false}],[["","preview"],{"blocking":false,"group":"","name":"preview","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","still"],{"blocking":false,"group":"","name":"still","queueSize":8,"type":0,"waitForMessage":false}],[["","isp"],{"blocking":false,"group":"","name":"isp","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":false,"group":"","name":"inputConfig","queueSize":8,"type":3,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"ColorCamera","properties":[185,18,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,129,64,1,129,64,2,255,255,255,255,0,136,0,0,240,65,136,0,0,128,191,136,0,0,128,191,0,185,4,0,0,0,0]}],[3,{"id":3,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,13,114,105,103,104,116,95,99,111,110,116,114,111,108,129,0,4,8]}],[2,{"id":2,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"MonoCamera","properties":[185,5,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,255,2,136,0,0,240,65]}],[0,{"id":0,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"MonoCamera","properties":[185,5,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,2,136,0,0,240,65]}],[1,{"id":1,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,12,108,101,102,116,95,99,111,110,116,114,111,108,129,0,4,8]}],[6,{"id":6,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,13,99,111,108,111,114,95,99,111,110,116,114,111,108,129,0,4,8]}],[11,{"id":11,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,5,110,110,79,117,116,0]}],[12,{"id":12,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":true,"group":"","name":"inputConfig","queueSize":8,"type":3,"waitForMessage":false}],[["","inputImage"],{"blocking":true,"group":"","name":"inputImage","queueSize":8,"type":3,"waitForMessage":true}]],"name":"ImageManip","properties":[185,3,185,8,185,7,185,4,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,185,3,185,2,136,0,0,0,0,136,0,0,0,0,185,2,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,0,136,0,0,128,63,136,0,0,128,63,0,1,185,15,133,44,1,133,44,1,0,0,0,0,186,0,1,0,186,0,0,0,136,0,0,0,0,0,0,185,2,8,0,0,1,1,0,0,134,176,30,4,0,4]}],[10,{"id":10,"ioInfo":[[["","passthrough"],{"blocking":false,"group":"","name":"passthrough","queueSize":8,"type":0,"waitForMessage":false}],[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","boundingBoxMapping"],{"blocking":false,"group":"","name":"boundingBoxMapping","queueSize":8,"type":0,"waitForMessage":false}],[["","passthroughDepth"],{"blocking":false,"group":"","name":"passthroughDepth","queueSize":8,"type":0,"waitForMessage":false}],[["","in"],{"blocking":false,"group":"","name":"in","queueSize":2,"type":3,"waitForMessage":true}],[["","inputDepth"],{"blocking":false,"group":"","name":"inputDepth","queueSize":4,"type":3,"waitForMessage":true}]],"name":"SpatialDetectionNetwork","properties":[185,15,1,130,128,61,221,0,189,12,97,115,115,101,116,58,95,95,98,108,111,98,8,2,0,136,0,0,0,63,0,0,186,0,187,0,136,0,0,0,0,136,154,153,153,62,185,2,100,129,16,39,0]}],[9,{"id":9,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,9,100,105,115,112,97,114,105,116,121,0]}],[8,{"id":8,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,12,115,116,101,114,101,111,67,111,110,102,105,103,129,0,4,8]}],[7,{"id":7,"ioInfo":[[["","rectifiedRight"],{"blocking":false,"group":"","name":"rectifiedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","rectifiedLeft"],{"blocking":false,"group":"","name":"rectifiedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","syncedLeft"],{"blocking":false,"group":"","name":"syncedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","syncedRight"],{"blocking":false,"group":"","name":"syncedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","depth"],{"blocking":false,"group":"","name":"depth","queueSize":8,"type":0,"waitForMessage":false}],[["","outConfig"],{"blocking":false,"group":"","name":"outConfig","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt1"],{"blocking":false,"group":"","name":"debugDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}],[["","debugExtDispLrCheckIt1"],{"blocking":false,"group":"","name":"debugExtDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt2"],{"blocking":false,"group":"","name":"debugDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","debugExtDispLrCheckIt2"],{"blocking":false,"group":"","name":"debugExtDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispCostDump"],{"blocking":false,"group":"","name":"debugDispCostDump","queueSize":8,"type":0,"waitForMessage":false}],[["","confidenceMap"],{"blocking":false,"group":"","name":"confidenceMap","queueSize":8,"type":0,"waitForMessage":false}],[["","left"],{"blocking":false,"group":"","name":"left","queueSize":8,"type":3,"waitForMessage":true}],[["","right"],{"blocking":false,"group":"","name":"right","queueSize":8,"type":3,"waitForMessage":true}],[["","disparity"],{"blocking":false,"group":"","name":"disparity","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":false,"group":"","name":"inputConfig","queueSize":4,"type":3,"waitForMessage":false}]],"name":"StereoDepth","properties":[185,15,185,5,185,8,0,2,136,0,0,122,68,1,0,0,4,3,185,7,5,0,185,5,0,2,136,0,0,0,63,0,1,185,4,0,3,136,205,204,204,62,0,185,2,0,134,255,255,0,0,185,2,0,50,185,2,1,0,185,4,255,0,1,0,185,5,1,0,0,128,245,185,3,0,2,127,185,5,1,128,250,129,244,1,128,250,129,244,1,0,1,255,190,190,133,64,2,133,64,1,1,185,5,189,0,189,0,190,16,16,0,3,255,255,1]}]]}
[2022-05-31 08:46:05.427] [debug] Asset map dump: {"map":{"/node/10/__blob":{"alignment":64,"offset":0,"size":14499200}}}
[10.42.0.37] [32.159] [system] [info] Memory Usage - DDR: 13.95 / 339.99 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 29.84 / 78.28 MiB, LeonRT Heap: 2.89 / 41.54 MiB
[10.42.0.37] [32.159] [system] [info] Temperatures - Average: 46.06 °C, CSS: 47.58 °C, MSS 45.09 °C, UPA: 45.32 °C, DSS: 46.23 °C
[10.42.0.37] [32.159] [system] [info] Cpu Usage - LeonOS 39.85%, LeonRT: 1.66%
[10.42.0.37] [32.939] [MonoCamera(2)] [info] Using board socket: 2, id: 2
[10.42.0.37] [32.939] [MonoCamera(0)] [info] Using board socket: 1, id: 1
[10.42.0.37] [32.942] [system] [info] ImageManip internal buffer size '203904'B, shave buffer size '37888'B
[10.42.0.37] [32.942] [system] [info] SpatialLocationCalculator shave buffer size '29696'B
[10.42.0.37] [32.943] [system] [info] SIPP (Signal Image Processing Pipeline) internal buffer size '16384'B

iam-shanmukha avatar May 31 '22 03:05 iam-shanmukha

Hello @iam-shanmukha , Could you update your depthai repo to the latest commit and run install_requirements.py afterward? It looks like you are using a bit outdated depthai_demo. THanks, Erik

Erol444 avatar May 31 '22 08:05 Erol444

Hi @Erol444, thanks for the follow up. I installed everything fresh again, still same issue. No output at all

Screenshot from 2022-05-31 16-35-40

iam-shanmukha avatar May 31 '22 11:05 iam-shanmukha

Hi @iam-shanmukha , I also noticed that depthai demo won't run callback if it's in cv mode (which is what you use), but only in QT GUI mode. By default it will use cv gui type on RPi/Jetson, could you try running python3 depthai_demo.py -cb callbacks.py -gt qt? Thanks, Erik

Erol444 avatar May 31 '22 21:05 Erol444

Hi @Erol444, thanks but, unable to run with qt. I am attaching the log here

DEPTHAI_LEVEL=debug python3 depthai_demo.py -cb callbacks.py -gt qt
[2022-06-01 15:51:26.831] [debug] Python bindings - version: 2.15.4.0 from 2022-05-09 16:11:43 +0300 build: 2022-05-09 13:51:54 +0000
[2022-06-01 15:51:26.831] [debug] Library information - version: 2.15.4, commit: 1503d545d4caad91e0c1a8436c7951ff79b400ef from 2022-05-09 16:09:05 +0300, build: 2022-05-09 13:45:52 +0000
[2022-06-01 15:51:26.833] [debug] Initialize - finished
[2022-06-01 15:51:27.037] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.18+c555ac2fb184b801291c95f7f73d23bf4dd42cf1.tar.xz' open: 5ms, archive read: 200ms
[2022-06-01 15:51:27.763] [debug] Resources - Archive 'depthai-device-fwp-db9c1703c929df0de6cc99b198d2d149f1735598.tar.xz' open: 5ms, archive read: 926ms
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Using depthai module from:  /home/nvidia/.local/lib/python3.6/site-packages/depthai.cpython-36m-aarch64-linux-gnu.so
Depthai version installed:  2.15.4.0
[2022-06-01 15:51:30.066] [debug] Python bindings - version: 2.15.4.0 from 2022-05-09 16:11:43 +0300 build: 2022-05-09 13:51:54 +0000
[2022-06-01 15:51:30.067] [debug] Library information - version: 2.15.4, commit: 1503d545d4caad91e0c1a8436c7951ff79b400ef from 2022-05-09 16:09:05 +0300, build: 2022-05-09 13:45:52 +0000
[2022-06-01 15:51:30.069] [debug] Initialize - finished
[2022-06-01 15:51:30.267] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.18+c555ac2fb184b801291c95f7f73d23bf4dd42cf1.tar.xz' open: 4ms, archive read: 194ms
[2022-06-01 15:51:31.085] [debug] Resources - Archive 'depthai-device-fwp-db9c1703c929df0de6cc99b198d2d149f1735598.tar.xz' open: 5ms, archive read: 1012ms
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Setting up demo...
Available devices:
[0] 10.42.0.37 [X_LINK_BOOTLOADER]
[2022-06-01 15:51:34.967] [debug] Device - OpenVINO version: 2021.4
[2022-06-01 15:51:34.968] [debug] Device - BoardConfig: {"gpio":[],"network":{"mtu":0,"xlinkTcpNoDelay":true},"pcieInternalClock":null,"sysctl":[],"uart":[],"usb":{"flashBootedPid":63037,"flashBootedVid":999,"maxSpeed":4,"pid":63035,"vid":999},"usb3PhyInternalClock":null,"watchdogInitialDelayMs":null,"watchdogTimeoutMs":null} 
libnop:
0000: b9 09 b9 05 81 e7 03 81 3b f6 81 e7 03 81 3d f6 04 b9 02 00 01 ba 00 be be bb 00 bb 00 be be
Traceback (most recent call last):
  File "depthai_demo.py", line 1078, in <module>
    runQt()
  File "depthai_demo.py", line 1062, in runQt
    app.start()
  File "depthai_demo.py", line 791, in start
    exit_code = self.startGui()
  File "/home/nvidia/depthai/gui/main.py", line 373, in startGui
    self.showSetupFrame("Starting demo...")
  File "/home/nvidia/depthai/gui/main.py", line 363, in showSetupFrame
    setupFrame = createBlankFrame(w, h)
  File "/home/nvidia/depthai/depthai_sdk/src/depthai_sdk/utils.py", line 291, in createBlankFrame
    image = np.zeros((height, width, 3), np.uint8)
ValueError: negative dimensions are not allowed
[2022-06-01 15:51:36.057] [debug] Booting FW with Bootloader. Version 0.0.16, Time taken: 925ms
[2022-06-01 15:51:36.058] [debug] DeviceBootloader about to be closed...
[2022-06-01 15:51:36.060] [debug] XLinkResetRemote of linkId: (0)
[2022-06-01 15:51:36.649] [debug] DeviceBootloader closed, 591
[10.42.0.37] [35.838] [system] [info] Memory Usage - DDR: 0.12 / 341.19 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.83 / 78.13 MiB, LeonRT Heap: 2.88 / 41.43 MiB
[10.42.0.37] [35.838] [system] [info] Temperatures - Average: 38.12 °C, CSS: 39.35 °C, MSS 37.94 °C, UPA: 37.48 °C, DSS: 37.71 °C
[10.42.0.37] [35.838] [system] [info] Cpu Usage - LeonOS 6.18%, LeonRT: 0.58%
[10.42.0.37] [36.839] [system] [info] Memory Usage - DDR: 0.12 / 341.19 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.83 / 78.13 MiB, LeonRT Heap: 2.88 / 41.43 MiB
[10.42.0.37] [36.839] [system] [info] Temperatures - Average: 38.59 °C, CSS: 39.11 °C, MSS 38.18 °C, UPA: 38.65 °C, DSS: 38.41 °C
[10.42.0.37] [36.839] [system] [info] Cpu Usage - LeonOS 1.82%, LeonRT: 0.06%
[10.42.0.37] [37.840] [system] [info] Memory Usage - DDR: 0.12 / 341.19 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.83 / 78.13 MiB, LeonRT Heap: 2.88 / 41.43 MiB
[10.42.0.37] [37.840] [system] [info] Temperatures - Average: 38.30 °C, CSS: 38.88 °C, MSS 37.94 °C, UPA: 38.41 °C, DSS: 37.94 °C
[10.42.0.37] [37.840] [system] [info] Cpu Usage - LeonOS 0.85%, LeonRT: 0.04%
[10.42.0.37] [38.841] [system] [info] Memory Usage - DDR: 0.12 / 341.19 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 24.83 / 78.13 MiB, LeonRT Heap: 2.88 / 41.43 MiB
[10.42.0.37] [38.841] [system] [info] Temperatures - Average: 38.53 °C, CSS: 39.35 °C, MSS 37.48 °C, UPA: 38.41 °C, DSS: 38.88 °C
[10.42.0.37] [38.841] [system] [info] Cpu Usage - LeonOS 0.61%, LeonRT: 0.04%
Enabling low-bandwidth mode due to connection mode... (protocol: XLinkProtocol.X_LINK_TCP_IP)
Setting PoE video quality to 50 to reduce latency...
[2022-06-01 15:51:44.612] [debug] Schema dump: {"connections":[{"node1Id":6,"node1Output":"preview","node1OutputGroup":"","node2Id":16,"node2Input":"inputImage","node2InputGroup":""},{"node1Id":9,"node1Output":"depth","node1OutputGroup":"","node2Id":14,"node2Input":"inputDepth","node2InputGroup":""},{"node1Id":16,"node1Output":"out","node1OutputGroup":"","node2Id":14,"node2Input":"in","node2InputGroup":""},{"node1Id":14,"node1Output":"out","node1OutputGroup":"","node2Id":15,"node2Input":"in","node2InputGroup":""},{"node1Id":9,"node1Output":"rectifiedRight","node1OutputGroup":"","node2Id":13,"node2Input":"in","node2InputGroup":""},{"node1Id":9,"node1Output":"rectifiedLeft","node1OutputGroup":"","node2Id":12,"node2Input":"in","node2InputGroup":""},{"node1Id":9,"node1Output":"depth","node1OutputGroup":"","node2Id":11,"node2Input":"in","node2InputGroup":""},{"node1Id":10,"node1Output":"out","node1OutputGroup":"","node2Id":9,"node2Input":"inputConfig","node2InputGroup":""},{"node1Id":0,"node1Output":"out","node1OutputGroup":"","node2Id":9,"node2Input":"left","node2InputGroup":""},{"node1Id":3,"node1Output":"out","node1OutputGroup":"","node2Id":9,"node2Input":"right","node2InputGroup":""},{"node1Id":14,"node1Output":"passthrough","node1OutputGroup":"","node2Id":17,"node2Input":"in","node2InputGroup":""},{"node1Id":2,"node1Output":"out","node1OutputGroup":"","node2Id":0,"node2Input":"inputControl","node2InputGroup":""},{"node1Id":6,"node1Output":"preview","node1OutputGroup":"","node2Id":7,"node2Input":"in","node2InputGroup":""},{"node1Id":0,"node1Output":"out","node1OutputGroup":"","node2Id":1,"node2Input":"in","node2InputGroup":""},{"node1Id":3,"node1Output":"out","node1OutputGroup":"","node2Id":4,"node2Input":"in","node2InputGroup":""},{"node1Id":5,"node1Output":"out","node1OutputGroup":"","node2Id":3,"node2Input":"inputControl","node2InputGroup":""},{"node1Id":8,"node1Output":"out","node1OutputGroup":"","node2Id":6,"node2Input":"inputControl","node2InputGroup":""}],"globalProperties":{"calibData":null,"cameraTuningBlobSize":null,"cameraTuningBlobUri":"","leonCssFrequencyHz":700000000.0,"leonMssFrequencyHz":700000000.0,"pipelineName":null,"pipelineVersion":null,"xlinkChunkSize":-1},"nodes":[[15,{"id":15,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,5,110,110,79,117,116,0]}],[14,{"id":14,"ioInfo":[[["","passthrough"],{"blocking":false,"group":"","name":"passthrough","queueSize":8,"type":0,"waitForMessage":false}],[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","boundingBoxMapping"],{"blocking":false,"group":"","name":"boundingBoxMapping","queueSize":8,"type":0,"waitForMessage":false}],[["","passthroughDepth"],{"blocking":false,"group":"","name":"passthroughDepth","queueSize":8,"type":0,"waitForMessage":false}],[["","in"],{"blocking":false,"group":"","name":"in","queueSize":2,"type":3,"waitForMessage":true}],[["","inputDepth"],{"blocking":false,"group":"","name":"inputDepth","queueSize":4,"type":3,"waitForMessage":true}]],"name":"SpatialDetectionNetwork","properties":[185,15,1,130,128,61,221,0,189,12,97,115,115,101,116,58,95,95,98,108,111,98,8,2,0,136,0,0,0,63,0,0,186,0,187,0,136,0,0,0,0,136,154,153,153,62,185,2,100,129,16,39,0]}],[4,{"id":4,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,5,114,105,103,104,116,0]}],[5,{"id":5,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,13,114,105,103,104,116,95,99,111,110,116,114,111,108,129,0,4,8]}],[3,{"id":3,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"MonoCamera","properties":[185,5,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,255,2,136,0,0,240,65]}],[17,{"id":17,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,7,110,110,73,110,112,117,116,0]}],[0,{"id":0,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"MonoCamera","properties":[185,5,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,2,136,0,0,240,65]}],[2,{"id":2,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,12,108,101,102,116,95,99,111,110,116,114,111,108,129,0,4,8]}],[16,{"id":16,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":true,"group":"","name":"inputConfig","queueSize":8,"type":3,"waitForMessage":false}],[["","inputImage"],{"blocking":true,"group":"","name":"inputImage","queueSize":8,"type":3,"waitForMessage":true}]],"name":"ImageManip","properties":[185,3,185,8,185,7,185,4,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,185,3,185,2,136,0,0,0,0,136,0,0,0,0,185,2,136,0,0,0,0,136,0,0,0,0,136,0,0,0,0,0,136,0,0,128,63,136,0,0,128,63,0,1,185,15,133,44,1,133,44,1,0,0,0,0,186,0,1,0,186,0,0,0,136,0,0,0,0,0,0,185,2,8,0,0,1,1,0,0,134,176,30,4,0,4]}],[1,{"id":1,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,4,108,101,102,116,0]}],[6,{"id":6,"ioInfo":[[["","video"],{"blocking":false,"group":"","name":"video","queueSize":8,"type":0,"waitForMessage":false}],[["","preview"],{"blocking":false,"group":"","name":"preview","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","still"],{"blocking":false,"group":"","name":"still","queueSize":8,"type":0,"waitForMessage":false}],[["","isp"],{"blocking":false,"group":"","name":"isp","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":false,"group":"","name":"inputConfig","queueSize":8,"type":3,"waitForMessage":false}],[["","inputControl"],{"blocking":true,"group":"","name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}]],"name":"ColorCamera","properties":[185,18,185,20,0,3,0,185,3,0,0,0,185,5,0,0,0,0,0,185,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,129,64,1,129,64,2,255,255,255,255,0,136,0,0,240,65,136,0,0,128,191,136,0,0,128,191,0,185,4,0,0,0,0]}],[7,{"id":7,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,5,99,111,108,111,114,0]}],[8,{"id":8,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,13,99,111,108,111,114,95,99,111,110,116,114,111,108,129,0,4,8]}],[9,{"id":9,"ioInfo":[[["","rectifiedRight"],{"blocking":false,"group":"","name":"rectifiedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","rectifiedLeft"],{"blocking":false,"group":"","name":"rectifiedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","syncedLeft"],{"blocking":false,"group":"","name":"syncedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","syncedRight"],{"blocking":false,"group":"","name":"syncedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","depth"],{"blocking":false,"group":"","name":"depth","queueSize":8,"type":0,"waitForMessage":false}],[["","outConfig"],{"blocking":false,"group":"","name":"outConfig","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt1"],{"blocking":false,"group":"","name":"debugDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}],[["","debugExtDispLrCheckIt1"],{"blocking":false,"group":"","name":"debugExtDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt2"],{"blocking":false,"group":"","name":"debugDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","debugExtDispLrCheckIt2"],{"blocking":false,"group":"","name":"debugExtDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispCostDump"],{"blocking":false,"group":"","name":"debugDispCostDump","queueSize":8,"type":0,"waitForMessage":false}],[["","confidenceMap"],{"blocking":false,"group":"","name":"confidenceMap","queueSize":8,"type":0,"waitForMessage":false}],[["","left"],{"blocking":false,"group":"","name":"left","queueSize":8,"type":3,"waitForMessage":true}],[["","right"],{"blocking":false,"group":"","name":"right","queueSize":8,"type":3,"waitForMessage":true}],[["","disparity"],{"blocking":false,"group":"","name":"disparity","queueSize":8,"type":0,"waitForMessage":false}],[["","inputConfig"],{"blocking":false,"group":"","name":"inputConfig","queueSize":4,"type":3,"waitForMessage":false}]],"name":"StereoDepth","properties":[185,16,185,5,185,8,0,2,136,0,0,122,68,1,0,0,4,3,185,7,5,0,185,5,0,2,136,0,0,0,63,0,1,185,4,0,3,136,205,204,204,62,0,185,2,0,134,255,255,0,0,185,2,0,50,185,2,1,0,185,4,255,0,1,0,185,5,1,0,0,128,245,185,3,0,2,127,185,5,1,128,250,129,244,1,128,250,129,244,1,0,1,255,190,190,133,64,2,133,64,1,1,185,5,189,0,189,0,190,16,16,0,3,255,255,1,190]}],[10,{"id":10,"ioInfo":[[["","out"],{"blocking":false,"group":"","name":"out","queueSize":8,"type":0,"waitForMessage":false}]],"name":"XLinkIn","properties":[185,3,189,12,115,116,101,114,101,111,67,111,110,102,105,103,129,0,4,8]}],[11,{"id":11,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,8,100,101,112,116,104,82,97,119,0]}],[12,{"id":12,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,13,114,101,99,116,105,102,105,101,100,76,101,102,116,0]}],[13,{"id":13,"ioInfo":[[["","in"],{"blocking":true,"group":"","name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":[185,3,136,0,0,128,191,189,14,114,101,99,116,105,102,105,101,100,82,105,103,104,116,0]}]]}
[2022-06-01 15:51:44.612] [debug] Asset map dump: {"map":{"/node/14/__blob":{"alignment":64,"offset":0,"size":14499200}}}
[10.42.0.37] [39.848] [system] [info] Memory Usage - DDR: 13.95 / 341.19 MiB, CMX: 2.05 / 2.50 MiB, LeonOS Heap: 29.85 / 78.13 MiB, LeonRT Heap: 2.89 / 41.43 MiB
[10.42.0.37] [39.848] [system] [info] Temperatures - Average: 39.29 °C, CSS: 40.97 °C, MSS 38.65 °C, UPA: 38.18 °C, DSS: 39.35 °C
[10.42.0.37] [39.848] [system] [info] Cpu Usage - LeonOS 17.55%, LeonRT: 1.97%
[10.42.0.37] [40.344] [MonoCamera(3)] [info] Using board socket: 2, id: 2
[10.42.0.37] [40.345] [MonoCamera(0)] [info] Using board socket: 1, id: 1
[10.42.0.37] [40.348] [system] [info] ImageManip internal buffer size '203904'B, shave buffer size '37888'B
[10.42.0.37] [40.348] [system] [info] SpatialLocationCalculator shave buffer size '29696'B
Error while running demo script... Command '"/usr/bin/python3" depthai_demo.py -cb callbacks.py --noSupervisor --guiType qt' returned non-zero exit status 1.
Waiting 5s for the device to be discoverable again...
[2022-06-01 15:51:50.924] [debug] Python bindings - version: 2.15.4.0 from 2022-05-09 16:11:43 +0300 build: 2022-05-09 13:51:54 +0000
[2022-06-01 15:51:50.924] [debug] Library information - version: 2.15.4, commit: 1503d545d4caad91e0c1a8436c7951ff79b400ef from 2022-05-09 16:09:05 +0300, build: 2022-05-09 13:45:52 +0000
[2022-06-01 15:51:50.926] [debug] Initialize - finished
[2022-06-01 15:51:51.124] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.18+c555ac2fb184b801291c95f7f73d23bf4dd42cf1.tar.xz' open: 4ms, archive read: 194ms
[2022-06-01 15:51:51.903] [debug] Resources - Archive 'depthai-device-fwp-db9c1703c929df0de6cc99b198d2d149f1735598.tar.xz' open: 5ms, archive read: 973ms
/home/nvidia/.local/lib/python3.6/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
Setting up demo...
Traceback (most recent call last):
  File "depthai_demo.py", line 1081, in <module>
    runOpenCv()
  File "depthai_demo.py", line 1071, in runOpenCv
    demo.run_all(confManager)
  File "depthai_demo.py", line 127, in run_all
    self.setup(conf)
  File "depthai_demo.py", line 184, in setup
    self._deviceInfo = getDeviceInfo(self._conf.args.deviceId, args.debug)
  File "/home/nvidia/depthai/depthai_sdk/src/depthai_sdk/utils.py", line 145, in getDeviceInfo
    raise RuntimeError("No DepthAI device found!")
RuntimeError: No DepthAI device found!
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "depthai_demo.py", line 356, in stop
    self._pm.closeDefaultQueues()
AttributeError: 'Demo' object has no attribute '_pm'
Sentry is attempting to send 2 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

iam-shanmukha avatar Jun 01 '22 10:06 iam-shanmukha

Update

  • I noticed that, I got negative width at the below line. -170 in my case. https://github.com/luxonis/depthai/blob/3819aa513f58f2d749e5d5c94953ce1d2fe0a061/depthai_sdk/src/depthai_sdk/utils.py#L291

  • A simple fix I did is making it positive, and it worked. Also, callbacks.py seems working.

image = np.zeros((abs(height), abs(width), 3), np.uint8)

Thanks for the follow up @Erol444. Can't we make the callbacks.py work in cv mode also?

Screenshot from 2022-06-01 16-35-18

iam-shanmukha avatar Jun 01 '22 11:06 iam-shanmukha

reminder :)

iam-shanmukha avatar Jun 07 '22 11:06 iam-shanmukha

Hello @iam-shanmukha , great that you got it working with QT GUI! Regarding working with CV GUI - we are a bit short on engineering resources, but I will add this as a FeatureRequest on this repo. Thanks!

Erol444 avatar Jun 07 '22 12:06 Erol444