Repository: luxonis/depthai
Issue: `depthai_demo.py -dnn` or disable UI toggle crashes with "Queue for stream name 'nnInput' doesn't exist"

Attempting to disable NN with `depthai_demo.py -dnn` crashes with "Queue for stream name 'nnInput' doesn't exist"

### Setup

* Microsoft Windows [Version 10.0.19044.1469]
* depthai `main` at f83ff69db8ad9cc4fe174e59ee48ad81c59867bb
* Python 3.9.5

### Repro

1. `c:\\python39\\python.exe depthai_demo.py -dnn`

### Result

```
C:\\njs\\depthai>c:\\python39\\python.exe depthai_demo.py -dnn
Using depthai module from:  C:\\Users\\dale\\AppData\\Roaming\\Python\\Python39\\site-packages\\depthai.cp39-win_amd64.pyd
Depthai version installed:  2.14.1.0.dev+27fa4519f289498e84768ab5229a1a45efb7e4df
Setting up demo...
Available devices:
[0] 14442C10C1A1C6D200 [X_LINK_UNBOOTED]
USB Connection speed: UsbSpeed.SUPER
  File "C:\\njs\\depthai\\depthai_demo.py", line 633, in run
    self.instance.run_all(self.conf)
  File "C:\\njs\\depthai\\depthai_demo.py", line 121, in run_all
    self.run()
  File "C:\\njs\\depthai\\depthai_demo.py", line 310, in run
    self._pv.createQueues(self._device, self._createQueueCallback)
  File "c:\\njs\\depthai\\depthai_sdk\\src\\depthai_sdk\\managers\\preview_manager.py", line 88, in createQueues
    self.outputQueues.append(device.getOutputQueue(name=name, maxSize=1, blocking=False))
Queue for stream name 'nnInput' doesn't exist
```

The crash can also be reproduced by

1. Run `c:\\python39\\python.exe depthai_demo.py`
2. Click the top-right AI "enabled" toggle to disable it.
3. Click "apply and restart"

Same crash will occur.

### Expected

Demo runs with all camera feeds displayed (color, depth,, etc.) except for the NN/AI feeds.
My goal is to get maximum FPS (~120fps) for color and mono cameras in the demo.

Changed files:
depthai_sdk/src/depthai_sdk/managers/nnet_manager.py, depthai_demo.py, depthai_helpers/config_manager.py

diff --git a/depthai_demo.py b/depthai_demo.py
index edcfd7af..af0ed357 100755
--- a/depthai_demo.py
+++ b/depthai_demo.py
@@ -615,19 +615,23 @@ def runQt():
                     self.conf.args.deviceId = defaultDevice
             if Previews.color.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.color.name)
-            if Previews.nnInput.name not in self.conf.args.show:
+            if self.conf.useNN and Previews.nnInput.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.nnInput.name)
-            if Previews.depth.name not in self.conf.args.show and Previews.disparityColor.name not in self.conf.args.show:
+            if self.conf.useDepth and not self.parent.useDisparity and Previews.depth.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.depth.name)
-            if Previews.depthRaw.name not in self.conf.args.show and Previews.disparity.name not in self.conf.args.show:
+            if self.conf.useDepth and not self.parent.useDisparity and Previews.depthRaw.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.depthRaw.name)
+            if self.conf.useDepth and self.parent.useDisparity and Previews.disparity.name not in self.conf.args.show:
+                self.conf.args.show.append(Previews.disparity.name)
+            if self.conf.useDepth and self.parent.useDisparity and Previews.disparityColor.name not in self.conf.args.show:
+                self.conf.args.show.append(Previews.disparityColor.name)
             if Previews.left.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.left.name)
-            if Previews.rectifiedLeft.name not in self.conf.args.show:
+            if self.conf.useDepth and Previews.rectifiedLeft.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.rectifiedLeft.name)
             if Previews.right.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.right.name)
-            if Previews.rectifiedRight.name not in self.conf.args.show:
+            if self.conf.useDepth and Previews.rectifiedRight.name not in self.conf.args.show:
                 self.conf.args.show.append(Previews.rectifiedRight.name)
             try:
                 self.instance.run_all(self.conf)
@@ -928,7 +932,7 @@ def runQt():
                     self.selectedPreview = updated[0]
                 self.updateArg("show", updated)
             else:
-                updated = filtered + [Previews.left.name, Previews.right.name]
+                updated = filtered
                 if self.selectedPreview not in updated:
                     self.selectedPreview = updated[0]
                 self.updateArg("show", updated)
diff --git a/depthai_helpers/config_manager.py b/depthai_helpers/config_manager.py
index ba2dccc0..47737620 100644
--- a/depthai_helpers/config_manager.py
+++ b/depthai_helpers/config_manager.py
@@ -133,6 +133,12 @@ class ConfigManager:
 
     def adjustPreviewToOptions(self):
         if len(self.args.show) != 0:
+            depthPreviews = [Previews.rectifiedRight.name, Previews.rectifiedLeft.name, Previews.depth.name,
+                             Previews.depthRaw.name, Previews.disparity.name, Previews.disparityColor.name]
+
+            if len([preview for preview in self.args.show if preview in depthPreviews]) == 0 and not self.useNN:
+                print("No depth-related previews chosen, disabling depth...")
+                self.args.disableDepth = True
             return
 
         self.args.show.append(Previews.color.name)
@@ -162,9 +168,7 @@ class ConfigManager:
         cams = device.getConnectedCameras()
         depthEnabled = dai.CameraBoardSocket.LEFT in cams and dai.CameraBoardSocket.RIGHT in cams
 
-        if depthEnabled:
-            self.args.disableDepth = False
-        else:
+        if not depthEnabled:
             if not self.args.disableDepth:
                 print("Disabling depth...")
                 self.args.disableDepth = True
@@ -181,7 +185,7 @@ class ConfigManager:
                 else:
                     print("Disabling {} preview...".format(name))
             if len(updatedShowArg) == 0:
-                print("No previews available, adding color and nnInput...")
+                print("No previews available, adding defaults...")
                 updatedShowArg.append("color")
                 if self.useNN:
                     updatedShowArg.append("nnInput")
diff --git a/depthai_sdk/src/depthai_sdk/managers/nnet_manager.py b/depthai_sdk/src/depthai_sdk/managers/nnet_manager.py
index 25079866..4e9a6a39 100644
--- a/depthai_sdk/src/depthai_sdk/managers/nnet_manager.py
+++ b/depthai_sdk/src/depthai_sdk/managers/nnet_manager.py
@@ -224,6 +224,9 @@ class NNetManager:
             return str(label)
 
     def parse(self, blocking=False):
+        if self.outputQueue is None:
+            return None, None
+
         if blocking:
             inNn = self.outputQueue.get()
         else: