示例#1
0
    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);
    }
示例#2
0
    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;
    }