private void Start() { // Predict style bottleneck; using (var predict = new StylePredict(predictionFileName)) { predict.Invoke(styleImage); styleBottleneck = predict.GetStyleBottleneck(); } styleTransfer = new StyleTransfer(transferFileName, styleBottleneck, compute); var webCamInput = GetComponent <WebCamInput>(); webCamInput.OnTextureUpdate.AddListener(OnTextureUpdate); }
void Start() { // Predict style bottleneck; string predictionModelPath = Path.Combine(Application.streamingAssetsPath, predictionFileName); using (var predict = new StylePredict(predictionModelPath)) { predict.Invoke(styleImage); styleBottleneck = predict.GetStyleBottleneck(); } string transferModelPath = Path.Combine(Application.streamingAssetsPath, transferFileName); styleTransfer = new StyleTransfer(transferModelPath, styleBottleneck, compute); // Init camera string cameraName = WebCamUtil.FindName(); webcamTexture = new WebCamTexture(cameraName, 640, 480, 30); webcamTexture.Play(); preview.texture = webcamTexture; }