Hi Luxonis team — I’m migrating a pipeline to DepthAI v3 (3.0.0-rc.4) and want to use SpatialDetectionNetwork with a local MobileNet SSD face model (face-detection-retail-0004.blob
, OpenVINO). I’d like to avoid Hub calls and keep the model fully offline.
It looks like the v3 way to feed a local model into SDN is via setNNArchive()
, providing a .nnarchive
that contains the blob and a config.json
describing parser I/O.
I’ve built such an archive and verified its contents, but constructing dai.NNArchive(path)
fails with:
RuntimeError: [json.exception.out_of_range.403] key 'inputs' not found
… even though inputs
is present at the top level of config.json
.
NNArchive Inspection Outputs
$ tar -tzf face-detection-retail-0004.nnarchive
config.json
face-detection-retail-0004.blob
$ tar -xOzf face-detection-retail-0004.nnarchive config.json
{
"model": { "blob": "face-detection-retail-0004.blob" },
"parser": {
"nn_family": "MOBILENET",
"input_size": [300, 300],
"num_classes": 1,
"coordinate_size": 4,
"confidence_threshold": 0.5,
"iou_threshold": 0.5
},
"inputs": [
{ "name": "data", "type": "image", "layout": "NCHW", "color_space": "BGR", "shape": [1, 3, 300, 300] }
],
"outputs": [
{ "name": "detection_out", "type": "detection" }
],
"mappings": { "labels": ["face"] }
}
MRE
import depthai as dai, tarfile, json
ARC = "/absolute/path/to/face-detection-retail-0004.nnarchive"
# Sanity: I can read config.json myself and it includes 'inputs' at top-level.
with tarfile.open(ARC, "r:gz") as tf:
cfg = json.load(tf.extractfile("config.json"))
print("Top-level keys:", list(cfg)) # shows ['model','parser','inputs','outputs','mappings']
# DepthAI parse:
arc = dai.NNArchive(ARC) # <-- raises: RuntimeError: [json.exception.out_of_range.403] key 'inputs' not found
print("Loaded:", type(arc))
Can you please provide some guidance on providing a local model to the SpatialDetectionNetwork
node?
Thanks,
Josh