geaxgx / depthai_hand_tracker

Running Google Mediapipe Hand Tracking models on Luxonis DepthAI hardware (OAK-D-lite, OAK-D, OAK-1,...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem running demo

joshuaGreineder opened this issue · comments

Whenever I try to run the demo program, it doesn't work and gives me this:

``C:\Users\Admin\AppData\Local\Programs\Python\Python37\python.exe C:/Users/Admin/depthai_hand_tracker/examples/3d_visualization/demo.py
Palm detection blob : C:\Users\Admin\depthai_hand_tracker\models\palm_detection_sh4.blob
Landmark blob : C:\Users\Admin\depthai_hand_tracker\models\hand_landmark_sh4.blob
Internal camera FPS set to: 23
Sensor resolution: (1920, 1080)
Internal camera image size: 1152 x 648 - crop_w:0 pad_h: 252
896 anchors have been created
Creating pipeline...
Creating Color Camera...
Creating Palm Detection Neural Network...
Creating Hand Landmark Neural Network...
Pipeline created.
[14442C10D1BC5ED700] [55.544] [NeuralNetwork(4)] [warning] Network compiled for 4 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance
[14442C10D1BC5ED700] [55.586] [NeuralNetwork(6)] [warning] Number of inference threads assigned for network is 1, assigning 2 will likely yield in better performance
[14442C10D1BC5ED700] [55.586] [NeuralNetwork(6)] [warning] Network compiled for 4 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance
[14442C10D1BC5ED700] [55.596] [NeuralNetwork(4)] [warning] The issued warnings are orientative, based on optimal settings for a single network, if multiple networks are running in parallel the optimal settings may vary
[14442C10D1BC5ED700] [55.596] [NeuralNetwork(6)] [warning] The issued warnings are orientative, based on optimal settings for a single network, if multiple networks are running in parallel the optimal settings may vary
Pipeline started - USB speed: SUPER
Traceback (most recent call last):
File "C:/Users/Admin/depthai_hand_tracker/examples/3d_visualization/demo.py", line 107, in
frame, hands, bag = tracker.next_frame()
File "C:\Users\Admin\depthai_hand_tracker\HandTracker.py", line 703, in next_frame
self.pd_postprocess(inference, focus_zone)
File "C:\Users\Admin\depthai_hand_tracker\HandTracker.py", line 436, in pd_postprocess
self.hands = mpu.non_max_suppression(self.hands, self.pd_nms_thresh)
File "C:\Users\Admin\depthai_hand_tracker\mediapipe_utils.py", line 239, in non_max_suppression
return [regions[i[0]] for i in indices]
File "C:\Users\Admin\depthai_hand_tracker\mediapipe_utils.py", line 239, in
return [regions[i[0]] for i in indices]
IndexError: invalid index to scalar variable.

Process finished with exit code 1

It seems you don't have the latest version of the repository, which has been updated yesterday. Can you please try with the latest version ? Thanks.

Seems that I have same problem and I cant start the default demo
Looks like the same error message :
(venv) PS B:\Github\depthai_hand_tracker> & b:/Github/depthai_hand_tracker/venv/Scripts/python.exe b:/Github/depthai_hand_tracker/demo.py Palm detection blob : B:\Github\depthai_hand_tracker\models\palm_detection_sh4.blob Landmark blob : B:\Github\depthai_hand_tracker\models\hand_landmark_lite_sh4.blob Internal camera FPS set to: 23 Sensor resolution: (1920, 1080) Internal camera image size: 1152 x 648 - crop_w:0 pad_h: 252 896 anchors have been created Creating pipeline... Creating Color Camera... Creating Palm Detection Neural Network... Creating Hand Landmark Neural Network (1 thread)... Pipeline created. [14442C1051FD60D700] [22.209] [NeuralNetwork(4)] [warning] Network compiled for 4 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance [14442C1051FD60D700] [22.211] [NeuralNetwork(6)] [warning] Number of inference threads assigned for network is 1, assigning 2 will likely yield in better performance Pipeline started - USB speed: SUPER [14442C1051FD60D700] [22.211] [NeuralNetwork(6)] [warning] Network compiled for 4 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance [14442C1051FD60D700] [22.221] [NeuralNetwork(4)] [warning] The issued warnings are orientative, based on optimal settings for a single network, if multiple networks are running in parallel the optimal settings may vary [14442C1051FD60D700] [22.221] [NeuralNetwork(6)] [warning] The issued warnings are orientative, based on optimal settings for a single network, if multiple networks are running in parallel the optimal settings may vary Traceback (most recent call last): File "b:/Github/depthai_hand_tracker/demo.py", line 80, in <module> frame, hands, bag = tracker.next_frame() File "b:\Github\depthai_hand_tracker\HandTracker.py", line 507, in next_frame self.pd_postprocess(inference) File "b:\Github\depthai_hand_tracker\HandTracker.py", line 391, in pd_postprocess self.hands = mpu.non_max_suppression(self.hands, self.pd_nms_thresh)[:self.max_hands] File "b:\Github\depthai_hand_tracker\mediapipe_utils.py", line 256, in non_max_suppression return [regions[i[0]] for i in indices] File "b:\Github\depthai_hand_tracker\mediapipe_utils.py", line 256, in <listcomp> return [regions[i[0]] for i in indices] IndexError: invalid index to scalar variable.

This issue is due to a change of behaviour of cv2.dnn.NMSBoxes with OpenCV 4.5.4.58. So I bet that you are using this version.
I have just commited a fix that adapts to OpenCV version.
Please pull the repository and try again.

Oh gosh thank You very much.