示例#1
0
    void Start()
    {
        // Read the file and convert the text inside in a Array separated by lines (Using Linq)
        outputParser.SetLabels(Regex.Split(m_LabelsFile.text, "\n|\r|\r\n").Where(s => !String.IsNullOrEmpty(s)).ToArray());
        outputParser.SetColors(m_Colors);
        // Load the onnx model file
        var model = ModelLoader.Load(m_ModelFile);

        // Create the barracuda inference engine (breaks down the given model into executable tasks and schedules them on the GPU or CPU)
        this.worker = WorkerFactory.CreateWorker(WorkerFactory.Type.ComputePrecompiled, model);
    }