Exemplo n.º 1
0
        public static async Task <ArcFaceModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            ArcFaceModel learningModel = new ArcFaceModel();

            learningModel.model = await LearningModel.LoadFromStreamAsync(stream);

            learningModel.session = new LearningModelSession(learningModel.model);
            learningModel.binding = new LearningModelBinding(learningModel.session);
            return(learningModel);
        }
Exemplo n.º 2
0
        private async void LoadModel()
        {
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ArcFace.onnx"));

            _arcFaceModel = await ArcFaceModel.CreateFromStreamAsync(file as IRandomAccessStreamReference);

            await objectDetection.Init(await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///BearFace.onnx")));

            LoadFace();

            _ready = true;
        }