Every model supported by the demo script includes a JSON file. For example, here is the one for Mobilenet SSD:
{
"nn_config":
{
"output_format" : "detection",
"NN_family" : "mobilenet",
"confidence_threshold" : 0.5,
"input_size": "300x300"
},
"mappings":
{
"labels":
[
"background",
"aeroplane",
"bicycle",
"bird",
"boat",
"bottle",
"bus",
"car",
"cat",
"chair",
"cow",
"diningtable",
"dog",
"horse",
"motorbike",
"person",
"pottedplant",
"sheep",
"sofa",
"train",
"tvmonitor"
]
}
}
I wonder what's the purpose of these files. Like, is the JSON file read by the host or the DepthAI device? Why do we need to specify the output_format
, NN_family
, and input_size
when the complete architecture of the deployed model is already encoded in <model>.blob?
To make things more complicated, @PINTO on Discord pointed me to an example without any JSON file: https://github.com/luxonis/depthai-experiments/tree/d34fbf3664b788088e26012c5aa973dc864520ed/gen2-mobile-object-localizer. So is it optional?
In addition, this tutorial by Roboflow refers to the creation of such a JSON file as a "major hack", but hacks are unreliable! Is there a non-hacky way to create one for my own custom model (if I need it)?