luxonis / depthai-experiments

Experimental projects we've done with DepthAI.
MIT License
799 stars 356 forks source link

Head pose estimation #509

Closed imadjawad closed 7 months ago

imadjawad commented 8 months ago

Hi All,

for an unknown reason, the example code is not working anymore, now I'm getting this error message:

**[2023-11-11 17:17:36] INFO [root.close:456] Closing OAK camera Traceback (most recent call last): File "", line 15, in File "/root/.local/lib/python3.9/site-packages/depthai_sdk/oak_camera.py", line 322, in create_nn comp = NNComponent(self.device, File "/root/.local/lib/python3.9/site-packages/depthai_sdk/components/nn_component.py", line 108, in init self._parse_model(model) File "/root/.local/lib/python3.9/site-packages/depthai_sdk/components/nn_component.py", line 256, in _parse_model raise ValueError(f"Specified model '{str(model)}' is not supported by DepthAI SDK.\n" ValueError: The specified model 'head-pose-estimation-adas-0001' is not supported by DepthAI SDK. Check SDK documentation page to see which models are supported.

**

I tried, update && upgrade, I installed different OS from Luxonis pre configured RPI os, returned with this results:

**Traceback (most recent call last): File "/home/pi/depthai/HPE1.py", line 2, in from depthai_sdk import OakCamera, TextPosition, Visualizer ImportError: cannot import name 'TextPosition' from 'depthai_sdk' (/root/.local/lib/python3.11/site-packages/depthai_sdk/init.py)**

OR

[2023-11-13 19:58:37] INFO [root.close:456] Closing OAK camera Traceback (most recent call last): File "", line 15, in File "/root/.local/lib/python3.11/site-packages/depthai_sdk/oak_camera.py", line 322, in create_nn comp = NNComponent(self.device, File "/root/.local/lib/python3.11/site-packages/depthai_sdk/components/nn_component.py", line 108, in init self._parse_model(model) File "/root/.local/lib/python3.11/site-packages/depthai_sdk/components/nn_component.py", line 256, in _parse_model raise ValueError(f"Specified model '{str(model)}' is not supported by DepthAI SDK.\n" ValueError: Specified model 'head-pose-estimation-adas-0001' is not supported by DepthAI SDK. Check SDK documentation page to see which models are supported.

Thank you!!

jakaskerl commented 7 months ago

Apologies, the model is not under the in the "nn_models" folder. Try doing this:

import blobconverter
MIN_THRESHOLD = 15. # Degrees in yaw/pitch/roll to be considered as head movement

with OakCamera() as oak:
    color = oak.create_camera('color')
    det_nn = oak.create_nn('face-detection-retail-0004', color)
    # Passthrough is enabled for debugging purposes
    # AspectRatioResizeMode has to be CROP for 2-stage pipelines at the moment
    det_nn.config_nn(resize_mode='crop')

    second_blob = blobconverter.from_zoo(name="head-pose-estimation-adas-0001", shaves=6)
    headpose = oak.create_nn(second_blob, input=det_nn)
imadjawad commented 7 months ago

Apologies, the model is not under the in the "nn_models" folder. Try doing this:

import blobconverter
MIN_THRESHOLD = 15. # Degrees in yaw/pitch/roll to be considered as head movement

with OakCamera() as oak:
    color = oak.create_camera('color')
    det_nn = oak.create_nn('face-detection-retail-0004', color)
    # Passthrough is enabled for debugging purposes
    # AspectRatioResizeMode has to be CROP for 2-stage pipelines at the moment
    det_nn.config_nn(resize_mode='crop')

    second_blob = blobconverter.from_zoo(name="head-pose-estimation-adas-0001", shaves=6)
    headpose = oak.create_nn(second_blob, input=det_nn)

Thank you!!