Hello,

to run depthai experiments , what should i do ?

Downloading the whole repository is too much . I tried to download via git only the repository i'm interested in but gives me errors. i have already the depthai folder installed and the examples run fine.

    smoothVision
    From GPT:

    Sparse Checkout with Git

    Sparse checkout allows you to clone only specific folders from a repository. This feature can be particularly useful if you need parts of a large repository, such as specific experiments or examples from DepthAI, without downloading everything. Here's how you can use it:

    Step 1: Initialize a New Git Repository

    First, create a new directory for your repository and initialize it as a Git repository:

    mkdir depthai-experiments
    cd depthai-experiments
    git init

    Step 2: Add the Remote Repository

    Add the DepthAI repository (or any other repository you're interested in) as a remote source:

    git remote add origin https://github.com/luxonis/depthai-experiments.git

    Step 3: Enable Sparse Checkout

    Enable the sparse checkout feature in your local Git configuration:

    git config core.sparseCheckout true

    Step 4: Specify the Directories You Want to Checkout

    Create a file named sparse-checkout in the .git/info/ directory and add the paths of the directories you're interested in:

    echo "examples/your_example_folder/" >> .git/info/sparse-checkout

    Replace "examples/your_example_folder/" with the actual path you wish to checkout.

    Step 5: Fetch and Checkout

    Now, fetch the content from the remote repository and checkout the specified directories:

    git fetch --depth=1 origin main
    git checkout main

    This will fetch only the latest commit (--depth=1 reduces the amount of data downloaded) and checkout the directories you specified in the sparse-checkout file.

    Thanks,
    Jaka

    the example " collision avoidance " gives errors :

    (envDepthAI) pi@luxonis:~/Desktop/luxonis/collision-avoidance $ python3 main.py

    2024-03-21 15:00:14,496 - root - INFO - Logging system initialized, kept in file /home/pi/Desktop/luxonis/collision-avoidance/camera.log...

    2024-03-21 15:00:16,158 - main - INFO - Setting up debug run...

    Traceback (most recent call last):

    File "/home/pi/Desktop/luxonis/collision-avoidance/main.py", line 121, in <module>

    MainDebug().run()
    
    ^^^^^^^^^^^

    File "/home/pi/Desktop/luxonis/collision-avoidance/main.py", line 47, in init

    super().__init__()

    File "/home/pi/Desktop/luxonis/collision-avoidance/main.py", line 19, in init

    self.depthai = self.depthai_class(model_name="vehicle-detection-adas-0002", threshold=0.5)
    
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/home/pi/Desktop/luxonis/collision-avoidance/depthai_utils.py", line 65, in init

    super().__init__(\*args, \*\*kwargs)

    File "/home/pi/Desktop/luxonis/collision-avoidance/depthai_utils.py", line 24, in init

    self.pipeline = self.create_pipeline({
    
                    ^^^^^^^^^^^^^^^^^^^^^^

    File "/home/pi/Desktop/luxonis/collision-avoidance/depthai_utils.py", line 14, in create_pipeline

    self.device = depthai.Device('', False)
    
                  ^^^^^^^^^^^^^^^^^^^^^^^^^

    TypeError: init(): incompatible constructor arguments. The following argument types are supported:

    1\. depthai.Device(pipeline: depthai.Pipeline)
    
    2\. depthai.Device(pipeline: depthai.Pipeline, usb2Mode: bool)
    
    3\. depthai.Device(pipeline: depthai.Pipeline, maxUsbSpeed: depthai.UsbSpeed)
    
    4\. depthai.Device(pipeline: depthai.Pipeline, pathToCmd: Path)
    
    5\. depthai.Device(pipeline: depthai.Pipeline, devInfo: depthai.DeviceInfo, usb2Mode: bool = False)
    
    6\. depthai.Device(pipeline: depthai.Pipeline, deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    7\. depthai.Device(pipeline: depthai.Pipeline, devInfo: depthai.DeviceInfo, pathToCmd: Path)
    
    8\. depthai.Device(version: depthai.OpenVINO.Version = <Version.???: 7>)
    
    9\. depthai.Device(version: depthai.OpenVINO.Version, usb2Mode: bool = False)
    
    10\. depthai.Device(version: depthai.OpenVINO.Version, maxUsbSpeed: depthai.UsbSpeed)
    
    11\. depthai.Device(version: depthai.OpenVINO.Version, pathToCmd: Path)
    
    12\. depthai.Device(version: depthai.OpenVINO.Version, deviceInfo: depthai.DeviceInfo, usb2Mode: bool = False)
    
    13\. depthai.Device(version: depthai.OpenVINO.Version, deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    14\. depthai.Device(version: depthai.OpenVINO.Version, deviceDesc: depthai.DeviceInfo, pathToCmd: Path)
    
    15\. depthai.Device(config: depthai.Device.Config)
    
    16\. depthai.Device(config: depthai.Device.Config, deviceInfo: depthai.DeviceInfo)
    
    17\. depthai.Device(deviceInfo: depthai.DeviceInfo)
    
    18\. depthai.Device(deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    19\. depthai.Device(nameOrDeviceId: str)
    
    20\. depthai.Device(nameOrDeviceId: str, maxUsbSpeed: depthai.UsbSpeed)

    Invoked with: '', False

    Exception ignored in: <function DepthAIDebug.del at 0x7f75613f60>

    Traceback (most recent call last):

    File "/home/pi/Desktop/luxonis/collision-avoidance/depthai_utils.py", line 86, in del

    super().__del__()

    File "/home/pi/Desktop/luxonis/collision-avoidance/depthai_utils.py", line 60, in del

    del self.device
    
        ^^^^^^^^^^^

    AttributeError: 'DepthAIDebug' object has no attribute 'device'

    Hi @smoothVision
    Where did you find this example?
    depthai.Device('', False) has to be called as depthai.Device() or depthai.Device(pipeline).

    Thanks,
    Jaka

    Hi @smoothVision
    Has to be some old code, for which you need the requirements installed.

    0.3.0.0+aeda4a9fdef6edc9f826b7dc354a123d1611a7c6 lord jesus that is old. Please just use the script from the other thread or the SDK.

    Thanks,
    Jaka