Beispiel #1
0
        public MainForm()
        {
            InitializeComponent();

            TfInvoke.CheckLibraryLoaded();
            messageLabel.Text = String.Empty;
            cameraButton.Text = "Start Camera";

            DisableUI();

            SessionOptions so = new SessionOptions();

            if (TfInvoke.IsGoogleCudaEnabled)
            {
                Tensorflow.ConfigProto config = new Tensorflow.ConfigProto();
                config.GpuOptions             = new Tensorflow.GPUOptions();
                config.GpuOptions.AllowGrowth = true;
                so.SetConfig(config.ToProtobuf());
            }
            _inceptionGraph = new MaskRcnnInceptionV2Coco(null, so);

            _inceptionGraph.OnDownloadProgressChanged += OnDownloadProgressChangedEventHandler;
            _inceptionGraph.OnDownloadCompleted       += onDownloadCompleted;

            _inceptionGraph.Init();
        }
Beispiel #2
0
        public async Task TestMaskRCNN()
        {
            using (Tensor imageTensor = ImageIO.ReadTensorFromImageFile <byte>(
                       "surfers.jpg",
                       -1,
                       -1,
                       0,
                       1.0f))
                using (MaskRcnnInceptionV2Coco model = new MaskRcnnInceptionV2Coco())
                {
                    await model.Init();

                    MaskRcnnInceptionV2Coco.RecognitionResult[][] results = model.Recognize(imageTensor);
                }
        }
Beispiel #3
0
        public MainForm()
        {
            InitializeComponent();

            TfInvoke.CheckLibraryLoaded();
            messageLabel.Text = String.Empty;
            cameraButton.Text = "Start Camera";

            DisableUI();

            //Use the following code for the full inception model
            _inceptionGraph = new MaskRcnnInceptionV2Coco();
            _inceptionGraph.OnDownloadProgressChanged += OnDownloadProgressChangedEventHandler;
            _inceptionGraph.OnDownloadCompleted       += onDownloadCompleted;

            _inceptionGraph.Init();
        }
Beispiel #4
0
 public async Task Init()
 {
     await _inceptionGraph.Init();
 }