void Start()
        {
            UISetup();

            AiliaImageSource = gameObject.GetComponent <AiliaImageSource>();

            // for Rendering
            blendMaterial      = new Material(Shader.Find("Ailia/AlphaBlending2Tex"));
            mainTexId          = Shader.PropertyToID("_MainTex");
            blendTexId         = Shader.PropertyToID("_BlendTex");
            blendFlagId        = Shader.PropertyToID("blendFlag");
            mainVFlipId        = Shader.PropertyToID("mainVFlip");
            blendVFlipId       = Shader.PropertyToID("blendVFlip");
            raw_image.material = blendMaterial;

            rawImageSize = raw_image.rectTransform.sizeDelta;

            if (inputDataProcessingShader != null)
            {
                computeShaderWeightId        = Shader.PropertyToID("weight");
                computeShaderBiasId          = Shader.PropertyToID("bias");
                computeShaderWidthId         = Shader.PropertyToID("width");
                computeShaderHeightId        = Shader.PropertyToID("height");
                computeShaderTextureId       = Shader.PropertyToID("texure");
                computeShaderResultId        = Shader.PropertyToID("result_buffer");
                channelLastKernel            = inputDataProcessingShader.FindKernel("ChannelLast");
                channelLastUpsideDownKernel  = inputDataProcessingShader.FindKernel("ChannelLastUpsideDown");
                channelFirstKernel           = inputDataProcessingShader.FindKernel("ChannelFirst");
                channelFirstUpsideDownKernel = inputDataProcessingShader.FindKernel("ChannelFirstUpsideDown");
            }

            AiliaInit();
        }
        void AiliaInit()
        {
            // Create Ailia
            ailiaModelVgg     = new AiliaModel();
            ailiaModelDecoder = new AiliaModel();
            CreateAdainNet(ailiaModelVgg, ailiaModelDecoder, gpu_mode);

            // Load sample image
            ContentImageSource = gameObject.AddComponent <AiliaImageSource>();
            StyleImageSource   = gameObject.AddComponent <AiliaImageSource>();
            ContentImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/Adain/SampleImage/cornell.jpg");
            StyleImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/Adain/SampleImage/woman_with_hat_matisse.jpg");
        }
Ejemplo n.º 3
0
        void AiliaInit()
        {
            // Create Ailia
            ailiaModelWC = new AiliaModel();
            ailiaModelBM = new AiliaModel();
            CreateDewarpNet(ailiaModelWC, ailiaModelBM, gpu_mode);

            // Load sample image
            AiliaImageSource = gameObject.GetComponent <AiliaImageSource>();
            if (AiliaImageSource == null)
            {
                AiliaImageSource = gameObject.AddComponent <AiliaImageSource>();
            }
            AiliaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageDeformation/SampleImage/dewarpnet_test.png");
        }
Ejemplo n.º 4
0
        void LoadImage(ImageManipulationModels imageManipulationModels, AiliaImageSource ailiaImageSource)
        {
            switch (imageManipulationModels)
            {
            case ImageManipulationModels.SRResNet:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageManipulation/SampleImage/lenna.png");
                break;

            case ImageManipulationModels.Noise2Noise:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageManipulation/SampleImage/monarch-gaussian-noisy.png");
                break;

            case ImageManipulationModels.IlluminationCorrection:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageManipulation/SampleImage/illumination_correction_test.png");
                break;

            case ImageManipulationModels.Colorization:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageManipulation/SampleImage/ansel_adams1.png");
                break;
            }
        }
        void LoadImage(ImageSegmentaionModels imageSegmentaionModels, AiliaImageSource ailiaImageSource)
        {
            switch (imageSegmentaionModels)
            {
            case ImageSegmentaionModels.HRNetV2_W18_Small_v2:
            case ImageSegmentaionModels.HRNetV2_W18_Small_v1:
            case ImageSegmentaionModels.HRNetV2_W48:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageSegmentation/SampleImage/road.png");
                break;

            case ImageSegmentaionModels.hair_segmentation:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageSegmentation/SampleImage/hair.jpg");
                break;

            case ImageSegmentaionModels.pspnet_hair_segmentation:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageSegmentation/SampleImage/hair2.jpg");
                break;

            case ImageSegmentaionModels.deeplabv3:
                ailiaImageSource.CreateSource("file://" + Application.dataPath + "/AXIP/AILIA-MODELS/ImageSegmentation/SampleImage/couple.jpg");
                break;
            }
        }