diff --git a/Assets/MediaPipeUnity.meta b/Assets/MediaPipeUnity.meta new file mode 100644 index 0000000..fae7951 --- /dev/null +++ b/Assets/MediaPipeUnity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2eeb6ad0b5f376a4c89c3d60981e3954 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common.meta b/Assets/MediaPipeUnity/Common.meta new file mode 100644 index 0000000..781423d --- /dev/null +++ b/Assets/MediaPipeUnity/Common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7edf4cdcf72d7a4ebb045b80f81aa26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts.meta b/Assets/MediaPipeUnity/Common/Scripts.meta new file mode 100644 index 0000000..3db4969 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4cf8a63bc91e254baf15f576e0722c3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs b/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs new file mode 100644 index 0000000..b5d3650 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; + +namespace Mediapipe.Unity +{ + public static class AssetLoader + { + private static ResourceManager _ResourceManager; + + public static void Provide(ResourceManager manager) + { + _ResourceManager = manager; + } + + public static IEnumerator PrepareAssetAsync(string name, string uniqueKey, bool overwrite = false) + { + if (_ResourceManager == null) + { +#if UNITY_EDITOR + Logger.LogWarning("ResourceManager is not provided, so default LocalResourceManager will be used"); + _ResourceManager = new LocalResourceManager(); +#else + throw new System.InvalidOperationException("ResourceManager is not provided"); +#endif + } + return _ResourceManager.PrepareAssetAsync(name, uniqueKey, overwrite); + } + + public static IEnumerator PrepareAssetAsync(string name, bool overwrite = false) + { + return PrepareAssetAsync(name, name, overwrite); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs.meta new file mode 100644 index 0000000..4b27efa --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/AssetLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8bd1b384b7c7414cb732e8fbabf95a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs b/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs new file mode 100644 index 0000000..9fa7084 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs @@ -0,0 +1,160 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; +using System.IO; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class Bootstrap : MonoBehaviour + { + [System.Serializable] + public enum AssetLoaderType + { + StreamingAssets, + AssetBundle, + Local, + } + + private const string _TAG = nameof(Bootstrap); + + [SerializeField] private ImageSourceType _defaultImageSource; + [SerializeField] private InferenceMode _preferableInferenceMode; + [SerializeField] private AssetLoaderType _assetLoaderType; + [SerializeField] private bool _enableGlog = true; + + public InferenceMode inferenceMode { get; private set; } + public bool isFinished { get; private set; } + private bool _isGlogInitialized; + + private void OnEnable() + { + var _ = StartCoroutine(Init()); + } + + private IEnumerator Init() + { + Logger.SetLogger(new MemoizedLogger(100)); + Logger.MinLogLevel = Logger.LogLevel.Debug; + + Protobuf.SetLogHandler(Protobuf.DefaultLogHandler); + + Logger.LogInfo(_TAG, "Setting global flags..."); + GlobalConfigManager.SetFlags(); + + if (_enableGlog) + { + if (Glog.LogDir != null) + { + if (!Directory.Exists(Glog.LogDir)) + { + Directory.CreateDirectory(Glog.LogDir); + } + Logger.LogVerbose(_TAG, $"Glog will output files under {Glog.LogDir}"); + } + Glog.Initialize("MediaPipeUnityPlugin"); + _isGlogInitialized = true; + } + + Logger.LogInfo(_TAG, "Initializing AssetLoader..."); + switch (_assetLoaderType) + { + case AssetLoaderType.AssetBundle: + { + AssetLoader.Provide(new AssetBundleResourceManager("mediapipe")); + break; + } + case AssetLoaderType.StreamingAssets: + { + AssetLoader.Provide(new StreamingAssetsResourceManager()); + break; + } + case AssetLoaderType.Local: + { +#if UNITY_EDITOR + AssetLoader.Provide(new LocalResourceManager()); + break; +#else + Logger.LogError("LocalResourceManager is only supported on UnityEditor"); + yield break; +#endif + } + default: + { + Logger.LogError($"AssetLoaderType is unknown: {_assetLoaderType}"); + yield break; + } + } + + DecideInferenceMode(); + if (inferenceMode == InferenceMode.GPU) + { + Logger.LogInfo(_TAG, "Initializing GPU resources..."); + yield return GpuManager.Initialize(); + + if (!GpuManager.IsInitialized) + { + Logger.LogWarning("If your native library is built for CPU, change 'Preferable Inference Mode' to CPU from the Inspector Window for Bootstrap"); + } + } + + Logger.LogInfo(_TAG, "Preparing ImageSource..."); + ImageSourceProvider.ImageSource = GetImageSource(_defaultImageSource); + + isFinished = true; + } + + public ImageSource GetImageSource(ImageSourceType imageSourceType) + { + switch (imageSourceType) + { + case ImageSourceType.WebCamera: + { + return GetComponent(); + } + case ImageSourceType.Image: + { + return GetComponent(); + } + case ImageSourceType.Video: + { + return GetComponent(); + } + case ImageSourceType.Unknown: + default: + { + throw new System.ArgumentException($"Unsupported source type: {imageSourceType}"); + } + } + } + + private void DecideInferenceMode() + { +#if UNITY_EDITOR_OSX || UNITY_EDITOR_WIN + if (_preferableInferenceMode == InferenceMode.GPU) { + Logger.LogWarning(_TAG, "Current platform does not support GPU inference mode, so falling back to CPU mode"); + } + inferenceMode = InferenceMode.CPU; +#else + inferenceMode = _preferableInferenceMode; +#endif + } + + private void OnApplicationQuit() + { + GpuManager.Shutdown(); + + if (_isGlogInitialized) + { + Glog.Shutdown(); + } + + Protobuf.ResetLogHandler(); + Logger.SetLogger(null); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs.meta new file mode 100644 index 0000000..2ecf69f --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Bootstrap.cs.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f4d846393f8d9f20fa64b924b0d95e68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - globalConfigManagerPrefab: {fileID: 4394522812020757894, guid: 488fbb6a3005b66c2b657204bce83fcf, + type: 3} + - gpuManagerPrefab: {fileID: 7458244645391269047, guid: a84904e562ecaf887b2dba62111bb901, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs b/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs new file mode 100644 index 0000000..169a74e --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs @@ -0,0 +1,140 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using System.IO; +using System.Text; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public static class GlobalConfigManager + { + private const string _TAG = nameof(GlobalConfigManager); + + private static string CacheDirPath => Path.Combine(Application.persistentDataPath, "Cache"); + + private static string ConfigFilePath => Path.Combine(CacheDirPath, "globalConfig.env"); + + private const string _GlogLogtostderrKey = "GLOG_logtostderr"; + private const string _GlogStderrthresholdKey = "GLOG_stderrthreshold"; + private const string _GlogMinloglevelKey = "GLOG_minloglevel"; + private const string _GlogVKey = "GLOG_v"; + private const string _GlogLogDirKey = "GLOG_log_dir"; + + public static bool GlogLogtostderr + { + get => Config[_GlogLogtostderrKey] == "1"; + set => Config[_GlogLogtostderrKey] = value ? "1" : "0"; + } + + public static int GlogStderrthreshold + { + get => int.Parse(Config[_GlogStderrthresholdKey]); + set => Config[_GlogStderrthresholdKey] = value.ToString(); + } + + public static int GlogMinloglevel + { + get => int.Parse(Config[_GlogMinloglevelKey]); + set => Config[_GlogMinloglevelKey] = value.ToString(); + } + + public static int GlogV + { + get => int.Parse(Config[_GlogVKey]); + set => Config[_GlogVKey] = value.ToString(); + } + + public static string GlogLogDir + { + get => Config[_GlogLogDirKey]; + set => Config[_GlogLogDirKey] = value; + } + + private static Dictionary _Config; + private static Dictionary Config + { + get + { + if (_Config == null) + { + _Config = new Dictionary() { + { _GlogLogtostderrKey, "1" }, + { _GlogStderrthresholdKey, "2" }, + { _GlogMinloglevelKey, "0" }, + { _GlogLogDirKey, "" }, + { _GlogVKey, "0" }, + }; + + if (!File.Exists(ConfigFilePath)) + { + Logger.LogDebug(_TAG, $"Global config file does not exist: {ConfigFilePath}"); + } + else + { + Logger.LogDebug(_TAG, $"Reading the config file ({ConfigFilePath})..."); + foreach (var line in File.ReadLines(ConfigFilePath)) + { + try + { + var pair = ParseLine(line); + _Config[pair.Item1] = pair.Item2; + } + catch (System.Exception e) + { + Logger.LogWarning($"{e}"); + } + } + } + } + + return _Config; + } + } + + public static void Commit() + { + string[] lines = { + $"{_GlogLogtostderrKey}={(GlogLogtostderr ? "1" : "0")}", + $"{_GlogStderrthresholdKey}={GlogStderrthreshold}", + $"{_GlogMinloglevelKey}={GlogMinloglevel}", + $"{_GlogLogDirKey}={GlogLogDir}", + $"{_GlogVKey}={GlogV}", + }; + if (!Directory.Exists(CacheDirPath)) + { + var _ = Directory.CreateDirectory(CacheDirPath); + } + File.WriteAllLines(ConfigFilePath, lines, Encoding.UTF8); + Logger.LogInfo(_TAG, "Global config file has been updated"); + } + + public static void SetFlags() + { + Glog.Logtostderr = GlogLogtostderr; + Glog.Stderrthreshold = GlogStderrthreshold; + Glog.Minloglevel = GlogMinloglevel; + Glog.V = GlogV; + Glog.LogDir = GlogLogDir == "" ? null : Path.Combine(Application.persistentDataPath, GlogLogDir); + } + + private static (string, string) ParseLine(string line) + { + var i = line.IndexOf('='); + + if (i < 0) + { + throw new System.FormatException("Each line in global config file must include '=', but not found"); + } + + var key = line.Substring(0, i); + var value = line.Substring(i + 1); + + return (key, value); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs.meta new file mode 100644 index 0000000..d5d90bc --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/GlobalConfigManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b93a8796afa16fd68ef2325d00d4d9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs b/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs new file mode 100644 index 0000000..49dd3d1 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs @@ -0,0 +1,311 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.Rendering; + +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace Mediapipe.Unity +{ + public abstract class GraphRunner : MonoBehaviour + { + public enum ConfigType + { + None, + CPU, + GPU, + OpenGLES, + } + +#pragma warning disable IDE1006 + // TODO: make it static + protected string TAG => GetType().Name; +#pragma warning restore IDE1006 + + [SerializeField] private TextAsset _cpuConfig = null; + [SerializeField] private TextAsset _gpuConfig = null; + [SerializeField] private TextAsset _openGlEsConfig = null; + [SerializeField] private long _timeoutMicrosec = 0; + + private static readonly GlobalInstanceTable _InstanceTable = new GlobalInstanceTable(5); + private static readonly Dictionary _NameTable = new Dictionary(); + + protected RunningMode runningMode { get; private set; } = RunningMode.Async; + private bool _isRunning = false; + + public InferenceMode inferenceMode => configType == ConfigType.CPU ? InferenceMode.CPU : InferenceMode.GPU; + public virtual ConfigType configType + { + get + { + if (GpuManager.IsInitialized) + { +#if UNITY_ANDROID + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3 && _openGlEsConfig != null) + { + return ConfigType.OpenGLES; + } +#endif + if (_gpuConfig != null) + { + return ConfigType.GPU; + } + } + return _cpuConfig != null ? ConfigType.CPU : ConfigType.None; + } + } + public TextAsset textConfig + { + get + { + switch (configType) + { + case ConfigType.CPU: return _cpuConfig; + case ConfigType.GPU: return _gpuConfig; + case ConfigType.OpenGLES: return _openGlEsConfig; + case ConfigType.None: + default: return null; + } + } + } + + public long timeoutMicrosec + { + get => _timeoutMicrosec; + set => _timeoutMicrosec = (long)Mathf.Max(0, value); + } + public long timeoutMillisec + { + get => timeoutMicrosec / 1000; + set => timeoutMicrosec = value * 1000; + } + + public RotationAngle rotation { get; private set; } = 0; + + private Stopwatch _stopwatch; + protected CalculatorGraph calculatorGraph { get; private set; } + protected Timestamp latestTimestamp; + + protected virtual void Start() + { + _InstanceTable.Add(GetInstanceID(), this); + } + + protected virtual void OnDestroy() + { + Stop(); + } + + public WaitForResult WaitForInit(RunningMode runningMode) + { + return new WaitForResult(this, Initialize(runningMode)); + } + + public virtual IEnumerator Initialize(RunningMode runningMode) + { + this.runningMode = runningMode; + + Logger.LogInfo(TAG, $"Config Type = {configType}"); + Logger.LogInfo(TAG, $"Running Mode = {runningMode}"); + + InitializeCalculatorGraph().AssertOk(); + _stopwatch = new Stopwatch(); + _stopwatch.Start(); + + Logger.LogInfo(TAG, "Loading dependent assets..."); + var assetRequests = RequestDependentAssets(); + yield return new WaitWhile(() => assetRequests.Any((request) => request.keepWaiting)); + + var errors = assetRequests.Where((request) => request.isError).Select((request) => request.error).ToList(); + if (errors.Count > 0) + { + foreach (var error in errors) + { + Logger.LogError(TAG, error); + } + throw new InternalException("Failed to prepare dependent assets"); + } + } + + public abstract void StartRun(ImageSource imageSource); + + protected void StartRun(SidePacket sidePacket) + { + calculatorGraph.StartRun(sidePacket).AssertOk(); + _isRunning = true; + } + + public virtual void Stop() + { + if (calculatorGraph != null) + { + if (_isRunning) + { + using (var status = calculatorGraph.CloseAllPacketSources()) + { + if (!status.Ok()) + { + Logger.LogError(TAG, status.ToString()); + } + } + + using (var status = calculatorGraph.WaitUntilDone()) + { + if (!status.Ok()) + { + Logger.LogError(TAG, status.ToString()); + } + } + } + + _isRunning = false; + var _ = _NameTable.Remove(calculatorGraph.mpPtr); + calculatorGraph.Dispose(); + calculatorGraph = null; + } + + if (_stopwatch != null && _stopwatch.IsRunning) + { + _stopwatch.Stop(); + } + } + + protected void AddPacketToInputStream(string streamName, Packet packet) + { + calculatorGraph.AddPacketToInputStream(streamName, packet).AssertOk(); + } + + protected void AddTextureFrameToInputStream(string streamName, TextureFrame textureFrame) + { + latestTimestamp = GetCurrentTimestamp(); + + if (configType == ConfigType.OpenGLES) + { + var gpuBuffer = textureFrame.BuildGpuBuffer(GpuManager.GlCalculatorHelper.GetGlContext()); + AddPacketToInputStream(streamName, new GpuBufferPacket(gpuBuffer, latestTimestamp)); + return; + } + + var imageFrame = textureFrame.BuildImageFrame(); + textureFrame.Release(); + + AddPacketToInputStream(streamName, new ImageFramePacket(imageFrame, latestTimestamp)); + } + + protected bool TryGetNext(OutputStream stream, out TValue value, bool allowBlock, long currentTimestampMicrosec) where TPacket : Packet, new() + { + var result = stream.TryGetNext(out value, allowBlock); + return result || allowBlock || stream.ResetTimestampIfTimedOut(currentTimestampMicrosec, timeoutMicrosec); + } + + protected long GetCurrentTimestampMicrosec() + { + return _stopwatch == null || !_stopwatch.IsRunning ? -1 : _stopwatch.ElapsedTicks / (TimeSpan.TicksPerMillisecond / 1000); + } + + protected Timestamp GetCurrentTimestamp() + { + var microsec = GetCurrentTimestampMicrosec(); + return microsec < 0 ? Timestamp.Unset() : new Timestamp(microsec); + } + + protected Status InitializeCalculatorGraph() + { + calculatorGraph = new CalculatorGraph(); + _NameTable.Add(calculatorGraph.mpPtr, GetInstanceID()); + + // NOTE: There's a simpler way to initialize CalculatorGraph. + // + // calculatorGraph = new CalculatorGraph(config.text); + // + // However, if the config format is invalid, this code does not initialize CalculatorGraph and does not throw exceptions either. + // The problem is that if you call ObserveStreamOutput in this state, the program will crash. + // The following code is not very efficient, but it will return Non-OK status when an invalid configuration is given. + try + { + var baseConfig = textConfig == null ? null : CalculatorGraphConfig.Parser.ParseFromTextFormat(textConfig.text); + if (baseConfig == null) + { + throw new InvalidOperationException("Failed to get the text config. Check if the config is set to GraphRunner"); + } + var status = ConfigureCalculatorGraph(baseConfig); + return !status.Ok() || inferenceMode == InferenceMode.CPU ? status : calculatorGraph.SetGpuResources(GpuManager.GpuResources); + } + catch (Exception e) + { + return Status.FailedPrecondition(e.ToString()); + } + } + + /// + /// Configure and initialize the . + /// + /// + /// This is the main process in .
+ /// At least, calculatorGraph.Initialize must be called here. + /// In addition to that, instances should be initialized. + ///
+ /// + /// A instance corresponding to .
+ /// It can be dynamically modified here. + /// + protected virtual Status ConfigureCalculatorGraph(CalculatorGraphConfig config) + { + return calculatorGraph.Initialize(config); + } + + protected void SetImageTransformationOptions(SidePacket sidePacket, ImageSource imageSource, bool expectedToBeMirrored = false) + { + // NOTE: The origin is left-bottom corner in Unity, and right-top corner in MediaPipe. + rotation = imageSource.rotation.Reverse(); + var inputRotation = rotation; + var isInverted = CoordinateSystem.ImageCoordinate.IsInverted(rotation); + var shouldBeMirrored = imageSource.isHorizontallyFlipped ^ expectedToBeMirrored; + var inputHorizontallyFlipped = isInverted ^ shouldBeMirrored; + var inputVerticallyFlipped = !isInverted; + + if ((inputHorizontallyFlipped && inputVerticallyFlipped) || rotation == RotationAngle.Rotation180) + { + inputRotation = inputRotation.Add(RotationAngle.Rotation180); + inputHorizontallyFlipped = !inputHorizontallyFlipped; + inputVerticallyFlipped = !inputVerticallyFlipped; + } + + Logger.LogDebug($"input_rotation = {inputRotation}, input_horizontally_flipped = {inputHorizontallyFlipped}, input_vertically_flipped = {inputVerticallyFlipped}"); + + sidePacket.Emplace("input_rotation", new IntPacket((int)inputRotation)); + sidePacket.Emplace("input_horizontally_flipped", new BoolPacket(inputHorizontallyFlipped)); + sidePacket.Emplace("input_vertically_flipped", new BoolPacket(inputVerticallyFlipped)); + } + + protected WaitForResult WaitForAsset(string assetName, string uniqueKey, long timeoutMillisec, bool overwrite = false) + { + return new WaitForResult(this, AssetLoader.PrepareAssetAsync(assetName, uniqueKey, overwrite), timeoutMillisec); + } + + protected WaitForResult WaitForAsset(string assetName, long timeoutMillisec, bool overwrite = false) + { + return WaitForAsset(assetName, assetName, timeoutMillisec, overwrite); + } + + protected WaitForResult WaitForAsset(string assetName, string uniqueKey, bool overwrite = false) + { + return new WaitForResult(this, AssetLoader.PrepareAssetAsync(assetName, uniqueKey, overwrite)); + } + + protected WaitForResult WaitForAsset(string assetName, bool overwrite = false) + { + return WaitForAsset(assetName, assetName, overwrite); + } + + protected abstract IList RequestDependentAssets(); + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs.meta new file mode 100644 index 0000000..44e622a --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/GraphRunner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00f8c92dc785a7523b94c869aaead45f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource.meta new file mode 100644 index 0000000..2e07639 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab516f3bbf28a23489219f7a966fa0cc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs new file mode 100644 index 0000000..8e19625 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs @@ -0,0 +1,159 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.Experimental.Rendering; + +namespace Mediapipe.Unity +{ + public abstract class ImageSource : MonoBehaviour + { + [Serializable] + public struct ResolutionStruct + { + public int width; + public int height; + public double frameRate; + + public ResolutionStruct(int width, int height, double frameRate) + { + this.width = width; + this.height = height; + this.frameRate = frameRate; + } + + public ResolutionStruct(Resolution resolution) + { + width = resolution.width; + height = resolution.height; + frameRate = resolution.refreshRate; + } + + public Resolution ToResolution() + { + return new Resolution() { width = width, height = height, refreshRate = (int)frameRate }; + } + + public override string ToString() + { + var aspectRatio = $"{width}x{height}"; + var frameRateStr = frameRate.ToString("#.##"); + return frameRate > 0 ? $"{aspectRatio} ({frameRateStr}Hz)" : aspectRatio; + } + } + + public ResolutionStruct resolution { get; protected set; } + + /// + /// To call this method, the image source must be prepared. + /// + /// + /// that is compatible with the current texture. + /// + public TextureFormat textureFormat => isPrepared ? TextureFormatFor(GetCurrentTexture()) : throw new InvalidOperationException("ImageSource is not prepared"); + public virtual int textureWidth => resolution.width; + public virtual int textureHeight => resolution.height; + /// + /// If does not support frame rate, it returns zero. + /// + public virtual double frameRate => resolution.frameRate; + public float focalLengthPx { get; } = 2.0f; // TODO: calculate at runtime + public virtual bool isHorizontallyFlipped { get; set; } = false; + public virtual bool isVerticallyFlipped { get; } = false; + public virtual bool isFrontFacing { get; } = false; + public virtual RotationAngle rotation { get; } = RotationAngle.Rotation0; + + public abstract string sourceName { get; } + public abstract string[] sourceCandidateNames { get; } + public abstract ResolutionStruct[] availableResolutions { get; } + + /// + /// Once finishes successfully, it will become true. + /// + /// + /// Returns if the image source is prepared. + /// + public abstract bool isPrepared { get; } + + public abstract bool isPlaying { get; } + + /// + /// Choose the source from . + /// + /// + /// You need to call for the change to take effect. + /// + /// The index of + public abstract void SelectSource(int sourceId); + + /// + /// Choose the resolution from . + /// + /// + /// You need to call for the change to take effect. + /// + /// The index of + public void SelectResolution(int resolutionId) + { + var resolutions = availableResolutions; + + if (resolutionId < 0 || resolutionId >= resolutions.Length) + { + throw new ArgumentException($"Invalid resolution ID: {resolutionId}"); + } + + resolution = resolutions[resolutionId]; + } + + /// + /// Prepare image source. + /// If is true, it will reset the image source. + /// + /// + /// When it finishes successfully, will return true. + /// + /// + public abstract IEnumerator Play(); + + /// + /// Resume image source. + /// If is true, it will do nothing. + /// + /// + /// The image source has not been played. + /// + public abstract IEnumerator Resume(); + + /// + /// Pause image source. + /// If is false, it will do nothing. + /// + public abstract void Pause(); + + /// + /// Stop image source. + /// + /// + /// When it finishes successfully, will return false. + /// + public abstract void Stop(); + + /// + /// To call this method, the image source must be prepared. + /// + /// + /// that contains the current image. + /// + public abstract Texture GetCurrentTexture(); + + protected static TextureFormat TextureFormatFor(Texture texture) + { + return GraphicsFormatUtility.GetTextureFormat(texture.graphicsFormat); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs.meta new file mode 100644 index 0000000..e512f61 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78116299de071af7094419302302ec05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs new file mode 100644 index 0000000..e2f632b --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +public enum ImageSourceType +{ + WebCamera = 0, + Image = 1, + Video = 2, + Unknown = 3, +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs.meta new file mode 100644 index 0000000..13c2a71 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/ImageSourceType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e20c591a3836aae1abc65429b7adde1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs new file mode 100644 index 0000000..b7ed72e --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs @@ -0,0 +1,136 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Linq; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class StaticImageSource : ImageSource + { + [SerializeField] private Texture[] _availableSources; + + [SerializeField] + private ResolutionStruct[] _defaultAvailableResolutions = new ResolutionStruct[] { + new ResolutionStruct(512, 512, 0), + new ResolutionStruct(640, 480, 0), + new ResolutionStruct(1280, 720, 0), + }; + + private Texture2D _outputTexture; + private Texture _image; + private Texture image + { + get + { + if (_image == null && _availableSources != null && _availableSources.Length > 0) + { + image = _availableSources[0]; + } + return _image; + } + set + { + _image = value; + resolution = GetDefaultResolution(); + } + } + + public override double frameRate => 0; + + public override string sourceName => image != null ? image.name : null; + + public override string[] sourceCandidateNames => _availableSources?.Select(source => source.name).ToArray(); + + public override ResolutionStruct[] availableResolutions => _defaultAvailableResolutions; + + public override bool isPrepared => _outputTexture != null; + + private bool _isPlaying = false; + public override bool isPlaying => _isPlaying; + + public override void SelectSource(int sourceId) + { + if (sourceId < 0 || sourceId >= _availableSources.Length) + { + throw new ArgumentException($"Invalid source ID: {sourceId}"); + } + + image = _availableSources[sourceId]; + } + + public override IEnumerator Play() + { + if (image == null) + { + throw new InvalidOperationException("Image is not selected"); + } + if (isPlaying) + { + yield break; + } + + InitializeOutputTexture(image); + _isPlaying = true; + yield return null; + } + + public override IEnumerator Resume() + { + if (!isPrepared) + { + throw new InvalidOperationException("Image is not prepared"); + } + _isPlaying = true; + + yield return null; + } + + public override void Pause() + { + _isPlaying = false; + } + public override void Stop() + { + _isPlaying = false; + _outputTexture = null; + } + + public override Texture GetCurrentTexture() + { + return _outputTexture; + } + + private ResolutionStruct GetDefaultResolution() + { + var resolutions = availableResolutions; + + return (resolutions == null || resolutions.Length == 0) ? new ResolutionStruct() : resolutions[0]; + } + + private void InitializeOutputTexture(Texture src) + { + _outputTexture = new Texture2D(textureWidth, textureHeight, TextureFormat.RGBA32, false); + + Texture resizedTexture = new Texture2D(textureWidth, textureHeight, TextureFormat.RGBA32, false); + // TODO: assert ConvertTexture finishes successfully + var _ = Graphics.ConvertTexture(src, resizedTexture); + + var currentRenderTexture = RenderTexture.active; + var tmpRenderTexture = new RenderTexture(resizedTexture.width, resizedTexture.height, 32); + Graphics.Blit(resizedTexture, tmpRenderTexture); + RenderTexture.active = tmpRenderTexture; + + var rect = new UnityEngine.Rect(0, 0, _outputTexture.width, _outputTexture.height); + _outputTexture.ReadPixels(rect, 0, 0); + _outputTexture.Apply(); + + RenderTexture.active = currentRenderTexture; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs.meta new file mode 100644 index 0000000..2d993ff --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/StaticImageSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd7955705ab46c72b9124bb116a2dca9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs new file mode 100644 index 0000000..418f8ee --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs @@ -0,0 +1,378 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using Unity.Collections; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.Experimental.Rendering; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class TextureFrame + { + public class ReleaseEvent : UnityEvent { } + + private const string _TAG = nameof(TextureFrame); + + private static readonly GlobalInstanceTable _InstanceTable = new GlobalInstanceTable(100); + /// + /// A dictionary to look up which native texture belongs to which . + /// + /// + /// Not all the instances are registered. + /// Texture names are queried only when necessary, and the corresponding data will be saved then. + /// + private static readonly Dictionary _NameTable = new Dictionary(); + + private readonly Texture2D _texture; + private IntPtr _nativeTexturePtr = IntPtr.Zero; + private GlSyncPoint _glSyncToken; + + // Buffers that will be used to copy texture data on CPU. + // They won't be initialized until it's necessary. + private Texture2D _textureBuffer; + + private Color32[] _pixelsBuffer; // for WebCamTexture + private Color32[] pixelsBuffer + { + get + { + if (_pixelsBuffer == null) + { + _pixelsBuffer = new Color32[width * height]; + } + return _pixelsBuffer; + } + } + + private readonly Guid _instanceId; + // NOTE: width and height can be accessed from a thread other than Main Thread. + public readonly int width; + public readonly int height; + public readonly TextureFormat format; + + private ImageFormat.Types.Format _format = ImageFormat.Types.Format.Unknown; + public ImageFormat.Types.Format imageFormat + { + get + { + if (_format == ImageFormat.Types.Format.Unknown) + { + _format = format.ToImageFormat(); + } + return _format; + } + } + + public bool isReadable => _texture.isReadable; + + // TODO: determine at runtime + public GpuBufferFormat gpuBufferformat => GpuBufferFormat.kBGRA32; + + /// + /// The event that will be invoked when the TextureFrame is released. + /// +#pragma warning disable IDE1006 // UnityEvent is PascalCase + public readonly ReleaseEvent OnRelease; +#pragma warning restore IDE1006 + + private TextureFrame(Texture2D texture) + { + _texture = texture; + width = texture.width; + height = texture.height; + format = texture.format; + OnRelease = new ReleaseEvent(); + _instanceId = Guid.NewGuid(); + _InstanceTable.Add(_instanceId, this); + } + + public TextureFrame(int width, int height, TextureFormat format) : this(new Texture2D(width, height, format, false)) { } + public TextureFrame(int width, int height) : this(width, height, TextureFormat.RGBA32) { } + + public void CopyTexture(Texture dst) + { + Graphics.CopyTexture(_texture, dst); + } + + public void CopyTextureFrom(Texture src) + { + Graphics.CopyTexture(src, _texture); + } + + public bool ConvertTexture(Texture dst) + { + return Graphics.ConvertTexture(_texture, dst); + } + + public bool ConvertTextureFrom(Texture src) + { + return Graphics.ConvertTexture(src, _texture); + } + + /// + /// Copy texture data from . + /// If format is different from , it converts the format. + /// + /// + /// After calling it, pixel data won't be read from CPU safely. + /// + public bool ReadTextureFromOnGPU(Texture src) + { + if (GetTextureFormat(src) != format) + { + return Graphics.ConvertTexture(src, _texture); + } + Graphics.CopyTexture(src, _texture); + return true; + } + + /// + /// Copy texture data from . + /// + /// + /// This operation is slow. + /// If CPU won't access the pixel data, use instead. + /// + public void ReadTextureFromOnCPU(Texture src) + { + var textureBuffer = LoadToTextureBuffer(src); + SetPixels32(textureBuffer.GetPixels32()); + } + + /// + /// Copy texture data from . + /// + /// + /// In most cases, it should be better to use directly. + /// + public void ReadTextureFromOnCPU(Texture2D src) + { + SetPixels32(src.GetPixels32()); + } + + /// + /// Copy texture data from . + /// + /// + /// The texture from which the pixels are read. + /// Its width and height must match that of the TextureFrame. + /// + /// + /// This operation is slow. + /// If CPU won't access the pixel data, use instead. + /// + public void ReadTextureFromOnCPU(WebCamTexture src) + { + SetPixels32(src.GetPixels32(pixelsBuffer)); + } + + public Color GetPixel(int x, int y) + { + return _texture.GetPixel(x, y); + } + + public Color32[] GetPixels32() + { + return _texture.GetPixels32(); + } + + public void SetPixels32(Color32[] pixels) + { + _texture.SetPixels32(pixels); + _texture.Apply(); + + if (!RevokeNativeTexturePtr()) + { + // If this line was executed, there must be a bug. + Logger.LogError("Failed to revoke the native texture."); + } + } + + public NativeArray GetRawTextureData() where T : struct + { + return _texture.GetRawTextureData(); + } + + /// The texture's native pointer + public IntPtr GetNativeTexturePtr() + { + if (_nativeTexturePtr == IntPtr.Zero) + { + _nativeTexturePtr = _texture.GetNativeTexturePtr(); + var name = (uint)_nativeTexturePtr; + + lock (((ICollection)_NameTable).SyncRoot) + { + if (!AcquireName(name, _instanceId)) + { + throw new InvalidProgramException($"Another instance (id={_instanceId}) is using the specified name ({name}) now"); + } + _NameTable.Add(name, _instanceId); + } + } + return _nativeTexturePtr; + } + + public uint GetTextureName() + { + return (uint)GetNativeTexturePtr(); + } + + public Guid GetInstanceID() + { + return _instanceId; + } + + public ImageFrame BuildImageFrame() + { + return new ImageFrame(imageFormat, width, height, 4 * width, GetRawTextureData()); + } + + public GpuBuffer BuildGpuBuffer(GlContext glContext) + { +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + var glTextureBuffer = new GlTextureBuffer(GetTextureName(), width, height, gpuBufferformat, OnReleaseTextureFrame, glContext); + return new GpuBuffer(glTextureBuffer); +#else + throw new NotSupportedException("This method is only supported on Linux or Android"); +#endif + } + + public void RemoveAllReleaseListeners() + { + OnRelease.RemoveAllListeners(); + } + + // TODO: stop invoking OnRelease when it's already released + public void Release(GlSyncPoint token = null) + { + if (_glSyncToken != null) + { + _glSyncToken.Dispose(); + } + _glSyncToken = token; + OnRelease.Invoke(this); + } + + /// + /// Waits until the GPU has executed all commands up to the sync point. + /// This blocks the CPU, and ensures the commands are complete from the point of view of all threads and contexts. + /// + public void WaitUntilReleased() + { + if (_glSyncToken == null) + { + return; + } + _glSyncToken.Wait(); + _glSyncToken.Dispose(); + _glSyncToken = null; + } + + [AOT.MonoPInvokeCallback(typeof(GlTextureBuffer.DeletionCallback))] + public static void OnReleaseTextureFrame(uint textureName, IntPtr syncTokenPtr) + { + var isIdFound = _NameTable.TryGetValue(textureName, out var _instanceId); + + if (!isIdFound) + { + Logger.LogError(_TAG, $"nameof (name={textureName}) is released, but the owner TextureFrame is not found"); + return; + } + + var isTextureFrameFound = _InstanceTable.TryGetValue(_instanceId, out var textureFrame); + + if (!isTextureFrameFound) + { + Logger.LogWarning(_TAG, $"nameof owner TextureFrame of the released texture (name={textureName}) is already garbage collected"); + return; + } + + var _glSyncToken = syncTokenPtr == IntPtr.Zero ? null : new GlSyncPoint(syncTokenPtr); + textureFrame.Release(_glSyncToken); + } + + /// + /// Remove from if it's stale. + /// If does not exist in , do nothing. + /// + /// + /// If the instance whose id is owns now, it still removes . + /// + /// Return if name is available + private static bool AcquireName(uint name, Guid ownerId) + { + if (_NameTable.TryGetValue(name, out var id)) + { + if (ownerId != id && _InstanceTable.TryGetValue(id, out var _)) + { + // if instance is found, the instance is using the name. + Logger.LogVerbose($"{id} is using {name} now"); + return false; + } + var _ = _NameTable.Remove(name); + } + return true; + } + + private static TextureFormat GetTextureFormat(Texture texture) + { + return GraphicsFormatUtility.GetTextureFormat(texture.graphicsFormat); + } + + /// + /// Remove the texture name from and empty . + /// This method needs to be called when an operation is performed that may change the internal texture. + /// + private bool RevokeNativeTexturePtr() + { + if (_nativeTexturePtr == IntPtr.Zero) + { + return true; + } + + var currentName = GetTextureName(); + if (!_NameTable.Remove(currentName)) + { + return false; + } + _nativeTexturePtr = IntPtr.Zero; + return true; + } + + private Texture2D LoadToTextureBuffer(Texture texture) + { + var textureFormat = GetTextureFormat(texture); + + if (_textureBuffer == null || _textureBuffer.format != textureFormat) + { + _textureBuffer = new Texture2D(width, height, textureFormat, false); + } + + var tmpRenderTexture = RenderTexture.GetTemporary(texture.width, texture.height, 32); + var currentRenderTexture = RenderTexture.active; + RenderTexture.active = tmpRenderTexture; + + Graphics.Blit(texture, tmpRenderTexture); + + var rect = new UnityEngine.Rect(0, 0, Mathf.Min(tmpRenderTexture.width, _textureBuffer.width), Mathf.Min(tmpRenderTexture.height, _textureBuffer.height)); + _textureBuffer.ReadPixels(rect, 0, 0); + _textureBuffer.Apply(); + RenderTexture.active = currentRenderTexture; + RenderTexture.ReleaseTemporary(tmpRenderTexture); + + return _textureBuffer; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs.meta new file mode 100644 index 0000000..203bfd9 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFrame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa7e0da68d497cd578438e238b6a6e7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs new file mode 100644 index 0000000..82f7901 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs @@ -0,0 +1,161 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class TextureFramePool : MonoBehaviour + { + private const string _TAG = nameof(TextureFramePool); + + [SerializeField] private int _poolSize = 10; + + private readonly object _formatLock = new object(); + private int _textureWidth = 0; + private int _textureHeight = 0; + private TextureFormat _format = TextureFormat.RGBA32; + + private Queue _availableTextureFrames; + /// + /// key: TextureFrame's instance ID + /// + private Dictionary _textureFramesInUse; + + /// + /// The total number of texture frames in the pool. + /// + public int frameCount + { + get + { + var availableTextureFramesCount = _availableTextureFrames == null ? 0 : _availableTextureFrames.Count; + var textureFramesInUseCount = _textureFramesInUse == null ? 0 : _textureFramesInUse.Count; + + return availableTextureFramesCount + textureFramesInUseCount; + } + } + + private void Start() + { + _availableTextureFrames = new Queue(_poolSize); + _textureFramesInUse = new Dictionary(); + } + + private void OnDestroy() + { + lock (((ICollection)_availableTextureFrames).SyncRoot) + { + _availableTextureFrames.Clear(); + _availableTextureFrames = null; + } + + lock (((ICollection)_textureFramesInUse).SyncRoot) + { + foreach (var textureFrame in _textureFramesInUse.Values) + { + textureFrame.OnRelease.RemoveListener(OnTextureFrameRelease); + } + _textureFramesInUse.Clear(); + _textureFramesInUse = null; + } + } + + public void ResizeTexture(int textureWidth, int textureHeight, TextureFormat format) + { + lock (_formatLock) + { + _textureWidth = textureWidth; + _textureHeight = textureHeight; + _format = format; + } + } + + public void ResizeTexture(int textureWidth, int textureHeight) + { + ResizeTexture(textureWidth, textureHeight, _format); + } + + public bool TryGetTextureFrame(out TextureFrame outFrame) + { + TextureFrame nextFrame = null; + + lock (((ICollection)_availableTextureFrames).SyncRoot) + { + if (_poolSize <= frameCount) + { + while (_availableTextureFrames.Count > 0) + { + var textureFrame = _availableTextureFrames.Dequeue(); + + if (!IsStale(textureFrame)) + { + nextFrame = textureFrame; + break; + } + } + } + else + { + nextFrame = CreateNewTextureFrame(); + } + } + + if (nextFrame == null) + { + outFrame = null; + return false; + } + + lock (((ICollection)_textureFramesInUse).SyncRoot) + { + _textureFramesInUse.Add(nextFrame.GetInstanceID(), nextFrame); + } + + nextFrame.WaitUntilReleased(); + outFrame = nextFrame; + return true; + } + + private void OnTextureFrameRelease(TextureFrame textureFrame) + { + lock (((ICollection)_textureFramesInUse).SyncRoot) + { + if (!_textureFramesInUse.Remove(textureFrame.GetInstanceID())) + { + // won't be run + Logger.LogWarning(_TAG, "The released texture does not belong to the pool"); + return; + } + + if (frameCount > _poolSize || IsStale(textureFrame)) + { + return; + } + _availableTextureFrames.Enqueue(textureFrame); + } + } + + private bool IsStale(TextureFrame textureFrame) + { + lock (_formatLock) + { + return textureFrame.width != _textureWidth || textureFrame.height != _textureHeight; + } + } + + private TextureFrame CreateNewTextureFrame() + { + var textureFrame = new TextureFrame(_textureWidth, _textureHeight, _format); + textureFrame.OnRelease.AddListener(OnTextureFrameRelease); + + return textureFrame; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs.meta new file mode 100644 index 0000000..b4bf528 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/TextureFramePool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5da564da19cb6b7d8e4f97f269edc5d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs new file mode 100644 index 0000000..e382c6c --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs @@ -0,0 +1,116 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Linq; +using UnityEngine; +using UnityEngine.Video; + +namespace Mediapipe.Unity +{ + public class VideoSource : ImageSource + { + [SerializeField] private VideoClip[] _availableSources; + + private VideoClip _video; + private VideoClip video + { + get + { + if (_video == null && _availableSources != null && _availableSources.Length > 0) + { + video = _availableSources[0]; + } + return _video; + } + set + { + _video = value; + resolution = new ResolutionStruct((int)_video.width, (int)_video.height, _video.frameRate); + } + } + + private VideoPlayer _videoPlayer; + + public override string sourceName => video != null ? video.name : null; + + public override string[] sourceCandidateNames => _availableSources?.Select(source => source.name).ToArray(); + + public override ResolutionStruct[] availableResolutions => video == null ? null : new ResolutionStruct[] { new ResolutionStruct((int)video.width, (int)video.height, video.frameRate) }; + + public override bool isPlaying => _videoPlayer != null && _videoPlayer.isPlaying; + public override bool isPrepared => _videoPlayer != null && _videoPlayer.isPrepared; + + public override void SelectSource(int sourceId) + { + if (sourceId < 0 || sourceId >= _availableSources.Length) + { + throw new ArgumentException($"Invalid source ID: {sourceId}"); + } + + video = _availableSources[sourceId]; + if (_videoPlayer != null) + { + _videoPlayer.clip = video; + } + } + + public override IEnumerator Play() + { + if (video == null) + { + throw new InvalidOperationException("Video is not selected"); + } + _videoPlayer = gameObject.AddComponent(); + _videoPlayer.renderMode = VideoRenderMode.APIOnly; + _videoPlayer.isLooping = true; + _videoPlayer.clip = video; + _videoPlayer.Prepare(); + + yield return new WaitUntil(() => _videoPlayer.isPrepared); + _videoPlayer.Play(); + } + + public override IEnumerator Resume() + { + if (!isPrepared) + { + throw new InvalidOperationException("VideoPlayer is not prepared"); + } + if (!isPlaying) + { + _videoPlayer.Play(); + } + yield return null; + } + + public override void Pause() + { + if (!isPlaying) + { + return; + } + _videoPlayer.Pause(); + } + + public override void Stop() + { + if (_videoPlayer == null) + { + return; + } + _videoPlayer.Stop(); + Destroy(gameObject.GetComponent()); + _videoPlayer = null; + } + + public override Texture GetCurrentTexture() + { + return _videoPlayer != null ? _videoPlayer.texture : null; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs.meta new file mode 100644 index 0000000..8f7b848 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/VideoSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04085488e5fac35599866a2a6fceeda3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs new file mode 100644 index 0000000..59c3d2d --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs @@ -0,0 +1,299 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +#if UNITY_ANDROID +using UnityEngine.Android; +#endif + +namespace Mediapipe.Unity +{ + public class WebCamSource : ImageSource + { + [Tooltip("For the default resolution, the one whose width is closest to this value will be chosen")] + [SerializeField] private int _preferableDefaultWidth = 1280; + + private const string _TAG = nameof(WebCamSource); + + [SerializeField] + private ResolutionStruct[] _defaultAvailableResolutions = new ResolutionStruct[] { + new ResolutionStruct(176, 144, 30), + new ResolutionStruct(320, 240, 30), + new ResolutionStruct(424, 240, 30), + new ResolutionStruct(640, 360, 30), + new ResolutionStruct(640, 480, 30), + new ResolutionStruct(848, 480, 30), + new ResolutionStruct(960, 540, 30), + new ResolutionStruct(1280, 720, 30), + new ResolutionStruct(1600, 896, 30), + new ResolutionStruct(1920, 1080, 30), + }; + + private static readonly object _PermissionLock = new object(); + private static bool _IsPermitted = false; + + private WebCamTexture _webCamTexture; + private WebCamTexture webCamTexture + { + get => _webCamTexture; + set + { + if (_webCamTexture != null) + { + _webCamTexture.Stop(); + } + _webCamTexture = value; + } + } + + public override int textureWidth => !isPrepared ? 0 : webCamTexture.width; + public override int textureHeight => !isPrepared ? 0 : webCamTexture.height; + + public override bool isVerticallyFlipped => isPrepared && webCamTexture.videoVerticallyMirrored; + public override bool isFrontFacing => isPrepared && (webCamDevice is WebCamDevice valueOfWebCamDevice) && valueOfWebCamDevice.isFrontFacing; + public override RotationAngle rotation => !isPrepared ? RotationAngle.Rotation0 : (RotationAngle)webCamTexture.videoRotationAngle; + + private WebCamDevice? _webCamDevice; + private WebCamDevice? webCamDevice + { + get => _webCamDevice; + set + { + if (_webCamDevice is WebCamDevice valueOfWebCamDevice) + { + if (value is WebCamDevice valueOfValue && valueOfValue.name == valueOfWebCamDevice.name) + { + // not changed + return; + } + } + else if (value == null) + { + // not changed + return; + } + _webCamDevice = value; + resolution = GetDefaultResolution(); + } + } + public override string sourceName => (webCamDevice is WebCamDevice valueOfWebCamDevice) ? valueOfWebCamDevice.name : null; + + private WebCamDevice[] _availableSources; + private WebCamDevice[] availableSources + { + get + { + if (_availableSources == null) + { + _availableSources = WebCamTexture.devices; + } + + return _availableSources; + } + set => _availableSources = value; + } + + public override string[] sourceCandidateNames => availableSources?.Select(device => device.name).ToArray(); + +#pragma warning disable IDE0025 + public override ResolutionStruct[] availableResolutions + { + get + { +#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR + if (webCamDevice is WebCamDevice valueOfWebCamDevice) { + return valueOfWebCamDevice.availableResolutions.Select(resolution => new ResolutionStruct(resolution)).ToArray(); + } +#endif + return webCamDevice == null ? null : _defaultAvailableResolutions; + } + } +#pragma warning restore IDE0025 + + public override bool isPrepared => webCamTexture != null; + public override bool isPlaying => webCamTexture != null && webCamTexture.isPlaying; + private bool _isInitialized; + + private IEnumerator Start() + { + yield return GetPermission(); + + if (!_IsPermitted) + { + _isInitialized = true; + yield break; + } + + availableSources = WebCamTexture.devices; + + if (availableSources != null && availableSources.Length > 0) + { + webCamDevice = availableSources[0]; + } + + _isInitialized = true; + } + + private IEnumerator GetPermission() + { + lock (_PermissionLock) + { + if (_IsPermitted) + { + yield break; + } + +#if UNITY_ANDROID + if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) + { + Permission.RequestUserPermission(Permission.Camera); + yield return new WaitForSeconds(0.1f); + } +#elif UNITY_IOS + if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) { + yield return Application.RequestUserAuthorization(UserAuthorization.WebCam); + } +#endif + +#if UNITY_ANDROID + if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) + { + Logger.LogWarning(_TAG, "Not permitted to use Camera"); + yield break; + } +#elif UNITY_IOS + if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) { + Logger.LogWarning(_TAG, "Not permitted to use WebCam"); + yield break; + } +#endif + _IsPermitted = true; + + yield return new WaitForEndOfFrame(); + } + } + + public override void SelectSource(int sourceId) + { + if (sourceId < 0 || sourceId >= availableSources.Length) + { + throw new ArgumentException($"Invalid source ID: {sourceId}"); + } + + webCamDevice = availableSources[sourceId]; + } + + public override IEnumerator Play() + { + yield return new WaitUntil(() => _isInitialized); + if (!_IsPermitted) + { + throw new InvalidOperationException("Not permitted to access cameras"); + } + + InitializeWebCamTexture(); + webCamTexture.Play(); + yield return WaitForWebCamTexture(); + } + + public override IEnumerator Resume() + { + if (!isPrepared) + { + throw new InvalidOperationException("WebCamTexture is not prepared yet"); + } + if (!webCamTexture.isPlaying) + { + webCamTexture.Play(); + } + yield return WaitForWebCamTexture(); + } + + public override void Pause() + { + if (isPlaying) + { + webCamTexture.Pause(); + } + } + + public override void Stop() + { + if (webCamTexture != null) + { + webCamTexture.Stop(); + } + webCamTexture = null; + } + + public override Texture GetCurrentTexture() + { + return webCamTexture; + } + + private ResolutionStruct GetDefaultResolution() + { + var resolutions = availableResolutions; + return resolutions == null || resolutions.Length == 0 ? new ResolutionStruct() : resolutions.OrderBy(resolution => resolution, new ResolutionStructComparer(_preferableDefaultWidth)).First(); + } + + private void InitializeWebCamTexture() + { + Stop(); + if (webCamDevice is WebCamDevice valueOfWebCamDevice) + { + webCamTexture = new WebCamTexture(valueOfWebCamDevice.name, resolution.width, resolution.height, (int)resolution.frameRate); + return; + } + throw new InvalidOperationException("Cannot initialize WebCamTexture because WebCamDevice is not selected"); + } + + private IEnumerator WaitForWebCamTexture() + { + const int timeoutFrame = 2000; + var count = 0; + Logger.LogVerbose("Waiting for WebCamTexture to start"); + yield return new WaitUntil(() => count++ > timeoutFrame || webCamTexture.width > 16); + + if (webCamTexture.width <= 16) + { + throw new TimeoutException("Failed to start WebCam"); + } + } + + private class ResolutionStructComparer : IComparer + { + private readonly int _preferableDefaultWidth; + + public ResolutionStructComparer(int preferableDefaultWidth) + { + _preferableDefaultWidth = preferableDefaultWidth; + } + + public int Compare(ResolutionStruct a, ResolutionStruct b) + { + var aDiff = Mathf.Abs(a.width - _preferableDefaultWidth); + var bDiff = Mathf.Abs(b.width - _preferableDefaultWidth); + if (aDiff != bDiff) + { + return aDiff - bDiff; + } + if (a.height != b.height) + { + // prefer smaller height + return a.height - b.height; + } + // prefer smaller frame rate + return (int)(a.frameRate - b.frameRate); + } + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs.meta new file mode 100644 index 0000000..4a670eb --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSource/WebCamSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 498146e99d4934673bd948c8be11227e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs new file mode 100644 index 0000000..48c8ac5 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + public static class ImageSourceProvider + { + private static ImageSource _ImageSource; + public static ImageSource ImageSource + { + get => _ImageSource; + set + { + if (value != null && !value.enabled) + { + value.enabled = true; + } + _ImageSource = value; + } + } + + public static ImageSourceType CurrentSourceType + { + get + { + if (_ImageSource is WebCamSource) + { + return ImageSourceType.WebCamera; + } + if (_ImageSource is StaticImageSource) + { + return ImageSourceType.Image; + } + if (_ImageSource is VideoSource) + { + return ImageSourceType.Video; + } + return ImageSourceType.Unknown; + } + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs.meta new file mode 100644 index 0000000..4694fcb --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 703949cb153f043aca7381a8f9b21a86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs new file mode 100644 index 0000000..25b9028 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs @@ -0,0 +1,131 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public abstract class ImageSourceSolution : Solution where T : GraphRunner + { + [SerializeField] protected Screen screen; + [SerializeField] protected T graphRunner; + [SerializeField] protected TextureFramePool textureFramePool; + + private Coroutine _coroutine; + + public RunningMode runningMode; + + public long timeoutMillisec + { + get => graphRunner.timeoutMillisec; + set => graphRunner.timeoutMillisec = value; + } + + public override void Play() + { + if (_coroutine != null) + { + Stop(); + } + base.Play(); + _coroutine = StartCoroutine(Run()); + } + + public override void Pause() + { + base.Pause(); + ImageSourceProvider.ImageSource.Pause(); + } + + public override void Resume() + { + base.Resume(); + var _ = StartCoroutine(ImageSourceProvider.ImageSource.Resume()); + } + + public override void Stop() + { + base.Stop(); + StopCoroutine(_coroutine); + ImageSourceProvider.ImageSource.Stop(); + graphRunner.Stop(); + } + + private IEnumerator Run() + { + var graphInitRequest = graphRunner.WaitForInit(runningMode); + var imageSource = ImageSourceProvider.ImageSource; + + yield return imageSource.Play(); + + if (!imageSource.isPrepared) + { + Logger.LogError(TAG, "Failed to start ImageSource, exiting..."); + yield break; + } + + // Use RGBA32 as the input format. + // TODO: When using GpuBuffer, MediaPipe assumes that the input format is BGRA, so the following code must be fixed. + textureFramePool.ResizeTexture(imageSource.textureWidth, imageSource.textureHeight, TextureFormat.RGBA32); + SetupScreen(imageSource); + + yield return graphInitRequest; + if (graphInitRequest.isError) + { + Logger.LogError(TAG, graphInitRequest.error); + yield break; + } + + OnStartRun(); + graphRunner.StartRun(imageSource); + + var waitWhilePausing = new WaitWhile(() => isPaused); + + while (true) + { + if (isPaused) + { + yield return waitWhilePausing; + } + + if (!textureFramePool.TryGetTextureFrame(out var textureFrame)) + { + yield return new WaitForEndOfFrame(); + continue; + } + + // Copy current image to TextureFrame + ReadFromImageSource(imageSource, textureFrame); + AddTextureFrameToInputStream(textureFrame); + yield return new WaitForEndOfFrame(); + + if (runningMode.IsSynchronous()) + { + RenderCurrentFrame(textureFrame); + yield return WaitForNextValue(); + } + } + } + + protected virtual void SetupScreen(ImageSource imageSource) + { + // NOTE: The screen will be resized later, keeping the aspect ratio. + screen.Initialize(imageSource); + } + + protected virtual void RenderCurrentFrame(TextureFrame textureFrame) + { + screen.ReadSync(textureFrame); + } + + protected abstract void OnStartRun(); + + protected abstract void AddTextureFrameToInputStream(TextureFrame textureFrame); + + protected abstract IEnumerator WaitForNextValue(); + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs.meta new file mode 100644 index 0000000..a6af36b --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/ImageSourceSolution.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7573abd3c3f9972e964d5c526c34e0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs b/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs new file mode 100644 index 0000000..99521be --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + [System.Serializable] + public enum InferenceMode + { + GPU, + CPU, + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs.meta new file mode 100644 index 0000000..131e770 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/InferenceMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d95cf1e3a8fe6741295a3b42972dec58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs b/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs new file mode 100644 index 0000000..6cd8f48 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs @@ -0,0 +1,264 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using LogLevel = Mediapipe.Unity.Logger.LogLevel; + +namespace Mediapipe.Unity +{ + public class MemoizedLogger : IExtendedLogger + { + public readonly struct LogStruct + { + public readonly LogLevel logLevel; + public readonly string tag; + public readonly object message; + public readonly DateTime utcTime; + + public LogStruct(LogLevel logLevel, string tag, object message) + { + this.logLevel = logLevel; + this.tag = tag; + this.message = message; + utcTime = DateTime.UtcNow; + } + + public LogStruct(LogType logType, string tag, object message) : this(GetLogLevelFromLogType(logType), tag, message) { } + + private static LogLevel GetLogLevelFromLogType(LogType logType) + { + switch (logType) + { + case LogType.Error: + case LogType.Exception: + { + return LogLevel.Error; + } + case LogType.Warning: + { + return LogLevel.Warn; + } + case LogType.Assert: + case LogType.Log: + default: + { + return LogLevel.Info; + } + } + } + } + + public MemoizedLogger(int historySize = 0) + { + this.historySize = historySize; + } + + private int _historySize; + public int historySize + { + get => _historySize; + set + { + _historySize = value; + + while (_historySize < histories.Count) + { + var _ = histories.Dequeue(); + } + } + } + + private Queue _histories; + public Queue histories + { + get + { + if (_histories == null) + { + _histories = new Queue(_historySize); + } + return _histories; + } + } + + public delegate void LogOutputEventHandler(LogStruct logStruct); + public event LogOutputEventHandler OnLogOutput; + + private readonly ILogger _logger = Debug.unityLogger; + + public LogType filterLogType + { + get => _logger.filterLogType; + set => _logger.filterLogType = value; + } + + public bool logEnabled + { + get => _logger.logEnabled; + set => _logger.logEnabled = value; + } + + public ILogHandler logHandler + { + get => _logger.logHandler; + set => _logger.logHandler = value; + } + + public bool IsLogTypeAllowed(LogType logType) + { + return true; + } + + public void Log(object message) + { + _logger.Log(message); + RecordInfoLog(null, message); + } + + public void Log(string tag, object message) + { + _logger.Log(tag, message); + RecordInfoLog(tag, message); + } + + public void Log(string tag, object message, UnityEngine.Object context) + { + _logger.Log(tag, message, context); + RecordInfoLog(tag, message); + } + + public void Log(LogType logType, object message) + { + _logger.Log(logType, message); + RecordLog(logType, null, message); + } + + public void Log(LogType logType, object message, UnityEngine.Object context) + { + _logger.Log(logType, message, context); + RecordLog(logType, null, message); + } + + public void Log(LogType logType, string tag, object message) + { + _logger.Log(logType, tag, message); + RecordLog(logType, tag, message); + } + + public void Log(LogType logType, string tag, object message, UnityEngine.Object context) + { + _logger.Log(logType, tag, message, context); + RecordLog(logType, tag, message); + } + + public void Log(LogLevel logLevel, string tag, object message, UnityEngine.Object context) + { + _logger.Log(logLevel.GetLogType(), tag, message, context); + RecordLog(new LogStruct(logLevel, tag, message)); + } + + public void Log(LogLevel logLevel, string tag, object message) + { + _logger.Log(logLevel.GetLogType(), tag, message); + RecordLog(new LogStruct(logLevel, tag, message)); + } + + public void Log(LogLevel logLevel, object message, UnityEngine.Object context) + { + _logger.Log(logLevel.GetLogType(), message, context); + RecordLog(new LogStruct(logLevel, null, message)); + } + + public void Log(LogLevel logLevel, object message) + { + _logger.Log(logLevel.GetLogType(), message); + RecordLog(new LogStruct(logLevel, null, message)); + } + + public void LogWarning(string tag, object message) + { + _logger.LogWarning(tag, message); + RecordWarnLog(tag, message); + } + + public void LogWarning(string tag, object message, UnityEngine.Object context) + { + _logger.LogWarning(tag, message, context); + RecordWarnLog(tag, message); + } + + public void LogError(string tag, object message) + { + _logger.LogError(tag, message); + RecordErrorLog(tag, message); + } + + public void LogError(string tag, object message, UnityEngine.Object context) + { + _logger.LogError(tag, message, context); + RecordErrorLog(tag, message); + } + + public void LogFormat(LogType logType, string format, params object[] args) + { + _logger.LogFormat(logType, format, args); + } + + public void LogFormat(LogType logType, UnityEngine.Object context, string format, params object[] args) + { + _logger.LogFormat(logType, context, format, args); + } + + public void LogException(Exception exception) + { + _logger.LogException(exception); + RecordErrorLog(null, exception); + } + + public void LogException(Exception exception, UnityEngine.Object context) + { + _logger.LogException(exception, context); + RecordErrorLog(null, exception); + } + + public void RecordLog(LogStruct log) + { + lock (((ICollection)histories).SyncRoot) + { + while (histories.Count > 0 && _historySize <= histories.Count) + { + var _ = histories.Dequeue(); + } + histories.Enqueue(log); + OnLogOutput?.Invoke(log); + } + } + + private void RecordLog(LogType logType, string tag, object message) + { + RecordLog(new LogStruct(logType, tag, message)); + } + + private void RecordInfoLog(string tag, object message) + { + RecordLog(new LogStruct(LogLevel.Info, tag, message)); + } + + private void RecordWarnLog(string tag, object message) + { + RecordLog(new LogStruct(LogLevel.Warn, tag, message)); + } + + private void RecordErrorLog(string tag, object message) + { + RecordLog(new LogStruct(LogLevel.Error, tag, message)); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs.meta new file mode 100644 index 0000000..f1015c2 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/MemoizedLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00164446b902a4f99ae323de716782fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs b/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs new file mode 100644 index 0000000..5b14673 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + [System.Serializable] + public enum RunningMode + { + Async, + NonBlockingSync, + Sync, + } + + public static class RunningModeExtension + { + public static bool IsSynchronous(this RunningMode runningMode) + { + return runningMode == RunningMode.Sync || runningMode == RunningMode.NonBlockingSync; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs.meta new file mode 100644 index 0000000..feae0cb --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/RunningMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e82590f067b6f1b96ac9dadddcd9ab26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/Screen.cs b/Assets/MediaPipeUnity/Common/Scripts/Screen.cs new file mode 100644 index 0000000..2f11273 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Screen.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; +using UnityEngine.UI; + +namespace Mediapipe.Unity +{ + public class Screen : MonoBehaviour + { + [SerializeField] private RawImage _screen; + + private ImageSource _imageSource; + + public Texture texture + { + private get => _screen.texture; + set => _screen.texture = value; + } + + public UnityEngine.Rect uvRect + { + set => _screen.uvRect = value; + } + + public void Initialize(ImageSource imageSource) + { + _imageSource = imageSource; + + Resize(_imageSource.textureWidth, _imageSource.textureHeight); + Rotate(_imageSource.rotation.Reverse()); + ResetUvRect(RunningMode.Async); + texture = imageSource.GetCurrentTexture(); + } + + public void Resize(int width, int height) + { + _screen.rectTransform.sizeDelta = new Vector2(width, height); + } + + public void Rotate(RotationAngle rotationAngle) + { + _screen.rectTransform.localEulerAngles = rotationAngle.GetEulerAngles(); + } + + public void ReadSync(TextureFrame textureFrame) + { + if (!(texture is Texture2D)) + { + texture = new Texture2D(_imageSource.textureWidth, _imageSource.textureHeight, TextureFormat.RGBA32, false); + ResetUvRect(RunningMode.Sync); + } + textureFrame.CopyTexture(texture); + } + + private void ResetUvRect(RunningMode runningMode) + { + var rect = new UnityEngine.Rect(0, 0, 1, 1); + + if (_imageSource.isVerticallyFlipped && runningMode == RunningMode.Async) + { + // In Async mode, we don't need to flip the screen vertically since the image will be copied on CPU. + rect = FlipVertically(rect); + } + + if (_imageSource.isFrontFacing) + { + // Flip the image (not the screen) horizontally. + // It should be taken into account that the image will be rotated later. + var rotation = _imageSource.rotation; + + if (rotation == RotationAngle.Rotation0 || rotation == RotationAngle.Rotation180) + { + rect = FlipHorizontally(rect); + } + else + { + rect = FlipVertically(rect); + } + } + + uvRect = rect; + } + + private UnityEngine.Rect FlipHorizontally(UnityEngine.Rect rect) + { + return new UnityEngine.Rect(1 - rect.x, rect.y, -rect.width, rect.height); + } + + private UnityEngine.Rect FlipVertically(UnityEngine.Rect rect) + { + return new UnityEngine.Rect(rect.x, 1 - rect.y, rect.width, -rect.height); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/Screen.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/Screen.cs.meta new file mode 100644 index 0000000..e0c40e9 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Screen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 827c4431af677e057aa6f14170d0785c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/Solution.cs b/Assets/MediaPipeUnity/Common/Scripts/Solution.cs new file mode 100644 index 0000000..813c66a --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Solution.cs @@ -0,0 +1,117 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public abstract class Solution : MonoBehaviour + { +#pragma warning disable IDE1006 + // TODO: make it static + protected virtual string TAG => GetType().Name; +#pragma warning restore IDE1006 + + public Bootstrap bootstrap; + protected bool isPaused; + + protected virtual IEnumerator Start() + { + bootstrap = FindBootstrap(); + yield return new WaitUntil(() => bootstrap.isFinished); + + Play(); + } + + /// + /// Start the main program from the beginning. + /// + public virtual void Play() + { + isPaused = false; + } + + /// + /// Pause the main program. + /// + public virtual void Pause() + { + isPaused = true; + } + + /// + /// Resume the main program. + /// If the main program has not begun, it'll do nothing. + /// + public virtual void Resume() + { + isPaused = false; + } + + /// + /// Stops the main program. + /// + public virtual void Stop() + { + isPaused = true; + } + + protected static void SetupAnnotationController(AnnotationController annotationController, ImageSource imageSource, bool expectedToBeMirrored = false) where T : HierarchicalAnnotation + { + annotationController.isMirrored = expectedToBeMirrored ^ imageSource.isHorizontallyFlipped ^ imageSource.isFrontFacing; + annotationController.rotationAngle = imageSource.rotation.Reverse(); + } + + protected static void ReadFromImageSource(ImageSource imageSource, TextureFrame textureFrame) + { + var sourceTexture = imageSource.GetCurrentTexture(); + + // For some reason, when the image is coiped on GPU, latency tends to be high. + // So even when OpenGL ES is available, use CPU to copy images. + var textureType = sourceTexture.GetType(); + + if (textureType == typeof(WebCamTexture)) + { + textureFrame.ReadTextureFromOnCPU((WebCamTexture)sourceTexture); + } + else if (textureType == typeof(Texture2D)) + { + textureFrame.ReadTextureFromOnCPU((Texture2D)sourceTexture); + } + else + { + textureFrame.ReadTextureFromOnCPU(sourceTexture); + } + } + + protected Bootstrap FindBootstrap() + { + var bootstrapObj = GameObject.Find("Bootstrap"); + + if (bootstrapObj != null) + { + return bootstrapObj.GetComponent(); + } + + Logger.LogWarning(TAG, "Global Bootstrap instance is not found (maybe running a sample scene directly), " + + "so activating a fallback Bootstrap instance attached to each Solution object"); + + var bootstrap = GetComponent(); + bootstrap.enabled = true; + + // hide menu button when trying a single scene. + DisableMenuButton(); + return bootstrap; + } + + private void DisableMenuButton() + { + var menuButton = GameObject.Find("MenuButton"); + menuButton.SetActive(false); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/Solution.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/Solution.cs.meta new file mode 100644 index 0000000..8dabeb8 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/Solution.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 589adc9f9488f9d8eaee5a408719b452 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs b/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs new file mode 100644 index 0000000..e112ff2 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; + +namespace Mediapipe.Unity +{ + public class StartSceneController : MonoBehaviour + { + private const string _TAG = nameof(Bootstrap); + + [SerializeField] private Image _screen; + [SerializeField] private GameObject _consolePrefab; + + private IEnumerator Start() + { + var _ = Instantiate(_consolePrefab, _screen.transform); + + var bootstrap = GetComponent(); + + yield return new WaitUntil(() => bootstrap.isFinished); + + DontDestroyOnLoad(gameObject); + + Logger.LogInfo(_TAG, "Loading the first scene..."); + var sceneLoadReq = SceneManager.LoadSceneAsync(1); + yield return new WaitUntil(() => sceneLoadReq.isDone); + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs.meta new file mode 100644 index 0000000..dc3b2df --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/StartSceneController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ca6b5afaa693af02957f0d68cf058d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs b/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs new file mode 100644 index 0000000..6fbb3b2 --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using UnityEngine; + +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace Mediapipe.Unity +{ + public class WaitForResult : CustomYieldInstruction + { + public object result { get; private set; } + + protected object tmpResult; + protected bool isDone = false; + + private readonly MonoBehaviour _runner; + private readonly IEnumerator _inner; + private readonly Coroutine _coroutine; + + public bool isError { get; private set; } = false; + public Exception error { get; private set; } + public override bool keepWaiting => !isDone && !isError; + + public WaitForResult(MonoBehaviour runner, IEnumerator inner, long timeoutMillisec = long.MaxValue) + { + _runner = runner; + _inner = inner; + _coroutine = runner.StartCoroutine(Run(timeoutMillisec)); + } + + private IEnumerator Run(long timeoutMillisec) + { + var stopwatch = new Stopwatch(); + stopwatch.Start(); + + while (true) + { + try + { + if (stopwatch.ElapsedMilliseconds > timeoutMillisec) + { + _runner.StopCoroutine(_coroutine); + throw new TimeoutException($"{stopwatch.ElapsedMilliseconds}ms has passed"); + } + if (!_inner.MoveNext()) + { + break; + } + tmpResult = _inner.Current; + } + catch (Exception e) + { + isError = true; + error = e; + yield break; + } + yield return tmpResult; + } + Done(tmpResult); + } + + protected virtual void Done(object result) + { + this.result = result; + isDone = true; + } + } + + public class WaitForResult : WaitForResult + { + public new T result { get; private set; } + + public WaitForResult(MonoBehaviour runner, IEnumerator inner, long timeoutMillisec = long.MaxValue) : base(runner, inner, timeoutMillisec) { } + + protected override void Done(object result) + { + this.result = (T)result; + isDone = true; + } + } +} diff --git a/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs.meta b/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs.meta new file mode 100644 index 0000000..90866df --- /dev/null +++ b/Assets/MediaPipeUnity/Common/Scripts/WaitForResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 374b5ec183b8225d0ac8b0664812f5f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/WeSign_extractor.unity b/Assets/MediaPipeUnity/WeSign_extractor.unity new file mode 100644 index 0000000..96aed09 --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor.unity @@ -0,0 +1,730 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &560904344 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 560904345} + - component: {fileID: 560904348} + - component: {fileID: 560904347} + - component: {fileID: 560904346} + m_Layer: 5 + m_Name: Screen + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &560904345 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 560904344} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1475592761} + m_Father: {fileID: 884590458} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &560904346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 560904344} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 827c4431af677e057aa6f14170d0785c, type: 3} + m_Name: + m_EditorClassIdentifier: + _screen: {fileID: 0} +--- !u!114 &560904347 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 560904344} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &560904348 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 560904344} + m_CullTransparentMesh: 1 +--- !u!1 &858349201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 858349204} + - component: {fileID: 858349203} + - component: {fileID: 858349202} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &858349202 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858349201} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &858349203 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858349201} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &858349204 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858349201} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &869147449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 869147450} + - component: {fileID: 869147451} + m_Layer: 0 + m_Name: OfficialSolution + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &869147450 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 869147449} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &869147451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 869147449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 043ccd99cf82b3cc9bf2e00956ce2b93, type: 3} + m_Name: + m_EditorClassIdentifier: + _configAsset: {fileID: 4900000, guid: 6288c43cdca97374782dac1ea87aa029, type: 3} + _screen: {fileID: 560904347} + _width: 640 + _height: 480 + _fps: 30 + _poseLandmarkListAnnotationController: {fileID: 1475592763} +--- !u!1 &884590454 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 884590458} + - component: {fileID: 884590457} + - component: {fileID: 884590456} + - component: {fileID: 884590455} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &884590455 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884590454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &884590456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884590454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &884590457 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884590454} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 1 + m_Camera: {fileID: 1522608648} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &884590458 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884590454} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 560904345} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1001 &937709944 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1475592761} + m_Modifications: + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462411, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + propertyPath: m_Name + value: PoseLandmarkList Annotation + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} +--- !u!4 &937709945 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + m_PrefabInstance: {fileID: 937709944} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1475592760 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1475592761} + - component: {fileID: 1475592763} + m_Layer: 5 + m_Name: AnnotationLayer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1475592761 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1475592760} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 937709945} + m_Father: {fileID: 560904345} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1475592763 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1475592760} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70c2b36b394190968977c6493e60e0af, type: 3} + m_Name: + m_EditorClassIdentifier: + annotation: {fileID: 2100643019} + _visualizeZ: 0 +--- !u!1 &1522608646 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1522608649} + - component: {fileID: 1522608648} + - component: {fileID: 1522608647} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1522608647 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522608646} + m_Enabled: 1 +--- !u!20 &1522608648 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522608646} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1522608649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522608646} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1802405420 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1802405422} + - component: {fileID: 1802405421} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1802405421 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1802405420} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1802405422 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1802405420} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &2100643019 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} + m_PrefabInstance: {fileID: 937709944} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39bac9dd52c31ae7aa01a7383bc44853, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/MediaPipeUnity/WeSign_extractor.unity.meta b/Assets/MediaPipeUnity/WeSign_extractor.unity.meta new file mode 100644 index 0000000..4274284 --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 14d8a9174a4263d83bdc4e90eb9a2ef7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt b/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt new file mode 100644 index 0000000..76bb646 --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt @@ -0,0 +1,94 @@ +# Copyright 2019 The MediaPipe Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Copied from mediapipe/graphs/holistic_tracking/holistic_tracking_gpu.pbtxt +# +# CHANGES: +# - Add ImageTransformationCalculator and rotate the input +# - Remove AnnotationOverlayCalculator + +# Tracks and renders pose + hands + face landmarks. + +# CPU image. (ImageFrame) +input_stream: "input_video" + +output_stream: "pose_landmarks" +output_stream: "pose_world_landmarks" +output_stream: "segmentation_mask" +output_stream: "pose_roi" +output_stream: "pose_detection" +output_stream: "face_landmarks" +output_stream: "left_hand_landmarks" +output_stream: "right_hand_landmarks" + +# Throttles the images flowing downstream for flow control. It passes through +# the very first incoming image unaltered, and waits for downstream nodes +# (calculators and subgraphs) in the graph to finish their tasks before it +# passes through another image. All images that come in while waiting are +# dropped, limiting the number of in-flight images in most part of the graph to +# 1. This prevents the downstream nodes from queuing up incoming images and data +# excessively, which leads to increased latency and memory usage, unwanted in +# real-time mobile applications. It also eliminates unnecessarily computation, +# e.g., the output produced by a node may get dropped downstream if the +# subsequent nodes are still busy processing previous inputs. +node { + calculator: "FlowLimiterCalculator" + input_stream: "input_video" + input_stream: "FINISHED:pose_landmarks" + input_stream_info: { + tag_index: "FINISHED" + back_edge: true + } + output_stream: "throttled_input_video" + node_options: { + [type.googleapis.com/mediapipe.FlowLimiterCalculatorOptions] { + max_in_flight: 1 + max_in_queue: 1 + # Timeout is disabled (set to 0) as first frame processing can take more + # than 1 second. + in_flight_timeout: 0 + } + } +} + +node: { + calculator: "ImageTransformationCalculator" + input_stream: "IMAGE:throttled_input_video" + output_stream: "IMAGE:transformed_input_video" + node_options: { + [type.googleapis.com/mediapipe.ImageTransformationCalculatorOptions] { + flip_vertically: true + } + } +} + + +node { + calculator: "HolisticLandmarkCpu" + input_stream: "IMAGE:transformed_input_video" + output_stream: "POSE_LANDMARKS:pose_landmarks" + output_stream: "WORLD_LANDMARKS:pose_world_landmarks" + output_stream: "SEGMENTATION_MASK:segmentation_mask_rotated" + output_stream: "POSE_ROI:pose_roi" + output_stream: "POSE_DETECTION:pose_detection" + output_stream: "FACE_LANDMARKS:face_landmarks" + output_stream: "LEFT_HAND_LANDMARKS:left_hand_landmarks" + output_stream: "RIGHT_HAND_LANDMARKS:right_hand_landmarks" +} + +node: { + calculator: "ImageTransformationCalculator" + input_stream: "IMAGE:segmentation_mask_rotated" + output_stream: "IMAGE:segmentation_mask" +} \ No newline at end of file diff --git a/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt.meta b/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt.meta new file mode 100644 index 0000000..aa730fc --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor_cpu.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6288c43cdca97374782dac1ea87aa029 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt b/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt new file mode 100644 index 0000000..75d9a07 --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt @@ -0,0 +1,101 @@ +# Copyright 2019 The MediaPipe Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Copied from mediapipe/graphs/holistic_tracking/holistic_tracking_gpu.pbtxt +# +# CHANGES: +# - `input_video` is ImageFrame (ImageFrameToGpuBufferCalculator converts it into GpuBuffer) +# - Add ImageTransformationCalculator and rotate the input +# - Remove AnnotationOverlayCalculator + +# Tracks and renders pose + hands + face landmarks. + +# ImageFrame +input_stream: "input_video" + +output_stream: "pose_landmarks" +output_stream: "pose_world_landmarks" +output_stream: "segmentation_mask" +output_stream: "pose_roi" +output_stream: "pose_detection" +output_stream: "face_landmarks" +output_stream: "left_hand_landmarks" +output_stream: "right_hand_landmarks" + +# Throttles the images flowing downstream for flow control. It passes through +# the very first incoming image unaltered, and waits for downstream nodes +# (calculators and subgraphs) in the graph to finish their tasks before it +# passes through another image. All images that come in while waiting are +# dropped, limiting the number of in-flight images in most part of the graph to +# 1. This prevents the downstream nodes from queuing up incoming images and data +# excessively, which leads to increased latency and memory usage, unwanted in +# real-time mobile applications. It also eliminates unnecessarily computation, +# e.g., the output produced by a node may get dropped downstream if the +# subsequent nodes are still busy processing previous inputs. +node { + calculator: "FlowLimiterCalculator" + input_stream: "input_video" + input_stream: "FINISHED:pose_landmarks" + input_stream_info: { + tag_index: "FINISHED" + back_edge: true + } + output_stream: "throttled_input_video" + node_options: { + [type.googleapis.com/mediapipe.FlowLimiterCalculatorOptions] { + max_in_flight: 1 + max_in_queue: 1 + # Timeout is disabled (set to 0) as first frame processing can take more + # than 1 second. + in_flight_timeout: 0 + } + } +} + +node: { + calculator: "ImageFrameToGpuBufferCalculator" + input_stream: "throttled_input_video" + output_stream: "throttled_input_video_gpu" +} + +node: { + calculator: "ImageTransformationCalculator" + input_stream: "IMAGE_GPU:throttled_input_video_gpu" + output_stream: "IMAGE_GPU:transformed_input_video" +} + +node { + calculator: "HolisticLandmarkGpu" + input_stream: "IMAGE:transformed_input_video" + output_stream: "POSE_LANDMARKS:pose_landmarks" + output_stream: "WORLD_LANDMARKS:pose_world_landmarks" + output_stream: "SEGMENTATION_MASK:segmentation_mask_gpu" + output_stream: "POSE_ROI:pose_roi" + output_stream: "POSE_DETECTION:pose_detection" + output_stream: "FACE_LANDMARKS:face_landmarks" + output_stream: "LEFT_HAND_LANDMARKS:left_hand_landmarks" + output_stream: "RIGHT_HAND_LANDMARKS:right_hand_landmarks" +} + +node: { + calculator: "ImageTransformationCalculator" + input_stream: "IMAGE_GPU:segmentation_mask_gpu" + output_stream: "IMAGE_GPU:segmentation_mask_unrotated_gpu" +} + +node: { + calculator: "GpuBufferToImageFrameCalculator" + input_stream: "segmentation_mask_unrotated_gpu" + output_stream: "segmentation_mask" +} \ No newline at end of file diff --git a/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt.meta b/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt.meta new file mode 100644 index 0000000..a3900c5 --- /dev/null +++ b/Assets/MediaPipeUnity/WeSign_extractor_gpu.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4ecf0a6acdaa4fe499c1339d2d4aeddb +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipeUnity/Wesign_extractor.cs b/Assets/MediaPipeUnity/Wesign_extractor.cs new file mode 100644 index 0000000..c1f157d --- /dev/null +++ b/Assets/MediaPipeUnity/Wesign_extractor.cs @@ -0,0 +1,202 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +// ATTENTION!: This code is for a tutorial. + +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using Unity.VisualScripting; +using UnityEngine; +using UnityEngine.UI; +using Mediapipe.Unity.CoordinateSystem; + + +namespace Mediapipe.Unity.Tutorial +{ + public class Wesign_extractor : MonoBehaviour + { + /// + /// Config file to set up the graph + /// + [SerializeField] private TextAsset _configAsset; + + /// + /// The screen object on which the video is displayed + /// + [SerializeField] private RawImage _screen; + + /// + /// width of the screen + /// + [SerializeField] private int _width; + + /// + /// height of the screen + /// + [SerializeField] private int _height; + + /// + /// fps of the screen + /// + [SerializeField] private int _fps; + + /// + /// Landmark annotation controller to show the landmarks on the screen + /// + [SerializeField] private PoseLandmarkListAnnotationController _poseLandmarkListAnnotationController; + + /// + /// MediaPipe graph + /// + private CalculatorGraph _graph; + + /// + /// Resource manager for graph resources + /// + private ResourceManager _resourceManager; + + /// + /// Webcam texture + /// + private WebCamTexture _webCamTexture; + + /// + /// Input texture + /// + private Texture2D _inputTexture; + + /// + /// Screen pixel data + /// + private Color32[] _pixelData; + + /// + /// Stopwatch to give a timestamp to video frames + /// + private Stopwatch _stopwatch; + + + /// + /// Google Mediapipe setup & run + /// + /// IEnumerator + /// + private IEnumerator Start() + { + // Webcam setup + if (WebCamTexture.devices.Length == 0) + { + throw new System.Exception("Web Camera devices are not found"); + } + var webCamDevice = WebCamTexture.devices[0]; + _webCamTexture = new WebCamTexture(webCamDevice.name, _width, _height, _fps); + _webCamTexture.Play(); + + yield return new WaitUntil(() => _webCamTexture.width > 16); + + _screen.rectTransform.sizeDelta = new Vector2(_width, _height); + _screen.texture = _webCamTexture; + + // TODO this method is kinda meh you should use ImageFrame + _inputTexture = new Texture2D(_width, _height, TextureFormat.RGBA32, false); + _pixelData = new Color32[_width * _height]; + + _resourceManager = new LocalResourceManager(); + yield return _resourceManager.PrepareAssetAsync("pose_detection.bytes"); + yield return _resourceManager.PrepareAssetAsync("pose_landmark_full.bytes"); + yield return _resourceManager.PrepareAssetAsync("face_landmark.bytes"); + yield return _resourceManager.PrepareAssetAsync("hand_landmark_full.bytes"); + yield return _resourceManager.PrepareAssetAsync("face_detection_short_range.bytes"); + yield return _resourceManager.PrepareAssetAsync("hand_recrop.bytes"); + yield return _resourceManager.PrepareAssetAsync("handedness.txt"); + + _stopwatch = new Stopwatch(); + + // Setting up the graph + _graph = new CalculatorGraph(_configAsset.text); + var posestream = new OutputStream(_graph, "pose_landmarks"); + var leftstream = new OutputStream(_graph, "left_hand_landmarks"); + var rightstream = new OutputStream(_graph, "right_hand_landmarks"); + posestream.StartPolling().AssertOk(); + leftstream.StartPolling().AssertOk(); + rightstream.StartPolling().AssertOk(); + _graph.StartRun().AssertOk(); + _stopwatch.Start(); + + + while (true) + { + _inputTexture.SetPixels32(_webCamTexture.GetPixels32(_pixelData)); + var imageFrame = new ImageFrame(ImageFormat.Types.Format.Srgba, _width, _height, _width * 4, _inputTexture.GetRawTextureData()); + var currentTimestamp = _stopwatch.ElapsedTicks / (System.TimeSpan.TicksPerMillisecond / 1000); + _graph.AddPacketToInputStream("input_video", new ImageFramePacket(imageFrame, new Timestamp(currentTimestamp))).AssertOk(); + + yield return new WaitForEndOfFrame(); + + //posestream.TryGetNext(out var poseLandmarks); + if (posestream.TryGetNext(out var poseLandmarks)) + { + if (poseLandmarks != null) + { + // Draw the poseLandmarks on the screen + _poseLandmarkListAnnotationController.DrawNow(poseLandmarks); + var x = poseLandmarks.Landmark[0]; + UnityEngine.Debug.Log($"Pose Coordinates: {x}"); + + } + } + if (leftstream.TryGetNext(out var leftLandmarks)) + { + if (leftLandmarks != null) + { + + var x = leftLandmarks.Landmark[0]; + UnityEngine.Debug.Log($"Pose left Coordinates: {x}"); + + } + } + if (rightstream.TryGetNext(out var rightLandmarks)) + { + if (rightLandmarks != null) + { + + var x = rightLandmarks.Landmark[0]; + UnityEngine.Debug.Log($"Pose right Coordinates: {x}"); + + } + } + + + } + + } + /// + /// Propper destruction on the Mediapipegraph + /// + private void OnDestroy() + { + if (_webCamTexture != null) + { + _webCamTexture.Stop(); + } + + if (_graph != null) + { + try + { + _graph.CloseInputStream("input_video").AssertOk(); + _graph.WaitUntilDone().AssertOk(); + } + finally + { + + _graph.Dispose(); + } + } + } + } +} diff --git a/Assets/MediaPipeUnity/Wesign_extractor.cs.meta b/Assets/MediaPipeUnity/Wesign_extractor.cs.meta new file mode 100644 index 0000000..a15cff5 --- /dev/null +++ b/Assets/MediaPipeUnity/Wesign_extractor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 043ccd99cf82b3cc9bf2e00956ce2b93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/LICENSE.md b/Packages/com.github.homuler.mediapipe/LICENSE.md new file mode 100644 index 0000000..66d93f0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 homuler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Packages/com.github.homuler.mediapipe/LICENSE.md.meta b/Packages/com.github.homuler.mediapipe/LICENSE.md.meta new file mode 100644 index 0000000..9d6248b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e728b176561fa96ed8fde03486bbb142 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources.meta b/Packages/com.github.homuler.mediapipe/PackageResources.meta new file mode 100644 index 0000000..c4becc4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a0d7e8178b74a234b982e1c9e95b06e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Materials.meta new file mode 100644 index 0000000..428c712 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 997abefdb7c9a1a469fea28ffa80e73a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat new file mode 100644 index 0000000..6c4ad3b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Line + m_Shader: {fileID: 207, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _TintColor: {r: 1, g: 0, b: 0, a: 0.5} + m_BuildTextureStacks: [] diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat.meta new file mode 100644 index 0000000..ad8c349 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/Line.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 207b29ccc237efe2f841a58fbf9e5478 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat new file mode 100644 index 0000000..f6e2564 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SolidConvergence + m_Shader: {fileID: 4800000, guid: 349b4f383ce8440988c29923e4684694, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat.meta new file mode 100644 index 0000000..7b47352 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidConvergence.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ea6416eaf3d1674291ec58a548378d8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat new file mode 100644 index 0000000..a024be2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SolidMaterial + m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat.meta new file mode 100644 index 0000000..1e702e0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Materials/SolidMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4cdc6c3db064fca08a172ce83ee9d12 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe.meta new file mode 100644 index 0000000..40b597e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f57990152e91970499d1fd5e93c57d89 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes new file mode 100644 index 0000000..7128856 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes.meta new file mode 100644 index 0000000..8ab556a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e77bccec954d4a4a8aa3c1a6bb94d15 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes new file mode 100644 index 0000000..a4cd58b Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes.meta new file mode 100644 index 0000000..e818e76 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_full_range_sparse.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 88d74f24916764d31a81ea6cbfa4ba68 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes new file mode 100644 index 0000000..659bce8 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes.meta new file mode 100644 index 0000000..ecbd821 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_detection_short_range.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b9f725766db3aa9629b417fd51e31530 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes new file mode 100644 index 0000000..573285d Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes.meta new file mode 100644 index 0000000..683a6ad --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a193c7ca3dc050c6d8b728e7e129f6a5 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes new file mode 100644 index 0000000..fe0a93a Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes.meta new file mode 100644 index 0000000..b8bc150 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/face_landmark_with_attention.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1cf05e630aa9cd6f38522c83264115ee +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes new file mode 100644 index 0000000..5c8e22e Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes.meta new file mode 100644 index 0000000..303fdcb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hair_segmentation.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0a4c697151131b35db0748e319aed581 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes new file mode 100644 index 0000000..01783cf Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes.meta new file mode 100644 index 0000000..b4544e1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_full.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d2c612bb3b8652c34a610554ef621c35 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes new file mode 100644 index 0000000..145e86c Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes.meta new file mode 100644 index 0000000..8370a77 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_landmark_lite.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fa86133ea84e644f09b246134dd08cb6 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes new file mode 100644 index 0000000..dcfd276 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes.meta new file mode 100644 index 0000000..4e801b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/hand_recrop.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: abf39997153d3bc48b9af20bb8d2c75a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt new file mode 100644 index 0000000..9f636db --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt @@ -0,0 +1,2 @@ +Left +Right diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt.meta new file mode 100644 index 0000000..ae19cb6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/handedness.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ca5d56c926737c2929c102575e703f4a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes new file mode 100644 index 0000000..974b910 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes.meta new file mode 100644 index 0000000..d6ec6e5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/iris_landmark.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71b173c4b3503de4a8c9875972d880a4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes new file mode 100644 index 0000000..14cb826 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes.meta new file mode 100644 index 0000000..adf8566 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_camera.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 25f7f8d6c78414aa6b47573191f3cb13 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes new file mode 100644 index 0000000..3a23dfd Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes.meta new file mode 100644 index 0000000..5002e90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 393afd72cbd0d7781ab071f3d6fb38fe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes new file mode 100644 index 0000000..718dc97 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes.meta new file mode 100644 index 0000000..84e42c4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_chair_1stage.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 53a5a9537d1a5ea59a5ee2dd6f154af2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes new file mode 100644 index 0000000..1a7a5d3 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes.meta new file mode 100644 index 0000000..3bfdeaf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_cup.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5cde808ca06049fbcbdbf351c0579181 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes new file mode 100644 index 0000000..d64234d Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes.meta new file mode 100644 index 0000000..b87e431 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f05d0f79da53b48858ba17062530313b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes new file mode 100644 index 0000000..2077114 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes.meta new file mode 100644 index 0000000..5f201fc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_3d_sneakers_1stage.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 290ea52a92f4d637289ebae96906985b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt new file mode 100644 index 0000000..ef9032c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt @@ -0,0 +1,24 @@ +??? +Bicycle +Boot +Laptop +Person +Chair +Cattle +Desk +Cat +Computer mouse +Computer monitor +Box +Mug +Coffee cup +Stationary bicycle +Table +Bottle +High heels +Vehicle +Footwear +Dog +Book +Camera +Car diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt.meta new file mode 100644 index 0000000..36ac6ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_oidv4_labelmap.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c852a0cff35fa9d1b6598816e80af6e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes new file mode 100644 index 0000000..3cb7291 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes.meta new file mode 100644 index 0000000..13e6459 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c800c44315d9fd7958d61b5cda0fa33f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes new file mode 100644 index 0000000..d37cd03 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes.meta new file mode 100644 index 0000000..0b9c34d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_full.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 21464d30652b570c3ab3f50d15a22dbf +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes new file mode 100644 index 0000000..a19339a Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes.meta new file mode 100644 index 0000000..dbaa278 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/palm_detection_lite.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc5368b59ebdc0638a873af1f2959457 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes new file mode 100644 index 0000000..4f1c521 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes.meta new file mode 100644 index 0000000..a6edd30 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_detection.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 26d78e7112fc7808b9d14fc20bb9500f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes new file mode 100644 index 0000000..e2ee84f Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes.meta new file mode 100644 index 0000000..0952987 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_full.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 295f47833d498a54aa06507f6072d2e4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes new file mode 100644 index 0000000..9b767e7 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes.meta new file mode 100644 index 0000000..a130ce8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_heavy.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4339a61d6cb8560d091a9bc06d2ab8b2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes new file mode 100644 index 0000000..280cc72 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes.meta new file mode 100644 index 0000000..f30b3f1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/pose_landmark_lite.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0a76dfea202fa3254ba68439997f3a5e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes new file mode 100644 index 0000000..374c072 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes.meta new file mode 100644 index 0000000..5d39a16 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/selfie_segmentation.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 137f92ecbad3e5ed5b8d39a5717113e2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes new file mode 100644 index 0000000..c07fcbe Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes differ diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes.meta new file mode 100644 index 0000000..da959f9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 84cdeb972f9a615ffb790f35c5b336f0 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt new file mode 100644 index 0000000..5a70ff8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt @@ -0,0 +1,91 @@ +??? +person +bicycle +car +motorcycle +airplane +bus +train +truck +boat +traffic light +fire hydrant +??? +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +??? +backpack +umbrella +??? +??? +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +??? +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +couch +potted plant +bed +??? +dining table +??? +??? +toilet +??? +tv +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +??? +book +clock +vase +scissors +teddy bear +hair drier +toothbrush diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt.meta new file mode 100644 index 0000000..ac21844 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/ssdlite_object_detection_labelmap.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ea5c71542478ca97ac06e52e10a127e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs.meta new file mode 100644 index 0000000..72e7c60 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a54e68f85589b244baf9f023c7247ab +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab new file mode 100644 index 0000000..cbfce76 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab @@ -0,0 +1,259 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2533287826761229786 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2533287826761229787} + - component: {fileID: 2533287826761229790} + - component: {fileID: 2533287826761229789} + - component: {fileID: 2533287826761229788} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2533287826761229787 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287826761229786} + m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 11, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2533287827353209602} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2533287826761229790 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287826761229786} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2533287826761229789 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287826761229786} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &2533287826761229788 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287826761229786} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &2533287827353209600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2533287827353209602} + - component: {fileID: 2533287827353209601} + - component: {fileID: 2533287827353209603} + m_Layer: 0 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2533287827353209602 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287827353209600} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2533287826761229787} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!120 &2533287827353209601 +LineRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287827353209600} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 207b29ccc237efe2f841a58fbf9e5478, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 10, y: 0, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0.01727295 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_UseWorldSpace: 0 + m_Loop: 0 +--- !u!114 &2533287827353209603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2533287827353209600} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a793788ee98ea8ea3b28457e7dd7197d, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 1, g: 1, b: 1, a: 1} + _direction: {x: 1, y: 0, z: 0} + _magnitude: 10 + _capScale: 1 + _lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab.meta new file mode 100644 index 0000000..b271371 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Arrow.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 960d38eab3d401593b4ec2080d613df3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab new file mode 100644 index 0000000..f3b3dee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6906784969693806809 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6304225122415972218} + - component: {fileID: 1814674383914226116} + - component: {fileID: 9135269113604921858} + m_Layer: 0 + m_Name: Circle Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6304225122415972218 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6906784969693806809} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!120 &1814674383914226116 +LineRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6906784969693806809} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 207b29ccc237efe2f841a58fbf9e5478, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Positions: [] + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 0, g: 1, b: 0, a: 1} + key1: {r: 0, g: 1, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_UseWorldSpace: 0 + m_Loop: 1 +--- !u!114 &9135269113604921858 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6906784969693806809} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98e622123dd1b9ac1a87d8609ce21d37, type: 3} + m_Name: + m_EditorClassIdentifier: + _lineRenderer: {fileID: 1814674383914226116} + _color: {r: 0, g: 1, b: 0, a: 1} + _lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab.meta new file mode 100644 index 0000000..b3cb4aa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Circle Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a30fb5c183ec11e59b1dbf1b3c8d2faa +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab new file mode 100644 index 0000000..0b6d0bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4824063073641375834 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4824063073641375833} + - component: {fileID: 4824063073641375832} + - component: {fileID: 4824063073641375835} + m_Layer: 0 + m_Name: Connection Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4824063073641375833 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4824063073641375834} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!120 &4824063073641375832 +LineRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4824063073641375834} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 207b29ccc237efe2f841a58fbf9e5478, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 0, g: 1, b: 0, a: 1} + key1: {r: 0, g: 1, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_UseWorldSpace: 0 + m_Loop: 0 +--- !u!114 &4824063073641375835 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4824063073641375834} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 90aa7330426be071f9141dd20224e6cb, type: 3} + m_Name: + m_EditorClassIdentifier: + _lineRenderer: {fileID: 4824063073641375832} + _color: {r: 0, g: 1, b: 0, a: 1} + _lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab.meta new file mode 100644 index 0000000..40d7f8d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ce6db8ad8200781fc9201c21237ce23b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab new file mode 100644 index 0000000..2260747 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &745748194542674601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 745748194542674602} + - component: {fileID: 8437385474393681368} + m_Layer: 0 + m_Name: Connection List Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &745748194542674602 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 745748194542674601} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8437385474393681368 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 745748194542674601} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 4824063073641375834, guid: ce6db8ad8200781fc9201c21237ce23b, + type: 3} + _color: {r: 1, g: 0, b: 0, a: 1} + _lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab.meta new file mode 100644 index 0000000..0c431a8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Connection List Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c97d04632e9be1a7cb05f6ab855b365b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab new file mode 100644 index 0000000..82c27e8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab @@ -0,0 +1,329 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2519151911608524794 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2519151911608524795} + - component: {fileID: 5770944814818036318} + m_Layer: 0 + m_Name: Cuboid Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2519151911608524795 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2519151911608524794} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6140629650347037949} + - {fileID: 2711096740066365767} + - {fileID: 3526978146265096737} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5770944814818036318 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2519151911608524794} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e88663936c139fb4971d8ab54a85a11, type: 3} + m_Name: + m_EditorClassIdentifier: + _pointListAnnotation: {fileID: 6140629650347037948} + _lineListAnnotation: {fileID: 6544068307370925621} + _transformAnnotation: {fileID: 508183085484426995} + _arrowLengthScale: 1 +--- !u!1001 &3085711672548358667 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2519151911608524795} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: Point List Annotation + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!114 &6140629650347037948 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 3085711672548358667} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &6140629650347037949 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 3085711672548358667} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3144842446730745438 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2519151911608524795} + m_Modifications: + - target: {fileID: 1970024004534580348, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_Name + value: Transform Annotation + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4070943725321397182, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + - target: {fileID: 4070943725731153277, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + - target: {fileID: 4070943725789682545, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6f13a2b002175f9a0865766faacfed08, type: 3} +--- !u!114 &508183085484426995 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3218336891424051373, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + m_PrefabInstance: {fileID: 3144842446730745438} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 219b3f9aac8f8d18db8e85142b28db7d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &3526978146265096737 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1970024004534580351, guid: 6f13a2b002175f9a0865766faacfed08, + type: 3} + m_PrefabInstance: {fileID: 3144842446730745438} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3442630378391270381 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2519151911608524795} + m_Modifications: + - target: {fileID: 745748194542674601, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_Name + value: Connection List Annotation + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c97d04632e9be1a7cb05f6ab855b365b, type: 3} +--- !u!4 &2711096740066365767 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 3442630378391270381} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6544068307370925621 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 3442630378391270381} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab.meta new file mode 100644 index 0000000..20c4341 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 915f3c383a25ff9bd985b1394fc052de +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab new file mode 100644 index 0000000..e4e0fe9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6458122111144983606 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6458122111144983605} + - component: {fileID: 6393730721216785986} + m_Layer: 0 + m_Name: Cuboid List Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6458122111144983605 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6458122111144983606} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6393730721216785986 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6458122111144983606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69c9a763206a6fa938324ba456924e67, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 2519151911608524794, guid: 915f3c383a25ff9bd985b1394fc052de, + type: 3} + _pointColor: {r: 0, g: 1, b: 0, a: 1} + _lineColor: {r: 1, g: 0, b: 0, a: 1} + _lineWidth: 1 + _arrowCapScale: 2 + _arrowLengthScale: 1 + _arrowWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab.meta new file mode 100644 index 0000000..63b1839 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Cuboid List Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad07199e23982e78c9dad255e1176177 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab new file mode 100644 index 0000000..de9ae50 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab @@ -0,0 +1,401 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5404176935574894484 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5404176934485794286} + - component: {fileID: 5404176935574894487} + m_Layer: 0 + m_Name: Detection Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5404176934485794286 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5404176935574894484} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8241125562864823518} + - {fileID: 6447834089412636779} + - {fileID: 326585805122188675} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5404176935574894487 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5404176935574894484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6a82b9904ff34cc4fb66157217fe48a9, type: 3} + m_Name: + m_EditorClassIdentifier: + _locationDataAnnotation: {fileID: 8241125562864823516} + _relativeKeypointsAnnotation: {fileID: 6447834089412636778} + _labelAnnotation: {fileID: 7310817467319291998} +--- !u!1001 &2782677811817078429 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 5404176934485794286} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: RelativeKeypoints + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!114 &6447834089412636778 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 2782677811817078429} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &6447834089412636779 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 2782677811817078429} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &3943381024138386822 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 5404176934485794286} + m_Modifications: + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4965192403804369243, guid: 3b696480602fe21de85315216956bd42, + type: 3} + propertyPath: m_Name + value: LocationData + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3b696480602fe21de85315216956bd42, type: 3} +--- !u!114 &8241125562864823516 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4965192403804369242, guid: 3b696480602fe21de85315216956bd42, + type: 3} + m_PrefabInstance: {fileID: 3943381024138386822} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba39488de81a63b298a92a9d09ac42db, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &8241125562864823518 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4965192403804369240, guid: 3b696480602fe21de85315216956bd42, + type: 3} + m_PrefabInstance: {fileID: 3943381024138386822} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4902813573071789332 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 5404176934485794286} + m_Modifications: + - target: {fileID: 912750501651204390, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_Name + value: Label Annotation + objectReference: {fileID: 0} + - target: {fileID: 2413779005072330058, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: _labelText + value: + objectReference: {fileID: 615235980274847209} + - target: {fileID: 2413779005072330058, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: _backgroundTransform + value: + objectReference: {fileID: 6388507230735456264} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_Pivot.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalPosition.z + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5513403384150495485, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_Text + value: + objectReference: {fileID: 0} + - target: {fileID: 7330468373985811433, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + propertyPath: m_Name + value: Background + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a705e6d9fdc0e9f8192e094fae8b0026, type: 3} +--- !u!224 &326585805122188675 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 4648294227339798679, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + m_PrefabInstance: {fileID: 4902813573071789332} + m_PrefabAsset: {fileID: 0} +--- !u!114 &615235980274847209 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5513403384150495485, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + m_PrefabInstance: {fileID: 4902813573071789332} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!224 &6388507230735456264 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2063426591457281308, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + m_PrefabInstance: {fileID: 4902813573071789332} + m_PrefabAsset: {fileID: 0} +--- !u!114 &7310817467319291998 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2413779005072330058, guid: a705e6d9fdc0e9f8192e094fae8b0026, + type: 3} + m_PrefabInstance: {fileID: 4902813573071789332} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 96652e94527a9f3e1b4079bc3d139d06, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab.meta new file mode 100644 index 0000000..dd4716b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9e4308c3e97d26a388364cbe0ea8bfb4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab new file mode 100644 index 0000000..79e6c6a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6320745076577806712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5535674424067552597} + - component: {fileID: -6338546567352850726} + m_Layer: 5 + m_Name: Detection List Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5535674424067552597 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6320745076577806712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &-6338546567352850726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6320745076577806712} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d433cdb024dfd584696eeb11efb71102, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 5404176935574894484, guid: 9e4308c3e97d26a388364cbe0ea8bfb4, + type: 3} + _lineWidth: 1 + _keypointRadius: 15 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab.meta new file mode 100644 index 0000000..ebd253b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Detection List Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 26114bc9cccb92454a468ea4d41f400a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab new file mode 100644 index 0000000..1199472 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab @@ -0,0 +1,228 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7273100862690186831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7273100862690186830} + - component: {fileID: 6062652630926106765} + m_Layer: 0 + m_Name: FaceLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7273100862690186830 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7273100862690186831} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2452028741229710434} + - {fileID: 1007056309493662031} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6062652630926106765 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7273100862690186831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1275dad009e98d9f490bd65e83f7eba5, type: 3} + m_Name: + m_EditorClassIdentifier: + _landmarkListAnnotation: {fileID: 2452028741229710435} + _connectionListAnnotation: {fileID: 8266140556773805629} +--- !u!1001 &549622122825475045 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7273100862690186830} + m_Modifications: + - target: {fileID: 745748194542674601, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_Name + value: Connection List Annotation + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c97d04632e9be1a7cb05f6ab855b365b, type: 3} +--- !u!4 &1007056309493662031 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 549622122825475045} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8266140556773805629 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 549622122825475045} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &6764999745827267220 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7273100862690186830} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: Point List Annotation + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: _radius + value: 10 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!4 &2452028741229710434 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 6764999745827267220} + m_PrefabAsset: {fileID: 0} +--- !u!114 &2452028741229710435 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 6764999745827267220} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..cb3e345 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 16074ce928b0558829296ab0d9ccadf3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab new file mode 100644 index 0000000..76aba05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab @@ -0,0 +1,531 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7477175687846711451 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7477175687846711450} + - component: {fileID: 5817503713440874067} + m_Layer: 0 + m_Name: FaceLandmarkListWithIris Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7477175687846711450 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7477175687846711451} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3152810051868743539} + - {fileID: 3653127876358463001} + - {fileID: 7035677120197205992} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5817503713440874067 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7477175687846711451} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e3266a44159f9c0f495c095447ca1e5f, type: 3} + m_Name: + m_EditorClassIdentifier: + _faceLandmarkListAnnotation: {fileID: 1949188687776883120} + _leftIrisLandmarkListAnnotation: {fileID: 3653127876358463003} + _rightIrisLandmarkListAnnotation: {fileID: 7035677120197205994} +--- !u!1001 &2731930088544666806 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7477175687846711450} + m_Modifications: + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405593, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Name + value: Right IrisLandmarkList Annotation + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _circleAnnotation + value: + objectReference: {fileID: 9122285150880855100} + - target: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _landmarkListAnnotation + value: + objectReference: {fileID: 6032653372641098551} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, type: 3} +--- !u!114 &6032653372641098551 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 2731930088544666806} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &7035677120197205992 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 2731930088544666806} + m_PrefabAsset: {fileID: 0} +--- !u!114 &7035677120197205994 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 2731930088544666806} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1663d4d6a7ce17fdbad3dcb3e667ee85, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &9122285150880855100 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 2731930088544666806} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98e622123dd1b9ac1a87d8609ce21d37, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &5705557952729350461 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7477175687846711450} + m_Modifications: + - target: {fileID: 2452028741229710435, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2452028741229710435, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: _radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7273100862690186831, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + propertyPath: m_Name + value: FaceLandmarkList Annotation + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 16074ce928b0558829296ab0d9ccadf3, type: 3} +--- !u!114 &1949188687776883120 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6062652630926106765, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + m_PrefabInstance: {fileID: 5705557952729350461} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1275dad009e98d9f490bd65e83f7eba5, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &3152810051868743539 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7273100862690186830, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + m_PrefabInstance: {fileID: 5705557952729350461} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8572875197927310663 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7477175687846711450} + m_Modifications: + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405593, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Name + value: Left IrisLandmarkList Annotation + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _circleAnnotation + value: + objectReference: {fileID: 3281406012129293773} + - target: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _landmarkListAnnotation + value: + objectReference: {fileID: 47693675119737542} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, type: 3} +--- !u!114 &47693675119737542 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 8572875197927310663} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &3281406012129293773 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 8572875197927310663} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98e622123dd1b9ac1a87d8609ce21d37, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &3653127876358463001 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 8572875197927310663} + m_PrefabAsset: {fileID: 0} +--- !u!114 &3653127876358463003 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4920882846540405596, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 8572875197927310663} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1663d4d6a7ce17fdbad3dcb3e667ee85, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab.meta new file mode 100644 index 0000000..c25aef6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/FaceLandmarkListWithIris Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c0d008e23161282b39199515fa2c0da4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab new file mode 100644 index 0000000..91b759e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab @@ -0,0 +1,265 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4724242833946851653 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4724242833946851652} + - component: {fileID: 7426451068229116525} + m_Layer: 0 + m_Name: HandLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4724242833946851652 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4724242833946851653} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 17314624880992430} + - {fileID: 4340673029162133842} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7426451068229116525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4724242833946851653} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: febd88b13c7a8e91b855c9dd35dd65d9, type: 3} + m_Name: + m_EditorClassIdentifier: + _landmarkListAnnotation: {fileID: 17314624880992431} + _connectionListAnnotation: {fileID: 4860466422646548000} + _leftLandmarkColor: {r: 1, g: 0.5411765, b: 0, a: 1} + _rightLandmarkColor: {r: 0, g: 0.8509804, b: 0.90588236, a: 1} +--- !u!1001 &3919333542530190328 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4724242833946851652} + m_Modifications: + - target: {fileID: 745748194542674601, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_Name + value: Connection List Annotation + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c97d04632e9be1a7cb05f6ab855b365b, type: 3} +--- !u!4 &4340673029162133842 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 3919333542530190328} + m_PrefabAsset: {fileID: 0} +--- !u!114 &4860466422646548000 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 3919333542530190328} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &9212328286361521752 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4724242833946851652} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: Point List Annotation + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!4 &17314624880992430 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 9212328286361521752} + m_PrefabAsset: {fileID: 0} +--- !u!114 &17314624880992431 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 9212328286361521752} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..214319c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HandLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b420c3106bd9cc5b6871a7df5459dba0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab new file mode 100644 index 0000000..38a50e0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab @@ -0,0 +1,858 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1314261227135839422 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1314261227135839417} + - component: {fileID: 1314261227135839416} + m_Layer: 5 + m_Name: HolisticLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1314261227135839417 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314261227135839422} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7432869076366971105} + - {fileID: 624164888610552290} + - {fileID: 6031111879974362046} + - {fileID: 6031111878222070829} + - {fileID: 6230533819516583250} + - {fileID: 6230533820724736947} + - {fileID: 1757634858630965815} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1314261227135839416 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314261227135839422} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8778d2c5de1025526bb9fccf445db529, type: 3} + m_Name: + m_EditorClassIdentifier: + _faceLandmarkListAnnotation: {fileID: 5789786791031881256} + _poseLandmarkListAnnotation: {fileID: 624164888610552317} + _leftHandLandmarkListAnnotation: {fileID: 8443471368909570199} + _rightHandLandmarkListAnnotation: {fileID: 8443471366905863940} + _connectionListAnnotation: {fileID: 7433944339976725829} +--- !u!1001 &63781188361027707 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 4438593960874954496, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4438593960874954496, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4438593960874954496, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7477175687846711451, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: m_Name + value: FaceLandmarkListWithIris Annotation + objectReference: {fileID: 0} + - target: {fileID: 7865938743610117470, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: _color.b + value: 0.90588236 + objectReference: {fileID: 0} + - target: {fileID: 7865938743610117470, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + propertyPath: _color.g + value: 0.8509804 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c0d008e23161282b39199515fa2c0da4, type: 3} +--- !u!114 &5789786791031881256 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5817503713440874067, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + m_PrefabInstance: {fileID: 63781188361027707} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e3266a44159f9c0f495c095447ca1e5f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &7432869076366971105 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7477175687846711450, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + m_PrefabInstance: {fileID: 63781188361027707} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1314261225232492044 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405593, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Name + value: Left IrisLandmarkList Annotation + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, type: 3} +--- !u!4 &6230533819516583250 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 1314261225232492044} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1314261225475358952 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462411, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: m_Name + value: PoseLandmarkList Annotation + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _leftLandmarkColor.g + value: 0.5411765 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _leftLandmarkColor.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _rightLandmarkColor.b + value: 0.90588236 + objectReference: {fileID: 0} + - target: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _rightLandmarkColor.g + value: 0.8509804 + objectReference: {fileID: 0} + - target: {fileID: 4106715738273262277, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4106715738273262277, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4106715738273262277, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 4418f6a92856c5b51b58a36e3be7ed5c, type: 3} +--- !u!4 &624164888610552290 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1915238444563462410, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + m_PrefabInstance: {fileID: 1314261225475358952} + m_PrefabAsset: {fileID: 0} +--- !u!114 &624164888610552317 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1915238444563462421, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + m_PrefabInstance: {fileID: 1314261225475358952} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39bac9dd52c31ae7aa01a7383bc44853, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1314261226180879098 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851653, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_Name + value: Left HandLandmarkList Annotation + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b420c3106bd9cc5b6871a7df5459dba0, type: 3} +--- !u!4 &6031111879974362046 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + m_PrefabInstance: {fileID: 1314261226180879098} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8443471368909570199 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7426451068229116525, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + m_PrefabInstance: {fileID: 1314261226180879098} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: febd88b13c7a8e91b855c9dd35dd65d9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1314261226305813865 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4724242833946851653, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + propertyPath: m_Name + value: Right HandLandmarkList Annotation + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b420c3106bd9cc5b6871a7df5459dba0, type: 3} +--- !u!4 &6031111878222070829 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4724242833946851652, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + m_PrefabInstance: {fileID: 1314261226305813865} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8443471366905863940 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7426451068229116525, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + m_PrefabInstance: {fileID: 1314261226305813865} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: febd88b13c7a8e91b855c9dd35dd65d9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1314261226439600365 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4366494465079868236, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405593, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_Name + value: Right IrisLandmarkList Annotation + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6589080662169022602, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: radius + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8525746990267350913, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, type: 3} +--- !u!4 &6230533820724736947 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4920882846540405598, guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890, + type: 3} + m_PrefabInstance: {fileID: 1314261226439600365} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1314261226608396445 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1314261227135839417} + m_Modifications: + - target: {fileID: 745748194542674601, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_Name + value: Connection List Annotation + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c97d04632e9be1a7cb05f6ab855b365b, type: 3} +--- !u!4 &1757634858630965815 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 1314261226608396445} + m_PrefabAsset: {fileID: 0} +--- !u!114 &7433944339976725829 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 1314261226608396445} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..1a8ced1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/HolisticLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cf645f1af5f90246e87c443ab2154263 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab new file mode 100644 index 0000000..3657957 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab @@ -0,0 +1,258 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4920882846540405593 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4920882846540405598} + - component: {fileID: 4920882846540405596} + m_Layer: 0 + m_Name: IrisLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4920882846540405598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4920882846540405593} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8525746990267350912} + - {fileID: 8271696829721912818} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4920882846540405596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4920882846540405593} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1663d4d6a7ce17fdbad3dcb3e667ee85, type: 3} + m_Name: + m_EditorClassIdentifier: + _landmarkListAnnotation: {fileID: 8525746990267350913} + _circleAnnotation: {fileID: 6589080662169022602} +--- !u!1001 &699405928064242038 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4920882846540405598} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: Point List Annotation + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!4 &8525746990267350912 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 699405928064242038} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8525746990267350913 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 699405928064242038} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &2717890661163346568 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4920882846540405598} + m_Modifications: + - target: {fileID: 1814674383914226116, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1814674383914226116, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1814674383914226116, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1814674383914226116, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6906784969693806809, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: m_Name + value: Circle Annotation + objectReference: {fileID: 0} + - target: {fileID: 9135269113604921858, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9135269113604921858, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, type: 3} +--- !u!4 &8271696829721912818 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6304225122415972218, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + m_PrefabInstance: {fileID: 2717890661163346568} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6589080662169022602 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9135269113604921858, guid: a30fb5c183ec11e59b1dbf1b3c8d2faa, + type: 3} + m_PrefabInstance: {fileID: 2717890661163346568} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98e622123dd1b9ac1a87d8609ce21d37, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..afe4254 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/IrisLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f0ce15b9d7f5f910fa2e3ddc2ea6d890 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab new file mode 100644 index 0000000..8e981c0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab @@ -0,0 +1,198 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &912750501651204390 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4648294227339798679} + - component: {fileID: 110471670344889224} + - component: {fileID: 5513403384150495485} + - component: {fileID: 2413779005072330058} + m_Layer: 5 + m_Name: Label Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4648294227339798679 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912750501651204390} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2063426591457281308} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!222 &110471670344889224 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912750501651204390} + m_CullTransparentMesh: 1 +--- !u!114 &5513403384150495485 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912750501651204390} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 48 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 72 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!114 &2413779005072330058 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912750501651204390} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 96652e94527a9f3e1b4079bc3d139d06, type: 3} + m_Name: + m_EditorClassIdentifier: + labelText: {fileID: 5513403384150495485} + background: {fileID: 0} +--- !u!1 &7330468373985811433 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2063426591457281308} + - component: {fileID: 6205929924803562203} + - component: {fileID: 6221164754174294866} + - component: {fileID: 6064356879475179775} + m_Layer: 5 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2063426591457281308 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7330468373985811433} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 1, z: 0} + m_Children: [] + m_Father: {fileID: 4648294227339798679} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!33 &6205929924803562203 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7330468373985811433} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6221164754174294866 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7330468373985811433} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b4cdc6c3db064fca08a172ce83ee9d12, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &6064356879475179775 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7330468373985811433} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab.meta new file mode 100644 index 0000000..77ea4bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Label Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a705e6d9fdc0e9f8192e094fae8b0026 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab new file mode 100644 index 0000000..063d2c5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab @@ -0,0 +1,50 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1416249681263347897 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1416249681263347896} + - component: {fileID: 5850198979010014858} + m_Layer: 0 + m_Name: Mask Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1416249681263347896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1416249681263347897} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5850198979010014858 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1416249681263347897} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f993d16dcccfcecb6892ad3cc2ea76c8, type: 3} + m_Name: + m_EditorClassIdentifier: + _screen: {fileID: 0} + _maskShader: {fileID: 0} + _maskTexture: {fileID: 0} + _color: {r: 0, g: 0, b: 1, a: 1} + _threshold: 0.9 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab.meta new file mode 100644 index 0000000..6e5fc4a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Mask Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 24d349d9c78db0f3d94d4657029f4c5e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab new file mode 100644 index 0000000..801325b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab @@ -0,0 +1,55 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5403310940259726730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5403310940259726732} + - component: {fileID: 5403310940259726731} + m_Layer: 0 + m_Name: Multi FaceLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5403310940259726732 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5403310940259726730} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5403310940259726731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5403310940259726730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d1ec0e202f29d7ee28cccba68415d95b, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 7477175687846711451, guid: c0d008e23161282b39199515fa2c0da4, + type: 3} + _faceLandmarkColor: {r: 0, g: 1, b: 0, a: 1} + _irisLandmarkColor: {r: 1, g: 0.92156863, b: 0.015686275, a: 1} + _faceLandmarkRadius: 10 + _irisLandmarkRadius: 10 + _faceConnectionColor: {r: 1, g: 0, b: 0, a: 1} + _irisCircleColor: {r: 0, g: 0, b: 1, a: 1} + _faceConnectionWidth: 1 + _irisCircleWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..b4bb255 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi FaceLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2e1291ddc10af56d4be1551cc630d40b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab new file mode 100644 index 0000000..f51b667 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7434967355688441420 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7434967355688441423} + - component: {fileID: -8837774153085666347} + m_Layer: 0 + m_Name: Multi HandLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7434967355688441423 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7434967355688441420} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &-8837774153085666347 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7434967355688441420} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ba3c50c2cb46dc9e916dd3a33c8a488, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 4724242833946851653, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + _leftLandmarkColor: {r: 1, g: 0.5411765, b: 0, a: 1} + _rightLandmarkColor: {r: 0, g: 0.8509804, b: 0.90588236, a: 1} + _landmarkRadius: 15 + _connectionColor: {r: 1, g: 1, b: 1, a: 1} + _connectionWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..5cf1f05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Multi HandLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 87a9be2a7620991a78342ef9a56fa62c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab new file mode 100644 index 0000000..bf092bf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab @@ -0,0 +1,112 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5105739270100195971 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5105739270100195975} + - component: {fileID: 5105739270100195974} + - component: {fileID: 5105739270100195973} + - component: {fileID: 5105739270100195972} + - component: {fileID: 5105739270100195704} + m_Layer: 0 + m_Name: Point Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5105739270100195975 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5105739270100195971} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5105739270100195974 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5105739270100195971} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5105739270100195973 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5105739270100195971} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b4cdc6c3db064fca08a172ce83ee9d12, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &5105739270100195972 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5105739270100195971} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &5105739270100195704 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5105739270100195971} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0476f607871e33f2783b582f7a75703c, type: 3} + m_Name: + m_EditorClassIdentifier: + color: {r: 0, g: 1, b: 0, a: 1} + radius: 15 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab.meta new file mode 100644 index 0000000..810317d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd50999c161e69345953a2cb517dd339 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab new file mode 100644 index 0000000..b7ad395 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &9215842904284588297 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9215842904284589814} + - component: {fileID: 9215842904284589815} + m_Layer: 0 + m_Name: Point List Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9215842904284589814 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9215842904284588297} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9215842904284589815 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9215842904284588297} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 5105739270100195971, guid: cd50999c161e69345953a2cb517dd339, + type: 3} + color: {r: 0, g: 1, b: 0, a: 1} + radius: 15 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab.meta new file mode 100644 index 0000000..5616cbf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Point List Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e260d2f5fb90a790385fcb2d815b23a6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab new file mode 100644 index 0000000..e1682b3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab @@ -0,0 +1,285 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1915238444563462411 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1915238444563462410} + - component: {fileID: 1915238444563462421} + m_Layer: 0 + m_Name: PoseLandmarkList Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1915238444563462410 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1915238444563462411} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5913343085919651617} + - {fileID: 5166490095076042167} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1915238444563462421 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1915238444563462411} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39bac9dd52c31ae7aa01a7383bc44853, type: 3} + m_Name: + m_EditorClassIdentifier: + _landmarkListAnnotation: {fileID: 5913343085919651616} + _connectionListAnnotation: {fileID: 4106715738273262277} + _leftLandmarkColor: {r: 1, g: 0.5411765, b: 0, a: 1} + _rightLandmarkColor: {r: 0, g: 0.8509804, b: 0.90588236, a: 1} +--- !u!1001 &3311599829723851223 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1915238444563462410} + m_Modifications: + - target: {fileID: 9215842904284588297, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_Name + value: Point List Annotation + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e260d2f5fb90a790385fcb2d815b23a6, type: 3} +--- !u!4 &5913343085919651617 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 9215842904284589814, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 3311599829723851223} + m_PrefabAsset: {fileID: 0} +--- !u!114 &5913343085919651616 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9215842904284589815, guid: e260d2f5fb90a790385fcb2d815b23a6, + type: 3} + m_PrefabInstance: {fileID: 3311599829723851223} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae7563ab8645734c6b682cbbca130f6f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &5614406909194798877 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1915238444563462410} + m_Modifications: + - target: {fileID: 745748194542674601, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_Name + value: Connection List Annotation + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 745748194542674603, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c97d04632e9be1a7cb05f6ab855b365b, type: 3} +--- !u!4 &5166490095076042167 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 745748194542674602, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 5614406909194798877} + m_PrefabAsset: {fileID: 0} +--- !u!114 &4106715738273262277 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8437385474393681368, guid: c97d04632e9be1a7cb05f6ab855b365b, + type: 3} + m_PrefabInstance: {fileID: 5614406909194798877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03e2158a34405b74280f0e793ae6d083, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab.meta new file mode 100644 index 0000000..42ba97d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/PoseLandmarkList Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4418f6a92856c5b51b58a36e3be7ed5c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab new file mode 100644 index 0000000..2b26e4f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab @@ -0,0 +1,160 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4965192403804369243 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4965192403804369240} + - component: {fileID: 4965192403804369241} + - component: {fileID: 4965192403804369242} + m_Layer: 0 + m_Name: Rectangle Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4965192403804369240 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4965192403804369243} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!120 &4965192403804369241 +LineRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4965192403804369243} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 207b29ccc237efe2f841a58fbf9e5478, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 0, b: 0, a: 1} + key1: {r: 1, g: 0, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_UseWorldSpace: 0 + m_Loop: 1 +--- !u!114 &4965192403804369242 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4965192403804369243} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba39488de81a63b298a92a9d09ac42db, type: 3} + m_Name: + m_EditorClassIdentifier: + _lineRenderer: {fileID: 4965192403804369241} + _color: {r: 1, g: 0, b: 0, a: 1} + _lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab.meta new file mode 100644 index 0000000..a850391 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3b696480602fe21de85315216956bd42 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab new file mode 100644 index 0000000..009269c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1620015869145370096 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1620015869145370099} + - component: {fileID: 1620015869145370098} + m_Layer: 0 + m_Name: Rectangle List Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1620015869145370099 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1620015869145370096} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1620015869145370098 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1620015869145370096} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ff689dc19c0db10608af875e2c24ade9, type: 3} + m_Name: + m_EditorClassIdentifier: + _annotationPrefab: {fileID: 4965192403804369243, guid: 3b696480602fe21de85315216956bd42, + type: 3} + color: {r: 1, g: 0, b: 0, a: 1} + lineWidth: 1 diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab.meta new file mode 100644 index 0000000..9614561 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Rectangle List Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8fcc7ea504479f06a9334ee2faa42b57 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab new file mode 100644 index 0000000..6f2c69a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab @@ -0,0 +1,748 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1970024004534580348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1970024004534580351} + - component: {fileID: 3218336891424051373} + m_Layer: 0 + m_Name: Transform Annotation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1970024004534580351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1970024004534580348} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4070943725249276834} + - {fileID: 4070943725190493614} + - {fileID: 4070943725931072865} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3218336891424051373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1970024004534580348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 219b3f9aac8f8d18db8e85142b28db7d, type: 3} + m_Name: + m_EditorClassIdentifier: + _xArrow: {fileID: 4070943725249276835} + _yArrow: {fileID: 4070943725190493615} + _zArrow: {fileID: 4070943725931072864} +--- !u!1001 &1970024002895185507 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1970024004534580351} + m_Modifications: + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.z + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229789, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + - target: {fileID: 2533287827353209600, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Name + value: Z Arrow + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].z + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].time + value: 0.0794487 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].value + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: d.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: d.z + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: coneScale + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _magnitude + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _direction.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _direction.z + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 960d38eab3d401593b4ec2080d613df3, type: 3} +--- !u!114 &4070943725931072864 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024002895185507} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a793788ee98ea8ea3b28457e7dd7197d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &4070943725931072865 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024002895185507} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1970024003290734752 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1970024004534580351} + m_Modifications: + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229789, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + - target: {fileID: 2533287827353209600, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Name + value: X Arrow + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.atime0 + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.ctime0 + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.ctime1 + value: 65535 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.ctime2 + value: 65535 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key0.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key1.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key2.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key2.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.key2.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.colorGradient.m_NumColorKeys + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].time + value: 0.09499359 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].value + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: coneScale + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _magnitude + value: 10 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 960d38eab3d401593b4ec2080d613df3, type: 3} +--- !u!4 &4070943725249276834 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024003290734752} + m_PrefabAsset: {fileID: 0} +--- !u!114 &4070943725249276835 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024003290734752} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a793788ee98ea8ea3b28457e7dd7197d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1970024003366043308 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1970024004534580351} + m_Modifications: + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.y + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229787, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287826761229789, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 0ea6416eaf3d1674291ec58a548378d8, type: 2} + - target: {fileID: 2533287827353209600, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Name + value: Y Arrow + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Positions.Array.data[1].y + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].time + value: 0.075992584 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209601, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[0].value + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: d.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: d.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: coneScale + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _magnitude + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _direction.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + propertyPath: _direction.y + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 960d38eab3d401593b4ec2080d613df3, type: 3} +--- !u!4 &4070943725190493614 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2533287827353209602, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024003366043308} + m_PrefabAsset: {fileID: 0} +--- !u!114 &4070943725190493615 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2533287827353209603, guid: 960d38eab3d401593b4ec2080d613df3, + type: 3} + m_PrefabInstance: {fileID: 1970024003366043308} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a793788ee98ea8ea3b28457e7dd7197d, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab.meta new file mode 100644 index 0000000..dee6b83 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Prefabs/Transform Annotation.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6f13a2b002175f9a0865766faacfed08 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders.meta new file mode 100644 index 0000000..3639f0a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8dc0ef8c328802f4fba9e38c57569cc4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader new file mode 100644 index 0000000..d9b0fc5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader @@ -0,0 +1,65 @@ +Shader "Unlit/MediaPipe/Convergence Shader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + _Color ("Main Color", Color) = (1, 1, 1, 1) + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _Color; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + if (v.vertex.y > 0) + { + v.vertex.x = 0; + v.vertex.z = 0; + } + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 col = _Color; + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader.meta new file mode 100644 index 0000000..47ad607 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/Convergence Shader.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 349b4f383ce8440988c29923e4684694 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader new file mode 100644 index 0000000..2ed63f5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader @@ -0,0 +1,75 @@ +Shader "Unlit/MediaPipe/Mask Shader" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "" {} + _MaskTex ("Mask Texture", 2D) = "blue" {} + _Width ("Mask Width", Int) = 0 + _Height ("Mask Height", Int) = 0 + _Threshold ("Threshold", Range(0.0, 1.0)) = 0.9 + } + + SubShader + { + Tags { "RenderType"="Transparent" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + sampler2D _MaskTex; + + int _Width; + int _Height; + float _Threshold; + uniform StructuredBuffer _MaskBuffer; + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 mainCol = tex2D(_MainTex, i.uv); + fixed4 maskCol = tex2D(_MaskTex, i.uv); + int idx = int(i.uv.y * _Height) * _Width + int(i.uv.x * _Width); + float mask = _MaskBuffer[idx]; + fixed4 col = lerp(mainCol, lerp(mainCol, maskCol, mask), step(_Threshold, mask)); + + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader.meta new file mode 100644 index 0000000..c9e3a9d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/MaskShader.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7adfa9ebe754989caa35dbb2c5526d1c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader new file mode 100644 index 0000000..f123ab1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader @@ -0,0 +1,76 @@ +Shader "Unlit/MediaPipe/Unmask Shader" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "" {} + _MaskTex ("Mask Texture", 2D) = "blue" {} + _Width ("Mask Width", Int) = 0 + _Height ("Mask Height", Int) = 0 + _Threshold ("Threshold", Range(0.0, 1.0)) = 0.9 + } + + SubShader + { + Tags { "RenderType"="Transparent" } + Blend SrcAlpha OneMinusSrcAlpha + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + sampler2D _MaskTex; + + int _Width; + int _Height; + float _Threshold; + uniform StructuredBuffer _MaskBuffer; + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 mainCol = tex2D(_MainTex, i.uv); + fixed4 maskCol = tex2D(_MaskTex, i.uv); + int idx = int(i.uv.y * _Height) * _Width + int(i.uv.x * _Width); + float mask = _MaskBuffer[idx]; + fixed4 col = lerp(maskCol, lerp(maskCol, mainCol, mask), step(_Threshold, mask)); + + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader.meta b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader.meta new file mode 100644 index 0000000..df2e146 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/Shaders/UnmaskShader.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d684c6d125278d05fbb1904ee5103f3a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef b/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef new file mode 100644 index 0000000..bd7821f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef @@ -0,0 +1,19 @@ +{ + "name": "Mediapipe.Runtime", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "Google.Protobuf.dll", + "System.Buffers.dll", + "System.Memory.dll", + "System.Runtime.CompilerServices.Unsafe.dll" + ], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef.meta b/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef.meta new file mode 100644 index 0000000..b9f333a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Mediapipe.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 04c4d86a70aa56c55a78c61f1ab1a56d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android.meta new file mode 100644 index 0000000..ea40240 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 960f22b76db95de4eb4600bfee401a1c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar new file mode 100644 index 0000000..10a6d35 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar.meta new file mode 100644 index 0000000..ef23aaf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Android/mediapipe_android.aar.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: dab210e21a2c0a02392e202ae0740817 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf.meta new file mode 100644 index 0000000..97b52ae --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e3cd6fec3ffc8d4891d93f9f4749c3a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll new file mode 100644 index 0000000..b588a31 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll.meta new file mode 100644 index 0000000..aff6c3a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/Google.Protobuf.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: d6da87d6a876f25c5802cf8e0df72d3b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll new file mode 100644 index 0000000..b6d9c77 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll.meta new file mode 100644 index 0000000..5462420 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Buffers.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 20fb96b12d894c5a7a8713caecebd3c8 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll new file mode 100644 index 0000000..bdfc501 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll.meta new file mode 100644 index 0000000..968c122 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Memory.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 4e19afad160897b59a93cac7cb3360d1 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000..3156239 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll.meta new file mode 100644 index 0000000..1e07285 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 944fd731fc40094858008e9975b5f55b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS.meta new file mode 100644 index 0000000..2ce4f67 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed7ff031c8aac574a948ab9410a00813 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework.meta new file mode 100644 index 0000000..d5979ae --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: 379781028b715724c84d478a31316d8f +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist new file mode 100644 index 0000000..a2e4073 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist.meta new file mode 100644 index 0000000..56546ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f5e4f9f82c5a94f9aad4546b87ee004e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity new file mode 100644 index 0000000..00e2cf8 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity.meta new file mode 100644 index 0000000..0f65263 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/iOS/MediaPipeUnity.framework/MediaPipeUnity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad6bde42792844b21b9e9f8bbb04cffa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib new file mode 100644 index 0000000..f580c1a Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib.meta new file mode 100644 index 0000000..da20b09 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: f268f30ffc5224c62a75c54d3cafa39f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: OSX + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so new file mode 100644 index 0000000..fd452dc Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so.meta new file mode 100644 index 0000000..7a3af45 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.so.meta @@ -0,0 +1,86 @@ +fileFormatVersion: 2 +guid: bc0d181be0a5a776b8f43517261c4634 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Linux + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll new file mode 100644 index 0000000..56c0099 Binary files /dev/null and b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll differ diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll.meta b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll.meta new file mode 100644 index 0000000..bad8576 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Plugins/mediapipe_c.dll.meta @@ -0,0 +1,70 @@ +fileFormatVersion: 2 +guid: 0e44f8471c53b14499215632d239cb0a +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts.meta new file mode 100644 index 0000000..078ff57 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3bdc35c12bddd84d811ee006d01bf7d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core.meta new file mode 100644 index 0000000..eda3e64 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f21484d7914a56a4abbcfaf9dc525c77 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs new file mode 100644 index 0000000..7e52924 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs @@ -0,0 +1,73 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +/// based on [OpenCvSharp](https://github.com/shimat/opencvsharp/blob/9a5f9828a74cfa3995562a06716e177705cde038/src/OpenCvSharp/Fundamentals/DisposableObject.cs) + +using System; +using System.Threading; + +namespace Mediapipe +{ + public abstract class DisposableObject : IDisposable + { + private volatile int _disposeSignaled = 0; + + public bool isDisposed { get; protected set; } + protected bool isOwner { get; private set; } + + protected DisposableObject() : this(true) { } + + protected DisposableObject(bool isOwner) + { + isDisposed = false; + this.isOwner = isOwner; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (Interlocked.Exchange(ref _disposeSignaled, 1) != 0) + { + return; + } + + isDisposed = true; + + if (disposing) + { + DisposeManaged(); + } + DisposeUnmanaged(); + } + + ~DisposableObject() + { + Dispose(false); + } + + protected virtual void DisposeManaged() { } + + protected virtual void DisposeUnmanaged() { } + + public void TransferOwnership() + { + isOwner = false; + } + + public void ThrowIfDisposed() + { + if (isDisposed) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs.meta new file mode 100644 index 0000000..cc70ec8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/DisposableObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9bf4260db1fcf38d9ab2123b9b848aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs new file mode 100644 index 0000000..fd5e2ec --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public interface IMpResourceHandle : IDisposable + { + IntPtr mpPtr { get; } + + /// + /// Relinquish the ownership, and release the resource it owns if necessary. + /// This method should be called only if the underlying native api moves the pointer. + /// + /// If the object itself is no longer used, call instead. + void ReleaseMpResource(); + + /// Relinquish the ownership + void TransferOwnership(); + + bool OwnsResource(); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs.meta new file mode 100644 index 0000000..1709e05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/IMpResourceHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5d6d5b8194184fe7bf9b284a3d1d76c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs new file mode 100644 index 0000000..b83557e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public class InternalException : Exception + { + public InternalException(string message) : base(message) { } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs.meta new file mode 100644 index 0000000..3a4d242 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/InternalException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c01fc4de4ae037a79dab98092851538 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs new file mode 100644 index 0000000..235a5df --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public class MediaPipeException : Exception + { + public MediaPipeException(string message) : base(message) { } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs.meta new file mode 100644 index 0000000..8292af2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipeException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 09e5bf77632ac85288dacb5b5445e9ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs new file mode 100644 index 0000000..a8c2d73 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public class MediaPipePluginException : Exception + { + public MediaPipePluginException(string message) : base(message) { } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs.meta new file mode 100644 index 0000000..d4bd2d0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MediaPipePluginException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e17a1d893e9d74c4eb7e85860d115c02 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs new file mode 100644 index 0000000..85ac1ef --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs @@ -0,0 +1,102 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + public abstract class MpResourceHandle : DisposableObject, IMpResourceHandle + { + private IntPtr _ptr = IntPtr.Zero; + protected IntPtr ptr + { + get => _ptr; + set + { + if (value != IntPtr.Zero && OwnsResource()) + { + throw new InvalidOperationException($"This object owns another resource"); + } + _ptr = value; + } + } + + protected MpResourceHandle(bool isOwner = true) : this(IntPtr.Zero, isOwner) { } + + protected MpResourceHandle(IntPtr ptr, bool isOwner = true) : base(isOwner) + { + this.ptr = ptr; + } + + #region IMpResourceHandle + public IntPtr mpPtr + { + get + { + ThrowIfDisposed(); + return ptr; + } + } + + public void ReleaseMpResource() + { + if (OwnsResource()) + { + DeleteMpPtr(); + } + ReleaseMpPtr(); + TransferOwnership(); + } + + public bool OwnsResource() + { + return isOwner && IsResourcePresent(); + } + #endregion + + protected override void DisposeUnmanaged() + { + if (OwnsResource()) + { + DeleteMpPtr(); + } + ReleaseMpPtr(); + base.DisposeUnmanaged(); + } + + /// + /// Forgets the pointer address. + /// After calling this method, will return false. + /// + protected void ReleaseMpPtr() + { + ptr = IntPtr.Zero; + } + + /// + /// Release the memory (call `delete` or `delete[]`) whether or not it owns it. + /// + /// In most cases, this method should not be called directly + protected abstract void DeleteMpPtr(); + + protected delegate MpReturnCode StringOutFunc(IntPtr ptr, out IntPtr strPtr); + protected string MarshalStringFromNative(StringOutFunc f) + { + f(mpPtr, out var strPtr).Assert(); + GC.KeepAlive(this); + + var str = Marshal.PtrToStringAnsi(strPtr); + UnsafeNativeMethods.delete_array__PKc(strPtr); + + return str; + } + + protected bool IsResourcePresent() + { + return ptr != IntPtr.Zero; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs.meta new file mode 100644 index 0000000..301949b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/MpResourceHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63faa26aefbc969038939ad114363133 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs new file mode 100644 index 0000000..da1bbac --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public abstract class SharedPtrHandle : MpResourceHandle + { + protected SharedPtrHandle(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + /// The owning pointer + public abstract IntPtr Get(); + + /// Release the owning pointer + public abstract void Reset(); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs.meta new file mode 100644 index 0000000..4e6aab9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/SharedPtrHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90b1644d510da0d46a0db08fd07d3c49 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs new file mode 100644 index 0000000..4eb2995 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +using System; + +namespace Mediapipe +{ + public abstract class UniquePtrHandle : MpResourceHandle + { + protected UniquePtrHandle(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + /// The owning pointer + public abstract IntPtr Get(); + + /// Release the owning pointer + public abstract IntPtr Release(); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs.meta new file mode 100644 index 0000000..4095c6f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core/UniquePtrHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d0d5e05b9407fab79fe7814143e1fe6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External.meta new file mode 100644 index 0000000..1ea6362 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce49803463ef3a0449a99d42aaaddc74 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs new file mode 100644 index 0000000..cfe11e9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs @@ -0,0 +1,122 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public static class Glog + { + public enum Severity : int + { + INFO = 0, + WARNING = 1, + ERROR = 2, + FATAL = 3, + } + + private static bool _Logtostderr = false; + public static bool Logtostderr + { + get => _Logtostderr; + set + { + UnsafeNativeMethods.glog_FLAGS_logtostderr(value); + _Logtostderr = value; + } + } + + private static int _Stderrthreshold = 2; + public static int Stderrthreshold + { + get => _Stderrthreshold; + set + { + UnsafeNativeMethods.glog_FLAGS_stderrthreshold(value); + _Stderrthreshold = value; + } + } + + private static int _Minloglevel = 0; + public static int Minloglevel + { + get => _Minloglevel; + set + { + UnsafeNativeMethods.glog_FLAGS_minloglevel(value); + _Minloglevel = value; + } + } + + private static string _LogDir; + public static string LogDir + { + get => _LogDir; + set + { + UnsafeNativeMethods.glog_FLAGS_log_dir(value ?? ""); + _LogDir = value; + } + } + + private static int _V = 0; + public static int V + { + get => _V; + set + { + UnsafeNativeMethods.glog_FLAGS_v(value); + _V = value; + } + } + + public static void Initialize(string name) + { + UnsafeNativeMethods.google_InitGoogleLogging__PKc(name).Assert(); + } + + public static void Shutdown() + { + UnsafeNativeMethods.google_ShutdownGoogleLogging().Assert(); + } + + public static void Log(Severity severity, string str) + { + switch (severity) + { + case Severity.INFO: + { + UnsafeNativeMethods.glog_LOG_INFO__PKc(str); + break; + } + case Severity.WARNING: + { + UnsafeNativeMethods.glog_LOG_WARNING__PKc(str); + break; + } + case Severity.ERROR: + { + UnsafeNativeMethods.glog_LOG_ERROR__PKc(str); + break; + } + case Severity.FATAL: + { + UnsafeNativeMethods.glog_LOG_FATAL__PKc(str); + break; + } + default: + { + throw new ArgumentException($"Unknown Severity: {severity}"); + } + } + } + + public static void FlushLogFiles(Severity severity = Severity.INFO) + { + UnsafeNativeMethods.google_FlushLogFiles(severity); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs.meta new file mode 100644 index 0000000..0221627 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Glog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86fef837b136593f2b178163cdc337b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs new file mode 100644 index 0000000..e25fdf1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe +{ + public static class Protobuf + { + public delegate void LogHandler(int level, string filename, int line, string message); + public static readonly LogHandler DefaultLogHandler = LogProtobufMessage; + + public static void SetLogHandler(LogHandler logHandler) + { + UnsafeNativeMethods.google_protobuf__SetLogHandler__PF(logHandler).Assert(); + } + + /// + /// Reset the . + /// If is called, this method should be called before the program exits. + /// + public static void ResetLogHandler() + { + UnsafeNativeMethods.google_protobuf__ResetLogHandler().Assert(); + } + + [AOT.MonoPInvokeCallback(typeof(LogHandler))] + private static void LogProtobufMessage(int level, string filename, int line, string message) + { + switch (level) + { + case 1: + { + UnityEngine.Debug.LogWarning($"[libprotobuf WARNING {filename}:{line}] {message}"); + return; + } + case 2: + { + UnityEngine.Debug.LogError($"[libprotobuf ERROR {filename}:{line}] {message}"); + return; + } + case 3: + { + UnityEngine.Debug.LogError($"[libprotobuf FATAL {filename}:{line}] {message}"); + return; + } + default: + { + UnityEngine.Debug.Log($"[libprotobuf INFO {filename}:{line}] {message}"); + return; + } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs.meta new file mode 100644 index 0000000..9dd7756 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c258e2200c807137bb781aa54c9c8a3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs new file mode 100644 index 0000000..9d11348 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +using pb = Google.Protobuf; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + internal readonly struct SerializedProto + { + private readonly IntPtr _str; + private readonly int _length; + + public void Dispose() + { + UnsafeNativeMethods.delete_array__PKc(_str); + } + + public T Deserialize(pb::MessageParser parser) where T : pb::IMessage + { + var bytes = new byte[_length]; + Marshal.Copy(_str, bytes, 0, bytes.Length); + return parser.ParseFrom(bytes); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs.meta new file mode 100644 index 0000000..8b4f0b0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProto.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8d10ad9609f7ff51963ca10e709bba5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs new file mode 100644 index 0000000..0e98053 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +using pb = Google.Protobuf; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + internal readonly struct SerializedProtoVector + { + private readonly IntPtr _data; + private readonly int _size; + + public void Dispose() + { + UnsafeNativeMethods.mp_api_SerializedProtoArray__delete(_data, _size); + } + + public List Deserialize(pb::MessageParser parser) where T : pb::IMessage + { + var protos = new List(_size); + + unsafe + { + var protoPtr = (SerializedProto*)_data; + + for (var i = 0; i < _size; i++) + { + var serializedProto = Marshal.PtrToStructure((IntPtr)protoPtr++); + protos.Add(serializedProto.Deserialize(parser)); + } + } + + return protos; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs.meta new file mode 100644 index 0000000..6161d93 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/SerializedProtoVector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d42fce9f6c3543838b1c20085f531c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs new file mode 100644 index 0000000..44a8fcd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class StdString : MpResourceHandle + { + public StdString(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public StdString(byte[] bytes) : base() + { + UnsafeNativeMethods.std_string__PKc_i(bytes, bytes.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.std_string__delete(ptr); + } + + public void Swap(StdString str) + { + UnsafeNativeMethods.std_string__swap__Rstr(mpPtr, str.mpPtr); + GC.KeepAlive(this); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs.meta new file mode 100644 index 0000000..f5bd5ba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/StdString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cb68ad64fa60ce26874036c880a55a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework.meta new file mode 100644 index 0000000..5c5c613 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1253c8fbe82b7704f868091ebe91f900 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs new file mode 100644 index 0000000..fd403d0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs @@ -0,0 +1,231 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +using Google.Protobuf; + +namespace Mediapipe +{ + public class CalculatorGraph : MpResourceHandle + { + public delegate Status.StatusArgs NativePacketCallback(IntPtr graphPtr, int streamId, IntPtr packetPtr); + public delegate void PacketCallback(TPacket packet) where TPacket : Packet; + + public CalculatorGraph() : base() + { + UnsafeNativeMethods.mp_CalculatorGraph__(out var ptr).Assert(); + this.ptr = ptr; + } + + private CalculatorGraph(byte[] serializedConfig) : base() + { + UnsafeNativeMethods.mp_CalculatorGraph__PKc_i(serializedConfig, serializedConfig.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + public CalculatorGraph(CalculatorGraphConfig config) : this(config.ToByteArray()) { } + + public CalculatorGraph(string textFormatConfig) : this(CalculatorGraphConfig.Parser.ParseFromTextFormat(textFormatConfig)) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_CalculatorGraph__delete(ptr); + } + + public Status Initialize(CalculatorGraphConfig config) + { + var bytes = config.ToByteArray(); + UnsafeNativeMethods.mp_CalculatorGraph__Initialize__PKc_i(mpPtr, bytes, bytes.Length, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status Initialize(CalculatorGraphConfig config, SidePacket sidePacket) + { + var bytes = config.ToByteArray(); + UnsafeNativeMethods.mp_CalculatorGraph__Initialize__PKc_i_Rsp(mpPtr, bytes, bytes.Length, sidePacket.mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + /// Crashes if config is not set + public CalculatorGraphConfig Config() + { + UnsafeNativeMethods.mp_CalculatorGraph__Config(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var config = serializedProto.Deserialize(CalculatorGraphConfig.Parser); + serializedProto.Dispose(); + + return config; + } + + public Status ObserveOutputStream(string streamName, int streamId, NativePacketCallback nativePacketCallback, bool observeTimestampBounds = false) + { + UnsafeNativeMethods.mp_CalculatorGraph__ObserveOutputStream__PKc_PF_b(mpPtr, streamName, streamId, nativePacketCallback, observeTimestampBounds, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status ObserveOutputStream(string streamName, PacketCallback packetCallback, bool observeTimestampBounds, out GCHandle callbackHandle) where TPacket : Packet, new() + { + NativePacketCallback nativePacketCallback = (IntPtr graphPtr, int streamId, IntPtr packetPtr) => + { + try + { + var packet = Packet.Create(packetPtr, false); + packetCallback(packet); + return Status.StatusArgs.Ok(); + } + catch (Exception e) + { + return Status.StatusArgs.Internal(e.ToString()); + } + }; + callbackHandle = GCHandle.Alloc(nativePacketCallback, GCHandleType.Pinned); + + return ObserveOutputStream(streamName, 0, nativePacketCallback, observeTimestampBounds); + } + + public Status ObserveOutputStream(string streamName, PacketCallback packetCallback, out GCHandle callbackHandle) where TPacket : Packet, new() + { + return ObserveOutputStream(streamName, packetCallback, false, out callbackHandle); + } + + public StatusOrPoller AddOutputStreamPoller(string streamName, bool observeTimestampBounds = false) + { + UnsafeNativeMethods.mp_CalculatorGraph__AddOutputStreamPoller__PKc_b(mpPtr, streamName, observeTimestampBounds, out var statusOrPollerPtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrPoller(statusOrPollerPtr); + } + + public Status Run() + { + return Run(new SidePacket()); + } + + public Status Run(SidePacket sidePacket) + { + UnsafeNativeMethods.mp_CalculatorGraph__Run__Rsp(mpPtr, sidePacket.mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(sidePacket); + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status StartRun() + { + return StartRun(new SidePacket()); + } + + public Status StartRun(SidePacket sidePacket) + { + UnsafeNativeMethods.mp_CalculatorGraph__StartRun__Rsp(mpPtr, sidePacket.mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(sidePacket); + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status WaitUntilIdle() + { + UnsafeNativeMethods.mp_CalculatorGraph__WaitUntilIdle(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status WaitUntilDone() + { + UnsafeNativeMethods.mp_CalculatorGraph__WaitUntilDone(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public bool HasError() + { + return SafeNativeMethods.mp_CalculatorGraph__HasError(mpPtr); + } + + public Status AddPacketToInputStream(string streamName, Packet packet) + { + UnsafeNativeMethods.mp_CalculatorGraph__AddPacketToInputStream__PKc_Ppacket(mpPtr, streamName, packet.mpPtr, out var statusPtr).Assert(); + packet.Dispose(); // respect move semantics + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status SetInputStreamMaxQueueSize(string streamName, int maxQueueSize) + { + UnsafeNativeMethods.mp_CalculatorGraph__SetInputStreamMaxQueueSize__PKc_i(mpPtr, streamName, maxQueueSize, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status CloseInputStream(string streamName) + { + UnsafeNativeMethods.mp_CalculatorGraph__CloseInputStream__PKc(mpPtr, streamName, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status CloseAllPacketSources() + { + UnsafeNativeMethods.mp_CalculatorGraph__CloseAllPacketSources(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public void Cancel() + { + UnsafeNativeMethods.mp_CalculatorGraph__Cancel(mpPtr).Assert(); + GC.KeepAlive(this); + } + + public bool GraphInputStreamsClosed() + { + return SafeNativeMethods.mp_CalculatorGraph__GraphInputStreamsClosed(mpPtr); + } + + public bool IsNodeThrottled(int nodeId) + { + return SafeNativeMethods.mp_CalculatorGraph__IsNodeThrottled__i(mpPtr, nodeId); + } + + public bool UnthrottleSources() + { + return SafeNativeMethods.mp_CalculatorGraph__UnthrottleSources(mpPtr); + } + + public GpuResources GetGpuResources() + { + UnsafeNativeMethods.mp_CalculatorGraph__GetGpuResources(mpPtr, out var gpuResourcesPtr).Assert(); + + GC.KeepAlive(this); + return new GpuResources(gpuResourcesPtr); + } + + public Status SetGpuResources(GpuResources gpuResources) + { + UnsafeNativeMethods.mp_CalculatorGraph__SetGpuResources__SPgpu(mpPtr, gpuResources.sharedPtr, out var statusPtr).Assert(); + + GC.KeepAlive(gpuResources); + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs.meta new file mode 100644 index 0000000..2e6e57b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aac82f941ea6a90309bfe58c72f0be18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs new file mode 100644 index 0000000..728ba05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using pb = Google.Protobuf; + +namespace Mediapipe +{ + public static class CalculatorGraphConfigExtension + { + public static CalculatorGraphConfig ParseFromTextFormat(this pb::MessageParser _, string configText) + { + if (UnsafeNativeMethods.mp_api__ConvertFromCalculatorGraphConfigTextFormat(configText, out var serializedProto)) + { + var config = serializedProto.Deserialize(CalculatorGraphConfig.Parser); + serializedProto.Dispose(); + return config; + } + throw new MediaPipeException("Failed to parse config text. See error logs for more details"); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs.meta new file mode 100644 index 0000000..b478d04 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraphConfigExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d17ea3a25da1d9e79b6121a228e2a99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats.meta new file mode 100644 index 0000000..1fc8f6c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c78bb0fe754bbb448fd9fd8082b8906 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs new file mode 100644 index 0000000..57bfd20 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs @@ -0,0 +1,320 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; + +namespace Mediapipe +{ + public class ImageFrame : MpResourceHandle + { + public static readonly uint DefaultAlignmentBoundary = 16; + public static readonly uint GlDefaultAlignmentBoundary = 4; + + public delegate void Deleter(IntPtr ptr); + + public ImageFrame() : base() + { + UnsafeNativeMethods.mp_ImageFrame__(out var ptr).Assert(); + this.ptr = ptr; + } + + public ImageFrame(IntPtr imageFramePtr, bool isOwner = true) : base(imageFramePtr, isOwner) { } + + public ImageFrame(ImageFormat.Types.Format format, int width, int height) : this(format, width, height, DefaultAlignmentBoundary) { } + + public ImageFrame(ImageFormat.Types.Format format, int width, int height, uint alignmentBoundary) : base() + { + UnsafeNativeMethods.mp_ImageFrame__ui_i_i_ui(format, width, height, alignmentBoundary, out var ptr).Assert(); + this.ptr = ptr; + } + + public ImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, IntPtr pixelData, Deleter deleter) : base() + { + unsafe + { + UnsafeNativeMethods.mp_ImageFrame__ui_i_i_i_Pui8_PF(format, width, height, widthStep, pixelData, deleter, out var ptr).Assert(); + this.ptr = ptr; + } + } + + public unsafe ImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, NativeArray pixelData, Deleter deleter) + : this(format, width, height, widthStep, (IntPtr)NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(pixelData), deleter) + { } + + /// + /// Initialize an . + /// + /// + /// won't be released if the instance is disposed of.
+ /// It's useful when: + /// + /// + /// You can reuse the memory allocated to . + /// + /// + /// You've not allocated the memory (e.g. ). + /// + /// + ///
+ public ImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, NativeArray pixelData) + : this(format, width, height, widthStep, pixelData, VoidDeleter) + { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_ImageFrame__delete(ptr); + } + + [AOT.MonoPInvokeCallback(typeof(Deleter))] + private static void VoidDeleter(IntPtr _) { } + + /// + /// The number of channels for a . + /// If channels don't make sense in the , returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public static int NumberOfChannelsForFormat(ImageFormat.Types.Format format) + { + switch (format) + { + case ImageFormat.Types.Format.Srgb: + case ImageFormat.Types.Format.Srgb48: + return 3; + case ImageFormat.Types.Format.Srgba: + case ImageFormat.Types.Format.Srgba64: + case ImageFormat.Types.Format.Sbgra: + return 4; + case ImageFormat.Types.Format.Gray8: + case ImageFormat.Types.Format.Gray16: + return 1; + case ImageFormat.Types.Format.Vec32F1: + return 1; + case ImageFormat.Types.Format.Vec32F2: + return 2; + case ImageFormat.Types.Format.Lab8: + return 3; + case ImageFormat.Types.Format.Ycbcr420P: + case ImageFormat.Types.Format.Ycbcr420P10: + case ImageFormat.Types.Format.Unknown: + default: + return 0; + } + } + + /// + /// The channel size for a . + /// If channels don't make sense in the , returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public static int ChannelSizeForFormat(ImageFormat.Types.Format format) + { + switch (format) + { + case ImageFormat.Types.Format.Srgb: + case ImageFormat.Types.Format.Srgba: + case ImageFormat.Types.Format.Sbgra: + return sizeof(byte); + case ImageFormat.Types.Format.Srgb48: + case ImageFormat.Types.Format.Srgba64: + return sizeof(ushort); + case ImageFormat.Types.Format.Gray8: + return sizeof(byte); + case ImageFormat.Types.Format.Gray16: + return sizeof(ushort); + case ImageFormat.Types.Format.Vec32F1: + case ImageFormat.Types.Format.Vec32F2: + // sizeof float may be wrong since it's platform-dependent, but we assume that it's constant across all supported platforms. + return sizeof(float); + case ImageFormat.Types.Format.Lab8: + return sizeof(byte); + case ImageFormat.Types.Format.Ycbcr420P: + case ImageFormat.Types.Format.Ycbcr420P10: + case ImageFormat.Types.Format.Unknown: + default: + return 0; + } + } + + /// + /// The depth of each channel in bytes for a . + /// If channels don't make sense in the , returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public static int ByteDepthForFormat(ImageFormat.Types.Format format) + { + switch (format) + { + case ImageFormat.Types.Format.Srgb: + case ImageFormat.Types.Format.Srgba: + case ImageFormat.Types.Format.Sbgra: + return 1; + case ImageFormat.Types.Format.Srgb48: + case ImageFormat.Types.Format.Srgba64: + return 2; + case ImageFormat.Types.Format.Gray8: + return 1; + case ImageFormat.Types.Format.Gray16: + return 2; + case ImageFormat.Types.Format.Vec32F1: + case ImageFormat.Types.Format.Vec32F2: + return 4; + case ImageFormat.Types.Format.Lab8: + return 1; + case ImageFormat.Types.Format.Ycbcr420P: + case ImageFormat.Types.Format.Ycbcr420P10: + case ImageFormat.Types.Format.Unknown: + default: + return 0; + } + } + + public bool IsEmpty() + { + return SafeNativeMethods.mp_ImageFrame__IsEmpty(mpPtr); + } + + public bool IsContiguous() + { + return SafeNativeMethods.mp_ImageFrame__IsContiguous(mpPtr); + } + + public bool IsAligned(uint alignmentBoundary) + { + SafeNativeMethods.mp_ImageFrame__IsAligned__ui(mpPtr, alignmentBoundary, out var value).Assert(); + + GC.KeepAlive(this); + return value; + } + + public ImageFormat.Types.Format Format() + { + return SafeNativeMethods.mp_ImageFrame__Format(mpPtr); + } + + public int Width() + { + return SafeNativeMethods.mp_ImageFrame__Width(mpPtr); + } + + public int Height() + { + return SafeNativeMethods.mp_ImageFrame__Height(mpPtr); + } + + /// + /// The channel size. + /// If channels don't make sense, returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public int ChannelSize() + { + return ChannelSizeForFormat(Format()); + } + + /// + /// The Number of channels. + /// If channels don't make sense, returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public int NumberOfChannels() + { + return NumberOfChannelsForFormat(Format()); + } + + /// + /// The depth of each image channel in bytes. + /// If channels don't make sense, returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public int ByteDepth() + { + return ByteDepthForFormat(Format()); + } + + public int WidthStep() + { + return SafeNativeMethods.mp_ImageFrame__WidthStep(mpPtr); + } + + public IntPtr MutablePixelData() + { + return SafeNativeMethods.mp_ImageFrame__MutablePixelData(mpPtr); + } + + public int PixelDataSize() + { + return Height() * WidthStep(); + } + + /// + /// The total size the pixel data would take if it was stored contiguously (which may not be the case). + /// If channels don't make sense, returns 0. + /// + /// + /// Unlike the original implementation, this API won't signal SIGABRT. + /// + public int PixelDataSizeStoredContiguously() + { + return Width() * Height() * ByteDepth() * NumberOfChannels(); + } + + public void SetToZero() + { + UnsafeNativeMethods.mp_ImageFrame__SetToZero(mpPtr).Assert(); + GC.KeepAlive(this); + } + + public void SetAlignmentPaddingAreas() + { + UnsafeNativeMethods.mp_ImageFrame__SetAlignmentPaddingAreas(mpPtr).Assert(); + GC.KeepAlive(this); + } + + public void CopyToBuffer(byte[] buffer) + { + CopyToBuffer(UnsafeNativeMethods.mp_ImageFrame__CopyToBuffer__Pui8_i, buffer); + } + + public void CopyToBuffer(ushort[] buffer) + { + CopyToBuffer(UnsafeNativeMethods.mp_ImageFrame__CopyToBuffer__Pui16_i, buffer); + } + + public void CopyToBuffer(float[] buffer) + { + CopyToBuffer(UnsafeNativeMethods.mp_ImageFrame__CopyToBuffer__Pf_i, buffer); + } + + private delegate MpReturnCode CopyToBufferHandler(IntPtr ptr, IntPtr buffer, int bufferSize); + + private void CopyToBuffer(CopyToBufferHandler handler, T[] buffer) where T : unmanaged + { + unsafe + { + fixed (T* bufferPtr = buffer) + { + handler(mpPtr, (IntPtr)bufferPtr, buffer.Length).Assert(); + } + } + + GC.KeepAlive(this); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs.meta new file mode 100644 index 0000000..875fa52 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats/ImageFrame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d935bef0b56e4e630af77963694500c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs new file mode 100644 index 0000000..f13b3fb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs @@ -0,0 +1,46 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class OutputStreamPoller : MpResourceHandle + { + public OutputStreamPoller(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_OutputStreamPoller__delete(ptr); + } + + public bool Next(Packet packet) + { + UnsafeNativeMethods.mp_OutputStreamPoller__Next_Ppacket(mpPtr, packet.mpPtr, out var result).Assert(); + + GC.KeepAlive(this); + return result; + } + + public void Reset() + { + UnsafeNativeMethods.mp_OutputStreamPoller__Reset(mpPtr).Assert(); + } + + public void SetMaxQueueSize(int queueSize) + { + UnsafeNativeMethods.mp_OutputStreamPoller__SetMaxQueueSize(mpPtr, queueSize).Assert(); + } + + public int QueueSize() + { + UnsafeNativeMethods.mp_OutputStreamPoller__QueueSize(mpPtr, out var result).Assert(); + + GC.KeepAlive(this); + return result; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs.meta new file mode 100644 index 0000000..f247b23 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e58cdfa177e4fe2c3aa7970d82850fcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.meta new file mode 100644 index 0000000..dc9bd2f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97cecb58177d3e64a9d08c53b7988347 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs new file mode 100644 index 0000000..3ad89af --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class Anchor3dVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public Anchor3dVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public Anchor3dVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public Anchor3dVectorPacket(Anchor3d[] value) : base() + { + UnsafeNativeMethods.mp__MakeAnchor3dVectorPacket__PA_i(value, value.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + public Anchor3dVectorPacket(Anchor3d[] value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeAnchor3dVectorPacket_At__PA_i_Rt(value, value.Length, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public Anchor3dVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetAnchor3dVector(mpPtr, out var anchorVector).Assert(); + GC.KeepAlive(this); + + var anchors = anchorVector.ToList(); + anchorVector.Dispose(); + + return anchors; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs.meta new file mode 100644 index 0000000..d0f3dcd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Anchor3dVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e1747c248b3628738bcd536767bfc09 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs new file mode 100644 index 0000000..ed1c2c8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class BoolPacket : Packet + { + /// + /// Creates an empty instance. + /// + public BoolPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public BoolPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public BoolPacket(bool value) : base() + { + UnsafeNativeMethods.mp__MakeBoolPacket__b(value, out var ptr).Assert(); + this.ptr = ptr; + } + + public BoolPacket(bool value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeBoolPacket_At__b_Rt(value, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public BoolPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override bool Get() + { + UnsafeNativeMethods.mp_Packet__GetBool(mpPtr, out var value).Assert(); + + GC.KeepAlive(this); + return value; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsBool(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs.meta new file mode 100644 index 0000000..dc5f8e4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/BoolPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2df39f2282bdd39baa43635710e5ddc2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs new file mode 100644 index 0000000..bfc5621 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class ClassificationListPacket : Packet + { + /// + /// Creates an empty instance. + /// + public ClassificationListPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public ClassificationListPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public ClassificationListPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override ClassificationList Get() + { + UnsafeNativeMethods.mp_Packet__GetClassificationList(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var classificationList = serializedProto.Deserialize(ClassificationList.Parser); + serializedProto.Dispose(); + + return classificationList; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs.meta new file mode 100644 index 0000000..e2b12a4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 135912f48f055c6b594eac0dcb8c66b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs new file mode 100644 index 0000000..1e7a55a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class ClassificationListVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public ClassificationListVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public ClassificationListVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public ClassificationListVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetClassificationListVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var classificationLists = serializedProtoVector.Deserialize(ClassificationList.Parser); + serializedProtoVector.Dispose(); + + return classificationLists; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs.meta new file mode 100644 index 0000000..4a960d9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ClassificationListVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c078b368cd8dfd66fba14dce3e749bcc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs new file mode 100644 index 0000000..9550a75 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class DetectionPacket : Packet + { + /// + /// Creates an empty instance. + /// + public DetectionPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public DetectionPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public DetectionPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override Detection Get() + { + UnsafeNativeMethods.mp_Packet__GetDetection(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var detection = serializedProto.Deserialize(Detection.Parser); + serializedProto.Dispose(); + + return detection; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs.meta new file mode 100644 index 0000000..6fb38b9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cfc4da8c1878374569d2813d16c368e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs new file mode 100644 index 0000000..d69b5a5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class DetectionVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public DetectionVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public DetectionVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public DetectionVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetDetectionVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var detections = serializedProtoVector.Deserialize(Detection.Parser); + serializedProtoVector.Dispose(); + + return detections; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs.meta new file mode 100644 index 0000000..5533256 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/DetectionVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e75eecc27e896404b76f06106435394 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs new file mode 100644 index 0000000..3f7a915 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class FaceGeometryPacket : Packet + { + /// + /// Creates an empty instance. + /// + public FaceGeometryPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FaceGeometryPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public FaceGeometryPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override FaceGeometry.FaceGeometry Get() + { + UnsafeNativeMethods.mp_Packet__GetFaceGeometry(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var geometry = serializedProto.Deserialize(FaceGeometry.FaceGeometry.Parser); + serializedProto.Dispose(); + + return geometry; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs.meta new file mode 100644 index 0000000..a4ca6c6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe56866aa90e25df2b520b254aa7d971 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs new file mode 100644 index 0000000..ae83a5e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class FaceGeometryVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public FaceGeometryVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FaceGeometryVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public FaceGeometryVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetFaceGeometryVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var geometries = serializedProtoVector.Deserialize(FaceGeometry.FaceGeometry.Parser); + serializedProtoVector.Dispose(); + + return geometries; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs.meta new file mode 100644 index 0000000..3d131bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FaceGeometryVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26bc289e136a1adfcb6608d60a732931 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs new file mode 100644 index 0000000..a034a36 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class FloatArrayPacket : Packet + { + private int _length = -1; + + public int length + { + get => _length; + set + { + if (_length >= 0) + { + throw new InvalidOperationException("Length is already set and cannot be changed"); + } + + _length = value; + } + } + + /// + /// Creates an empty instance. + /// + public FloatArrayPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FloatArrayPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public FloatArrayPacket(float[] value) : base() + { + UnsafeNativeMethods.mp__MakeFloatArrayPacket__Pf_i(value, value.Length, out var ptr).Assert(); + this.ptr = ptr; + length = value.Length; + } + + public FloatArrayPacket(float[] value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeFloatArrayPacket_At__Pf_i_Rt(value, value.Length, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + length = value.Length; + } + + public FloatArrayPacket At(Timestamp timestamp) + { + var packet = At(timestamp); + packet.length = length; + return packet; + } + + public override float[] Get() + { + if (length < 0) + { + throw new InvalidOperationException("The array's length is unknown, set Length first"); + } + + var result = new float[length]; + UnsafeNativeMethods.mp_Packet__GetFloatArray_i(mpPtr, length, out var arrayPtr).Assert(); + GC.KeepAlive(this); + + unsafe + { + var src = (float*)arrayPtr; + + for (var i = 0; i < result.Length; i++) + { + result[i] = *src++; + } + } + + UnsafeNativeMethods.delete_array__Pf(arrayPtr); + return result; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsFloatArray(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs.meta new file mode 100644 index 0000000..68c8520 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatArrayPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: febbf4ee3984896dc8b2f12c06963c37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs new file mode 100644 index 0000000..cc19ca3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class FloatPacket : Packet + { + /// + /// Creates an empty instance. + /// + public FloatPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FloatPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public FloatPacket(float value) : base() + { + UnsafeNativeMethods.mp__MakeFloatPacket__f(value, out var ptr).Assert(); + this.ptr = ptr; + } + + public FloatPacket(float value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeFloatPacket_At__f_Rt(value, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public FloatPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override float Get() + { + UnsafeNativeMethods.mp_Packet__GetFloat(mpPtr, out var value).Assert(); + + GC.KeepAlive(this); + return value; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsFloat(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs.meta new file mode 100644 index 0000000..c592f42 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e3f137c2b492809ca377d451e20c329 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs new file mode 100644 index 0000000..648a505 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs @@ -0,0 +1,108 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + internal readonly struct FloatVector + { + private readonly IntPtr _data; + private readonly int _size; + + public void Dispose() + { + UnsafeNativeMethods.delete_array__Pf(_data); + } + + public List Copy() + { + var data = new List(_size); + + unsafe + { + var floatPtr = (float*)_data; + + for (var i = 0; i < _size; i++) + { + data.Add(*floatPtr++); + } + } + return data; + } + } + + public class FloatVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + /// + public FloatVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FloatVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + + public FloatVectorPacket(float[] value) : base() + { + UnsafeNativeMethods.mp__MakeFloatVectorPacket__Pf_i(value, value.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + public FloatVectorPacket(float[] value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeFloatVectorPacket_At__Pf_i_Rt(value, value.Length, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public FloatVectorPacket(List value) : base() + { + UnsafeNativeMethods.mp__MakeFloatVectorPacket__Pf_i(value.ToArray(), value.Count, out var ptr).Assert(); + this.ptr = ptr; + } + + public FloatVectorPacket(List value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeFloatVectorPacket_At__Pf_i_Rt(value.ToArray(), value.Count, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public FloatVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetFloatVector(mpPtr, out var floatVector).Assert(); + GC.KeepAlive(this); + + var result = floatVector.Copy(); + floatVector.Dispose(); + return result; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsFloatVector(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs.meta new file mode 100644 index 0000000..23702bb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FloatVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a9b77e746fd38d46a09d847f7370446 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs new file mode 100644 index 0000000..0e23b5d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class FrameAnnotationPacket : Packet + { + /// + /// Creates an empty instance. + /// + public FrameAnnotationPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public FrameAnnotationPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public FrameAnnotationPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override FrameAnnotation Get() + { + UnsafeNativeMethods.mp_Packet__GetFrameAnnotation(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var frameAnnotation = serializedProto.Deserialize(FrameAnnotation.Parser); + serializedProto.Dispose(); + + return frameAnnotation; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs.meta new file mode 100644 index 0000000..194d352 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/FrameAnnotationPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9bd57a3f3c77dbb16babe8243fc373c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs new file mode 100644 index 0000000..7308ca1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GpuBufferPacket : Packet + { + /// + /// Creates an empty instance. + /// + public GpuBufferPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public GpuBufferPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public GpuBufferPacket(GpuBuffer gpuBuffer) : base() + { + UnsafeNativeMethods.mp__MakeGpuBufferPacket__Rgb(gpuBuffer.mpPtr, out var ptr).Assert(); + gpuBuffer.Dispose(); // respect move semantics + + this.ptr = ptr; + } + + public GpuBufferPacket(GpuBuffer gpuBuffer, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeGpuBufferPacket_At__Rgb_Rts(gpuBuffer.mpPtr, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + gpuBuffer.Dispose(); // respect move semantics + + this.ptr = ptr; + } + + public GpuBufferPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override GpuBuffer Get() + { + UnsafeNativeMethods.mp_Packet__GetGpuBuffer(mpPtr, out var gpuBufferPtr).Assert(); + + GC.KeepAlive(this); + return new GpuBuffer(gpuBufferPtr, false); + } + + public override StatusOr Consume() + { + UnsafeNativeMethods.mp_Packet__ConsumeGpuBuffer(mpPtr, out var statusOrGpuBufferPtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrGpuBuffer(statusOrGpuBufferPtr); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsGpuBuffer(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs.meta new file mode 100644 index 0000000..f47034c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/GpuBufferPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62016354701eafa7a9a1b07d445b0c44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs new file mode 100644 index 0000000..7f01933 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class ImageFramePacket : Packet + { + /// + /// Creates an empty instance. + /// + public ImageFramePacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public ImageFramePacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public ImageFramePacket(ImageFrame imageFrame) : base() + { + UnsafeNativeMethods.mp__MakeImageFramePacket__Pif(imageFrame.mpPtr, out var ptr).Assert(); + imageFrame.Dispose(); // respect move semantics + + this.ptr = ptr; + } + + public ImageFramePacket(ImageFrame imageFrame, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeImageFramePacket_At__Pif_Rt(imageFrame.mpPtr, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + imageFrame.Dispose(); // respect move semantics + + this.ptr = ptr; + } + + public ImageFramePacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override ImageFrame Get() + { + UnsafeNativeMethods.mp_Packet__GetImageFrame(mpPtr, out var imageFramePtr).Assert(); + + GC.KeepAlive(this); + return new ImageFrame(imageFramePtr, false); + } + + public override StatusOr Consume() + { + UnsafeNativeMethods.mp_Packet__ConsumeImageFrame(mpPtr, out var statusOrImageFramePtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrImageFrame(statusOrImageFramePtr); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsImageFrame(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs.meta new file mode 100644 index 0000000..dc17b81 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/ImageFramePacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be86f766875a6a848b0add7e41a2226b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs new file mode 100644 index 0000000..8490cb9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class IntPacket : Packet + { + /// + /// Creates an empty instance. + /// + public IntPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public IntPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public IntPacket(int value) : base() + { + UnsafeNativeMethods.mp__MakeIntPacket__i(value, out var ptr).Assert(); + this.ptr = ptr; + } + + public IntPacket(int value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeIntPacket_At__i_Rt(value, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public IntPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override int Get() + { + UnsafeNativeMethods.mp_Packet__GetInt(mpPtr, out var value).Assert(); + + GC.KeepAlive(this); + return value; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsInt(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs.meta new file mode 100644 index 0000000..33572de --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/IntPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea1e37ccb5fd27c0c85d183ab96562e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs new file mode 100644 index 0000000..4ec0fc1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class LandmarkListPacket : Packet + { + /// + /// Creates an empty instance. + /// + public LandmarkListPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public LandmarkListPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public LandmarkListPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override LandmarkList Get() + { + UnsafeNativeMethods.mp_Packet__GetLandmarkList(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var landmarkList = serializedProto.Deserialize(LandmarkList.Parser); + serializedProto.Dispose(); + + return landmarkList; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs.meta new file mode 100644 index 0000000..5cf7140 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a52c4850b3d6f4fff840b03da689e307 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs new file mode 100644 index 0000000..9225cf2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class LandmarkListVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public LandmarkListVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public LandmarkListVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public LandmarkListVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetLandmarkListVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var landmarkLists = serializedProtoVector.Deserialize(LandmarkList.Parser); + serializedProtoVector.Dispose(); + + return landmarkLists; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs.meta new file mode 100644 index 0000000..a0f1bea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/LandmarkListVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5221b835adb8927dc84cb8c5f3af2f8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs new file mode 100644 index 0000000..e2f139b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs @@ -0,0 +1,66 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Google.Protobuf; +using System; + +namespace Mediapipe +{ + public class MatrixPacket : Packet + { + /// + /// Creates an empty instance. + /// + public MatrixPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public MatrixPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public MatrixPacket(MatrixData matrixData) : base() + { + var value = matrixData.ToByteArray(); + UnsafeNativeMethods.mp__MakeMatrixPacket__PKc_i(value, value.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + public MatrixPacket(MatrixData matrixData, Timestamp timestamp) : base() + { + var value = matrixData.ToByteArray(); + UnsafeNativeMethods.mp__MakeMatrixPacket_At__PKc_i_Rt(value, value.Length, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public MatrixPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override MatrixData Get() + { + UnsafeNativeMethods.mp_Packet__GetMatrix(mpPtr, out var serializedMatrixData).Assert(); + GC.KeepAlive(this); + + var matrixData = serializedMatrixData.Deserialize(MatrixData.Parser); + serializedMatrixData.Dispose(); + + return matrixData; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsMatrix(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs.meta new file mode 100644 index 0000000..2e04b57 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/MatrixPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef898503888a0ee42af28aef1fbbe794 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs new file mode 100644 index 0000000..a9c46d8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class NormalizedLandmarkListPacket : Packet + { + /// + /// Creates an empty instance. + /// + public NormalizedLandmarkListPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public NormalizedLandmarkListPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public NormalizedLandmarkListPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override NormalizedLandmarkList Get() + { + UnsafeNativeMethods.mp_Packet__GetNormalizedLandmarkList(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var normalizedLandmarkList = serializedProto.Deserialize(NormalizedLandmarkList.Parser); + serializedProto.Dispose(); + + return normalizedLandmarkList; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs.meta new file mode 100644 index 0000000..eb587ab --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f33ad7ff69288fbda9c5d2d3a173a23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs new file mode 100644 index 0000000..001a8d2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class NormalizedLandmarkListVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public NormalizedLandmarkListVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public NormalizedLandmarkListVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public NormalizedLandmarkListVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetNormalizedLandmarkListVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var normalizedLandmarkLists = serializedProtoVector.Deserialize(NormalizedLandmarkList.Parser); + serializedProtoVector.Dispose(); + + return normalizedLandmarkLists; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs.meta new file mode 100644 index 0000000..c89e4d5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedLandmarkListVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf1c0c41a515dfae985791690002e1fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs new file mode 100644 index 0000000..9ea0c1d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class NormalizedRectPacket : Packet + { + /// + /// Creates an empty instance. + /// + public NormalizedRectPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public NormalizedRectPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public NormalizedRectPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override NormalizedRect Get() + { + UnsafeNativeMethods.mp_Packet__GetNormalizedRect(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var normalizedRect = serializedProto.Deserialize(NormalizedRect.Parser); + serializedProto.Dispose(); + + return normalizedRect; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs.meta new file mode 100644 index 0000000..0b5d5c9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e39d3cdad5a34bdaf93a850f4f3880eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs new file mode 100644 index 0000000..f76eaf9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class NormalizedRectVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public NormalizedRectVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public NormalizedRectVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public NormalizedRectVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetNormalizedRectVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var normalizedRects = serializedProtoVector.Deserialize(NormalizedRect.Parser); + serializedProtoVector.Dispose(); + + return normalizedRects; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs.meta new file mode 100644 index 0000000..d409ec6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/NormalizedRectVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 227b1bd0b120bd104af18a436ed254ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs new file mode 100644 index 0000000..edff56b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs @@ -0,0 +1,120 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public abstract class Packet : MpResourceHandle + { + /// + /// The native resource won't be initialized. + /// + protected Packet() : base() { } + + /// + /// If is set to false, the native resource won't be initialized. + /// + protected Packet(bool isOwner) : base(isOwner) + { + if (isOwner) + { + UnsafeNativeMethods.mp_Packet__(out var ptr).Assert(); + this.ptr = ptr; + } + } + + protected Packet(IntPtr ptr, bool isOwner) : base(ptr, isOwner) { } + + /// + /// Creates a read-write instance. + /// + /// + /// This is a slow operation that makes use of internally, so you should avoid calling it in a loop.
+ /// If you need to call it in a loop and is set to false, call instead. + ///
+ public static TPacket Create(IntPtr packetPtr, bool isOwner) where TPacket : Packet, new() + { + return (TPacket)Activator.CreateInstance(typeof(TPacket), packetPtr, isOwner); + } + + public void SwitchNativePtr(IntPtr packetPtr) + { + if (isOwner) + { + throw new InvalidOperationException("This operation is permitted only when the packet instance is for reference"); + } + ptr = packetPtr; + } + + /// Thrown when the value is not set + public abstract TValue Get(); + + public abstract StatusOr Consume(); + + public bool IsEmpty() + { + return SafeNativeMethods.mp_Packet__IsEmpty(mpPtr); + } + + public Status ValidateAsProtoMessageLite() + { + UnsafeNativeMethods.mp_Packet__ValidateAsProtoMessageLite(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + // TODO: declare as abstract + public virtual Status ValidateAsType() + { + throw new NotImplementedException(); + } + + public Timestamp Timestamp() + { + UnsafeNativeMethods.mp_Packet__Timestamp(mpPtr, out var timestampPtr).Assert(); + + GC.KeepAlive(this); + return new Timestamp(timestampPtr); + } + + public string DebugString() + { + return MarshalStringFromNative(UnsafeNativeMethods.mp_Packet__DebugString); + } + + public string RegisteredTypeName() + { + var typeName = MarshalStringFromNative(UnsafeNativeMethods.mp_Packet__RegisteredTypeName); + + return typeName ?? ""; + } + + public string DebugTypeName() + { + return MarshalStringFromNative(UnsafeNativeMethods.mp_Packet__DebugTypeName); + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_Packet__delete(ptr); + } + + /// + /// This method will copy the value and create another packet internally. + /// To avoid copying the value, it's preferable to instantiate the packet with timestamp in the first place. + /// + /// New packet with the given timestamp and the copied value + protected TPacket At(Timestamp timestamp) where TPacket : Packet, new() + { + UnsafeNativeMethods.mp_Packet__At__Rt(mpPtr, timestamp.mpPtr, out var packetPtr).Assert(); + GC.KeepAlive(timestamp); + + return Create(packetPtr, true); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs.meta new file mode 100644 index 0000000..c1e1684 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/Packet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a857adad76d497e579b18d1b74c2183c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs new file mode 100644 index 0000000..dba6924 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class RectPacket : Packet + { + /// + /// Creates an empty instance. + /// + public RectPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public RectPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public RectPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override Rect Get() + { + UnsafeNativeMethods.mp_Packet__GetRect(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var rect = serializedProto.Deserialize(Rect.Parser); + serializedProto.Dispose(); + + return rect; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs.meta new file mode 100644 index 0000000..0414913 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bab9dce43b38fd7939bfef3e750d3340 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs new file mode 100644 index 0000000..0f933ea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe +{ + public class RectVectorPacket : Packet> + { + /// + /// Creates an empty instance. + /// + public RectVectorPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public RectVectorPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public RectVectorPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override List Get() + { + UnsafeNativeMethods.mp_Packet__GetRectVector(mpPtr, out var serializedProtoVector).Assert(); + GC.KeepAlive(this); + + var rects = serializedProtoVector.Deserialize(Rect.Parser); + serializedProtoVector.Dispose(); + + return rects; + } + + public override StatusOr> Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs.meta new file mode 100644 index 0000000..5376427 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/RectVectorPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b3010621ded8ad44949c9958d647b3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs new file mode 100644 index 0000000..aa10927 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class SidePacket : MpResourceHandle + { + public SidePacket() : base() + { + UnsafeNativeMethods.mp_SidePacket__(out var ptr).Assert(); + this.ptr = ptr; + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_SidePacket__delete(ptr); + } + + public int size => SafeNativeMethods.mp_SidePacket__size(mpPtr); + + /// + /// This method cannot verify that the packet type corresponding to the is indeed a , + /// so you must make sure by youreself that it is. + /// + public TPacket At(string key) where TPacket : Packet, new() + { + UnsafeNativeMethods.mp_SidePacket__at__PKc(mpPtr, key, out var packetPtr).Assert(); + + if (packetPtr == IntPtr.Zero) + { + return default; // null + } + GC.KeepAlive(this); + return Packet.Create(packetPtr, true); + } + + public void Emplace(string key, Packet packet) + { + UnsafeNativeMethods.mp_SidePacket__emplace__PKc_Rp(mpPtr, key, packet.mpPtr).Assert(); + packet.Dispose(); // respect move semantics + GC.KeepAlive(this); + } + + public int Erase(string key) + { + UnsafeNativeMethods.mp_SidePacket__erase__PKc(mpPtr, key, out var count).Assert(); + + GC.KeepAlive(this); + return count; + } + + public void Clear() + { + SafeNativeMethods.mp_SidePacket__clear(mpPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs.meta new file mode 100644 index 0000000..2d1869f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/SidePacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8976efac5d9187e5ea5bd0f2c974425e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs new file mode 100644 index 0000000..b203276 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs @@ -0,0 +1,86 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + public class StringPacket : Packet + { + /// + /// Creates an empty instance. + /// + public StringPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public StringPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public StringPacket(string value) : base() + { + UnsafeNativeMethods.mp__MakeStringPacket__PKc(value, out var ptr).Assert(); + this.ptr = ptr; + } + + public StringPacket(byte[] bytes) : base() + { + UnsafeNativeMethods.mp__MakeStringPacket__PKc_i(bytes, bytes.Length, out var ptr).Assert(); + this.ptr = ptr; + } + + public StringPacket(string value, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeStringPacket_At__PKc_Rt(value, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public StringPacket(byte[] bytes, Timestamp timestamp) : base() + { + UnsafeNativeMethods.mp__MakeStringPacket_At__PKc_i_Rt(bytes, bytes.Length, timestamp.mpPtr, out var ptr).Assert(); + GC.KeepAlive(timestamp); + this.ptr = ptr; + } + + public StringPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override string Get() + { + return MarshalStringFromNative(UnsafeNativeMethods.mp_Packet__GetString); + } + + public byte[] GetByteArray() + { + UnsafeNativeMethods.mp_Packet__GetByteString(mpPtr, out var strPtr, out var size).Assert(); + GC.KeepAlive(this); + + var bytes = new byte[size]; + Marshal.Copy(strPtr, bytes, 0, size); + UnsafeNativeMethods.delete_array__PKc(strPtr); + + return bytes; + } + + public override StatusOr Consume() + { + UnsafeNativeMethods.mp_Packet__ConsumeString(mpPtr, out var statusOrStringPtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrString(statusOrStringPtr); + } + + public override Status ValidateAsType() + { + UnsafeNativeMethods.mp_Packet__ValidateAsString(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs.meta new file mode 100644 index 0000000..2420e96 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70e3fdcd8f227f24d8b41100474fec7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs new file mode 100644 index 0000000..17f9f67 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class TimedModelMatrixProtoListPacket : Packet + { + /// + /// Creates an empty instance. + /// + public TimedModelMatrixProtoListPacket() : base(true) { } + + [UnityEngine.Scripting.Preserve] + public TimedModelMatrixProtoListPacket(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + public TimedModelMatrixProtoListPacket At(Timestamp timestamp) + { + return At(timestamp); + } + + public override TimedModelMatrixProtoList Get() + { + UnsafeNativeMethods.mp_Packet__GetTimedModelMatrixProtoList(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var matrixProtoList = serializedProto.Deserialize(TimedModelMatrixProtoList.Parser); + serializedProto.Dispose(); + + return matrixProtoList; + } + + public override StatusOr Consume() + { + throw new NotSupportedException(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs.meta new file mode 100644 index 0000000..62dd5db --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/TimedModelMatrixProtoListPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 244922fa9b8ff20ef8962313f8179a24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port.meta new file mode 100644 index 0000000..669da05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05b4466114b944943af1190894cbc5db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs new file mode 100644 index 0000000..a6f1765 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs @@ -0,0 +1,273 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + public class Status : MpResourceHandle + { + public enum StatusCode : int + { + Ok = 0, + Cancelled = 1, + Unknown = 2, + InvalidArgument = 3, + DeadlineExceeded = 4, + NotFound = 5, + AlreadyExists = 6, + PermissionDenied = 7, + ResourceExhausted = 8, + FailedPrecondition = 9, + Aborted = 10, + OutOfRange = 11, + Unimplemented = 12, + Internal = 13, + Unavailable = 14, + DataLoss = 15, + Unauthenticated = 16, + } + + [StructLayout(LayoutKind.Sequential)] + public readonly struct StatusArgs + { + private readonly StatusCode _code; + private readonly IntPtr _message; + + private StatusArgs(StatusCode code, string message = null) + { + _code = code; + _message = Marshal.StringToHGlobalAnsi(message); + } + + public static StatusArgs Ok() + { + return new StatusArgs(StatusCode.Ok); + } + + public static StatusArgs Cancelled(string message = null) + { + return new StatusArgs(StatusCode.Cancelled, message); + } + + public static StatusArgs Unknown(string message = null) + { + return new StatusArgs(StatusCode.Unknown, message); + } + + public static StatusArgs InvalidArgument(string message = null) + { + return new StatusArgs(StatusCode.InvalidArgument, message); + } + + public static StatusArgs DeadlineExceeded(string message = null) + { + return new StatusArgs(StatusCode.DeadlineExceeded, message); + } + + public static StatusArgs NotFound(string message = null) + { + return new StatusArgs(StatusCode.NotFound, message); + } + + public static StatusArgs AlreadyExists(string message = null) + { + return new StatusArgs(StatusCode.AlreadyExists, message); + } + + public static StatusArgs PermissionDenied(string message = null) + { + return new StatusArgs(StatusCode.PermissionDenied, message); + } + + public static StatusArgs ResourceExhausted(string message = null) + { + return new StatusArgs(StatusCode.ResourceExhausted, message); + } + + public static StatusArgs FailedPrecondition(string message = null) + { + return new StatusArgs(StatusCode.FailedPrecondition, message); + } + + public static StatusArgs Aborted(string message = null) + { + return new StatusArgs(StatusCode.Aborted, message); + } + + public static StatusArgs OutOfRange(string message = null) + { + return new StatusArgs(StatusCode.OutOfRange, message); + } + + public static StatusArgs Unimplemented(string message = null) + { + return new StatusArgs(StatusCode.Unimplemented, message); + } + + public static StatusArgs Internal(string message = null) + { + return new StatusArgs(StatusCode.Internal, message); + } + + public static StatusArgs Unavailable(string message = null) + { + return new StatusArgs(StatusCode.Unavailable, message); + } + + public static StatusArgs DataLoss(string message = null) + { + return new StatusArgs(StatusCode.DataLoss, message); + } + + public static StatusArgs Unauthenticated(string message = null) + { + return new StatusArgs(StatusCode.Unauthenticated, message); + } + } + + public Status(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.absl_Status__delete(ptr); + } + + private bool? _ok; + private int? _rawCode; + + public void AssertOk() + { + if (!Ok()) + { + throw new MediaPipeException(ToString()); + } + } + + public bool Ok() + { + if (_ok is bool valueOfOk) + { + return valueOfOk; + } + _ok = SafeNativeMethods.absl_Status__ok(mpPtr); + return (bool)_ok; + } + + public StatusCode Code() + { + return (StatusCode)RawCode(); + } + + public int RawCode() + { + if (_rawCode is int valueOfRawCode) + { + return valueOfRawCode; + } + _rawCode = SafeNativeMethods.absl_Status__raw_code(mpPtr); + return (int)_rawCode; + } + + public override string ToString() + { + return MarshalStringFromNative(UnsafeNativeMethods.absl_Status__ToString); + } + + public static Status Build(StatusCode code, string message, bool isOwner = true) + { + UnsafeNativeMethods.absl_Status__i_PKc((int)code, message, out var ptr).Assert(); + + return new Status(ptr, isOwner); + } + + public static Status Ok(bool isOwner = true) + { + return Build(StatusCode.Ok, "", isOwner); + } + + public static Status Cancelled(string message = "", bool isOwner = true) + { + return Build(StatusCode.Cancelled, message, isOwner); + } + + public static Status Unknown(string message = "", bool isOwner = true) + { + return Build(StatusCode.Unknown, message, isOwner); + } + + public static Status InvalidArgument(string message = "", bool isOwner = true) + { + return Build(StatusCode.InvalidArgument, message, isOwner); + } + + public static Status DeadlineExceeded(string message = "", bool isOwner = true) + { + return Build(StatusCode.DeadlineExceeded, message, isOwner); + } + + public static Status NotFound(string message = "", bool isOwner = true) + { + return Build(StatusCode.NotFound, message, isOwner); + } + + public static Status AlreadyExists(string message = "", bool isOwner = true) + { + return Build(StatusCode.AlreadyExists, message, isOwner); + } + + public static Status PermissionDenied(string message = "", bool isOwner = true) + { + return Build(StatusCode.PermissionDenied, message, isOwner); + } + + public static Status ResourceExhausted(string message = "", bool isOwner = true) + { + return Build(StatusCode.ResourceExhausted, message, isOwner); + } + + public static Status FailedPrecondition(string message = "", bool isOwner = true) + { + return Build(StatusCode.FailedPrecondition, message, isOwner); + } + + public static Status Aborted(string message = "", bool isOwner = true) + { + return Build(StatusCode.Aborted, message, isOwner); + } + + public static Status OutOfRange(string message = "", bool isOwner = true) + { + return Build(StatusCode.OutOfRange, message, isOwner); + } + + public static Status Unimplemented(string message = "", bool isOwner = true) + { + return Build(StatusCode.Unimplemented, message, isOwner); + } + + public static Status Internal(string message = "", bool isOwner = true) + { + return Build(StatusCode.Internal, message, isOwner); + } + + public static Status Unavailable(string message = "", bool isOwner = true) + { + return Build(StatusCode.Unavailable, message, isOwner); + } + + public static Status DataLoss(string message = "", bool isOwner = true) + { + return Build(StatusCode.DataLoss, message, isOwner); + } + + public static Status Unauthenticated(string message = "", bool isOwner = true) + { + return Build(StatusCode.Unauthenticated, message, isOwner); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs.meta new file mode 100644 index 0000000..b6594e9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/Status.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3eaa030180f28e4098aed69b42d8294 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs new file mode 100644 index 0000000..21059b8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public abstract class StatusOr : MpResourceHandle + { + public StatusOr(IntPtr ptr) : base(ptr) { } + + public abstract Status status { get; } + public virtual bool Ok() + { + return status.Ok(); + } + + public virtual T ValueOr(T defaultValue = default) + { + return Ok() ? Value() : defaultValue; + } + + /// Thrown when status is not ok + public abstract T Value(); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs.meta new file mode 100644 index 0000000..0cf2131 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOr.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8265706b497a321ed85fa4a0f30c8edc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs new file mode 100644 index 0000000..c22de8f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class StatusOrGpuBuffer : StatusOr + { + public StatusOrGpuBuffer(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_StatusOrGpuBuffer__delete(ptr); + } + + private Status _status; + public override Status status + { + get + { + if (_status == null || _status.isDisposed) + { + UnsafeNativeMethods.mp_StatusOrGpuBuffer__status(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + _status = new Status(statusPtr); + } + return _status; + } + } + + public override bool Ok() + { + return SafeNativeMethods.mp_StatusOrGpuBuffer__ok(mpPtr); + } + + public override GpuBuffer Value() + { + UnsafeNativeMethods.mp_StatusOrGpuBuffer__value(mpPtr, out var gpuBufferPtr).Assert(); + Dispose(); + + return new GpuBuffer(gpuBufferPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs.meta new file mode 100644 index 0000000..84f9d7f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd1abb804326267d2ad3280f742335f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs new file mode 100644 index 0000000..17f853d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class StatusOrGpuResources : StatusOr + { + public StatusOrGpuResources(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_StatusOrGpuResources__delete(ptr); + } + + private Status _status; + public override Status status + { + get + { + if (_status == null || _status.isDisposed) + { + UnsafeNativeMethods.mp_StatusOrGpuResources__status(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + _status = new Status(statusPtr); + } + return _status; + } + } + + public override bool Ok() + { + return SafeNativeMethods.mp_StatusOrGpuResources__ok(mpPtr); + } + + public override GpuResources Value() + { + UnsafeNativeMethods.mp_StatusOrGpuResources__value(mpPtr, out var gpuResourcesPtr).Assert(); + Dispose(); + + return new GpuResources(gpuResourcesPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs.meta new file mode 100644 index 0000000..e569274 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrGpuResources.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b25d33a8b95748e448e3a0fa860ed096 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs new file mode 100644 index 0000000..c227f66 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class StatusOrImageFrame : StatusOr + { + public StatusOrImageFrame(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_StatusOrImageFrame__delete(ptr); + } + + private Status _status; + public override Status status + { + get + { + if (_status == null || _status.isDisposed) + { + UnsafeNativeMethods.mp_StatusOrImageFrame__status(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + _status = new Status(statusPtr); + } + return _status; + } + } + + public override bool Ok() + { + return SafeNativeMethods.mp_StatusOrImageFrame__ok(mpPtr); + } + + public override ImageFrame Value() + { + UnsafeNativeMethods.mp_StatusOrImageFrame__value(mpPtr, out var imageFramePtr).Assert(); + Dispose(); + + return new ImageFrame(imageFramePtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs.meta new file mode 100644 index 0000000..4616ebb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrImageFrame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb972d14519613db3a10e80e53ccceb6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs new file mode 100644 index 0000000..1a432ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class StatusOrPoller : StatusOr> + { + public StatusOrPoller(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_StatusOrPoller__delete(ptr); + } + + private Status _status; + public override Status status + { + get + { + if (_status == null || _status.isDisposed) + { + UnsafeNativeMethods.mp_StatusOrPoller__status(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + _status = new Status(statusPtr); + } + return _status; + } + } + + public override bool Ok() + { + return SafeNativeMethods.mp_StatusOrPoller__ok(mpPtr); + } + + public override OutputStreamPoller Value() + { + UnsafeNativeMethods.mp_StatusOrPoller__value(mpPtr, out var pollerPtr).Assert(); + Dispose(); + + return new OutputStreamPoller(pollerPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs.meta new file mode 100644 index 0000000..27bcd7b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrPoller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 516e50f1c8b1a564fb3a1a52ac7941a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs new file mode 100644 index 0000000..3307b5b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs @@ -0,0 +1,63 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + public class StatusOrString : StatusOr + { + public StatusOrString(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_StatusOrString__delete(ptr); + } + + private Status _status; + public override Status status + { + get + { + if (_status == null || _status.isDisposed) + { + UnsafeNativeMethods.mp_StatusOrString__status(mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(this); + _status = new Status(statusPtr); + } + return _status; + } + } + + public override bool Ok() + { + return SafeNativeMethods.mp_StatusOrString__ok(mpPtr); + } + + public override string Value() + { + var str = MarshalStringFromNative(UnsafeNativeMethods.mp_StatusOrString__value); + Dispose(); // respect move semantics + + return str; + } + + public byte[] ValueAsByteArray() + { + UnsafeNativeMethods.mp_StatusOrString__bytearray(mpPtr, out var strPtr, out var size).Assert(); + GC.KeepAlive(this); + + var bytes = new byte[size]; + Marshal.Copy(strPtr, bytes, 0, size); + UnsafeNativeMethods.delete_array__PKc(strPtr); + Dispose(); + + return bytes; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs.meta new file mode 100644 index 0000000..e598fb0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Port/StatusOrString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66b1ae14027703a7f9af3b146a26adfc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs new file mode 100644 index 0000000..1ff46ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs @@ -0,0 +1,175 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class Timestamp : MpResourceHandle, IEquatable + { + public Timestamp(IntPtr ptr) : base(ptr) { } + + public Timestamp(long value) : base() + { + UnsafeNativeMethods.mp_Timestamp__l(value, out var ptr).Assert(); + this.ptr = ptr; + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_Timestamp__delete(ptr); + } + + #region IEquatable + public bool Equals(Timestamp other) + { + return other != null && Microseconds() == other.Microseconds(); + } + +#pragma warning disable IDE0049 + public override bool Equals(System.Object obj) + { + var timestampObj = obj == null ? null : (obj as Timestamp); + + return timestampObj != null && Equals(timestampObj); + } +#pragma warning restore IDE0049 + +#pragma warning disable IDE0002 + public static bool operator ==(Timestamp x, Timestamp y) + { + return (((object)x) == null || ((object)y) == null) ? System.Object.Equals(x, y) : x.Equals(y); + } + + public static bool operator !=(Timestamp x, Timestamp y) + { + return (((object)x) == null || ((object)y) == null) ? !System.Object.Equals(x, y) : !x.Equals(y); + } +#pragma warning restore IDE0002 + + public override int GetHashCode() + { + return Microseconds().GetHashCode(); + } + #endregion + + public long Value() + { + return SafeNativeMethods.mp_Timestamp__Value(mpPtr); + } + + public double Seconds() + { + return SafeNativeMethods.mp_Timestamp__Seconds(mpPtr); + } + + public long Microseconds() + { + return SafeNativeMethods.mp_Timestamp__Microseconds(mpPtr); + } + + public bool IsSpecialValue() + { + return SafeNativeMethods.mp_Timestamp__IsSpecialValue(mpPtr); + } + + public bool IsRangeValue() + { + return SafeNativeMethods.mp_Timestamp__IsRangeValue(mpPtr); + } + + public bool IsAllowedInStream() + { + return SafeNativeMethods.mp_Timestamp__IsAllowedInStream(mpPtr); + } + + public string DebugString() + { + return MarshalStringFromNative(UnsafeNativeMethods.mp_Timestamp__DebugString); + } + + public Timestamp NextAllowedInStream() + { + UnsafeNativeMethods.mp_Timestamp__NextAllowedInStream(mpPtr, out var nextPtr).Assert(); + + GC.KeepAlive(this); + return new Timestamp(nextPtr); + } + + public Timestamp PreviousAllowedInStream() + { + UnsafeNativeMethods.mp_Timestamp__PreviousAllowedInStream(mpPtr, out var prevPtr).Assert(); + + GC.KeepAlive(this); + return new Timestamp(prevPtr); + } + + public static Timestamp FromSeconds(double seconds) + { + UnsafeNativeMethods.mp_Timestamp_FromSeconds__d(seconds, out var ptr).Assert(); + + return new Timestamp(ptr); + } + + #region SpecialValues + public static Timestamp Unset() + { + UnsafeNativeMethods.mp_Timestamp_Unset(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Unstarted() + { + UnsafeNativeMethods.mp_Timestamp_Unstarted(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp PreStream() + { + UnsafeNativeMethods.mp_Timestamp_PreStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Min() + { + UnsafeNativeMethods.mp_Timestamp_Min(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Max() + { + UnsafeNativeMethods.mp_Timestamp_Max(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp PostStream() + { + UnsafeNativeMethods.mp_Timestamp_PostStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp OneOverPostStream() + { + UnsafeNativeMethods.mp_Timestamp_OneOverPostStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Done() + { + UnsafeNativeMethods.mp_Timestamp_Done(out var ptr).Assert(); + + return new Timestamp(ptr); + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs.meta new file mode 100644 index 0000000..ff562d5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e33f53c4ae6a087aaf4345cc29d0c1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool.meta new file mode 100644 index 0000000..c79c92c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 908f070a5a235a340bcd2a52a0fdb469 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs new file mode 100644 index 0000000..871555b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs @@ -0,0 +1,149 @@ +#pragma warning disable IDE0073 +// Copyright 2019 The MediaPipe Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Collections.Generic; +using System.Linq; + +namespace Mediapipe +{ + /// + /// translated version of mediapipe/framework/tool/name_util.cc + /// + public static partial class Tool + { + public static string GetUnusedNodeName(CalculatorGraphConfig config, string nodeNameBase) + { + var nodeNames = new HashSet(config.Node.Select(node => node.Name).Where(name => name.Length > 0)); + + var candidate = nodeNameBase; + var iter = 1; + + while (nodeNames.Contains(candidate)) + { + candidate = $"{nodeNameBase}_{++iter:D2}"; + } + + return candidate; + } + + public static string GetUnusedSidePacketName(CalculatorGraphConfig config, string inputSidePacketNameBase) + { + var inputSidePackets = new HashSet( + config.Node.SelectMany(node => node.InputSidePacket) + .Select(sidePacket => + { + ParseTagIndexName(sidePacket, out var tag, out var index, out var name); + return name; + })); + + var candidate = inputSidePacketNameBase; + var iter = 1; + + while (inputSidePackets.Contains(candidate)) + { + candidate = $"{inputSidePacketNameBase}_{++iter:D2}"; + } + + return candidate; + } + + public static string GetUnusedStreamName(CalculatorGraphConfig config, string streamNameBase) + { + var outputStreamNames = config.Node.SelectMany(node => node.OutputStream) + .Select(outputStream => + { + ParseTagIndexName(outputStream, out var tag, out var index, out var name); + return name; + }); + + var candidate = streamNameBase; + var iter = 1; + + while (config.InputStream.Contains(candidate)) + { + candidate = $"{streamNameBase}_{++iter:D2}"; + } + + while (outputStreamNames.Contains(candidate)) + { + candidate = $"{streamNameBase}_{++iter:D2}"; + } + + return candidate; + } + + /// + /// Thrown when is invalid + /// + public static string CanonicalNodeName(CalculatorGraphConfig graphConfig, int nodeId) + { + var nodeConfig = graphConfig.Node[nodeId]; + var nodeName = nodeConfig.Name.Length == 0 ? nodeConfig.Calculator : nodeConfig.Name; + + var nodesWithSameName = graphConfig.Node + .Select((node, i) => (node.Name.Length == 0 ? node.Calculator : node.Name, i)) + .Where(pair => pair.Item1 == nodeName); + + if (nodesWithSameName.Count() <= 1) + { + return nodeName; + } + + var seq = nodesWithSameName.Count(pair => pair.i <= nodeId); + return $"{nodeName}_{seq}"; + } + + /// + /// Thrown when the format of is invalid + /// + public static string ParseNameFromStream(string stream) + { + ParseTagIndexName(stream, out var _, out var _, out var name); + return name; + } + + /// + /// Thrown when the format of is invalid + /// + public static (string, int) ParseTagIndex(string tagIndex) + { + ParseTagIndex(tagIndex, out var tag, out var index); + return (tag, index); + } + + /// + /// Thrown when the format of is invalid + /// + public static (string, int) ParseTagIndexFromStream(string stream) + { + ParseTagIndexName(stream, out var tag, out var index, out var _); + return (tag, index); + } + + public static string CatTag(string tag, int index) + { + var colonIndex = index <= 0 || tag.Length == 0 ? "" : $":{index}"; + return $"{tag}{colonIndex}"; + } + + public static string CatStream((string, int) tagIndex, string name) + { + var tag = CatTag(tagIndex.Item1, tagIndex.Item2); + + return tag.Length == 0 ? name : $"{tag}:{name}"; + } + } +} +#pragma warning restore IDE0073 diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs.meta new file mode 100644 index 0000000..c661bda --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/NameUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87bcc70794ac17b298319e0f78cdf904 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs new file mode 100644 index 0000000..59c49bf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs @@ -0,0 +1,185 @@ +#pragma warning disable IDE0073 +// Copyright 2019 The MediaPipe Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Text.RegularExpressions; + +namespace Mediapipe +{ + /// + /// translated version of mediapipe/framework/tool/validate_name.cc + /// + + internal static partial class Internal + { + public const int MaxCollectionItemId = 10000; + } + + public static partial class Tool + { + private const string _NameRegex = "[a-z_][a-z0-9_]*"; + private const string _NumberRegex = "(0|[1-9][0-9]*)"; + private const string _TagRegex = "[A-Z_][A-Z0-9_]*"; + private static readonly string _TagAndNameRegex = $"({_TagRegex}:)?{_NameRegex}"; + private static readonly string _TagIndexNameRegex = $"({_TagRegex}:({_NumberRegex}:)?)?{_NameRegex}"; + private static readonly string _TagIndexRegex = $"({_TagRegex})?(:{_NumberRegex})?"; + + public static void ValidateName(string name) + { + if (name.Length > 0 && new Regex($"^{_NameRegex}$").IsMatch(name)) + { + return; + } + throw new ArgumentException($"Name \"{name}\" does not match \"{_NameRegex}\"."); + } + + public static void ValidateNumber(string number) + { + if (number.Length > 0 && new Regex($"^{_NumberRegex}$").IsMatch(number)) + { + return; + } + throw new ArgumentException($"Number \"{number}\" does not match \"{_NumberRegex}\"."); + } + + public static void ValidateTag(string tag) + { + if (tag.Length > 0 && new Regex($"^{_TagRegex}$").IsMatch(tag)) + { + return; + } + throw new ArgumentException($"Tag \"{tag}\" does not match \"{_TagRegex}\"."); + } + + public static void ParseTagAndName(string tagAndName, out string tag, out string name) + { + var nameIndex = -1; + var v = tagAndName.Split(':'); + + try + { + if (v.Length == 1) + { + ValidateName(v[0]); + nameIndex = 0; + } + else if (v.Length == 2) + { + ValidateTag(v[0]); + ValidateName(v[1]); + nameIndex = 1; + } + + if (nameIndex == -1) + { + throw new ArgumentException(); + } + } + catch (ArgumentException) + { + throw new ArgumentException($"\"tag and name\" is invalid, \"{tagAndName}\" does not match \"{_TagAndNameRegex}\" (examples: \"TAG:name\", \"longer_name\")."); + } + + tag = nameIndex == 1 ? v[0] : ""; + name = v[nameIndex]; + } + + public static void ParseTagIndexName(string tagIndexName, out string tag, out int index, out string name) + { + var nameIndex = -1; + var theIndex = 0; + var v = tagIndexName.Split(':'); + + try + { + if (v.Length == 1) + { + ValidateName(v[0]); + theIndex = -1; + nameIndex = 0; + } + else if (v.Length == 2) + { + ValidateTag(v[0]); + ValidateName(v[1]); + nameIndex = 1; + } + else if (v.Length == 3) + { + ValidateTag(v[0]); + ValidateNumber(v[1]); + + theIndex = int.TryParse(v[1], out var result) && result <= Internal.MaxCollectionItemId ? result : throw new ArgumentException(); + ValidateName(v[2]); + nameIndex = 2; + } + + if (nameIndex == -1) + { + throw new ArgumentException(); + } + } + catch (ArgumentException) + { + throw new ArgumentException($"TAG:index:name is invalid, \"{tagIndexName}\" does not match \"{_TagIndexNameRegex}\" (examples: \"TAG:name\", \"VIDEO:2:name_b\", \"longer_name\")."); + } + + tag = nameIndex != 0 ? v[0] : ""; + index = theIndex; + name = v[nameIndex]; + } + + public static void ParseTagIndex(string tagIndex, out string tag, out int index) + { + var theIndex = -1; + var v = tagIndex.Split(':'); + + try + { + if (v.Length == 1) + { + if (v[0].Length != 0) + { + ValidateTag(v[0]); + } + theIndex = 0; + } + else if (v.Length == 2) + { + if (v[0].Length != 0) + { + ValidateTag(v[0]); + } + ValidateNumber(v[1]); + + theIndex = int.TryParse(v[1], out var result) && result <= Internal.MaxCollectionItemId ? result : throw new ArgumentException(); + } + + if (theIndex == -1) + { + throw new ArgumentException(); + } + } + catch (ArgumentException) + { + throw new ArgumentException($"TAG:index is invalid, \"{tagIndex}\" does not match \"{_TagIndexRegex}\" (examples: \"TAG\", \"VIDEO:2\")."); + } + + tag = v[0]; + index = theIndex; + } + } +} +#pragma warning restore IDE0073 diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs.meta new file mode 100644 index 0000000..546a000 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Tool/ValidateName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1421b820df4848b608b207d722d8c016 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs new file mode 100644 index 0000000..25ced10 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs @@ -0,0 +1,236 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Google.Protobuf; + +namespace Mediapipe +{ + public enum NodeType : int + { + Unknown = 0, + Calculator = 1, + PacketGenerator = 2, + GraphInputStream = 3, + StatusHandler = 4, + }; + + [StructLayout(LayoutKind.Sequential)] + public readonly struct NodeRef + { + public readonly NodeType type; + public readonly int index; + } + + [StructLayout(LayoutKind.Sequential)] + public readonly struct EdgeInfo + { + public readonly int upstream; + public readonly NodeRef parentNode; + public readonly string name; + public readonly bool backEdge; + + internal EdgeInfo(int upstream, NodeRef parentNode, string name, bool backEdge) + { + this.upstream = upstream; + this.parentNode = parentNode; + this.name = name; + this.backEdge = backEdge; + } + } + + [StructLayout(LayoutKind.Sequential)] + internal readonly struct EdgeInfoVector + { + private readonly IntPtr _data; + private readonly int _size; + + public void Dispose() + { + UnsafeNativeMethods.mp_api_EdgeInfoArray__delete(_data, _size); + } + + public List Copy() + { + var edgeInfos = new List(_size); + + unsafe + { + var edgeInfoPtr = (EdgeInfoTmp*)_data; + + for (var i = 0; i < _size; i++) + { + var edgeInfoTmp = Marshal.PtrToStructure((IntPtr)edgeInfoPtr++); + edgeInfos.Add(edgeInfoTmp.Copy()); + } + } + + return edgeInfos; + } + + [StructLayout(LayoutKind.Sequential)] + private readonly struct EdgeInfoTmp + { + private readonly int _upstream; + private readonly NodeRef _parentNode; + private readonly IntPtr _name; + + [MarshalAs(UnmanagedType.U1)] + private readonly bool _backEdge; + + public EdgeInfo Copy() + { + var name = Marshal.PtrToStringAnsi(_name); + return new EdgeInfo(_upstream, _parentNode, name, _backEdge); + } + } + } + + public class ValidatedGraphConfig : MpResourceHandle + { + public ValidatedGraphConfig() : base() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__(out var ptr).Assert(); + this.ptr = ptr; + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__delete(ptr); + } + + public Status Initialize(CalculatorGraphConfig config) + { + var bytes = config.ToByteArray(); + UnsafeNativeMethods.mp_ValidatedGraphConfig__Initialize__Rcgc(mpPtr, bytes, bytes.Length, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public Status Initialize(string graphType) + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__Initialize__PKc(mpPtr, graphType, out var statusPtr).Assert(); + + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public bool Initialized() + { + return SafeNativeMethods.mp_ValidatedGraphConfig__Initialized(mpPtr); + } + + public Status ValidateRequiredSidePackets(SidePacket sidePacket) + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__ValidateRequiredSidePackets__Rsp(mpPtr, sidePacket.mpPtr, out var statusPtr).Assert(); + + GC.KeepAlive(sidePacket); + GC.KeepAlive(this); + return new Status(statusPtr); + } + + public CalculatorGraphConfig Config(ExtensionRegistry extensionRegistry = null) + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__Config(mpPtr, out var serializedProto).Assert(); + GC.KeepAlive(this); + + var parser = extensionRegistry == null ? CalculatorGraphConfig.Parser : CalculatorGraphConfig.Parser.WithExtensionRegistry(extensionRegistry); + var config = serializedProto.Deserialize(parser); + serializedProto.Dispose(); + + return config; + } + + public List InputStreamInfos() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__InputStreamInfos(mpPtr, out var edgeInfoVector).Assert(); + GC.KeepAlive(this); + + var edgeInfos = edgeInfoVector.Copy(); + edgeInfoVector.Dispose(); + return edgeInfos; + } + + public List OutputStreamInfos() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__OutputStreamInfos(mpPtr, out var edgeInfoVector).Assert(); + GC.KeepAlive(this); + + var edgeInfos = edgeInfoVector.Copy(); + edgeInfoVector.Dispose(); + return edgeInfos; + } + + public List InputSidePacketInfos() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__InputSidePacketInfos(mpPtr, out var edgeInfoVector).Assert(); + GC.KeepAlive(this); + + var edgeInfos = edgeInfoVector.Copy(); + edgeInfoVector.Dispose(); + return edgeInfos; + } + + public List OutputSidePacketInfos() + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__OutputSidePacketInfos(mpPtr, out var edgeInfoVector).Assert(); + GC.KeepAlive(this); + + var edgeInfos = edgeInfoVector.Copy(); + edgeInfoVector.Dispose(); + return edgeInfos; + } + + public int OutputStreamIndex(string name) + { + return SafeNativeMethods.mp_ValidatedGraphConfig__OutputStreamIndex__PKc(mpPtr, name); + } + + public int OutputSidePacketIndex(string name) + { + return SafeNativeMethods.mp_ValidatedGraphConfig__OutputSidePacketIndex__PKc(mpPtr, name); + } + + public int OutputStreamToNode(string name) + { + return SafeNativeMethods.mp_ValidatedGraphConfig__OutputStreamToNode__PKc(mpPtr, name); + } + + public StatusOrString RegisteredSidePacketTypeName(string name) + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__RegisteredSidePacketTypeName(mpPtr, name, out var statusOrStringPtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrString(statusOrStringPtr); + } + + public StatusOrString RegisteredStreamTypeName(string name) + { + UnsafeNativeMethods.mp_ValidatedGraphConfig__RegisteredStreamTypeName(mpPtr, name, out var statusOrStringPtr).Assert(); + + GC.KeepAlive(this); + return new StatusOrString(statusOrStringPtr); + } + + public string Package() + { + return MarshalStringFromNative(UnsafeNativeMethods.mp_ValidatedGraphConfig__Package); + } + + public static bool IsReservedExecutorName(string name) + { + return SafeNativeMethods.mp_ValidatedGraphConfig_IsReservedExecutorName(name); + } + + public bool IsExternalSidePacket(string name) + { + return SafeNativeMethods.mp_ValidatedGraphConfig__IsExternalSidePacket__PKc(mpPtr, name); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs.meta new file mode 100644 index 0000000..95aa2e5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e409ef683bc387c80adab78733e0b0f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu.meta new file mode 100644 index 0000000..bbdb3ea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e6f26889c9551644aaaf3a29dd2c82d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs new file mode 100644 index 0000000..7961807 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +#if UNITY_STANDALONE_LINUX || UNITY_ANDROID +namespace Mediapipe +{ + public class Egl + { + public static IntPtr GetCurrentContext() + { + return SafeNativeMethods.eglGetCurrentContext(); + } + } +} +#endif diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs.meta new file mode 100644 index 0000000..652c078 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Egl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 451f377fbd9cb54bcb56031e72e6603b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs new file mode 100644 index 0000000..fee4f1c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class Gl + { + public static uint GL_TEXTURE_2D = 0x0DE1; + + public static void Flush() + { + UnsafeNativeMethods.glFlush(); + } + + public static void ReadPixels(int x, int y, int width, int height, uint glFormat, uint glType, IntPtr pixels) + { + UnsafeNativeMethods.glReadPixels(x, y, width, height, glFormat, glType, pixels); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs.meta new file mode 100644 index 0000000..61a26fc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/Gl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2fced906166b27dff82e2af4aa2e38c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs new file mode 100644 index 0000000..c9ecacc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs @@ -0,0 +1,132 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + + public class GlCalculatorHelper : MpResourceHandle + { + public delegate Status.StatusArgs NativeGlStatusFunction(); + public delegate void GlFunction(); + + public GlCalculatorHelper() : base() + { + UnsafeNativeMethods.mp_GlCalculatorHelper__(out var ptr).Assert(); + this.ptr = ptr; + } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_GlCalculatorHelper__delete(ptr); + } + + public void InitializeForTest(GpuResources gpuResources) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__InitializeForTest__Pgr(mpPtr, gpuResources.mpPtr).Assert(); + + GC.KeepAlive(gpuResources); + GC.KeepAlive(this); + } + + /// + /// Function that is run in Gl Context. + /// Make sure that this function doesn't throw exceptions and won't be GCed. + /// + public Status RunInGlContext(NativeGlStatusFunction nativeGlStatusFunction) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__RunInGlContext__PF(mpPtr, nativeGlStatusFunction, out var statusPtr).Assert(); + GC.KeepAlive(this); + + return new Status(statusPtr); + } + + public Status RunInGlContext(GlFunction glFunction) + { + return RunInGlContext(() => + { + try + { + glFunction(); + return Status.StatusArgs.Ok(); + } + catch (Exception e) + { + return Status.StatusArgs.Internal(e.ToString()); + } + }); + } + + public GlTexture CreateSourceTexture(ImageFrame imageFrame) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__CreateSourceTexture__Rif(mpPtr, imageFrame.mpPtr, out var texturePtr).Assert(); + + GC.KeepAlive(this); + GC.KeepAlive(imageFrame); + return new GlTexture(texturePtr); + } + + public GlTexture CreateSourceTexture(GpuBuffer gpuBuffer) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__CreateSourceTexture__Rgb(mpPtr, gpuBuffer.mpPtr, out var texturePtr).Assert(); + + GC.KeepAlive(this); + GC.KeepAlive(gpuBuffer); + return new GlTexture(texturePtr); + } + +#if UNITY_IOS + public GlTexture CreateSourceTexture(GpuBuffer gpuBuffer, int plane) { + UnsafeNativeMethods.mp_GlCalculatorHelper__CreateSourceTexture__Rgb_i(mpPtr, gpuBuffer.mpPtr, plane, out var texturePtr).Assert(); + + GC.KeepAlive(this); + GC.KeepAlive(gpuBuffer); + return new GlTexture(texturePtr); + } +#endif + + public GlTexture CreateDestinationTexture(int width, int height, GpuBufferFormat format) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__CreateDestinationTexture__i_i_ui(mpPtr, width, height, format, out var texturePtr).Assert(); + + GC.KeepAlive(this); + return new GlTexture(texturePtr); + } + + public GlTexture CreateDestinationTexture(GpuBuffer gpuBuffer) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__CreateDestinationTexture__Rgb(mpPtr, gpuBuffer.mpPtr, out var texturePtr).Assert(); + + GC.KeepAlive(this); + GC.KeepAlive(gpuBuffer); + return new GlTexture(texturePtr); + } + + public uint framebuffer => SafeNativeMethods.mp_GlCalculatorHelper__framebuffer(mpPtr); + + public void BindFramebuffer(GlTexture glTexture) + { + UnsafeNativeMethods.mp_GlCalculatorHelper__BindFrameBuffer__Rtexture(mpPtr, glTexture.mpPtr).Assert(); + + GC.KeepAlive(glTexture); + GC.KeepAlive(this); + } + + public GlContext GetGlContext() + { + var glContextPtr = SafeNativeMethods.mp_GlCalculatorHelper__GetGlContext(mpPtr); + + GC.KeepAlive(this); + return new GlContext(glContextPtr, false); + } + + public bool Initialized() + { + return SafeNativeMethods.mp_GlCalculatorHelper__Initialized(mpPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs.meta new file mode 100644 index 0000000..0973d90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d373b6292efa02f09bb64650c4ceab57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs new file mode 100644 index 0000000..d0e8776 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs @@ -0,0 +1,91 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GlContext : MpResourceHandle + { + private SharedPtrHandle _sharedPtrHandle; + + public static GlContext GetCurrent() + { + UnsafeNativeMethods.mp_GlContext_GetCurrent(out var glContextPtr).Assert(); + + return glContextPtr == IntPtr.Zero ? null : new GlContext(glContextPtr); + } + + public GlContext(IntPtr ptr, bool isOwner = true) : base(isOwner) + { + _sharedPtrHandle = new SharedPtr(ptr, isOwner); + this.ptr = _sharedPtrHandle.Get(); + } + + protected override void DisposeManaged() + { + if (_sharedPtrHandle != null) + { + _sharedPtrHandle.Dispose(); + _sharedPtrHandle = null; + } + base.DisposeManaged(); + } + + protected override void DeleteMpPtr() + { + // Do nothing + } + + public IntPtr sharedPtr => _sharedPtrHandle == null ? IntPtr.Zero : _sharedPtrHandle.mpPtr; + +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + public IntPtr eglDisplay => SafeNativeMethods.mp_GlContext__egl_display(mpPtr); + + public IntPtr eglConfig => SafeNativeMethods.mp_GlContext__egl_config(mpPtr); + + public IntPtr eglContext => SafeNativeMethods.mp_GlContext__egl_context(mpPtr); +#endif + +#if UNITY_STANDALONE_OSX + // NOTE: On macOS, native libs cannot be built with GPU enabled, so it cannot be used actually. + public IntPtr nsglContext => SafeNativeMethods.mp_GlContext__nsgl_context(mpPtr); +#elif UNITY_IOS + public IntPtr eaglContext => SafeNativeMethods.mp_GlContext__eagl_context(mpPtr); +#endif + + public bool IsCurrent() + { + return SafeNativeMethods.mp_GlContext__IsCurrent(mpPtr); + } + + public int glMajorVersion => SafeNativeMethods.mp_GlContext__gl_major_version(mpPtr); + + public int glMinorVersion => SafeNativeMethods.mp_GlContext__gl_minor_version(mpPtr); + + public long glFinishCount => SafeNativeMethods.mp_GlContext__gl_finish_count(mpPtr); + + private class SharedPtr : SharedPtrHandle + { + public SharedPtr(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_SharedGlContext__delete(ptr); + } + + public override IntPtr Get() + { + return SafeNativeMethods.mp_SharedGlContext__get(mpPtr); + } + + public override void Reset() + { + UnsafeNativeMethods.mp_SharedGlContext__reset(mpPtr); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs.meta new file mode 100644 index 0000000..02b042e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9326248fed7e3b84f91321864c9e94a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs new file mode 100644 index 0000000..144723b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs @@ -0,0 +1,84 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GlSyncPoint : MpResourceHandle + { + private SharedPtrHandle _sharedPtrHandle; + + public GlSyncPoint(IntPtr ptr) : base() + { + _sharedPtrHandle = new SharedPtr(ptr); + this.ptr = _sharedPtrHandle.Get(); + } + + protected override void DisposeManaged() + { + if (_sharedPtrHandle != null) + { + _sharedPtrHandle.Dispose(); + _sharedPtrHandle = null; + } + base.DisposeManaged(); + } + + protected override void DeleteMpPtr() + { + // Do nothing + } + + public IntPtr sharedPtr => _sharedPtrHandle == null ? IntPtr.Zero : _sharedPtrHandle.mpPtr; + + public void Wait() + { + UnsafeNativeMethods.mp_GlSyncPoint__Wait(mpPtr).Assert(); + } + + public void WaitOnGpu() + { + UnsafeNativeMethods.mp_GlSyncPoint__WaitOnGpu(mpPtr).Assert(); + } + + public bool IsReady() + { + UnsafeNativeMethods.mp_GlSyncPoint__IsReady(mpPtr, out var value).Assert(); + + GC.KeepAlive(this); + return value; + } + + public GlContext GetContext() + { + UnsafeNativeMethods.mp_GlSyncPoint__GetContext(mpPtr, out var sharedGlContextPtr).Assert(); + + GC.KeepAlive(this); + return new GlContext(sharedGlContextPtr); + } + + private class SharedPtr : SharedPtrHandle + { + public SharedPtr(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_GlSyncToken__delete(ptr); + } + + public override IntPtr Get() + { + return SafeNativeMethods.mp_GlSyncToken__get(mpPtr); + } + + public override void Reset() + { + UnsafeNativeMethods.mp_GlSyncToken__reset(mpPtr); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs.meta new file mode 100644 index 0000000..fb9ccf0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlSyncPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6711aa0798875aad858e15d3900032b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs new file mode 100644 index 0000000..ef9487c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GlTexture : MpResourceHandle + { + public GlTexture() : base() + { + UnsafeNativeMethods.mp_GlTexture__(out var ptr).Assert(); + this.ptr = ptr; + } + + public GlTexture(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_GlTexture__delete(ptr); + } + + public int width => SafeNativeMethods.mp_GlTexture__width(mpPtr); + + public int height => SafeNativeMethods.mp_GlTexture__height(mpPtr); + + public uint target => SafeNativeMethods.mp_GlTexture__target(mpPtr); + + public uint name => SafeNativeMethods.mp_GlTexture__name(mpPtr); + + public void Release() + { + UnsafeNativeMethods.mp_GlTexture__Release(mpPtr).Assert(); + GC.KeepAlive(this); + } + + public GpuBuffer GetGpuBufferFrame() + { + UnsafeNativeMethods.mp_GlTexture__GetGpuBufferFrame(mpPtr, out var gpuBufferPtr).Assert(); + + GC.KeepAlive(this); + return new GpuBuffer(gpuBufferPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs.meta new file mode 100644 index 0000000..c8fedc5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTexture.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91fe3aeb09816f4b4909de29906d7903 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs new file mode 100644 index 0000000..42b3b18 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs @@ -0,0 +1,149 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GlTextureBuffer : MpResourceHandle + { + private SharedPtrHandle _sharedPtrHandle; + + /// + /// In the original MediaPipe repo, DeletionCallback only receives GlSyncToken. + /// However, IL2CPP does not support marshaling delegates that point to instance methods to native code, + /// so it receives also the texture name to specify the target instance. + /// + public delegate void DeletionCallback(uint name, IntPtr glSyncToken); + + public GlTextureBuffer(IntPtr ptr, bool isOwner = true) : base(isOwner) + { + _sharedPtrHandle = new SharedPtr(ptr, isOwner); + this.ptr = _sharedPtrHandle.Get(); + } + + /// + /// A function called when the texture buffer is deleted. + /// Make sure that this function doesn't throw exceptions and won't be GCed. + /// + public GlTextureBuffer(uint target, uint name, int width, int height, + GpuBufferFormat format, DeletionCallback callback, GlContext glContext) : base() + { + var sharedContextPtr = glContext == null ? IntPtr.Zero : glContext.sharedPtr; + UnsafeNativeMethods.mp_SharedGlTextureBuffer__ui_ui_i_i_ui_PF_PSgc( + target, name, width, height, format, callback, sharedContextPtr, out var ptr).Assert(); + + _sharedPtrHandle = new SharedPtr(ptr); + this.ptr = _sharedPtrHandle.Get(); + } + + public GlTextureBuffer(uint name, int width, int height, GpuBufferFormat format, DeletionCallback callback, GlContext glContext = null) : + this(Gl.GL_TEXTURE_2D, name, width, height, format, callback, glContext) + { } + + protected override void DisposeManaged() + { + if (_sharedPtrHandle != null) + { + _sharedPtrHandle.Dispose(); + _sharedPtrHandle = null; + } + base.DisposeManaged(); + } + + protected override void DeleteMpPtr() + { + // Do nothing + } + + public IntPtr sharedPtr => _sharedPtrHandle == null ? IntPtr.Zero : _sharedPtrHandle.mpPtr; + + public uint Name() + { + return SafeNativeMethods.mp_GlTextureBuffer__name(mpPtr); + } + + public uint Target() + { + return SafeNativeMethods.mp_GlTextureBuffer__target(mpPtr); + } + + public int Width() + { + return SafeNativeMethods.mp_GlTextureBuffer__width(mpPtr); + } + + public int Height() + { + return SafeNativeMethods.mp_GlTextureBuffer__height(mpPtr); + } + + public GpuBufferFormat Format() + { + return SafeNativeMethods.mp_GlTextureBuffer__format(mpPtr); + } + + public void WaitUntilComplete() + { + UnsafeNativeMethods.mp_GlTextureBuffer__WaitUntilComplete(mpPtr).Assert(); + } + + public void WaitOnGpu() + { + UnsafeNativeMethods.mp_GlTextureBuffer__WaitOnGpu(mpPtr).Assert(); + } + + public void Reuse() + { + UnsafeNativeMethods.mp_GlTextureBuffer__Reuse(mpPtr).Assert(); + } + + public void Updated(GlSyncPoint prodToken) + { + UnsafeNativeMethods.mp_GlTextureBuffer__Updated__Pgst(mpPtr, prodToken.sharedPtr).Assert(); + } + + public void DidRead(GlSyncPoint consToken) + { + UnsafeNativeMethods.mp_GlTextureBuffer__DidRead__Pgst(mpPtr, consToken.sharedPtr).Assert(); + } + + public void WaitForConsumers() + { + UnsafeNativeMethods.mp_GlTextureBuffer__WaitForConsumers(mpPtr).Assert(); + } + + public void WaitForConsumersOnGpu() + { + UnsafeNativeMethods.mp_GlTextureBuffer__WaitForConsumersOnGpu(mpPtr).Assert(); + } + + public GlContext GetProducerContext() + { + return new GlContext(SafeNativeMethods.mp_GlTextureBuffer__GetProducerContext(mpPtr), false); + } + + private class SharedPtr : SharedPtrHandle + { + public SharedPtr(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_SharedGlTextureBuffer__delete(ptr); + } + + public override IntPtr Get() + { + return SafeNativeMethods.mp_SharedGlTextureBuffer__get(mpPtr); + } + + public override void Reset() + { + UnsafeNativeMethods.mp_SharedGlTextureBuffer__reset(mpPtr); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs.meta new file mode 100644 index 0000000..547b374 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdc0e340c6497d69482b411dd1da98d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs new file mode 100644 index 0000000..d598312 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + public struct GlTextureInfo + { + public int glInternalFormat; + public uint glFormat; + public uint glType; + public int downscale; + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs.meta new file mode 100644 index 0000000..0b9ff89 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlTextureInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52c2de190149bd59f8fdc4b61fb65e5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs new file mode 100644 index 0000000..1fa83d7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe +{ + public enum GlVersion : uint + { + kGL = 1, + kGLES2 = 2, + kGLES3 = 3, + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs.meta new file mode 100644 index 0000000..448a75c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlVersion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8ed2bce7c4dadfed96ab02757192254 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs new file mode 100644 index 0000000..e80589d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GpuBuffer : MpResourceHandle + { + public GpuBuffer(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { } + +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + public GpuBuffer(GlTextureBuffer glTextureBuffer) : base() + { + UnsafeNativeMethods.mp_GpuBuffer__PSgtb(glTextureBuffer.sharedPtr, out var ptr).Assert(); + glTextureBuffer.Dispose(); // respect move semantics + this.ptr = ptr; + } +#endif + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_GpuBuffer__delete(ptr); + } + + public GpuBufferFormat Format() + { + return SafeNativeMethods.mp_GpuBuffer__format(mpPtr); + } + + public int Width() + { + return SafeNativeMethods.mp_GpuBuffer__width(mpPtr); + } + + public int Height() + { + return SafeNativeMethods.mp_GpuBuffer__height(mpPtr); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs.meta new file mode 100644 index 0000000..a5c7376 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6ff19d1ad393a456aa8a1957d8de679 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs new file mode 100644 index 0000000..4a00b58 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs @@ -0,0 +1,38 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe +{ + public enum GpuBufferFormat : uint + { + kUnknown = 0, + kBGRA32 = ('B' << 24) + ('G' << 16) + ('R' << 8) + 'A', + kGrayFloat32 = ('L' << 24) + ('0' << 16) + ('0' << 8) + 'f', + kGrayHalf16 = ('L' << 24) + ('0' << 16) + ('0' << 8) + 'h', + kOneComponent8 = ('L' << 24) + ('0' << 16) + ('0' << 8) + '8', + kTwoComponentHalf16 = ('2' << 24) + ('C' << 16) + ('0' << 8) + 'h', + kTwoComponentFloat32 = ('2' << 24) + ('C' << 16) + ('0' << 8) + 'f', + kBiPlanar420YpCbCr8VideoRange = ('4' << 24) + ('2' << 16) + ('0' << 8) + 'v', + kBiPlanar420YpCbCr8FullRange = ('4' << 24) + ('2' << 16) + ('0' << 8) + 'f', + kRGB24 = 0x00000018, // Note: prefer BGRA32 whenever possible. + kRGBAHalf64 = ('R' << 24) + ('G' << 16) + ('h' << 8) + 'A', + kRGBAFloat128 = ('R' << 24) + ('G' << 16) + ('f' << 8) + 'A', + } + + public static class GpuBufferFormatExtension + { + public static ImageFormat.Types.Format ImageFormatFor(this GpuBufferFormat gpuBufferFormat) + { + return SafeNativeMethods.mp__ImageFormatForGpuBufferFormat__ui(gpuBufferFormat); + } + + public static GlTextureInfo GlTextureInfoFor(this GpuBufferFormat gpuBufferFormat, int plane, GlVersion glVersion = GlVersion.kGLES3) + { + UnsafeNativeMethods.mp__GlTextureInfoForGpuBufferFormat__ui_i_ui(gpuBufferFormat, plane, glVersion, out var glTextureInfo).Assert(); + return glTextureInfo; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs.meta new file mode 100644 index 0000000..c5ff5f9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuBufferFormat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9cf369502e143ed428fb320c1bf6a612 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs new file mode 100644 index 0000000..f70159e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs @@ -0,0 +1,73 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; + +namespace Mediapipe +{ + public class GpuResources : MpResourceHandle + { + private SharedPtrHandle _sharedPtrHandle; + + /// Shared pointer of mediapipe::GpuResources + public GpuResources(IntPtr ptr) : base() + { + _sharedPtrHandle = new SharedPtr(ptr); + this.ptr = _sharedPtrHandle.Get(); + } + + protected override void DisposeManaged() + { + if (_sharedPtrHandle != null) + { + _sharedPtrHandle.Dispose(); + _sharedPtrHandle = null; + } + base.DisposeManaged(); + } + + protected override void DeleteMpPtr() + { + // Do nothing + } + + public IntPtr sharedPtr => _sharedPtrHandle == null ? IntPtr.Zero : _sharedPtrHandle.mpPtr; + + public static StatusOrGpuResources Create() + { + UnsafeNativeMethods.mp_GpuResources_Create(out var statusOrGpuResourcesPtr).Assert(); + + return new StatusOrGpuResources(statusOrGpuResourcesPtr); + } + + public static StatusOrGpuResources Create(IntPtr externalContext) + { + UnsafeNativeMethods.mp_GpuResources_Create__Pv(externalContext, out var statusOrGpuResourcesPtr).Assert(); + + return new StatusOrGpuResources(statusOrGpuResourcesPtr); + } + + private class SharedPtr : SharedPtrHandle + { + public SharedPtr(IntPtr ptr) : base(ptr) { } + + protected override void DeleteMpPtr() + { + UnsafeNativeMethods.mp_SharedGpuResources__delete(ptr); + } + + public override IntPtr Get() + { + return SafeNativeMethods.mp_SharedGpuResources__get(mpPtr); + } + + public override void Reset() + { + UnsafeNativeMethods.mp_SharedGpuResources__reset(mpPtr); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs.meta new file mode 100644 index 0000000..245fd9d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79a3f5b48340727e8b240d5aa9fb28ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs.meta new file mode 100644 index 0000000..c57f73b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 85e7186cd21de904eb6fba4184078cb0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking.meta new file mode 100644 index 0000000..3896cef --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d4d6ab3090c33541932d6dcccba2c32 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs new file mode 100644 index 0000000..8e6ca3c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + public struct Anchor3d + { + public float x; + public float y; + public float z; + public int stickerId; + + public override string ToString() + { + return $"({x}, {y}, {z}), #{stickerId}"; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs.meta new file mode 100644 index 0000000..0087767 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3d.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dcbd63ef2a5963ee698de211fffbd1e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs new file mode 100644 index 0000000..13cb47f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs @@ -0,0 +1,41 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + [StructLayout(LayoutKind.Sequential)] + internal struct Anchor3dVector + { + public IntPtr data; + public int size; + + public void Dispose() + { + UnsafeNativeMethods.mp_Anchor3dArray__delete(data); + } + + public List ToList() + { + var anchors = new List(size); + + unsafe + { + var anchorPtr = (Anchor3d*)data; + + for (var i = 0; i < size; i++) + { + anchors.Add(Marshal.PtrToStructure((IntPtr)anchorPtr++)); + } + } + + return anchors; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs.meta new file mode 100644 index 0000000..ab210b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Graphs/InstantMotionTracking/Anchor3dVector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 245fdb6c2b3fc7c938665fbf58cd4789 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke.meta new file mode 100644 index 0000000..c67ff51 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e8d8b511757e5e4ca73936f8d4dc0c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs new file mode 100644 index 0000000..74f5614 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe +{ + public enum MpReturnCode : int + { + Success = 0, + /// A standard exception is thrown + StandardError = 1, + /// Something other than standard exception is thrown + UnknownError = 70, + /// SDK failed to set status code (bug) + Unset = 128, // + /// Received SIGABRT + Aborted = 134, + } + + public static class MpReturnCodeExtension + { + public static void Assert(this MpReturnCode code) + { + switch (code) + { + case MpReturnCode.Success: return; + case MpReturnCode.Aborted: + { + throw new MediaPipeException("MediaPipe Aborted, refer glog files for more details"); + } + case MpReturnCode.StandardError: + { + throw new MediaPipePluginException($"Exception is thrown in Unmanaged Code"); + } + case MpReturnCode.UnknownError: + { + throw new MediaPipePluginException($"Unknown exception is thrown in Unmanaged Code"); + } + case MpReturnCode.Unset: + { + // Bug + throw new MediaPipePluginException($"Failed to call a native function, but the reason is unknown"); + } + default: + { + throw new MediaPipePluginException($"Failed to call a native function, but the reason is undefined"); + } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs.meta new file mode 100644 index 0000000..5facf22 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/MpReturnCode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d48f3aced83c172239335deecd37ccaa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods.meta new file mode 100644 index 0000000..c086878 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e1279bcaf6a4f074fbba7d136d880907 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External.meta new file mode 100644 index 0000000..da6b1de --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06f197b48df268a4c854e0a995ccfb26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs new file mode 100644 index 0000000..a1343a7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool absl_Status__ok(IntPtr status); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int absl_Status__raw_code(IntPtr status); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs.meta new file mode 100644 index 0000000..f2cf19c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da8fc54cee1027e99b8906eb2bf52fe9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs new file mode 100644 index 0000000..6a0d096 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode absl_Status__i_PKc(int code, string message, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void absl_Status__delete(IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode absl_Status__ToString(IntPtr status, out IntPtr str); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs.meta new file mode 100644 index 0000000..0d134e7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Absl_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 155484db76e5b33b9abb229007a71250 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs new file mode 100644 index 0000000..9a2d75e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode google_InitGoogleLogging__PKc(string name); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode google_ShutdownGoogleLogging(); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_FLAGS_logtostderr([MarshalAs(UnmanagedType.I1)] bool value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_FLAGS_stderrthreshold(int threshold); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_FLAGS_minloglevel(int level); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_FLAGS_log_dir(string dir); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_FLAGS_v(int v); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_LOG_INFO__PKc(string str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_LOG_WARNING__PKc(string str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_LOG_ERROR__PKc(string str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void glog_LOG_FATAL__PKc(string str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void google_FlushLogFiles(Glog.Severity severity); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs.meta new file mode 100644 index 0000000..da892db --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5746b8714205e5f4c9b283abb157f283 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs new file mode 100644 index 0000000..2ab2d2f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs @@ -0,0 +1,74 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode google_protobuf__SetLogHandler__PF( + [MarshalAs(UnmanagedType.FunctionPtr)] Protobuf.LogHandler logHandler); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode google_protobuf__ResetLogHandler(); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_api_SerializedProtoArray__delete(IntPtr serializedProtoVectorData, int size); + + #region MessageProto + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetClassificationList(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetClassificationListVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetDetection(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetDetectionVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFaceGeometry(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFaceGeometryVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFrameAnnotation(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetLandmarkList(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetLandmarkListVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetNormalizedLandmarkList(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetNormalizedLandmarkListVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetNormalizedRect(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetNormalizedRectVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetRect(IntPtr packet, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetRectVector(IntPtr packet, out SerializedProtoVector serializedProtoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetTimedModelMatrixProtoList(IntPtr packet, out SerializedProto serializedProto); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs.meta new file mode 100644 index 0000000..a682879 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Protobuf_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2824e1ee33b214b5931f71e3476d099 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs new file mode 100644 index 0000000..2ea4c46 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_StatusOrString__ok(IntPtr statusOrString); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs.meta new file mode 100644 index 0000000..4fb98ed --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4387fa8ccc9d34346989f3157763325c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs new file mode 100644 index 0000000..1965f17 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void delete_array__PKc(IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void delete_array__Pf(IntPtr str); + + #region String + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void std_string__delete(IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode std_string__PKc_i(byte[] bytes, int size, out IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void std_string__swap__Rstr(IntPtr src, IntPtr dst); + #endregion + + #region StatusOrString + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_StatusOrString__delete(IntPtr statusOrString); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrString__status(IntPtr statusOrString, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrString__value(IntPtr statusOrString, out IntPtr value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrString__bytearray(IntPtr statusOrString, out IntPtr value, out int size); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs.meta new file mode 100644 index 0000000..ada02bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Stdlib_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8145b1567167432dda87798d70f47019 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework.meta new file mode 100644 index 0000000..16b3fba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b05ef67a7940b44e9c78e9845c84aa8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs new file mode 100644 index 0000000..cf9b237 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_CalculatorGraph__HasError(IntPtr graph); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_CalculatorGraph__HasInputStream__PKc(IntPtr graph, string name); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_CalculatorGraph__GraphInputStreamsClosed(IntPtr graph); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_CalculatorGraph__IsNodeThrottled__i(IntPtr graph, int nodeId); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_CalculatorGraph__UnthrottleSources(IntPtr graph); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs.meta new file mode 100644 index 0000000..0acda71 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4151a04c25074315f99f586059854ebe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs new file mode 100644 index 0000000..3e43fbf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs @@ -0,0 +1,77 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__(out IntPtr graph); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__PKc_i(byte[] serializedConfig, int size, out IntPtr graph); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_CalculatorGraph__delete(IntPtr graph); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__Initialize__PKc_i(IntPtr graph, byte[] serializedConfig, int size, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__Initialize__PKc_i_Rsp( + IntPtr graph, byte[] serializedConfig, int size, IntPtr sidePackets, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__Config(IntPtr graph, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__ObserveOutputStream__PKc_PF_b(IntPtr graph, string streamName, int streamId, + [MarshalAs(UnmanagedType.FunctionPtr)] CalculatorGraph.NativePacketCallback packetCallback, [MarshalAs(UnmanagedType.I1)] bool observeTimestampBounds, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__AddOutputStreamPoller__PKc_b(IntPtr graph, string streamName, [MarshalAs(UnmanagedType.I1)] bool observeTimestampBounds, out IntPtr statusOrPoller); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__Run__Rsp(IntPtr graph, IntPtr sidePackets, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__StartRun__Rsp(IntPtr graph, IntPtr sidePackets, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__WaitUntilIdle(IntPtr graph, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__WaitUntilDone(IntPtr graph, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__AddPacketToInputStream__PKc_Ppacket( + IntPtr graph, string streamName, IntPtr packet, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__SetInputStreamMaxQueueSize__PKc_i( + IntPtr graph, string streamName, int maxQueueSize, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__CloseInputStream__PKc(IntPtr graph, string streamName, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__CloseAllPacketSources(IntPtr graph, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__Cancel(IntPtr graph); + + #region GPU + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__GetGpuResources(IntPtr graph, out IntPtr gpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_CalculatorGraph__SetGpuResources__SPgpu(IntPtr graph, IntPtr gpuResources, out IntPtr status); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs.meta new file mode 100644 index 0000000..0dd3871 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/CalculatorGraph_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f798d37c18934402bf7aa85c095fa32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs new file mode 100644 index 0000000..f7353ab --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_api__ConvertFromCalculatorGraphConfigTextFormat(string configText, out SerializedProto serializedProto); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs.meta new file mode 100644 index 0000000..4e6fecd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Calculator_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c7f419d9297b69f7bd4259432b3a846 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format.meta new file mode 100644 index 0000000..9b3d989 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 49d82fd23aaa04643b39b7aa9f461010 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs new file mode 100644 index 0000000..ff05130 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_ImageFrame__IsEmpty(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_ImageFrame__IsContiguous(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__IsAligned__ui( + IntPtr imageFrame, uint alignmentBoundary, [MarshalAs(UnmanagedType.I1)] out bool value); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern ImageFormat.Types.Format mp_ImageFrame__Format(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ImageFrame__Width(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ImageFrame__Height(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ImageFrame__WidthStep(IntPtr imageFrame); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_ImageFrame__MutablePixelData(IntPtr imageFrame); + + #region StatusOr + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_StatusOrImageFrame__ok(IntPtr statusOrImageFrame); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs.meta new file mode 100644 index 0000000..e11c0fb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99e8da896b508c97fbfe30b3c8d1c0d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs new file mode 100644 index 0000000..e637c89 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs @@ -0,0 +1,72 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__(out IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__ui_i_i_ui( + ImageFormat.Types.Format format, int width, int height, uint alignmentBoundary, out IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__ui_i_i_i_Pui8_PF( + ImageFormat.Types.Format format, int width, int height, int widthStep, IntPtr pixelData, + [MarshalAs(UnmanagedType.FunctionPtr)] ImageFrame.Deleter deleter, out IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_ImageFrame__delete(IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__SetToZero(IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__SetAlignmentPaddingAreas(IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__CopyToBuffer__Pui8_i(IntPtr imageFrame, IntPtr buffer, int bufferSize); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__CopyToBuffer__Pui16_i(IntPtr imageFrame, IntPtr buffer, int bufferSize); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ImageFrame__CopyToBuffer__Pf_i(IntPtr imageFrame, IntPtr buffer, int bufferSize); + + #region StatusOr + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_StatusOrImageFrame__delete(IntPtr statusOrImageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrImageFrame__status(IntPtr statusOrImageFrame, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrImageFrame__value(IntPtr statusOrImageFrame, out IntPtr imageFrame); + #endregion + + #region Packet + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeImageFramePacket__Pif(IntPtr imageFrame, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeImageFramePacket_At__Pif_Rt(IntPtr imageFrame, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ConsumeImageFrame(IntPtr packet, out IntPtr statusOrImageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetImageFrame(IntPtr packet, out IntPtr imageFrame); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsImageFrame(IntPtr packet, out IntPtr status); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs.meta new file mode 100644 index 0000000..2d0545a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/ImageFrame_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f1912965dccdf052aba3a477883eb98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs new file mode 100644 index 0000000..bfc16ae --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + #region Packet + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeMatrixPacket__PKc_i(byte[] serializedMatrixData, int size, out IntPtr packet_out); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeMatrixPacket_At__PKc_i_Rt(byte[] serializedMatrixData, int size, IntPtr timestamp, out IntPtr packet_out); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsMatrix(IntPtr packet, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetMatrix(IntPtr packet, out SerializedProto serializedProto); + + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs.meta new file mode 100644 index 0000000..67688a5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Format/Matrix_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc5345171757d2049a546634b03b8c5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs new file mode 100644 index 0000000..2499ba2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_StatusOrPoller__ok(IntPtr statusOrPoller); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs.meta new file mode 100644 index 0000000..ba059fa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 089b00baa4837fc45b59e49b3fd89708 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs new file mode 100644 index 0000000..397ed43 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + #region OutputStreamPoller + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_OutputStreamPoller__delete(IntPtr poller); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_OutputStreamPoller__Reset(IntPtr poller); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_OutputStreamPoller__Next_Ppacket(IntPtr poller, IntPtr packet, out bool result); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_OutputStreamPoller__SetMaxQueueSize(IntPtr poller, int queueSize); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_OutputStreamPoller__QueueSize(IntPtr poller, out int queueSize); + #endregion + + #region StatusOrPoller + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_StatusOrPoller__delete(IntPtr statusOrPoller); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrPoller__status(IntPtr statusOrPoller, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrPoller__value(IntPtr statusOrPoller, out IntPtr poller); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs.meta new file mode 100644 index 0000000..adeffba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/OutputStreamPoller_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c8eb1e2420bbdbd79777f61fa67daa5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs new file mode 100644 index 0000000..1cd93db --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Packet__IsEmpty(IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SidePacket__clear(IntPtr sidePacket); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_SidePacket__size(IntPtr sidePacket); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs.meta new file mode 100644 index 0000000..01dac4b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa23fae0b90d981ac997812e8d7541fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs new file mode 100644 index 0000000..a931f04 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs @@ -0,0 +1,153 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + #region common + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__(out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_Packet__delete(IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__At__Rt(IntPtr packet, IntPtr timestamp, out IntPtr newPacket); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsProtoMessageLite(IntPtr packet, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__Timestamp(IntPtr packet, out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__DebugString(IntPtr packet, out IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__RegisteredTypeName(IntPtr packet, out IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__DebugTypeName(IntPtr packet, out IntPtr str); + #endregion + + #region Bool + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeBoolPacket__b([MarshalAs(UnmanagedType.I1)] bool value, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeBoolPacket_At__b_Rt([MarshalAs(UnmanagedType.I1)] bool value, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetBool(IntPtr packet, [MarshalAs(UnmanagedType.I1)] out bool value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsBool(IntPtr packet, out IntPtr status); + #endregion + + #region Float + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatPacket__f(float value, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatPacket_At__f_Rt(float value, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFloat(IntPtr packet, out float value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsFloat(IntPtr packet, out IntPtr status); + #endregion + + #region Int + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeIntPacket__i(int value, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeIntPacket_At__i_Rt(int value, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetInt(IntPtr packet, out int value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsInt(IntPtr packet, out IntPtr status); + #endregion + + #region FloatArray + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatArrayPacket__Pf_i(float[] value, int size, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatArrayPacket_At__Pf_i_Rt(float[] value, int size, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFloatArray_i(IntPtr packet, int size, out IntPtr value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsFloatArray(IntPtr packet, out IntPtr status); + #endregion + + #region FloatVector + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatVectorPacket__Pf_i(float[] value, int size, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeFloatVectorPacket_At__Pf_i_Rt(float[] value, int size, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetFloatVector(IntPtr packet, out FloatVector value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsFloatVector(IntPtr packet, out IntPtr status); + #endregion + + #region String + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeStringPacket__PKc(string value, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeStringPacket_At__PKc_Rt(string value, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeStringPacket__PKc_i(byte[] bytes, int size, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeStringPacket_At__PKc_i_Rt(byte[] bytes, int size, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetString(IntPtr packet, out IntPtr value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetByteString(IntPtr packet, out IntPtr value, out int size); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ConsumeString(IntPtr packet, out IntPtr statusOrValue); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsString(IntPtr packet, out IntPtr status); + #endregion + + #region SidePacket + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_SidePacket__(out IntPtr sidePacket); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SidePacket__delete(IntPtr sidePacket); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_SidePacket__emplace__PKc_Rp(IntPtr sidePacket, string key, IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_SidePacket__at__PKc(IntPtr sidePacket, string key, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_SidePacket__erase__PKc(IntPtr sidePacket, string key, out int count); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs.meta new file mode 100644 index 0000000..3e935e7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Packet_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f45c37386d4ecb8abb6f74475d29dc6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs new file mode 100644 index 0000000..1429894 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern long mp_Timestamp__Value(IntPtr timestamp); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern double mp_Timestamp__Seconds(IntPtr timestamp); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern long mp_Timestamp__Microseconds(IntPtr timestamp); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsSpecialValue(IntPtr timestamp); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsRangeValue(IntPtr timestamp); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsAllowedInStream(IntPtr timestamp); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta new file mode 100644 index 0000000..eed5ed5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd82a3be1540e60c9ab398f1d488758c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs new file mode 100644 index 0000000..8471173 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__l(long value, out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_Timestamp__delete(IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__DebugString(IntPtr timestamp, out IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__NextAllowedInStream(IntPtr timestamp, out IntPtr nextTimestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__PreviousAllowedInStream(IntPtr timestamp, out IntPtr prevTimestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_FromSeconds__d(double seconds, out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Unset(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Unstarted(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_PreStream(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Min(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Max(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_PostStream(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_OneOverPostStream(out IntPtr timestamp); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Done(out IntPtr timestamp); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta new file mode 100644 index 0000000..dbc9efa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3552112fccbfde24b80dbe41bf72a806 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs new file mode 100644 index 0000000..9bb46c8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_ValidatedGraphConfig__Initialized(IntPtr config); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ValidatedGraphConfig__OutputStreamIndex__PKc(IntPtr config, string name); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ValidatedGraphConfig__OutputSidePacketIndex__PKc(IntPtr config, string name); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_ValidatedGraphConfig__OutputStreamToNode__PKc(IntPtr config, string name); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_ValidatedGraphConfig_IsReservedExecutorName(string name); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_ValidatedGraphConfig__IsExternalSidePacket__PKc(IntPtr config, string name); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs.meta new file mode 100644 index 0000000..0b0af1a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c73850dfbc5a5d0bc9c02651552efc2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs new file mode 100644 index 0000000..d528922 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__(out IntPtr config); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_ValidatedGraphConfig__delete(IntPtr config); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__Initialize__Rcgc(IntPtr config, byte[] serializedConfig, int size, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__Initialize__PKc(IntPtr config, string graphType, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__ValidateRequiredSidePackets__Rsp(IntPtr config, IntPtr sidePackets, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__Config(IntPtr config, out SerializedProto serializedProto); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__InputStreamInfos(IntPtr config, out EdgeInfoVector edgeInfoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__OutputStreamInfos(IntPtr config, out EdgeInfoVector edgeInfoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__InputSidePacketInfos(IntPtr config, out EdgeInfoVector edgeInfoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__OutputSidePacketInfos(IntPtr config, out EdgeInfoVector edgeInfoVector); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__RegisteredSidePacketTypeName(IntPtr config, string name, out IntPtr statusOrString); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__RegisteredStreamTypeName(IntPtr config, string name, out IntPtr statusOrString); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_ValidatedGraphConfig__Package(IntPtr config, out IntPtr str); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_api_EdgeInfoArray__delete(IntPtr data, int size); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs.meta new file mode 100644 index 0000000..dbf0621 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Framework/ValidatedGraphConfig_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3178003154386ee09ae63eb0a48f386b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu.meta new file mode 100644 index 0000000..afbe429 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06552cb1942286044a1ae8ad31c92246 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs new file mode 100644 index 0000000..39f50fa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern uint mp_GlCalculatorHelper__framebuffer(IntPtr glCalculatorHelper); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlCalculatorHelper__GetGlContext(IntPtr glCalculatorHelper); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_GlCalculatorHelper__Initialized(IntPtr glCalculatorHelper); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs.meta new file mode 100644 index 0000000..99bd17f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e564c364aa8fc108c952c34bd5708e49 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs new file mode 100644 index 0000000..592638c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__(out IntPtr glCalculatorHelper); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_GlCalculatorHelper__delete(IntPtr glCalculatorHelper); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__InitializeForTest__Pgr(IntPtr glCalculatorHelper, IntPtr gpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__RunInGlContext__PF( + IntPtr glCalculatorHelper, [MarshalAs(UnmanagedType.FunctionPtr)] GlCalculatorHelper.NativeGlStatusFunction glFunc, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__CreateSourceTexture__Rif( + IntPtr glCalculatorHelper, IntPtr imageFrame, out IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__CreateSourceTexture__Rgb( + IntPtr glCalculatorHelper, IntPtr gpuBuffer, out IntPtr glTexture); + +#if UNITY_IOS + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__CreateSourceTexture__Rgb_i( + IntPtr glCalculatorHelper, IntPtr gpuBuffer, int plane, out IntPtr glTexture); +#endif + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__CreateDestinationTexture__i_i_ui( + IntPtr glCalculatorHelper, int outputWidth, int outputHeight, GpuBufferFormat formatCode, out IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__CreateDestinationTexture__Rgb( + IntPtr glCalculatorHelper, IntPtr gpuBuffer, out IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlCalculatorHelper__BindFrameBuffer__Rtexture(IntPtr glCalculatorHelper, IntPtr glTexture); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs.meta new file mode 100644 index 0000000..de58070 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlCalculatorHelper_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82da240322adcf754810db201ec3bb6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs new file mode 100644 index 0000000..ca9fe90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + #region GlContext + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_SharedGlContext__get(IntPtr sharedGlContext); + +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__egl_display(IntPtr glContext); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__egl_config(IntPtr glContext); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__egl_context(IntPtr glContext); +#endif + +#if UNITY_IOS + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__eagl_context(IntPtr glContext); +#elif UNITY_STANDALONE_OSX + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__nsgl_context(IntPtr glContext); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlContext__nsgl_pixel_format(IntPtr glContext); +#endif + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_GlContext__IsCurrent(IntPtr glContext); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlContext__gl_major_version(IntPtr glContext); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlContext__gl_minor_version(IntPtr glContext); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern long mp_GlContext__gl_finish_count(IntPtr glContext); + #endregion + + #region GlSyncToken + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlSyncToken__get(IntPtr glSyncToken); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs.meta new file mode 100644 index 0000000..f11aced --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6d0d1aa759d4722881c31504ff7f2b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs new file mode 100644 index 0000000..7e49aea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + #region GlContext + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGlContext__delete(IntPtr sharedGlContext); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGlContext__reset(IntPtr sharedGlContext); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlContext_GetCurrent(out IntPtr sharedGlContext); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlContext_Create__P_b([MarshalAs(UnmanagedType.I1)] bool createThread, out IntPtr statusOrSharedGlContext); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlContext_Create__Rgc_b( + IntPtr shareContext, [MarshalAs(UnmanagedType.I1)] bool createThread, out IntPtr statusOrSharedGlContext); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlContext_Create__ui_b( + uint shareContext, [MarshalAs(UnmanagedType.I1)] bool createThread, out IntPtr statusOrSharedGlContext); + +#if UNITY_IOS + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlContext_Create__Pes_b( + IntPtr sharegroup, [MarshalAs(UnmanagedType.I1)]bool createThread, out IntPtr statusOrSharedGlContext); +#endif + #endregion + + #region GlSyncToken + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_GlSyncToken__delete(IntPtr glSyncToken); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_GlSyncToken__reset(IntPtr glSyncToken); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlSyncPoint__Wait(IntPtr glSyncPoint); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlSyncPoint__WaitOnGpu(IntPtr glSyncPoint); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlSyncPoint__IsReady(IntPtr glSyncPoint, out bool value); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlSyncPoint__GetContext(IntPtr glSyncPoint, out IntPtr sharedGlContext); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs.meta new file mode 100644 index 0000000..b8848cf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlContext_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07ecf4eb645a5867f8fd99c199334778 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs new file mode 100644 index 0000000..fe2a99d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + #region GlTextureBuffer + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern uint mp_GlTextureBuffer__name(IntPtr glTextureBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern uint mp_GlTextureBuffer__target(IntPtr glTextureBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlTextureBuffer__width(IntPtr glTextureBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlTextureBuffer__height(IntPtr glTextureBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern GpuBufferFormat mp_GlTextureBuffer__format(IntPtr glTextureBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_GlTextureBuffer__GetProducerContext(IntPtr glTextureBuffer); + #endregion + + #region SharedGlTextureBuffer + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_SharedGlTextureBuffer__get(IntPtr glTextureBuffer); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs.meta new file mode 100644 index 0000000..5f36b2e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94158874b636c7c1c86afcec7fca108e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs new file mode 100644 index 0000000..777cdce --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs @@ -0,0 +1,51 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + #region GlTextureBuffer + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__WaitUntilComplete(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__WaitOnGpu(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__Reuse(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__Updated__Pgst(IntPtr glTextureBuffer, IntPtr prodToken); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__DidRead__Pgst(IntPtr glTextureBuffer, IntPtr consToken); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__WaitForConsumers(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTextureBuffer__WaitForConsumersOnGpu(IntPtr glTextureBuffer); + #endregion + + #region SharedGlTextureBuffer + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGlTextureBuffer__delete(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGlTextureBuffer__reset(IntPtr glTextureBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_SharedGlTextureBuffer__ui_ui_i_i_ui_PF_PSgc( + uint target, uint name, int width, int height, GpuBufferFormat format, + [MarshalAs(UnmanagedType.FunctionPtr)] GlTextureBuffer.DeletionCallback deletionCallback, + IntPtr producerContext, out IntPtr sharedGlTextureBuffer); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs.meta new file mode 100644 index 0000000..fc69398 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTextureBuffer_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7aaa60de75bee921e82d0d1a754b3544 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs new file mode 100644 index 0000000..8c8dece --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs @@ -0,0 +1,27 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlTexture__width(IntPtr glTexture); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GlTexture__height(IntPtr glTexture); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern uint mp_GlTexture__target(IntPtr glTexture); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern uint mp_GlTexture__name(IntPtr glTexture); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs.meta new file mode 100644 index 0000000..70a17b2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8844f009f7a785ec8bcfdd8b60c7f3a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs new file mode 100644 index 0000000..ced7bd5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTexture__(out IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_GlTexture__delete(IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTexture__Release(IntPtr glTexture); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GlTexture__GetGpuBufferFrame(IntPtr glTexture, out IntPtr gpuBuffer); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs.meta new file mode 100644 index 0000000..482d485 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GlTexture_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bc45e10b1b9589dc88a57aa1b1dc97b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs new file mode 100644 index 0000000..09b5ed3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { +#if UNITY_STANDALONE_LINUX || UNITY_ANDROID + [Pure, DllImport(MediaPipeLibrary)] + public static extern IntPtr eglGetCurrentContext(); +#endif + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs.meta new file mode 100644 index 0000000..a67669c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 240d79bdaffc8e1beb14793ddfa70635 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs new file mode 100644 index 0000000..b14872e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary)] + public static extern void glFlush(); + + [DllImport(MediaPipeLibrary)] + public static extern void glReadPixels(int x, int y, int width, int height, uint glFormat, uint glType, IntPtr pixels); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs.meta new file mode 100644 index 0000000..c93a71f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/Gl_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cdb6820be7e5d26ab959e3787392835b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs new file mode 100644 index 0000000..8ec91f8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern ImageFormat.Types.Format mp__ImageFormatForGpuBufferFormat__ui(GpuBufferFormat format); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern ImageFormat.Types.Format mp__GpuBufferFormatForImageFormat__ui(ImageFormat.Types.Format format); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs.meta new file mode 100644 index 0000000..006a0c9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f824754e827bdc1282d0352454e46dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs new file mode 100644 index 0000000..e5246a0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__GlTextureInfoForGpuBufferFormat__ui_i_ui( + GpuBufferFormat format, int plane, GlVersion glVersion, out GlTextureInfo glTextureInfo); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs.meta new file mode 100644 index 0000000..494ec13 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBufferFormat_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a463b93a1e2b3efd915a3d5ae85687a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs new file mode 100644 index 0000000..c1b27b1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GpuBuffer__width(IntPtr gpuBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern int mp_GpuBuffer__height(IntPtr gpuBuffer); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern GpuBufferFormat mp_GpuBuffer__format(IntPtr gpuBuffer); + + #region StatusOr + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_StatusOrGpuBuffer__ok(IntPtr statusOrGpuBuffer); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs.meta new file mode 100644 index 0000000..d4a6034 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ed78dc9779f9f974a01a9e5ce6e2b78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs new file mode 100644 index 0000000..8c70188 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs @@ -0,0 +1,50 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GpuBuffer__PSgtb(IntPtr glTextureBuffer, out IntPtr gpuBuffer); +#endif + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_GpuBuffer__delete(IntPtr gpuBuffer); + + #region StatusOr + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_StatusOrGpuBuffer__delete(IntPtr statusOrGpuBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrGpuBuffer__status(IntPtr statusOrGpuBuffer, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrGpuBuffer__value(IntPtr statusOrGpuBuffer, out IntPtr gpuBuffer); + #endregion + + #region Packet + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeGpuBufferPacket__Rgb(IntPtr gpuBuffer, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeGpuBufferPacket_At__Rgb_Rts(IntPtr gpuBuffer, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ConsumeGpuBuffer(IntPtr packet, out IntPtr statusOrGpuBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetGpuBuffer(IntPtr packet, out IntPtr gpuBuffer); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__ValidateAsGpuBuffer(IntPtr packet, out IntPtr status); + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs.meta new file mode 100644 index 0000000..ee114f2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuBuffer_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fccfad8d2e49e5e6db0b9c0ee0fac50f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs new file mode 100644 index 0000000..55345a6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern IntPtr mp_SharedGpuResources__get(IntPtr gpuResources); + + [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_StatusOrGpuResources__ok(IntPtr statusOrGpuResources); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs.meta new file mode 100644 index 0000000..a0f8dad --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfa309ee6a68a6599898f97bb6266a3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs new file mode 100644 index 0000000..ae800cd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGpuResources__delete(IntPtr gpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_SharedGpuResources__reset(IntPtr gpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GpuResources_Create(out IntPtr statusOrGpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_GpuResources_Create__Pv(IntPtr externalContext, out IntPtr statusOrGpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_StatusOrGpuResources__delete(IntPtr statusOrGpuResources); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrGpuResources__status(IntPtr statusOrGpuResources, out IntPtr status); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_StatusOrGpuResources__value(IntPtr statusOrGpuResources, out IntPtr gpuResources); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs.meta new file mode 100644 index 0000000..091a70f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Gpu/GpuResources_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03fee8ca1b3101d6b9e0a862b958fc6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs.meta new file mode 100644 index 0000000..689177b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 758c9122bbda91842afa6a5246b5bb6f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs new file mode 100644 index 0000000..396797c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class UnsafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeAnchor3dVectorPacket__PA_i(Anchor3d[] value, int size, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp__MakeAnchor3dVectorPacket_At__PA_i_Rt(Anchor3d[] value, int size, IntPtr timestamp, out IntPtr packet); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_Anchor3dArray__delete(IntPtr anchorVectorData); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Packet__GetAnchor3dVector(IntPtr packet, out Anchor3dVector anchorVector); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs.meta new file mode 100644 index 0000000..6af67c7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Graphs/InstantMotionTracking_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d4da3790f601856f9eb91cc8a09f14a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util.meta new file mode 100644 index 0000000..8f831aa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0c107b877d7bc04484e971776be6563 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs new file mode 100644 index 0000000..47adbfd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + internal static partial class SafeNativeMethods + { + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp__SetCustomGlobalResourceProvider__P( + [MarshalAs(UnmanagedType.FunctionPtr)] ResourceManager.NativeResourceProvider provider); + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp__SetCustomGlobalPathResolver__P( + [MarshalAs(UnmanagedType.FunctionPtr)] ResourceManager.PathResolver resolver); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs.meta new file mode 100644 index 0000000..f74e158 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b34d2d2f3864709d8d61b85b4210662 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs new file mode 100644 index 0000000..316ee66 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Security; + +namespace Mediapipe +{ + [SuppressUnmanagedCodeSecurity] + internal static partial class SafeNativeMethods + { + internal const string MediaPipeLibrary = +#if UNITY_EDITOR + "mediapipe_c"; +#elif UNITY_IOS || UNITY_WEBGL + "__Internal"; +#elif UNITY_ANDROID + "mediapipe_jni"; +#else + "mediapipe_c"; +#endif + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs.meta new file mode 100644 index 0000000..9db61ae --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/SafeNativeMethods.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cf59e5da7fcb7327b128ee398a54333 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs new file mode 100644 index 0000000..6fe17cf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Security; +using System.Runtime.InteropServices; + +namespace Mediapipe +{ + [SuppressUnmanagedCodeSecurity] + internal static partial class UnsafeNativeMethods + { + internal const string MediaPipeLibrary = +#if UNITY_EDITOR + "mediapipe_c"; +#elif UNITY_IOS || UNITY_WEBGL + "__Internal"; +#elif UNITY_ANDROID + "mediapipe_jni"; +#else + "mediapipe_c"; +#endif + + static UnsafeNativeMethods() + { + mp_api__SetFreeHGlobal(FreeHGlobal); + } + + private delegate void FreeHGlobalDelegate(IntPtr hglobal); + + [AOT.MonoPInvokeCallback(typeof(FreeHGlobalDelegate))] + private static void FreeHGlobal(IntPtr hglobal) + { + Marshal.FreeHGlobal(hglobal); + } + + [DllImport(MediaPipeLibrary, ExactSpelling = true)] + private static extern void mp_api__SetFreeHGlobal([MarshalAs(UnmanagedType.FunctionPtr)] FreeHGlobalDelegate freeHGlobal); + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs.meta new file mode 100644 index 0000000..61e2276 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/UnsafeNativeMethods.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0741cbca28e1141548c6fde244b9eafb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf.meta new file mode 100644 index 0000000..354c961 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9209dcba140cd74da532c5679a327e3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators.meta new file mode 100644 index 0000000..a0d37a9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d639eabb704425d479a573ef18e142a6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio.meta new file mode 100644 index 0000000..8f330bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 059c7aa2c00274a449cfb855015d3e08 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs new file mode 100644 index 0000000..b2bcd3b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs @@ -0,0 +1,651 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/audio/mfcc_mel_calculators.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/audio/mfcc_mel_calculators.proto + public static partial class MfccMelCalculatorsReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/audio/mfcc_mel_calculators.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MfccMelCalculatorsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjZtZWRpYXBpcGUvY2FsY3VsYXRvcnMvYXVkaW8vbWZjY19tZWxfY2FsY3Vs", + "YXRvcnMucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9j", + "YWxjdWxhdG9yLnByb3RvItUBChxNZWxTcGVjdHJ1bUNhbGN1bGF0b3JPcHRp", + "b25zEhkKDWNoYW5uZWxfY291bnQYASABKAU6AjIwEiAKE21pbl9mcmVxdWVu", + "Y3lfaGVydHoYAiABKAI6AzEyNRIhChNtYXhfZnJlcXVlbmN5X2hlcnR6GAMg", + "ASgCOgQzODAwMlUKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9u", + "cxi0oLwlIAEoCzInLm1lZGlhcGlwZS5NZWxTcGVjdHJ1bUNhbGN1bGF0b3JP", + "cHRpb25zIsUBChVNZmNjQ2FsY3VsYXRvck9wdGlvbnMSRAoTbWVsX3NwZWN0", + "cnVtX3BhcmFtcxgBIAEoCzInLm1lZGlhcGlwZS5NZWxTcGVjdHJ1bUNhbGN1", + "bGF0b3JPcHRpb25zEhYKCm1mY2NfY291bnQYAiABKA06AjEzMk4KA2V4dBIc", + "Lm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiJnrQlIAEoCzIgLm1lZGlh", + "cGlwZS5NZmNjQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MelSpectrumCalculatorOptions), global::Mediapipe.MelSpectrumCalculatorOptions.Parser, new[]{ "ChannelCount", "MinFrequencyHertz", "MaxFrequencyHertz" }, null, null, new pb::Extension[] { global::Mediapipe.MelSpectrumCalculatorOptions.Extensions.Ext }, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MfccCalculatorOptions), global::Mediapipe.MfccCalculatorOptions.Parser, new[]{ "MelSpectrumParams", "MfccCount" }, null, null, new pb::Extension[] { global::Mediapipe.MfccCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class MelSpectrumCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MelSpectrumCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MfccMelCalculatorsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MelSpectrumCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MelSpectrumCalculatorOptions(MelSpectrumCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + channelCount_ = other.channelCount_; + minFrequencyHertz_ = other.minFrequencyHertz_; + maxFrequencyHertz_ = other.maxFrequencyHertz_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MelSpectrumCalculatorOptions Clone() { + return new MelSpectrumCalculatorOptions(this); + } + + /// Field number for the "channel_count" field. + public const int ChannelCountFieldNumber = 1; + private readonly static int ChannelCountDefaultValue = 20; + + private int channelCount_; + /// + /// Total number of frequency bands to use. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ChannelCount { + get { if ((_hasBits0 & 1) != 0) { return channelCount_; } else { return ChannelCountDefaultValue; } } + set { + _hasBits0 |= 1; + channelCount_ = value; + } + } + /// Gets whether the "channel_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasChannelCount { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "channel_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearChannelCount() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_frequency_hertz" field. + public const int MinFrequencyHertzFieldNumber = 2; + private readonly static float MinFrequencyHertzDefaultValue = 125F; + + private float minFrequencyHertz_; + /// + /// Lower edge of lowest triangular Mel band. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinFrequencyHertz { + get { if ((_hasBits0 & 2) != 0) { return minFrequencyHertz_; } else { return MinFrequencyHertzDefaultValue; } } + set { + _hasBits0 |= 2; + minFrequencyHertz_ = value; + } + } + /// Gets whether the "min_frequency_hertz" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFrequencyHertz { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_frequency_hertz" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFrequencyHertz() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_frequency_hertz" field. + public const int MaxFrequencyHertzFieldNumber = 3; + private readonly static float MaxFrequencyHertzDefaultValue = 3800F; + + private float maxFrequencyHertz_; + /// + /// Upper edge of highest triangular Mel band. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxFrequencyHertz { + get { if ((_hasBits0 & 4) != 0) { return maxFrequencyHertz_; } else { return MaxFrequencyHertzDefaultValue; } } + set { + _hasBits0 |= 4; + maxFrequencyHertz_ = value; + } + } + /// Gets whether the "max_frequency_hertz" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxFrequencyHertz { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_frequency_hertz" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxFrequencyHertz() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MelSpectrumCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MelSpectrumCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChannelCount != other.ChannelCount) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinFrequencyHertz, other.MinFrequencyHertz)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxFrequencyHertz, other.MaxFrequencyHertz)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasChannelCount) hash ^= ChannelCount.GetHashCode(); + if (HasMinFrequencyHertz) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinFrequencyHertz); + if (HasMaxFrequencyHertz) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxFrequencyHertz); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasChannelCount) { + output.WriteRawTag(8); + output.WriteInt32(ChannelCount); + } + if (HasMinFrequencyHertz) { + output.WriteRawTag(21); + output.WriteFloat(MinFrequencyHertz); + } + if (HasMaxFrequencyHertz) { + output.WriteRawTag(29); + output.WriteFloat(MaxFrequencyHertz); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasChannelCount) { + output.WriteRawTag(8); + output.WriteInt32(ChannelCount); + } + if (HasMinFrequencyHertz) { + output.WriteRawTag(21); + output.WriteFloat(MinFrequencyHertz); + } + if (HasMaxFrequencyHertz) { + output.WriteRawTag(29); + output.WriteFloat(MaxFrequencyHertz); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasChannelCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChannelCount); + } + if (HasMinFrequencyHertz) { + size += 1 + 4; + } + if (HasMaxFrequencyHertz) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MelSpectrumCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasChannelCount) { + ChannelCount = other.ChannelCount; + } + if (other.HasMinFrequencyHertz) { + MinFrequencyHertz = other.MinFrequencyHertz; + } + if (other.HasMaxFrequencyHertz) { + MaxFrequencyHertz = other.MaxFrequencyHertz; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChannelCount = input.ReadInt32(); + break; + } + case 21: { + MinFrequencyHertz = input.ReadFloat(); + break; + } + case 29: { + MaxFrequencyHertz = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ChannelCount = input.ReadInt32(); + break; + } + case 21: { + MinFrequencyHertz = input.ReadFloat(); + break; + } + case 29: { + MaxFrequencyHertz = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the MelSpectrumCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(78581812, pb::FieldCodec.ForMessage(628654498, global::Mediapipe.MelSpectrumCalculatorOptions.Parser)); + } + #endregion + + } + + public sealed partial class MfccCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MfccCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MfccMelCalculatorsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MfccCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MfccCalculatorOptions(MfccCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + melSpectrumParams_ = other.melSpectrumParams_ != null ? other.melSpectrumParams_.Clone() : null; + mfccCount_ = other.mfccCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MfccCalculatorOptions Clone() { + return new MfccCalculatorOptions(this); + } + + /// Field number for the "mel_spectrum_params" field. + public const int MelSpectrumParamsFieldNumber = 1; + private global::Mediapipe.MelSpectrumCalculatorOptions melSpectrumParams_; + /// + /// Specification of the underlying mel filterbank. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MelSpectrumCalculatorOptions MelSpectrumParams { + get { return melSpectrumParams_; } + set { + melSpectrumParams_ = value; + } + } + + /// Field number for the "mfcc_count" field. + public const int MfccCountFieldNumber = 2; + private readonly static uint MfccCountDefaultValue = 13; + + private uint mfccCount_; + /// + /// How many MFCC coefficients to emit. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint MfccCount { + get { if ((_hasBits0 & 1) != 0) { return mfccCount_; } else { return MfccCountDefaultValue; } } + set { + _hasBits0 |= 1; + mfccCount_ = value; + } + } + /// Gets whether the "mfcc_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMfccCount { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "mfcc_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMfccCount() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MfccCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MfccCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(MelSpectrumParams, other.MelSpectrumParams)) return false; + if (MfccCount != other.MfccCount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (melSpectrumParams_ != null) hash ^= MelSpectrumParams.GetHashCode(); + if (HasMfccCount) hash ^= MfccCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (melSpectrumParams_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MelSpectrumParams); + } + if (HasMfccCount) { + output.WriteRawTag(16); + output.WriteUInt32(MfccCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (melSpectrumParams_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MelSpectrumParams); + } + if (HasMfccCount) { + output.WriteRawTag(16); + output.WriteUInt32(MfccCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (melSpectrumParams_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MelSpectrumParams); + } + if (HasMfccCount) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MfccCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MfccCalculatorOptions other) { + if (other == null) { + return; + } + if (other.melSpectrumParams_ != null) { + if (melSpectrumParams_ == null) { + MelSpectrumParams = new global::Mediapipe.MelSpectrumCalculatorOptions(); + } + MelSpectrumParams.MergeFrom(other.MelSpectrumParams); + } + if (other.HasMfccCount) { + MfccCount = other.MfccCount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (melSpectrumParams_ == null) { + MelSpectrumParams = new global::Mediapipe.MelSpectrumCalculatorOptions(); + } + input.ReadMessage(MelSpectrumParams); + break; + } + case 16: { + MfccCount = input.ReadUInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (melSpectrumParams_ == null) { + MelSpectrumParams = new global::Mediapipe.MelSpectrumCalculatorOptions(); + } + input.ReadMessage(MelSpectrumParams); + break; + } + case 16: { + MfccCount = input.ReadUInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the MfccCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(78450441, pb::FieldCodec.ForMessage(627603530, global::Mediapipe.MfccCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs.meta new file mode 100644 index 0000000..9585ca2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/MfccMelCalculators.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e942e5612d6f9bdaa65119f63c218fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs new file mode 100644 index 0000000..426b5a0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs @@ -0,0 +1,711 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/audio/rational_factor_resample_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/audio/rational_factor_resample_calculator.proto + public static partial class RationalFactorResampleCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/audio/rational_factor_resample_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RationalFactorResampleCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkVtZWRpYXBpcGUvY2FsY3VsYXRvcnMvYXVkaW8vcmF0aW9uYWxfZmFjdG9y", + "X3Jlc2FtcGxlX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFw", + "aXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIqwDCidSYXRpb25hbEZh", + "Y3RvclJlc2FtcGxlQ2FsY3VsYXRvck9wdGlvbnMSGgoSdGFyZ2V0X3NhbXBs", + "ZV9yYXRlGAEgASgBEnwKIXJlc2FtcGxlcl9yYXRpb25hbF9mYWN0b3Jfb3B0", + "aW9ucxgCIAEoCzJRLm1lZGlhcGlwZS5SYXRpb25hbEZhY3RvclJlc2FtcGxl", + "Q2FsY3VsYXRvck9wdGlvbnMuUmVzYW1wbGVyUmF0aW9uYWxGYWN0b3JPcHRp", + "b25zEisKHWNoZWNrX2luY29uc2lzdGVudF90aW1lc3RhbXBzGAMgASgIOgR0", + "cnVlGlgKHlJlc2FtcGxlclJhdGlvbmFsRmFjdG9yT3B0aW9ucxIOCgZyYWRp", + "dXMYASABKAESDgoGY3V0b2ZmGAIgASgBEhYKC2thaXNlcl9iZXRhGAMgASgB", + "OgE2MmAKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjKv+57", + "IAEoCzIyLm1lZGlhcGlwZS5SYXRpb25hbEZhY3RvclJlc2FtcGxlQ2FsY3Vs", + "YXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RationalFactorResampleCalculatorOptions), global::Mediapipe.RationalFactorResampleCalculatorOptions.Parser, new[]{ "TargetSampleRate", "ResamplerRationalFactorOptions", "CheckInconsistentTimestamps" }, null, null, new pb::Extension[] { global::Mediapipe.RationalFactorResampleCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions), global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions.Parser, new[]{ "Radius", "Cutoff", "KaiserBeta" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// NOTE: This calculator uses QResampler, despite the name, which supersedes + /// RationalFactorResampler. + /// + public sealed partial class RationalFactorResampleCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RationalFactorResampleCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RationalFactorResampleCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RationalFactorResampleCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RationalFactorResampleCalculatorOptions(RationalFactorResampleCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + targetSampleRate_ = other.targetSampleRate_; + resamplerRationalFactorOptions_ = other.resamplerRationalFactorOptions_ != null ? other.resamplerRationalFactorOptions_.Clone() : null; + checkInconsistentTimestamps_ = other.checkInconsistentTimestamps_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RationalFactorResampleCalculatorOptions Clone() { + return new RationalFactorResampleCalculatorOptions(this); + } + + /// Field number for the "target_sample_rate" field. + public const int TargetSampleRateFieldNumber = 1; + private readonly static double TargetSampleRateDefaultValue = 0D; + + private double targetSampleRate_; + /// + /// target_sample_rate is the sample rate, in Hertz, of the output + /// stream. Required. Must be greater than 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double TargetSampleRate { + get { if ((_hasBits0 & 1) != 0) { return targetSampleRate_; } else { return TargetSampleRateDefaultValue; } } + set { + _hasBits0 |= 1; + targetSampleRate_ = value; + } + } + /// Gets whether the "target_sample_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetSampleRate { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "target_sample_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetSampleRate() { + _hasBits0 &= ~1; + } + + /// Field number for the "resampler_rational_factor_options" field. + public const int ResamplerRationalFactorOptionsFieldNumber = 2; + private global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions resamplerRationalFactorOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions ResamplerRationalFactorOptions { + get { return resamplerRationalFactorOptions_; } + set { + resamplerRationalFactorOptions_ = value; + } + } + + /// Field number for the "check_inconsistent_timestamps" field. + public const int CheckInconsistentTimestampsFieldNumber = 3; + private readonly static bool CheckInconsistentTimestampsDefaultValue = true; + + private bool checkInconsistentTimestamps_; + /// + /// Set to false to disable checks for jitter in timestamp values. Useful with + /// live audio input. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CheckInconsistentTimestamps { + get { if ((_hasBits0 & 2) != 0) { return checkInconsistentTimestamps_; } else { return CheckInconsistentTimestampsDefaultValue; } } + set { + _hasBits0 |= 2; + checkInconsistentTimestamps_ = value; + } + } + /// Gets whether the "check_inconsistent_timestamps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCheckInconsistentTimestamps { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "check_inconsistent_timestamps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCheckInconsistentTimestamps() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RationalFactorResampleCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RationalFactorResampleCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TargetSampleRate, other.TargetSampleRate)) return false; + if (!object.Equals(ResamplerRationalFactorOptions, other.ResamplerRationalFactorOptions)) return false; + if (CheckInconsistentTimestamps != other.CheckInconsistentTimestamps) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTargetSampleRate) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TargetSampleRate); + if (resamplerRationalFactorOptions_ != null) hash ^= ResamplerRationalFactorOptions.GetHashCode(); + if (HasCheckInconsistentTimestamps) hash ^= CheckInconsistentTimestamps.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTargetSampleRate) { + output.WriteRawTag(9); + output.WriteDouble(TargetSampleRate); + } + if (resamplerRationalFactorOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ResamplerRationalFactorOptions); + } + if (HasCheckInconsistentTimestamps) { + output.WriteRawTag(24); + output.WriteBool(CheckInconsistentTimestamps); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTargetSampleRate) { + output.WriteRawTag(9); + output.WriteDouble(TargetSampleRate); + } + if (resamplerRationalFactorOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ResamplerRationalFactorOptions); + } + if (HasCheckInconsistentTimestamps) { + output.WriteRawTag(24); + output.WriteBool(CheckInconsistentTimestamps); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTargetSampleRate) { + size += 1 + 8; + } + if (resamplerRationalFactorOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResamplerRationalFactorOptions); + } + if (HasCheckInconsistentTimestamps) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RationalFactorResampleCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTargetSampleRate) { + TargetSampleRate = other.TargetSampleRate; + } + if (other.resamplerRationalFactorOptions_ != null) { + if (resamplerRationalFactorOptions_ == null) { + ResamplerRationalFactorOptions = new global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions(); + } + ResamplerRationalFactorOptions.MergeFrom(other.ResamplerRationalFactorOptions); + } + if (other.HasCheckInconsistentTimestamps) { + CheckInconsistentTimestamps = other.CheckInconsistentTimestamps; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + TargetSampleRate = input.ReadDouble(); + break; + } + case 18: { + if (resamplerRationalFactorOptions_ == null) { + ResamplerRationalFactorOptions = new global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions(); + } + input.ReadMessage(ResamplerRationalFactorOptions); + break; + } + case 24: { + CheckInconsistentTimestamps = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + TargetSampleRate = input.ReadDouble(); + break; + } + case 18: { + if (resamplerRationalFactorOptions_ == null) { + ResamplerRationalFactorOptions = new global::Mediapipe.RationalFactorResampleCalculatorOptions.Types.ResamplerRationalFactorOptions(); + } + input.ReadMessage(ResamplerRationalFactorOptions); + break; + } + case 24: { + CheckInconsistentTimestamps = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RationalFactorResampleCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Parameters for initializing QResampler. See QResampler for more details. + /// + public sealed partial class ResamplerRationalFactorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResamplerRationalFactorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RationalFactorResampleCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ResamplerRationalFactorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ResamplerRationalFactorOptions(ResamplerRationalFactorOptions other) : this() { + _hasBits0 = other._hasBits0; + radius_ = other.radius_; + cutoff_ = other.cutoff_; + kaiserBeta_ = other.kaiserBeta_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ResamplerRationalFactorOptions Clone() { + return new ResamplerRationalFactorOptions(this); + } + + /// Field number for the "radius" field. + public const int RadiusFieldNumber = 1; + private readonly static double RadiusDefaultValue = 0D; + + private double radius_; + /// + /// Kernel radius in units of input samples. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Radius { + get { if ((_hasBits0 & 1) != 0) { return radius_; } else { return RadiusDefaultValue; } } + set { + _hasBits0 |= 1; + radius_ = value; + } + } + /// Gets whether the "radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRadius { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRadius() { + _hasBits0 &= ~1; + } + + /// Field number for the "cutoff" field. + public const int CutoffFieldNumber = 2; + private readonly static double CutoffDefaultValue = 0D; + + private double cutoff_; + /// + /// Anti-aliasing cutoff frequency in Hertz. A reasonable setting is + /// 0.45 * min(input_sample_rate, output_sample_rate). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Cutoff { + get { if ((_hasBits0 & 2) != 0) { return cutoff_; } else { return CutoffDefaultValue; } } + set { + _hasBits0 |= 2; + cutoff_ = value; + } + } + /// Gets whether the "cutoff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCutoff { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "cutoff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCutoff() { + _hasBits0 &= ~2; + } + + /// Field number for the "kaiser_beta" field. + public const int KaiserBetaFieldNumber = 3; + private readonly static double KaiserBetaDefaultValue = 6D; + + private double kaiserBeta_; + /// + /// The Kaiser beta parameter for the kernel window. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double KaiserBeta { + get { if ((_hasBits0 & 4) != 0) { return kaiserBeta_; } else { return KaiserBetaDefaultValue; } } + set { + _hasBits0 |= 4; + kaiserBeta_ = value; + } + } + /// Gets whether the "kaiser_beta" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKaiserBeta { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "kaiser_beta" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKaiserBeta() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ResamplerRationalFactorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ResamplerRationalFactorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Radius, other.Radius)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Cutoff, other.Cutoff)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(KaiserBeta, other.KaiserBeta)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRadius) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Radius); + if (HasCutoff) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Cutoff); + if (HasKaiserBeta) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(KaiserBeta); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRadius) { + output.WriteRawTag(9); + output.WriteDouble(Radius); + } + if (HasCutoff) { + output.WriteRawTag(17); + output.WriteDouble(Cutoff); + } + if (HasKaiserBeta) { + output.WriteRawTag(25); + output.WriteDouble(KaiserBeta); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRadius) { + output.WriteRawTag(9); + output.WriteDouble(Radius); + } + if (HasCutoff) { + output.WriteRawTag(17); + output.WriteDouble(Cutoff); + } + if (HasKaiserBeta) { + output.WriteRawTag(25); + output.WriteDouble(KaiserBeta); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRadius) { + size += 1 + 8; + } + if (HasCutoff) { + size += 1 + 8; + } + if (HasKaiserBeta) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ResamplerRationalFactorOptions other) { + if (other == null) { + return; + } + if (other.HasRadius) { + Radius = other.Radius; + } + if (other.HasCutoff) { + Cutoff = other.Cutoff; + } + if (other.HasKaiserBeta) { + KaiserBeta = other.KaiserBeta; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + Radius = input.ReadDouble(); + break; + } + case 17: { + Cutoff = input.ReadDouble(); + break; + } + case 25: { + KaiserBeta = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Radius = input.ReadDouble(); + break; + } + case 17: { + Cutoff = input.ReadDouble(); + break; + } + case 25: { + KaiserBeta = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the RationalFactorResampleCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(259760074, pb::FieldCodec.ForMessage(2078080594, global::Mediapipe.RationalFactorResampleCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs.meta new file mode 100644 index 0000000..8938256 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/RationalFactorResampleCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e299b58b16d1d889c9aac5beddbca7d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs new file mode 100644 index 0000000..081641c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs @@ -0,0 +1,707 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/audio/spectrogram_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/audio/spectrogram_calculator.proto + public static partial class SpectrogramCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/audio/spectrogram_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SpectrogramCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvYXVkaW8vc3BlY3Ryb2dyYW1fY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8i/gQKHFNwZWN0cm9ncmFtQ2FsY3VsYXRvck9w", + "dGlvbnMSHgoWZnJhbWVfZHVyYXRpb25fc2Vjb25kcxgBIAEoARIgChVmcmFt", + "ZV9vdmVybGFwX3NlY29uZHMYAiABKAE6ATASHgoQcGFkX2ZpbmFsX3BhY2tl", + "dBgDIAEoCDoEdHJ1ZRJaCgtvdXRwdXRfdHlwZRgEIAEoDjIyLm1lZGlhcGlw", + "ZS5TcGVjdHJvZ3JhbUNhbGN1bGF0b3JPcHRpb25zLk91dHB1dFR5cGU6EVNR", + "VUFSRURfTUFHTklUVURFEicKGGFsbG93X211bHRpY2hhbm5lbF9pbnB1dBgF", + "IAEoCDoFZmFsc2USTQoLd2luZG93X3R5cGUYBiABKA4yMi5tZWRpYXBpcGUu", + "U3BlY3Ryb2dyYW1DYWxjdWxhdG9yT3B0aW9ucy5XaW5kb3dUeXBlOgRIQU5O", + "EhcKDG91dHB1dF9zY2FsZRgHIAEoAToBMRIiChN1c2VfbG9jYWxfdGltZXN0", + "YW1wGAggASgIOgVmYWxzZSJUCgpPdXRwdXRUeXBlEhUKEVNRVUFSRURfTUFH", + "TklUVURFEAASFAoQTElORUFSX01BR05JVFVERRABEgwKCERFQ0lCRUxTEAIS", + "CwoHQ09NUExFWBADIj4KCldpbmRvd1R5cGUSCAoESEFOThAAEgsKB0hBTU1J", + "TkcQARIKCgZDT1NJTkUQAhINCglTUVJUX0hBTk4QBDJVCgNleHQSHC5tZWRp", + "YXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYwIiqJCABKAsyJy5tZWRpYXBpcGUu", + "U3BlY3Ryb2dyYW1DYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SpectrogramCalculatorOptions), global::Mediapipe.SpectrogramCalculatorOptions.Parser, new[]{ "FrameDurationSeconds", "FrameOverlapSeconds", "PadFinalPacket", "OutputType", "AllowMultichannelInput", "WindowType", "OutputScale", "UseLocalTimestamp" }, null, new[]{ typeof(global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType), typeof(global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType) }, new pb::Extension[] { global::Mediapipe.SpectrogramCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SpectrogramCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SpectrogramCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SpectrogramCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SpectrogramCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SpectrogramCalculatorOptions(SpectrogramCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + frameDurationSeconds_ = other.frameDurationSeconds_; + frameOverlapSeconds_ = other.frameOverlapSeconds_; + padFinalPacket_ = other.padFinalPacket_; + outputType_ = other.outputType_; + allowMultichannelInput_ = other.allowMultichannelInput_; + windowType_ = other.windowType_; + outputScale_ = other.outputScale_; + useLocalTimestamp_ = other.useLocalTimestamp_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SpectrogramCalculatorOptions Clone() { + return new SpectrogramCalculatorOptions(this); + } + + /// Field number for the "frame_duration_seconds" field. + public const int FrameDurationSecondsFieldNumber = 1; + private readonly static double FrameDurationSecondsDefaultValue = 0D; + + private double frameDurationSeconds_; + /// + /// Analysis window duration in seconds. Required. Must be greater than 0. + /// (Note: the spectrogram DFT length will be the smallest power-of-2 + /// sample count that can hold this duration.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FrameDurationSeconds { + get { if ((_hasBits0 & 1) != 0) { return frameDurationSeconds_; } else { return FrameDurationSecondsDefaultValue; } } + set { + _hasBits0 |= 1; + frameDurationSeconds_ = value; + } + } + /// Gets whether the "frame_duration_seconds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameDurationSeconds { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_duration_seconds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameDurationSeconds() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_overlap_seconds" field. + public const int FrameOverlapSecondsFieldNumber = 2; + private readonly static double FrameOverlapSecondsDefaultValue = 0D; + + private double frameOverlapSeconds_; + /// + /// Duration of overlap between adjacent windows. + /// Hence, frame_rate = 1/(frame_duration_seconds - frame_overlap_seconds). + /// Note the frame_rate here is not the MediaPipe packet rate, the frame here + /// means each Fourier transform analysis waveform frame, the output MediaPipe + /// packet rate will the the same as input, if frame rate is lower than input + /// packet rate, will result in intermittent empty output packets. Required + /// that 0 <= frame_overlap_seconds < frame_duration_seconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FrameOverlapSeconds { + get { if ((_hasBits0 & 2) != 0) { return frameOverlapSeconds_; } else { return FrameOverlapSecondsDefaultValue; } } + set { + _hasBits0 |= 2; + frameOverlapSeconds_ = value; + } + } + /// Gets whether the "frame_overlap_seconds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameOverlapSeconds { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_overlap_seconds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameOverlapSeconds() { + _hasBits0 &= ~2; + } + + /// Field number for the "pad_final_packet" field. + public const int PadFinalPacketFieldNumber = 3; + private readonly static bool PadFinalPacketDefaultValue = true; + + private bool padFinalPacket_; + /// + /// Whether to pad the final packet with zeros. If true, guarantees that + /// all input samples will output. If set to false, any partial packet + /// at the end of the stream will be dropped. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool PadFinalPacket { + get { if ((_hasBits0 & 4) != 0) { return padFinalPacket_; } else { return PadFinalPacketDefaultValue; } } + set { + _hasBits0 |= 4; + padFinalPacket_ = value; + } + } + /// Gets whether the "pad_final_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPadFinalPacket { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "pad_final_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPadFinalPacket() { + _hasBits0 &= ~4; + } + + /// Field number for the "output_type" field. + public const int OutputTypeFieldNumber = 4; + private readonly static global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType OutputTypeDefaultValue = global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType.SquaredMagnitude; + + private global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType outputType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType OutputType { + get { if ((_hasBits0 & 8) != 0) { return outputType_; } else { return OutputTypeDefaultValue; } } + set { + _hasBits0 |= 8; + outputType_ = value; + } + } + /// Gets whether the "output_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputType { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "output_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputType() { + _hasBits0 &= ~8; + } + + /// Field number for the "allow_multichannel_input" field. + public const int AllowMultichannelInputFieldNumber = 5; + private readonly static bool AllowMultichannelInputDefaultValue = false; + + private bool allowMultichannelInput_; + /// + /// If set to true then the output will be a vector of spectrograms, one for + /// each channel and the stream will have a MultiStreamTimeSeriesHeader. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AllowMultichannelInput { + get { if ((_hasBits0 & 16) != 0) { return allowMultichannelInput_; } else { return AllowMultichannelInputDefaultValue; } } + set { + _hasBits0 |= 16; + allowMultichannelInput_ = value; + } + } + /// Gets whether the "allow_multichannel_input" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAllowMultichannelInput { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "allow_multichannel_input" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAllowMultichannelInput() { + _hasBits0 &= ~16; + } + + /// Field number for the "window_type" field. + public const int WindowTypeFieldNumber = 6; + private readonly static global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType WindowTypeDefaultValue = global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType.Hann; + + private global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType windowType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType WindowType { + get { if ((_hasBits0 & 32) != 0) { return windowType_; } else { return WindowTypeDefaultValue; } } + set { + _hasBits0 |= 32; + windowType_ = value; + } + } + /// Gets whether the "window_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWindowType { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "window_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWindowType() { + _hasBits0 &= ~32; + } + + /// Field number for the "output_scale" field. + public const int OutputScaleFieldNumber = 7; + private readonly static double OutputScaleDefaultValue = 1D; + + private double outputScale_; + /// + /// Support a fixed multiplicative scaling of the output. This is applied + /// uniformly regardless of output type (i.e., even dBs are multiplied, not + /// offset). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double OutputScale { + get { if ((_hasBits0 & 64) != 0) { return outputScale_; } else { return OutputScaleDefaultValue; } } + set { + _hasBits0 |= 64; + outputScale_ = value; + } + } + /// Gets whether the "output_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputScale { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "output_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputScale() { + _hasBits0 &= ~64; + } + + /// Field number for the "use_local_timestamp" field. + public const int UseLocalTimestampFieldNumber = 8; + private readonly static bool UseLocalTimestampDefaultValue = false; + + private bool useLocalTimestamp_; + /// + /// If use_local_timestamp is true, the output packet's timestamp is based on + /// the last sample of the packet and it's inferred from the latest input + /// packet's timestamp. If false, the output packet's timestamp is based on + /// the cumulative timestamping, which is inferred from the intial input + /// timestamp and the cumulative number of samples. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseLocalTimestamp { + get { if ((_hasBits0 & 128) != 0) { return useLocalTimestamp_; } else { return UseLocalTimestampDefaultValue; } } + set { + _hasBits0 |= 128; + useLocalTimestamp_ = value; + } + } + /// Gets whether the "use_local_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseLocalTimestamp { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "use_local_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseLocalTimestamp() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SpectrogramCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SpectrogramCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FrameDurationSeconds, other.FrameDurationSeconds)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FrameOverlapSeconds, other.FrameOverlapSeconds)) return false; + if (PadFinalPacket != other.PadFinalPacket) return false; + if (OutputType != other.OutputType) return false; + if (AllowMultichannelInput != other.AllowMultichannelInput) return false; + if (WindowType != other.WindowType) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OutputScale, other.OutputScale)) return false; + if (UseLocalTimestamp != other.UseLocalTimestamp) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrameDurationSeconds) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FrameDurationSeconds); + if (HasFrameOverlapSeconds) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FrameOverlapSeconds); + if (HasPadFinalPacket) hash ^= PadFinalPacket.GetHashCode(); + if (HasOutputType) hash ^= OutputType.GetHashCode(); + if (HasAllowMultichannelInput) hash ^= AllowMultichannelInput.GetHashCode(); + if (HasWindowType) hash ^= WindowType.GetHashCode(); + if (HasOutputScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OutputScale); + if (HasUseLocalTimestamp) hash ^= UseLocalTimestamp.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrameDurationSeconds) { + output.WriteRawTag(9); + output.WriteDouble(FrameDurationSeconds); + } + if (HasFrameOverlapSeconds) { + output.WriteRawTag(17); + output.WriteDouble(FrameOverlapSeconds); + } + if (HasPadFinalPacket) { + output.WriteRawTag(24); + output.WriteBool(PadFinalPacket); + } + if (HasOutputType) { + output.WriteRawTag(32); + output.WriteEnum((int) OutputType); + } + if (HasAllowMultichannelInput) { + output.WriteRawTag(40); + output.WriteBool(AllowMultichannelInput); + } + if (HasWindowType) { + output.WriteRawTag(48); + output.WriteEnum((int) WindowType); + } + if (HasOutputScale) { + output.WriteRawTag(57); + output.WriteDouble(OutputScale); + } + if (HasUseLocalTimestamp) { + output.WriteRawTag(64); + output.WriteBool(UseLocalTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrameDurationSeconds) { + output.WriteRawTag(9); + output.WriteDouble(FrameDurationSeconds); + } + if (HasFrameOverlapSeconds) { + output.WriteRawTag(17); + output.WriteDouble(FrameOverlapSeconds); + } + if (HasPadFinalPacket) { + output.WriteRawTag(24); + output.WriteBool(PadFinalPacket); + } + if (HasOutputType) { + output.WriteRawTag(32); + output.WriteEnum((int) OutputType); + } + if (HasAllowMultichannelInput) { + output.WriteRawTag(40); + output.WriteBool(AllowMultichannelInput); + } + if (HasWindowType) { + output.WriteRawTag(48); + output.WriteEnum((int) WindowType); + } + if (HasOutputScale) { + output.WriteRawTag(57); + output.WriteDouble(OutputScale); + } + if (HasUseLocalTimestamp) { + output.WriteRawTag(64); + output.WriteBool(UseLocalTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrameDurationSeconds) { + size += 1 + 8; + } + if (HasFrameOverlapSeconds) { + size += 1 + 8; + } + if (HasPadFinalPacket) { + size += 1 + 1; + } + if (HasOutputType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OutputType); + } + if (HasAllowMultichannelInput) { + size += 1 + 1; + } + if (HasWindowType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) WindowType); + } + if (HasOutputScale) { + size += 1 + 8; + } + if (HasUseLocalTimestamp) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SpectrogramCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasFrameDurationSeconds) { + FrameDurationSeconds = other.FrameDurationSeconds; + } + if (other.HasFrameOverlapSeconds) { + FrameOverlapSeconds = other.FrameOverlapSeconds; + } + if (other.HasPadFinalPacket) { + PadFinalPacket = other.PadFinalPacket; + } + if (other.HasOutputType) { + OutputType = other.OutputType; + } + if (other.HasAllowMultichannelInput) { + AllowMultichannelInput = other.AllowMultichannelInput; + } + if (other.HasWindowType) { + WindowType = other.WindowType; + } + if (other.HasOutputScale) { + OutputScale = other.OutputScale; + } + if (other.HasUseLocalTimestamp) { + UseLocalTimestamp = other.UseLocalTimestamp; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + FrameDurationSeconds = input.ReadDouble(); + break; + } + case 17: { + FrameOverlapSeconds = input.ReadDouble(); + break; + } + case 24: { + PadFinalPacket = input.ReadBool(); + break; + } + case 32: { + OutputType = (global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType) input.ReadEnum(); + break; + } + case 40: { + AllowMultichannelInput = input.ReadBool(); + break; + } + case 48: { + WindowType = (global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType) input.ReadEnum(); + break; + } + case 57: { + OutputScale = input.ReadDouble(); + break; + } + case 64: { + UseLocalTimestamp = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + FrameDurationSeconds = input.ReadDouble(); + break; + } + case 17: { + FrameOverlapSeconds = input.ReadDouble(); + break; + } + case 24: { + PadFinalPacket = input.ReadBool(); + break; + } + case 32: { + OutputType = (global::Mediapipe.SpectrogramCalculatorOptions.Types.OutputType) input.ReadEnum(); + break; + } + case 40: { + AllowMultichannelInput = input.ReadBool(); + break; + } + case 48: { + WindowType = (global::Mediapipe.SpectrogramCalculatorOptions.Types.WindowType) input.ReadEnum(); + break; + } + case 57: { + OutputScale = input.ReadDouble(); + break; + } + case 64: { + UseLocalTimestamp = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the SpectrogramCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Output value type can be squared-magnitude, linear-magnitude, + /// deciBels (dB, = 20*log10(linear_magnitude)), or std::complex. + /// Their relationship: + /// COMPLEX c = Re + Im*i; + /// SQUARED_MAGNITUDE = Re^2 + Im^2; + /// LINEAR_MAGNITUDE = sqrt(SQUARED_MAGNITUDE); + /// DECIBELS = 20*log10(LINEAR_MAGNITUDE) = 10*log10(SQUARED_MAGNITUDE); + /// + public enum OutputType { + [pbr::OriginalName("SQUARED_MAGNITUDE")] SquaredMagnitude = 0, + [pbr::OriginalName("LINEAR_MAGNITUDE")] LinearMagnitude = 1, + [pbr::OriginalName("DECIBELS")] Decibels = 2, + [pbr::OriginalName("COMPLEX")] Complex = 3, + } + + /// + /// Which window to use when computing the FFT. + /// + public enum WindowType { + [pbr::OriginalName("HANN")] Hann = 0, + [pbr::OriginalName("HAMMING")] Hamming = 1, + [pbr::OriginalName("COSINE")] Cosine = 2, + [pbr::OriginalName("SQRT_HANN")] SqrtHann = 4, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the SpectrogramCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(76186688, pb::FieldCodec.ForMessage(609493506, global::Mediapipe.SpectrogramCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs.meta new file mode 100644 index 0000000..1b1dbe3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/SpectrogramCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b5bc8940ffca19b58e9817b89f87cc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs new file mode 100644 index 0000000..b56a71e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs @@ -0,0 +1,381 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/audio/stabilized_log_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/audio/stabilized_log_calculator.proto + public static partial class StabilizedLogCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/audio/stabilized_log_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StabilizedLogCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjttZWRpYXBpcGUvY2FsY3VsYXRvcnMvYXVkaW8vc3RhYmlsaXplZF9sb2df", + "Y2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3", + "b3JrL2NhbGN1bGF0b3IucHJvdG8i0AEKHlN0YWJpbGl6ZWRMb2dDYWxjdWxh", + "dG9yT3B0aW9ucxIZCgpzdGFiaWxpemVyGAEgASgCOgUxZS0wNRIhChNjaGVj", + "a19ub25uZWdhdGl2aXR5GAIgASgIOgR0cnVlEhcKDG91dHB1dF9zY2FsZRgD", + "IAEoAToBMTJXCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY", + "46HQMCABKAsyKS5tZWRpYXBpcGUuU3RhYmlsaXplZExvZ0NhbGN1bGF0b3JP", + "cHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.StabilizedLogCalculatorOptions), global::Mediapipe.StabilizedLogCalculatorOptions.Parser, new[]{ "Stabilizer", "CheckNonnegativity", "OutputScale" }, null, null, new pb::Extension[] { global::Mediapipe.StabilizedLogCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class StabilizedLogCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StabilizedLogCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StabilizedLogCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilizedLogCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilizedLogCalculatorOptions(StabilizedLogCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + stabilizer_ = other.stabilizer_; + checkNonnegativity_ = other.checkNonnegativity_; + outputScale_ = other.outputScale_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilizedLogCalculatorOptions Clone() { + return new StabilizedLogCalculatorOptions(this); + } + + /// Field number for the "stabilizer" field. + public const int StabilizerFieldNumber = 1; + private readonly static float StabilizerDefaultValue = 1e-05F; + + private float stabilizer_; + /// + /// The calculator computes log(x + stabilizer). stabilizer must be >= + /// 0, with 0 indicating a lack of stabilization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Stabilizer { + get { if ((_hasBits0 & 1) != 0) { return stabilizer_; } else { return StabilizerDefaultValue; } } + set { + _hasBits0 |= 1; + stabilizer_ = value; + } + } + /// Gets whether the "stabilizer" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStabilizer { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "stabilizer" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStabilizer() { + _hasBits0 &= ~1; + } + + /// Field number for the "check_nonnegativity" field. + public const int CheckNonnegativityFieldNumber = 2; + private readonly static bool CheckNonnegativityDefaultValue = true; + + private bool checkNonnegativity_; + /// + /// If true, CHECK that all input values in are >= 0. If false, the + /// code will take the log of the potentially negative input values + /// plus the stabilizer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CheckNonnegativity { + get { if ((_hasBits0 & 2) != 0) { return checkNonnegativity_; } else { return CheckNonnegativityDefaultValue; } } + set { + _hasBits0 |= 2; + checkNonnegativity_ = value; + } + } + /// Gets whether the "check_nonnegativity" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCheckNonnegativity { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "check_nonnegativity" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCheckNonnegativity() { + _hasBits0 &= ~2; + } + + /// Field number for the "output_scale" field. + public const int OutputScaleFieldNumber = 3; + private readonly static double OutputScaleDefaultValue = 1D; + + private double outputScale_; + /// + /// Support a fixed multiplicative scaling of the output. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double OutputScale { + get { if ((_hasBits0 & 4) != 0) { return outputScale_; } else { return OutputScaleDefaultValue; } } + set { + _hasBits0 |= 4; + outputScale_ = value; + } + } + /// Gets whether the "output_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "output_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputScale() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StabilizedLogCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StabilizedLogCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Stabilizer, other.Stabilizer)) return false; + if (CheckNonnegativity != other.CheckNonnegativity) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OutputScale, other.OutputScale)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasStabilizer) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Stabilizer); + if (HasCheckNonnegativity) hash ^= CheckNonnegativity.GetHashCode(); + if (HasOutputScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OutputScale); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasStabilizer) { + output.WriteRawTag(13); + output.WriteFloat(Stabilizer); + } + if (HasCheckNonnegativity) { + output.WriteRawTag(16); + output.WriteBool(CheckNonnegativity); + } + if (HasOutputScale) { + output.WriteRawTag(25); + output.WriteDouble(OutputScale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStabilizer) { + output.WriteRawTag(13); + output.WriteFloat(Stabilizer); + } + if (HasCheckNonnegativity) { + output.WriteRawTag(16); + output.WriteBool(CheckNonnegativity); + } + if (HasOutputScale) { + output.WriteRawTag(25); + output.WriteDouble(OutputScale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasStabilizer) { + size += 1 + 4; + } + if (HasCheckNonnegativity) { + size += 1 + 1; + } + if (HasOutputScale) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StabilizedLogCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasStabilizer) { + Stabilizer = other.Stabilizer; + } + if (other.HasCheckNonnegativity) { + CheckNonnegativity = other.CheckNonnegativity; + } + if (other.HasOutputScale) { + OutputScale = other.OutputScale; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Stabilizer = input.ReadFloat(); + break; + } + case 16: { + CheckNonnegativity = input.ReadBool(); + break; + } + case 25: { + OutputScale = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Stabilizer = input.ReadFloat(); + break; + } + case 16: { + CheckNonnegativity = input.ReadBool(); + break; + } + case 25: { + OutputScale = input.ReadDouble(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the StabilizedLogCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(101978339, pb::FieldCodec.ForMessage(815826714, global::Mediapipe.StabilizedLogCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs.meta new file mode 100644 index 0000000..5ed007d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/StabilizedLogCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8aabac06e0c90cf0587cf5c799c349c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs new file mode 100644 index 0000000..598e7da --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs @@ -0,0 +1,586 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/audio/time_series_framer_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/audio/time_series_framer_calculator.proto + public static partial class TimeSeriesFramerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/audio/time_series_framer_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TimeSeriesFramerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvYXVkaW8vdGltZV9zZXJpZXNfZnJh", + "bWVyX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIsUDCiFUaW1lU2VyaWVzRnJhbWVy", + "Q2FsY3VsYXRvck9wdGlvbnMSHgoWZnJhbWVfZHVyYXRpb25fc2Vjb25kcxgB", + "IAEoARIgChVmcmFtZV9vdmVybGFwX3NlY29uZHMYAiABKAE6ATASLwogZW11", + "bGF0ZV9mcmFjdGlvbmFsX2ZyYW1lX292ZXJsYXAYBSABKAg6BWZhbHNlEh4K", + "EHBhZF9maW5hbF9wYWNrZXQYAyABKAg6BHRydWUSWgoPd2luZG93X2Z1bmN0", + "aW9uGAQgASgOMjsubWVkaWFwaXBlLlRpbWVTZXJpZXNGcmFtZXJDYWxjdWxh", + "dG9yT3B0aW9ucy5XaW5kb3dGdW5jdGlvbjoETk9ORRIiChN1c2VfbG9jYWxf", + "dGltZXN0YW1wGAYgASgIOgVmYWxzZSIxCg5XaW5kb3dGdW5jdGlvbhIICgRO", + "T05FEAASCwoHSEFNTUlORxABEggKBEhBTk4QAjJaCgNleHQSHC5tZWRpYXBp", + "cGUuQ2FsY3VsYXRvck9wdGlvbnMYxaeSGCABKAsyLC5tZWRpYXBpcGUuVGlt", + "ZVNlcmllc0ZyYW1lckNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimeSeriesFramerCalculatorOptions), global::Mediapipe.TimeSeriesFramerCalculatorOptions.Parser, new[]{ "FrameDurationSeconds", "FrameOverlapSeconds", "EmulateFractionalFrameOverlap", "PadFinalPacket", "WindowFunction", "UseLocalTimestamp" }, null, new[]{ typeof(global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction) }, new pb::Extension[] { global::Mediapipe.TimeSeriesFramerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TimeSeriesFramerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimeSeriesFramerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TimeSeriesFramerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesFramerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesFramerCalculatorOptions(TimeSeriesFramerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + frameDurationSeconds_ = other.frameDurationSeconds_; + frameOverlapSeconds_ = other.frameOverlapSeconds_; + emulateFractionalFrameOverlap_ = other.emulateFractionalFrameOverlap_; + padFinalPacket_ = other.padFinalPacket_; + windowFunction_ = other.windowFunction_; + useLocalTimestamp_ = other.useLocalTimestamp_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesFramerCalculatorOptions Clone() { + return new TimeSeriesFramerCalculatorOptions(this); + } + + /// Field number for the "frame_duration_seconds" field. + public const int FrameDurationSecondsFieldNumber = 1; + private readonly static double FrameDurationSecondsDefaultValue = 0D; + + private double frameDurationSeconds_; + /// + /// Frame duration in seconds. Required. Must be greater than 0. This is + /// rounded to the nearest integer number of samples. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FrameDurationSeconds { + get { if ((_hasBits0 & 1) != 0) { return frameDurationSeconds_; } else { return FrameDurationSecondsDefaultValue; } } + set { + _hasBits0 |= 1; + frameDurationSeconds_ = value; + } + } + /// Gets whether the "frame_duration_seconds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameDurationSeconds { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_duration_seconds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameDurationSeconds() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_overlap_seconds" field. + public const int FrameOverlapSecondsFieldNumber = 2; + private readonly static double FrameOverlapSecondsDefaultValue = 0D; + + private double frameOverlapSeconds_; + /// + /// Frame overlap in seconds. + /// + /// If emulate_fractional_frame_overlap is false (the default), then the frame + /// overlap is rounded to the nearest integer number of samples, and the step + /// from one frame to the next will be the difference between the number of + /// samples in a frame and the number of samples in the overlap. + /// + /// If emulate_fractional_frame_overlap is true, then frame overlap will be a + /// variable number of samples, such that the long-time average time step from + /// one frame to the next will be the difference between the (nominal, not + /// rounded) frame_duration_seconds and frame_overlap_seconds. This is useful + /// where the desired time step is not an integral number of input samples. + /// + /// A negative frame_overlap_seconds corresponds to skipping some input samples + /// between each frame of emitted samples. + /// + /// Required that frame_overlap_seconds < frame_duration_seconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FrameOverlapSeconds { + get { if ((_hasBits0 & 2) != 0) { return frameOverlapSeconds_; } else { return FrameOverlapSecondsDefaultValue; } } + set { + _hasBits0 |= 2; + frameOverlapSeconds_ = value; + } + } + /// Gets whether the "frame_overlap_seconds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameOverlapSeconds { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_overlap_seconds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameOverlapSeconds() { + _hasBits0 &= ~2; + } + + /// Field number for the "emulate_fractional_frame_overlap" field. + public const int EmulateFractionalFrameOverlapFieldNumber = 5; + private readonly static bool EmulateFractionalFrameOverlapDefaultValue = false; + + private bool emulateFractionalFrameOverlap_; + /// + /// See frame_overlap_seconds for semantics. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EmulateFractionalFrameOverlap { + get { if ((_hasBits0 & 16) != 0) { return emulateFractionalFrameOverlap_; } else { return EmulateFractionalFrameOverlapDefaultValue; } } + set { + _hasBits0 |= 16; + emulateFractionalFrameOverlap_ = value; + } + } + /// Gets whether the "emulate_fractional_frame_overlap" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEmulateFractionalFrameOverlap { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "emulate_fractional_frame_overlap" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEmulateFractionalFrameOverlap() { + _hasBits0 &= ~16; + } + + /// Field number for the "pad_final_packet" field. + public const int PadFinalPacketFieldNumber = 3; + private readonly static bool PadFinalPacketDefaultValue = true; + + private bool padFinalPacket_; + /// + /// Whether to pad the final packet with zeros. If true, guarantees that all + /// input samples (other than those that fall in gaps implied by negative + /// frame_overlap_seconds) will be emitted. If set to false, any partial + /// packet at the end of the stream will be dropped. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool PadFinalPacket { + get { if ((_hasBits0 & 4) != 0) { return padFinalPacket_; } else { return PadFinalPacketDefaultValue; } } + set { + _hasBits0 |= 4; + padFinalPacket_ = value; + } + } + /// Gets whether the "pad_final_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPadFinalPacket { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "pad_final_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPadFinalPacket() { + _hasBits0 &= ~4; + } + + /// Field number for the "window_function" field. + public const int WindowFunctionFieldNumber = 4; + private readonly static global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction WindowFunctionDefaultValue = global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction.None; + + private global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction windowFunction_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction WindowFunction { + get { if ((_hasBits0 & 8) != 0) { return windowFunction_; } else { return WindowFunctionDefaultValue; } } + set { + _hasBits0 |= 8; + windowFunction_ = value; + } + } + /// Gets whether the "window_function" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWindowFunction { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "window_function" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWindowFunction() { + _hasBits0 &= ~8; + } + + /// Field number for the "use_local_timestamp" field. + public const int UseLocalTimestampFieldNumber = 6; + private readonly static bool UseLocalTimestampDefaultValue = false; + + private bool useLocalTimestamp_; + /// + /// If use_local_timestamp is true, the output packet's timestamp is based on + /// the last sample of the packet and it's inferred from the latest input + /// packet's timestamp. If false, the output packet's timestamp is based on + /// the cumulative timestamping, which is inferred from the intial input + /// timestamp and the cumulative number of samples. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseLocalTimestamp { + get { if ((_hasBits0 & 32) != 0) { return useLocalTimestamp_; } else { return UseLocalTimestampDefaultValue; } } + set { + _hasBits0 |= 32; + useLocalTimestamp_ = value; + } + } + /// Gets whether the "use_local_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseLocalTimestamp { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "use_local_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseLocalTimestamp() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimeSeriesFramerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimeSeriesFramerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FrameDurationSeconds, other.FrameDurationSeconds)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FrameOverlapSeconds, other.FrameOverlapSeconds)) return false; + if (EmulateFractionalFrameOverlap != other.EmulateFractionalFrameOverlap) return false; + if (PadFinalPacket != other.PadFinalPacket) return false; + if (WindowFunction != other.WindowFunction) return false; + if (UseLocalTimestamp != other.UseLocalTimestamp) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrameDurationSeconds) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FrameDurationSeconds); + if (HasFrameOverlapSeconds) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FrameOverlapSeconds); + if (HasEmulateFractionalFrameOverlap) hash ^= EmulateFractionalFrameOverlap.GetHashCode(); + if (HasPadFinalPacket) hash ^= PadFinalPacket.GetHashCode(); + if (HasWindowFunction) hash ^= WindowFunction.GetHashCode(); + if (HasUseLocalTimestamp) hash ^= UseLocalTimestamp.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrameDurationSeconds) { + output.WriteRawTag(9); + output.WriteDouble(FrameDurationSeconds); + } + if (HasFrameOverlapSeconds) { + output.WriteRawTag(17); + output.WriteDouble(FrameOverlapSeconds); + } + if (HasPadFinalPacket) { + output.WriteRawTag(24); + output.WriteBool(PadFinalPacket); + } + if (HasWindowFunction) { + output.WriteRawTag(32); + output.WriteEnum((int) WindowFunction); + } + if (HasEmulateFractionalFrameOverlap) { + output.WriteRawTag(40); + output.WriteBool(EmulateFractionalFrameOverlap); + } + if (HasUseLocalTimestamp) { + output.WriteRawTag(48); + output.WriteBool(UseLocalTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrameDurationSeconds) { + output.WriteRawTag(9); + output.WriteDouble(FrameDurationSeconds); + } + if (HasFrameOverlapSeconds) { + output.WriteRawTag(17); + output.WriteDouble(FrameOverlapSeconds); + } + if (HasPadFinalPacket) { + output.WriteRawTag(24); + output.WriteBool(PadFinalPacket); + } + if (HasWindowFunction) { + output.WriteRawTag(32); + output.WriteEnum((int) WindowFunction); + } + if (HasEmulateFractionalFrameOverlap) { + output.WriteRawTag(40); + output.WriteBool(EmulateFractionalFrameOverlap); + } + if (HasUseLocalTimestamp) { + output.WriteRawTag(48); + output.WriteBool(UseLocalTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrameDurationSeconds) { + size += 1 + 8; + } + if (HasFrameOverlapSeconds) { + size += 1 + 8; + } + if (HasEmulateFractionalFrameOverlap) { + size += 1 + 1; + } + if (HasPadFinalPacket) { + size += 1 + 1; + } + if (HasWindowFunction) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) WindowFunction); + } + if (HasUseLocalTimestamp) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimeSeriesFramerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasFrameDurationSeconds) { + FrameDurationSeconds = other.FrameDurationSeconds; + } + if (other.HasFrameOverlapSeconds) { + FrameOverlapSeconds = other.FrameOverlapSeconds; + } + if (other.HasEmulateFractionalFrameOverlap) { + EmulateFractionalFrameOverlap = other.EmulateFractionalFrameOverlap; + } + if (other.HasPadFinalPacket) { + PadFinalPacket = other.PadFinalPacket; + } + if (other.HasWindowFunction) { + WindowFunction = other.WindowFunction; + } + if (other.HasUseLocalTimestamp) { + UseLocalTimestamp = other.UseLocalTimestamp; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + FrameDurationSeconds = input.ReadDouble(); + break; + } + case 17: { + FrameOverlapSeconds = input.ReadDouble(); + break; + } + case 24: { + PadFinalPacket = input.ReadBool(); + break; + } + case 32: { + WindowFunction = (global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction) input.ReadEnum(); + break; + } + case 40: { + EmulateFractionalFrameOverlap = input.ReadBool(); + break; + } + case 48: { + UseLocalTimestamp = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + FrameDurationSeconds = input.ReadDouble(); + break; + } + case 17: { + FrameOverlapSeconds = input.ReadDouble(); + break; + } + case 24: { + PadFinalPacket = input.ReadBool(); + break; + } + case 32: { + WindowFunction = (global::Mediapipe.TimeSeriesFramerCalculatorOptions.Types.WindowFunction) input.ReadEnum(); + break; + } + case 40: { + EmulateFractionalFrameOverlap = input.ReadBool(); + break; + } + case 48: { + UseLocalTimestamp = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TimeSeriesFramerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Optional windowing function. The default is NONE (no windowing function). + /// + public enum WindowFunction { + [pbr::OriginalName("NONE")] None = 0, + [pbr::OriginalName("HAMMING")] Hamming = 1, + [pbr::OriginalName("HANN")] Hann = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TimeSeriesFramerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(50631621, pb::FieldCodec.ForMessage(405052970, global::Mediapipe.TimeSeriesFramerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs.meta new file mode 100644 index 0000000..79e4ecc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio/TimeSeriesFramerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 958deb93c83159234bb9670b7990bad1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core.meta new file mode 100644 index 0000000..01d7869 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7f7a1fe0a2608d04abf8c7f66d9da395 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs new file mode 100644 index 0000000..12aaca7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs @@ -0,0 +1,266 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/clip_vector_size_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/clip_vector_size_calculator.proto + public static partial class ClipVectorSizeCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/clip_vector_size_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ClipVectorSizeCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjxtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9jbGlwX3ZlY3Rvcl9zaXpl", + "X2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1l", + "d29yay9jYWxjdWxhdG9yLnByb3RvIpUBCh9DbGlwVmVjdG9yU2l6ZUNhbGN1", + "bGF0b3JPcHRpb25zEhcKDG1heF92ZWNfc2l6ZRgBIAEoBToBMTJZCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYtur8ggEgASgLMioubWVk", + "aWFwaXBlLkNsaXBWZWN0b3JTaXplQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ClipVectorSizeCalculatorOptions), global::Mediapipe.ClipVectorSizeCalculatorOptions.Parser, new[]{ "MaxVecSize" }, null, null, new pb::Extension[] { global::Mediapipe.ClipVectorSizeCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ClipVectorSizeCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClipVectorSizeCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ClipVectorSizeCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipVectorSizeCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipVectorSizeCalculatorOptions(ClipVectorSizeCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maxVecSize_ = other.maxVecSize_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipVectorSizeCalculatorOptions Clone() { + return new ClipVectorSizeCalculatorOptions(this); + } + + /// Field number for the "max_vec_size" field. + public const int MaxVecSizeFieldNumber = 1; + private readonly static int MaxVecSizeDefaultValue = 1; + + private int maxVecSize_; + /// + /// Maximum size of output vector. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxVecSize { + get { if ((_hasBits0 & 1) != 0) { return maxVecSize_; } else { return MaxVecSizeDefaultValue; } } + set { + _hasBits0 |= 1; + maxVecSize_ = value; + } + } + /// Gets whether the "max_vec_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxVecSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "max_vec_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxVecSize() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ClipVectorSizeCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ClipVectorSizeCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MaxVecSize != other.MaxVecSize) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaxVecSize) hash ^= MaxVecSize.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaxVecSize) { + output.WriteRawTag(8); + output.WriteInt32(MaxVecSize); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaxVecSize) { + output.WriteRawTag(8); + output.WriteInt32(MaxVecSize); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaxVecSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxVecSize); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ClipVectorSizeCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaxVecSize) { + MaxVecSize = other.MaxVecSize; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MaxVecSize = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MaxVecSize = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the ClipVectorSizeCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(274674998, pb::FieldCodec.ForMessage(2197399986, global::Mediapipe.ClipVectorSizeCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs.meta new file mode 100644 index 0000000..043b8a3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ClipVectorSizeCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec6deb810b6d3180eacc5a07b49cb1f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs new file mode 100644 index 0000000..09fd062 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs @@ -0,0 +1,268 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/concatenate_vector_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/concatenate_vector_calculator.proto + public static partial class ConcatenateVectorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/concatenate_vector_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ConcatenateVectorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9jb25jYXRlbmF0ZV92ZWN0", + "b3JfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3IucHJvdG8iqgEKIkNvbmNhdGVuYXRlVmVjdG9y", + "Q2FsY3VsYXRvck9wdGlvbnMSJwoYb25seV9lbWl0X2lmX2FsbF9wcmVzZW50", + "GAEgASgIOgVmYWxzZTJbCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9w", + "dGlvbnMYz7HYeyABKAsyLS5tZWRpYXBpcGUuQ29uY2F0ZW5hdGVWZWN0b3JD", + "YWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ConcatenateVectorCalculatorOptions), global::Mediapipe.ConcatenateVectorCalculatorOptions.Parser, new[]{ "OnlyEmitIfAllPresent" }, null, null, new pb::Extension[] { global::Mediapipe.ConcatenateVectorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ConcatenateVectorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConcatenateVectorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ConcatenateVectorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConcatenateVectorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConcatenateVectorCalculatorOptions(ConcatenateVectorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + onlyEmitIfAllPresent_ = other.onlyEmitIfAllPresent_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConcatenateVectorCalculatorOptions Clone() { + return new ConcatenateVectorCalculatorOptions(this); + } + + /// Field number for the "only_emit_if_all_present" field. + public const int OnlyEmitIfAllPresentFieldNumber = 1; + private readonly static bool OnlyEmitIfAllPresentDefaultValue = false; + + private bool onlyEmitIfAllPresent_; + /// + /// If true, the calculator will only emit a packet at the given timestamp if + /// all input streams have a non-empty packet (AND operation on streams). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OnlyEmitIfAllPresent { + get { if ((_hasBits0 & 1) != 0) { return onlyEmitIfAllPresent_; } else { return OnlyEmitIfAllPresentDefaultValue; } } + set { + _hasBits0 |= 1; + onlyEmitIfAllPresent_ = value; + } + } + /// Gets whether the "only_emit_if_all_present" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOnlyEmitIfAllPresent { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "only_emit_if_all_present" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOnlyEmitIfAllPresent() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ConcatenateVectorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ConcatenateVectorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OnlyEmitIfAllPresent != other.OnlyEmitIfAllPresent) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOnlyEmitIfAllPresent) hash ^= OnlyEmitIfAllPresent.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOnlyEmitIfAllPresent) { + output.WriteRawTag(8); + output.WriteBool(OnlyEmitIfAllPresent); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOnlyEmitIfAllPresent) { + output.WriteRawTag(8); + output.WriteBool(OnlyEmitIfAllPresent); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOnlyEmitIfAllPresent) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ConcatenateVectorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOnlyEmitIfAllPresent) { + OnlyEmitIfAllPresent = other.OnlyEmitIfAllPresent; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OnlyEmitIfAllPresent = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OnlyEmitIfAllPresent = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the ConcatenateVectorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(259397839, pb::FieldCodec.ForMessage(2075182714, global::Mediapipe.ConcatenateVectorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs.meta new file mode 100644 index 0000000..4471f9e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConcatenateVectorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cc6df1b91a8dc722b4f55972cb3588f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs new file mode 100644 index 0000000..c9551a4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs @@ -0,0 +1,863 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/constant_side_packet_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/constant_side_packet_calculator.proto + public static partial class ConstantSidePacketCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/constant_side_packet_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ConstantSidePacketCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9jb25zdGFudF9zaWRlX3Bh", + "Y2tldF9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9m", + "cmFtZXdvcmsvY2FsY3VsYXRvci5wcm90bxowbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9mb3JtYXRzL2NsYXNzaWZpY2F0aW9uLnByb3RvGiptZWRpYXBpcGUvZnJh", + "bWV3b3JrL2Zvcm1hdHMvbGFuZG1hcmsucHJvdG8i/QMKI0NvbnN0YW50U2lk", + "ZVBhY2tldENhbGN1bGF0b3JPcHRpb25zElEKBnBhY2tldBgBIAMoCzJBLm1l", + "ZGlhcGlwZS5Db25zdGFudFNpZGVQYWNrZXRDYWxjdWxhdG9yT3B0aW9ucy5D", + "b25zdGFudFNpZGVQYWNrZXQaowIKEkNvbnN0YW50U2lkZVBhY2tldBITCglp", + "bnRfdmFsdWUYASABKAVIABIVCgtmbG9hdF92YWx1ZRgCIAEoAkgAEhQKCmJv", + "b2xfdmFsdWUYAyABKAhIABIWCgxzdHJpbmdfdmFsdWUYBCABKAlIABIWCgx1", + "aW50NjRfdmFsdWUYBSABKARIABJCChljbGFzc2lmaWNhdGlvbl9saXN0X3Zh", + "bHVlGAYgASgLMh0ubWVkaWFwaXBlLkNsYXNzaWZpY2F0aW9uTGlzdEgAEjYK", + "E2xhbmRtYXJrX2xpc3RfdmFsdWUYByABKAsyFy5tZWRpYXBpcGUuTGFuZG1h", + "cmtMaXN0SAASFgoMZG91YmxlX3ZhbHVlGAkgASgBSABCBwoFdmFsdWUyXQoD", + "ZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGIWq7ooBIAEoCzIu", + "Lm1lZGlhcGlwZS5Db25zdGFudFNpZGVQYWNrZXRDYWxjdWxhdG9yT3B0aW9u", + "cw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ClassificationReflection.Descriptor, global::Mediapipe.LandmarkReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ConstantSidePacketCalculatorOptions), global::Mediapipe.ConstantSidePacketCalculatorOptions.Parser, new[]{ "Packet" }, null, null, new pb::Extension[] { global::Mediapipe.ConstantSidePacketCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ConstantSidePacketCalculatorOptions.Types.ConstantSidePacket), global::Mediapipe.ConstantSidePacketCalculatorOptions.Types.ConstantSidePacket.Parser, new[]{ "IntValue", "FloatValue", "BoolValue", "StringValue", "Uint64Value", "ClassificationListValue", "LandmarkListValue", "DoubleValue" }, new[]{ "Value" }, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class ConstantSidePacketCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConstantSidePacketCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ConstantSidePacketCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacketCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacketCalculatorOptions(ConstantSidePacketCalculatorOptions other) : this() { + packet_ = other.packet_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacketCalculatorOptions Clone() { + return new ConstantSidePacketCalculatorOptions(this); + } + + /// Field number for the "packet" field. + public const int PacketFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_packet_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ConstantSidePacketCalculatorOptions.Types.ConstantSidePacket.Parser); + private readonly pbc::RepeatedField packet_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Packet { + get { return packet_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ConstantSidePacketCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ConstantSidePacketCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!packet_.Equals(other.packet_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= packet_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + packet_.WriteTo(output, _repeated_packet_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + packet_.WriteTo(ref output, _repeated_packet_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += packet_.CalculateSize(_repeated_packet_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ConstantSidePacketCalculatorOptions other) { + if (other == null) { + return; + } + packet_.Add(other.packet_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + packet_.AddEntriesFrom(input, _repeated_packet_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + packet_.AddEntriesFrom(ref input, _repeated_packet_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ConstantSidePacketCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class ConstantSidePacket : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConstantSidePacket()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ConstantSidePacketCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacket() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacket(ConstantSidePacket other) : this() { + switch (other.ValueCase) { + case ValueOneofCase.IntValue: + IntValue = other.IntValue; + break; + case ValueOneofCase.FloatValue: + FloatValue = other.FloatValue; + break; + case ValueOneofCase.BoolValue: + BoolValue = other.BoolValue; + break; + case ValueOneofCase.StringValue: + StringValue = other.StringValue; + break; + case ValueOneofCase.Uint64Value: + Uint64Value = other.Uint64Value; + break; + case ValueOneofCase.ClassificationListValue: + ClassificationListValue = other.ClassificationListValue.Clone(); + break; + case ValueOneofCase.LandmarkListValue: + LandmarkListValue = other.LandmarkListValue.Clone(); + break; + case ValueOneofCase.DoubleValue: + DoubleValue = other.DoubleValue; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConstantSidePacket Clone() { + return new ConstantSidePacket(this); + } + + /// Field number for the "int_value" field. + public const int IntValueFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int IntValue { + get { return HasIntValue ? (int) value_ : 0; } + set { + value_ = value; + valueCase_ = ValueOneofCase.IntValue; + } + } + /// Gets whether the "int_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntValue { + get { return valueCase_ == ValueOneofCase.IntValue; } + } + /// Clears the value of the oneof if it's currently set to "int_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntValue() { + if (HasIntValue) { + ClearValue(); + } + } + + /// Field number for the "float_value" field. + public const int FloatValueFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FloatValue { + get { return HasFloatValue ? (float) value_ : 0F; } + set { + value_ = value; + valueCase_ = ValueOneofCase.FloatValue; + } + } + /// Gets whether the "float_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFloatValue { + get { return valueCase_ == ValueOneofCase.FloatValue; } + } + /// Clears the value of the oneof if it's currently set to "float_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFloatValue() { + if (HasFloatValue) { + ClearValue(); + } + } + + /// Field number for the "bool_value" field. + public const int BoolValueFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BoolValue { + get { return HasBoolValue ? (bool) value_ : false; } + set { + value_ = value; + valueCase_ = ValueOneofCase.BoolValue; + } + } + /// Gets whether the "bool_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoolValue { + get { return valueCase_ == ValueOneofCase.BoolValue; } + } + /// Clears the value of the oneof if it's currently set to "bool_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoolValue() { + if (HasBoolValue) { + ClearValue(); + } + } + + /// Field number for the "string_value" field. + public const int StringValueFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string StringValue { + get { return HasStringValue ? (string) value_ : ""; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + valueCase_ = ValueOneofCase.StringValue; + } + } + /// Gets whether the "string_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStringValue { + get { return valueCase_ == ValueOneofCase.StringValue; } + } + /// Clears the value of the oneof if it's currently set to "string_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStringValue() { + if (HasStringValue) { + ClearValue(); + } + } + + /// Field number for the "uint64_value" field. + public const int Uint64ValueFieldNumber = 5; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong Uint64Value { + get { return HasUint64Value ? (ulong) value_ : 0UL; } + set { + value_ = value; + valueCase_ = ValueOneofCase.Uint64Value; + } + } + /// Gets whether the "uint64_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUint64Value { + get { return valueCase_ == ValueOneofCase.Uint64Value; } + } + /// Clears the value of the oneof if it's currently set to "uint64_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUint64Value() { + if (HasUint64Value) { + ClearValue(); + } + } + + /// Field number for the "classification_list_value" field. + public const int ClassificationListValueFieldNumber = 6; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ClassificationList ClassificationListValue { + get { return valueCase_ == ValueOneofCase.ClassificationListValue ? (global::Mediapipe.ClassificationList) value_ : null; } + set { + value_ = value; + valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.ClassificationListValue; + } + } + + /// Field number for the "landmark_list_value" field. + public const int LandmarkListValueFieldNumber = 7; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LandmarkList LandmarkListValue { + get { return valueCase_ == ValueOneofCase.LandmarkListValue ? (global::Mediapipe.LandmarkList) value_ : null; } + set { + value_ = value; + valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.LandmarkListValue; + } + } + + /// Field number for the "double_value" field. + public const int DoubleValueFieldNumber = 9; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleValue { + get { return HasDoubleValue ? (double) value_ : 0D; } + set { + value_ = value; + valueCase_ = ValueOneofCase.DoubleValue; + } + } + /// Gets whether the "double_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDoubleValue { + get { return valueCase_ == ValueOneofCase.DoubleValue; } + } + /// Clears the value of the oneof if it's currently set to "double_value" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDoubleValue() { + if (HasDoubleValue) { + ClearValue(); + } + } + + private object value_; + /// Enum of possible cases for the "value" oneof. + public enum ValueOneofCase { + None = 0, + IntValue = 1, + FloatValue = 2, + BoolValue = 3, + StringValue = 4, + Uint64Value = 5, + ClassificationListValue = 6, + LandmarkListValue = 7, + DoubleValue = 9, + } + private ValueOneofCase valueCase_ = ValueOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValueOneofCase ValueCase { + get { return valueCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearValue() { + valueCase_ = ValueOneofCase.None; + value_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ConstantSidePacket); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ConstantSidePacket other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IntValue != other.IntValue) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FloatValue, other.FloatValue)) return false; + if (BoolValue != other.BoolValue) return false; + if (StringValue != other.StringValue) return false; + if (Uint64Value != other.Uint64Value) return false; + if (!object.Equals(ClassificationListValue, other.ClassificationListValue)) return false; + if (!object.Equals(LandmarkListValue, other.LandmarkListValue)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleValue, other.DoubleValue)) return false; + if (ValueCase != other.ValueCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIntValue) hash ^= IntValue.GetHashCode(); + if (HasFloatValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FloatValue); + if (HasBoolValue) hash ^= BoolValue.GetHashCode(); + if (HasStringValue) hash ^= StringValue.GetHashCode(); + if (HasUint64Value) hash ^= Uint64Value.GetHashCode(); + if (valueCase_ == ValueOneofCase.ClassificationListValue) hash ^= ClassificationListValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.LandmarkListValue) hash ^= LandmarkListValue.GetHashCode(); + if (HasDoubleValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); + hash ^= (int) valueCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIntValue) { + output.WriteRawTag(8); + output.WriteInt32(IntValue); + } + if (HasFloatValue) { + output.WriteRawTag(21); + output.WriteFloat(FloatValue); + } + if (HasBoolValue) { + output.WriteRawTag(24); + output.WriteBool(BoolValue); + } + if (HasStringValue) { + output.WriteRawTag(34); + output.WriteString(StringValue); + } + if (HasUint64Value) { + output.WriteRawTag(40); + output.WriteUInt64(Uint64Value); + } + if (valueCase_ == ValueOneofCase.ClassificationListValue) { + output.WriteRawTag(50); + output.WriteMessage(ClassificationListValue); + } + if (valueCase_ == ValueOneofCase.LandmarkListValue) { + output.WriteRawTag(58); + output.WriteMessage(LandmarkListValue); + } + if (HasDoubleValue) { + output.WriteRawTag(73); + output.WriteDouble(DoubleValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIntValue) { + output.WriteRawTag(8); + output.WriteInt32(IntValue); + } + if (HasFloatValue) { + output.WriteRawTag(21); + output.WriteFloat(FloatValue); + } + if (HasBoolValue) { + output.WriteRawTag(24); + output.WriteBool(BoolValue); + } + if (HasStringValue) { + output.WriteRawTag(34); + output.WriteString(StringValue); + } + if (HasUint64Value) { + output.WriteRawTag(40); + output.WriteUInt64(Uint64Value); + } + if (valueCase_ == ValueOneofCase.ClassificationListValue) { + output.WriteRawTag(50); + output.WriteMessage(ClassificationListValue); + } + if (valueCase_ == ValueOneofCase.LandmarkListValue) { + output.WriteRawTag(58); + output.WriteMessage(LandmarkListValue); + } + if (HasDoubleValue) { + output.WriteRawTag(73); + output.WriteDouble(DoubleValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIntValue) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntValue); + } + if (HasFloatValue) { + size += 1 + 4; + } + if (HasBoolValue) { + size += 1 + 1; + } + if (HasStringValue) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); + } + if (HasUint64Value) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Uint64Value); + } + if (valueCase_ == ValueOneofCase.ClassificationListValue) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassificationListValue); + } + if (valueCase_ == ValueOneofCase.LandmarkListValue) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LandmarkListValue); + } + if (HasDoubleValue) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ConstantSidePacket other) { + if (other == null) { + return; + } + switch (other.ValueCase) { + case ValueOneofCase.IntValue: + IntValue = other.IntValue; + break; + case ValueOneofCase.FloatValue: + FloatValue = other.FloatValue; + break; + case ValueOneofCase.BoolValue: + BoolValue = other.BoolValue; + break; + case ValueOneofCase.StringValue: + StringValue = other.StringValue; + break; + case ValueOneofCase.Uint64Value: + Uint64Value = other.Uint64Value; + break; + case ValueOneofCase.ClassificationListValue: + if (ClassificationListValue == null) { + ClassificationListValue = new global::Mediapipe.ClassificationList(); + } + ClassificationListValue.MergeFrom(other.ClassificationListValue); + break; + case ValueOneofCase.LandmarkListValue: + if (LandmarkListValue == null) { + LandmarkListValue = new global::Mediapipe.LandmarkList(); + } + LandmarkListValue.MergeFrom(other.LandmarkListValue); + break; + case ValueOneofCase.DoubleValue: + DoubleValue = other.DoubleValue; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IntValue = input.ReadInt32(); + break; + } + case 21: { + FloatValue = input.ReadFloat(); + break; + } + case 24: { + BoolValue = input.ReadBool(); + break; + } + case 34: { + StringValue = input.ReadString(); + break; + } + case 40: { + Uint64Value = input.ReadUInt64(); + break; + } + case 50: { + global::Mediapipe.ClassificationList subBuilder = new global::Mediapipe.ClassificationList(); + if (valueCase_ == ValueOneofCase.ClassificationListValue) { + subBuilder.MergeFrom(ClassificationListValue); + } + input.ReadMessage(subBuilder); + ClassificationListValue = subBuilder; + break; + } + case 58: { + global::Mediapipe.LandmarkList subBuilder = new global::Mediapipe.LandmarkList(); + if (valueCase_ == ValueOneofCase.LandmarkListValue) { + subBuilder.MergeFrom(LandmarkListValue); + } + input.ReadMessage(subBuilder); + LandmarkListValue = subBuilder; + break; + } + case 73: { + DoubleValue = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IntValue = input.ReadInt32(); + break; + } + case 21: { + FloatValue = input.ReadFloat(); + break; + } + case 24: { + BoolValue = input.ReadBool(); + break; + } + case 34: { + StringValue = input.ReadString(); + break; + } + case 40: { + Uint64Value = input.ReadUInt64(); + break; + } + case 50: { + global::Mediapipe.ClassificationList subBuilder = new global::Mediapipe.ClassificationList(); + if (valueCase_ == ValueOneofCase.ClassificationListValue) { + subBuilder.MergeFrom(ClassificationListValue); + } + input.ReadMessage(subBuilder); + ClassificationListValue = subBuilder; + break; + } + case 58: { + global::Mediapipe.LandmarkList subBuilder = new global::Mediapipe.LandmarkList(); + if (valueCase_ == ValueOneofCase.LandmarkListValue) { + subBuilder.MergeFrom(LandmarkListValue); + } + input.ReadMessage(subBuilder); + LandmarkListValue = subBuilder; + break; + } + case 73: { + DoubleValue = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the ConstantSidePacketCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(291214597, pb::FieldCodec.ForMessage(2329716778, global::Mediapipe.ConstantSidePacketCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs.meta new file mode 100644 index 0000000..570e896 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/ConstantSidePacketCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e73d442ad681299e98590bf3612ea3ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs new file mode 100644 index 0000000..5963131 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs @@ -0,0 +1,316 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/dequantize_byte_array_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/dequantize_byte_array_calculator.proto + public static partial class DequantizeByteArrayCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/dequantize_byte_array_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DequantizeByteArrayCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9kZXF1YW50aXplX2J5dGVf", + "YXJyYXlfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8iwAEKJERlcXVhbnRpemVCeXRl", + "QXJyYXlDYWxjdWxhdG9yT3B0aW9ucxIbChNtYXhfcXVhbnRpemVkX3ZhbHVl", + "GAEgASgCEhsKE21pbl9xdWFudGl6ZWRfdmFsdWUYAiABKAIyXgoDZXh0Ehwu", + "bWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGLfv7IEBIAEoCzIvLm1lZGlh", + "cGlwZS5EZXF1YW50aXplQnl0ZUFycmF5Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.DequantizeByteArrayCalculatorOptions), global::Mediapipe.DequantizeByteArrayCalculatorOptions.Parser, new[]{ "MaxQuantizedValue", "MinQuantizedValue" }, null, null, new pb::Extension[] { global::Mediapipe.DequantizeByteArrayCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DequantizeByteArrayCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DequantizeByteArrayCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DequantizeByteArrayCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DequantizeByteArrayCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DequantizeByteArrayCalculatorOptions(DequantizeByteArrayCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maxQuantizedValue_ = other.maxQuantizedValue_; + minQuantizedValue_ = other.minQuantizedValue_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DequantizeByteArrayCalculatorOptions Clone() { + return new DequantizeByteArrayCalculatorOptions(this); + } + + /// Field number for the "max_quantized_value" field. + public const int MaxQuantizedValueFieldNumber = 1; + private readonly static float MaxQuantizedValueDefaultValue = 0F; + + private float maxQuantizedValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxQuantizedValue { + get { if ((_hasBits0 & 1) != 0) { return maxQuantizedValue_; } else { return MaxQuantizedValueDefaultValue; } } + set { + _hasBits0 |= 1; + maxQuantizedValue_ = value; + } + } + /// Gets whether the "max_quantized_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxQuantizedValue { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "max_quantized_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxQuantizedValue() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_quantized_value" field. + public const int MinQuantizedValueFieldNumber = 2; + private readonly static float MinQuantizedValueDefaultValue = 0F; + + private float minQuantizedValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinQuantizedValue { + get { if ((_hasBits0 & 2) != 0) { return minQuantizedValue_; } else { return MinQuantizedValueDefaultValue; } } + set { + _hasBits0 |= 2; + minQuantizedValue_ = value; + } + } + /// Gets whether the "min_quantized_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinQuantizedValue { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_quantized_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinQuantizedValue() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DequantizeByteArrayCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DequantizeByteArrayCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxQuantizedValue, other.MaxQuantizedValue)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinQuantizedValue, other.MinQuantizedValue)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaxQuantizedValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxQuantizedValue); + if (HasMinQuantizedValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinQuantizedValue); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaxQuantizedValue) { + output.WriteRawTag(13); + output.WriteFloat(MaxQuantizedValue); + } + if (HasMinQuantizedValue) { + output.WriteRawTag(21); + output.WriteFloat(MinQuantizedValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaxQuantizedValue) { + output.WriteRawTag(13); + output.WriteFloat(MaxQuantizedValue); + } + if (HasMinQuantizedValue) { + output.WriteRawTag(21); + output.WriteFloat(MinQuantizedValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaxQuantizedValue) { + size += 1 + 4; + } + if (HasMinQuantizedValue) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DequantizeByteArrayCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaxQuantizedValue) { + MaxQuantizedValue = other.MaxQuantizedValue; + } + if (other.HasMinQuantizedValue) { + MinQuantizedValue = other.MinQuantizedValue; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MaxQuantizedValue = input.ReadFloat(); + break; + } + case 21: { + MinQuantizedValue = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MaxQuantizedValue = input.ReadFloat(); + break; + } + case 21: { + MinQuantizedValue = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the DequantizeByteArrayCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(272316343, pb::FieldCodec.ForMessage(2178530746, global::Mediapipe.DequantizeByteArrayCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs.meta new file mode 100644 index 0000000..f1ac312 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/DequantizeByteArrayCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c83016a6ddf294310a8eae8a93589f19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs new file mode 100644 index 0000000..723bf34 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs @@ -0,0 +1,383 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/flow_limiter_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/flow_limiter_calculator.proto + public static partial class FlowLimiterCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/flow_limiter_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FlowLimiterCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9mbG93X2xpbWl0ZXJfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8izQEKHEZsb3dMaW1pdGVyQ2FsY3VsYXRvck9w", + "dGlvbnMSGAoNbWF4X2luX2ZsaWdodBgBIAEoBToBMRIXCgxtYXhfaW5fcXVl", + "dWUYAiABKAU6ATASIgoRaW5fZmxpZ2h0X3RpbWVvdXQYAyABKAM6BzEwMDAw", + "MDAyVgoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGPig9JsB", + "IAEoCzInLm1lZGlhcGlwZS5GbG93TGltaXRlckNhbGN1bGF0b3JPcHRpb25z", + "QkMKJWNvbS5nb29nbGUubWVkaWFwaXBlLmNhbGN1bGF0b3IucHJvdG9CGkZs", + "b3dMaW1pdGVyQ2FsY3VsYXRvclByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FlowLimiterCalculatorOptions), global::Mediapipe.FlowLimiterCalculatorOptions.Parser, new[]{ "MaxInFlight", "MaxInQueue", "InFlightTimeout" }, null, null, new pb::Extension[] { global::Mediapipe.FlowLimiterCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FlowLimiterCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FlowLimiterCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowLimiterCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowLimiterCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowLimiterCalculatorOptions(FlowLimiterCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maxInFlight_ = other.maxInFlight_; + maxInQueue_ = other.maxInQueue_; + inFlightTimeout_ = other.inFlightTimeout_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowLimiterCalculatorOptions Clone() { + return new FlowLimiterCalculatorOptions(this); + } + + /// Field number for the "max_in_flight" field. + public const int MaxInFlightFieldNumber = 1; + private readonly static int MaxInFlightDefaultValue = 1; + + private int maxInFlight_; + /// + /// The maximum number of frames released for processing at one time. + /// The default value limits to 1 frame processing at a time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxInFlight { + get { if ((_hasBits0 & 1) != 0) { return maxInFlight_; } else { return MaxInFlightDefaultValue; } } + set { + _hasBits0 |= 1; + maxInFlight_ = value; + } + } + /// Gets whether the "max_in_flight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxInFlight { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "max_in_flight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxInFlight() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_in_queue" field. + public const int MaxInQueueFieldNumber = 2; + private readonly static int MaxInQueueDefaultValue = 0; + + private int maxInQueue_; + /// + /// The maximum number of frames queued waiting for processing. + /// The default value limits to 0 frames awaiting processing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxInQueue { + get { if ((_hasBits0 & 2) != 0) { return maxInQueue_; } else { return MaxInQueueDefaultValue; } } + set { + _hasBits0 |= 2; + maxInQueue_ = value; + } + } + /// Gets whether the "max_in_queue" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxInQueue { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_in_queue" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxInQueue() { + _hasBits0 &= ~2; + } + + /// Field number for the "in_flight_timeout" field. + public const int InFlightTimeoutFieldNumber = 3; + private readonly static long InFlightTimeoutDefaultValue = 1000000L; + + private long inFlightTimeout_; + /// + /// The maximum time in microseconds to wait for a frame to finish processing. + /// The default value stops waiting after 1 sec. + /// The value 0 specifies no timeout. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long InFlightTimeout { + get { if ((_hasBits0 & 4) != 0) { return inFlightTimeout_; } else { return InFlightTimeoutDefaultValue; } } + set { + _hasBits0 |= 4; + inFlightTimeout_ = value; + } + } + /// Gets whether the "in_flight_timeout" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInFlightTimeout { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "in_flight_timeout" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInFlightTimeout() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FlowLimiterCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FlowLimiterCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MaxInFlight != other.MaxInFlight) return false; + if (MaxInQueue != other.MaxInQueue) return false; + if (InFlightTimeout != other.InFlightTimeout) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaxInFlight) hash ^= MaxInFlight.GetHashCode(); + if (HasMaxInQueue) hash ^= MaxInQueue.GetHashCode(); + if (HasInFlightTimeout) hash ^= InFlightTimeout.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaxInFlight) { + output.WriteRawTag(8); + output.WriteInt32(MaxInFlight); + } + if (HasMaxInQueue) { + output.WriteRawTag(16); + output.WriteInt32(MaxInQueue); + } + if (HasInFlightTimeout) { + output.WriteRawTag(24); + output.WriteInt64(InFlightTimeout); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaxInFlight) { + output.WriteRawTag(8); + output.WriteInt32(MaxInFlight); + } + if (HasMaxInQueue) { + output.WriteRawTag(16); + output.WriteInt32(MaxInQueue); + } + if (HasInFlightTimeout) { + output.WriteRawTag(24); + output.WriteInt64(InFlightTimeout); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaxInFlight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxInFlight); + } + if (HasMaxInQueue) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxInQueue); + } + if (HasInFlightTimeout) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(InFlightTimeout); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FlowLimiterCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaxInFlight) { + MaxInFlight = other.MaxInFlight; + } + if (other.HasMaxInQueue) { + MaxInQueue = other.MaxInQueue; + } + if (other.HasInFlightTimeout) { + InFlightTimeout = other.InFlightTimeout; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MaxInFlight = input.ReadInt32(); + break; + } + case 16: { + MaxInQueue = input.ReadInt32(); + break; + } + case 24: { + InFlightTimeout = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MaxInFlight = input.ReadInt32(); + break; + } + case 16: { + MaxInQueue = input.ReadInt32(); + break; + } + case 24: { + InFlightTimeout = input.ReadInt64(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FlowLimiterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(326963320, pb::FieldCodec.ForMessage(2615706562, global::Mediapipe.FlowLimiterCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs.meta new file mode 100644 index 0000000..446ddcb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/FlowLimiterCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e986e3ff876b89a6b33dd65994a05b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs new file mode 100644 index 0000000..e7eda37 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs @@ -0,0 +1,324 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/gate_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/gate_calculator.proto + public static partial class GateCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/gate_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GateCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9nYXRlX2NhbGN1bGF0b3Iu", + "cHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxh", + "dG9yLnByb3RvIp0BChVHYXRlQ2FsY3VsYXRvck9wdGlvbnMSHgoWZW1wdHlf", + "cGFja2V0c19hc19hbGxvdxgBIAEoCBIUCgVhbGxvdxgCIAEoCDoFZmFsc2Uy", + "TgoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGN+f6HwgASgL", + "MiAubWVkaWFwaXBlLkdhdGVDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GateCalculatorOptions), global::Mediapipe.GateCalculatorOptions.Parser, new[]{ "EmptyPacketsAsAllow", "Allow" }, null, null, new pb::Extension[] { global::Mediapipe.GateCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GateCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GateCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GateCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GateCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GateCalculatorOptions(GateCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + emptyPacketsAsAllow_ = other.emptyPacketsAsAllow_; + allow_ = other.allow_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GateCalculatorOptions Clone() { + return new GateCalculatorOptions(this); + } + + /// Field number for the "empty_packets_as_allow" field. + public const int EmptyPacketsAsAllowFieldNumber = 1; + private readonly static bool EmptyPacketsAsAllowDefaultValue = false; + + private bool emptyPacketsAsAllow_; + /// + /// By default an empty packet in the ALLOW or DISALLOW input stream indicates + /// disallowing the corresponding packets in the data input streams. Setting + /// this option to true inverts that, allowing the data packets to go through. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EmptyPacketsAsAllow { + get { if ((_hasBits0 & 1) != 0) { return emptyPacketsAsAllow_; } else { return EmptyPacketsAsAllowDefaultValue; } } + set { + _hasBits0 |= 1; + emptyPacketsAsAllow_ = value; + } + } + /// Gets whether the "empty_packets_as_allow" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEmptyPacketsAsAllow { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "empty_packets_as_allow" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEmptyPacketsAsAllow() { + _hasBits0 &= ~1; + } + + /// Field number for the "allow" field. + public const int AllowFieldNumber = 2; + private readonly static bool AllowDefaultValue = false; + + private bool allow_; + /// + /// Whether to allow or disallow the input streams to pass when no + /// ALLOW/DISALLOW input or side input is specified. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Allow { + get { if ((_hasBits0 & 2) != 0) { return allow_; } else { return AllowDefaultValue; } } + set { + _hasBits0 |= 2; + allow_ = value; + } + } + /// Gets whether the "allow" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAllow { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "allow" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAllow() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GateCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GateCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (EmptyPacketsAsAllow != other.EmptyPacketsAsAllow) return false; + if (Allow != other.Allow) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasEmptyPacketsAsAllow) hash ^= EmptyPacketsAsAllow.GetHashCode(); + if (HasAllow) hash ^= Allow.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasEmptyPacketsAsAllow) { + output.WriteRawTag(8); + output.WriteBool(EmptyPacketsAsAllow); + } + if (HasAllow) { + output.WriteRawTag(16); + output.WriteBool(Allow); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasEmptyPacketsAsAllow) { + output.WriteRawTag(8); + output.WriteBool(EmptyPacketsAsAllow); + } + if (HasAllow) { + output.WriteRawTag(16); + output.WriteBool(Allow); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasEmptyPacketsAsAllow) { + size += 1 + 1; + } + if (HasAllow) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GateCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasEmptyPacketsAsAllow) { + EmptyPacketsAsAllow = other.EmptyPacketsAsAllow; + } + if (other.HasAllow) { + Allow = other.Allow; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + EmptyPacketsAsAllow = input.ReadBool(); + break; + } + case 16: { + Allow = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + EmptyPacketsAsAllow = input.ReadBool(); + break; + } + case 16: { + Allow = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the GateCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(261754847, pb::FieldCodec.ForMessage(2094038778, global::Mediapipe.GateCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs.meta new file mode 100644 index 0000000..d41ce46 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GateCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bddce3ccccc7b7e36bcb0818374ba7f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs new file mode 100644 index 0000000..d549bb4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs @@ -0,0 +1,266 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/graph_profile_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/graph_profile_calculator.proto + public static partial class GraphProfileCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/graph_profile_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GraphProfileCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9ncmFwaF9wcm9maWxlX2Nh", + "bGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9jYWxjdWxhdG9yLnByb3RvIpsBCh1HcmFwaFByb2ZpbGVDYWxjdWxhdG9y", + "T3B0aW9ucxIhChBwcm9maWxlX2ludGVydmFsGAEgASgDOgcxMDAwMDAwMlcK", + "A2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjXp52vASABKAsy", + "KC5tZWRpYXBpcGUuR3JhcGhQcm9maWxlQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GraphProfileCalculatorOptions), global::Mediapipe.GraphProfileCalculatorOptions.Parser, new[]{ "ProfileInterval" }, null, null, new pb::Extension[] { global::Mediapipe.GraphProfileCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GraphProfileCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphProfileCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GraphProfileCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfileCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfileCalculatorOptions(GraphProfileCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + profileInterval_ = other.profileInterval_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfileCalculatorOptions Clone() { + return new GraphProfileCalculatorOptions(this); + } + + /// Field number for the "profile_interval" field. + public const int ProfileIntervalFieldNumber = 1; + private readonly static long ProfileIntervalDefaultValue = 1000000L; + + private long profileInterval_; + /// + /// The interval in microseconds between successive reported GraphProfiles. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ProfileInterval { + get { if ((_hasBits0 & 1) != 0) { return profileInterval_; } else { return ProfileIntervalDefaultValue; } } + set { + _hasBits0 |= 1; + profileInterval_ = value; + } + } + /// Gets whether the "profile_interval" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProfileInterval { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "profile_interval" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProfileInterval() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GraphProfileCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GraphProfileCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ProfileInterval != other.ProfileInterval) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasProfileInterval) hash ^= ProfileInterval.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasProfileInterval) { + output.WriteRawTag(8); + output.WriteInt64(ProfileInterval); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasProfileInterval) { + output.WriteRawTag(8); + output.WriteInt64(ProfileInterval); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasProfileInterval) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ProfileInterval); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GraphProfileCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasProfileInterval) { + ProfileInterval = other.ProfileInterval; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ProfileInterval = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ProfileInterval = input.ReadInt64(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the GraphProfileCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(367481815, pb::FieldCodec.ForMessage(2939854522, global::Mediapipe.GraphProfileCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs.meta new file mode 100644 index 0000000..6f9d677 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/GraphProfileCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 250f01530277860d7940984595bfa8e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs new file mode 100644 index 0000000..28df98a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs @@ -0,0 +1,325 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/packet_cloner_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/packet_cloner_calculator.proto + public static partial class PacketClonerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/packet_cloner_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketClonerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9wYWNrZXRfY2xvbmVyX2Nh", + "bGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9jYWxjdWxhdG9yLnByb3RvIukBCh1QYWNrZXRDbG9uZXJDYWxjdWxhdG9y", + "T3B0aW9ucxIzCiRvdXRwdXRfb25seV93aGVuX2FsbF9pbnB1dHNfcmVjZWl2", + "ZWQYASABKAg6BWZhbHNlEjsKLG91dHB1dF9wYWNrZXRzX29ubHlfd2hlbl9h", + "bGxfaW5wdXRzX3JlY2VpdmVkGAIgASgIOgVmYWxzZTJWCgNleHQSHC5tZWRp", + "YXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYlaa4eyABKAsyKC5tZWRpYXBpcGUu", + "UGFja2V0Q2xvbmVyQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketClonerCalculatorOptions), global::Mediapipe.PacketClonerCalculatorOptions.Parser, new[]{ "OutputOnlyWhenAllInputsReceived", "OutputPacketsOnlyWhenAllInputsReceived" }, null, null, new pb::Extension[] { global::Mediapipe.PacketClonerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class PacketClonerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketClonerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketClonerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketClonerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketClonerCalculatorOptions(PacketClonerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputOnlyWhenAllInputsReceived_ = other.outputOnlyWhenAllInputsReceived_; + outputPacketsOnlyWhenAllInputsReceived_ = other.outputPacketsOnlyWhenAllInputsReceived_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketClonerCalculatorOptions Clone() { + return new PacketClonerCalculatorOptions(this); + } + + /// Field number for the "output_only_when_all_inputs_received" field. + public const int OutputOnlyWhenAllInputsReceivedFieldNumber = 1; + private readonly static bool OutputOnlyWhenAllInputsReceivedDefaultValue = false; + + private bool outputOnlyWhenAllInputsReceived_; + /// + /// When true, this calculator will drop received TICK packets if any input + /// stream hasn't received a packet yet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputOnlyWhenAllInputsReceived { + get { if ((_hasBits0 & 1) != 0) { return outputOnlyWhenAllInputsReceived_; } else { return OutputOnlyWhenAllInputsReceivedDefaultValue; } } + set { + _hasBits0 |= 1; + outputOnlyWhenAllInputsReceived_ = value; + } + } + /// Gets whether the "output_only_when_all_inputs_received" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputOnlyWhenAllInputsReceived { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_only_when_all_inputs_received" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputOnlyWhenAllInputsReceived() { + _hasBits0 &= ~1; + } + + /// Field number for the "output_packets_only_when_all_inputs_received" field. + public const int OutputPacketsOnlyWhenAllInputsReceivedFieldNumber = 2; + private readonly static bool OutputPacketsOnlyWhenAllInputsReceivedDefaultValue = false; + + private bool outputPacketsOnlyWhenAllInputsReceived_; + /// + /// Similar with above, but also transmit empty packet for all streams before + /// all inputs are received. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputPacketsOnlyWhenAllInputsReceived { + get { if ((_hasBits0 & 2) != 0) { return outputPacketsOnlyWhenAllInputsReceived_; } else { return OutputPacketsOnlyWhenAllInputsReceivedDefaultValue; } } + set { + _hasBits0 |= 2; + outputPacketsOnlyWhenAllInputsReceived_ = value; + } + } + /// Gets whether the "output_packets_only_when_all_inputs_received" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputPacketsOnlyWhenAllInputsReceived { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "output_packets_only_when_all_inputs_received" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputPacketsOnlyWhenAllInputsReceived() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketClonerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketClonerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputOnlyWhenAllInputsReceived != other.OutputOnlyWhenAllInputsReceived) return false; + if (OutputPacketsOnlyWhenAllInputsReceived != other.OutputPacketsOnlyWhenAllInputsReceived) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputOnlyWhenAllInputsReceived) hash ^= OutputOnlyWhenAllInputsReceived.GetHashCode(); + if (HasOutputPacketsOnlyWhenAllInputsReceived) hash ^= OutputPacketsOnlyWhenAllInputsReceived.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputOnlyWhenAllInputsReceived) { + output.WriteRawTag(8); + output.WriteBool(OutputOnlyWhenAllInputsReceived); + } + if (HasOutputPacketsOnlyWhenAllInputsReceived) { + output.WriteRawTag(16); + output.WriteBool(OutputPacketsOnlyWhenAllInputsReceived); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputOnlyWhenAllInputsReceived) { + output.WriteRawTag(8); + output.WriteBool(OutputOnlyWhenAllInputsReceived); + } + if (HasOutputPacketsOnlyWhenAllInputsReceived) { + output.WriteRawTag(16); + output.WriteBool(OutputPacketsOnlyWhenAllInputsReceived); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputOnlyWhenAllInputsReceived) { + size += 1 + 1; + } + if (HasOutputPacketsOnlyWhenAllInputsReceived) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketClonerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputOnlyWhenAllInputsReceived) { + OutputOnlyWhenAllInputsReceived = other.OutputOnlyWhenAllInputsReceived; + } + if (other.HasOutputPacketsOnlyWhenAllInputsReceived) { + OutputPacketsOnlyWhenAllInputsReceived = other.OutputPacketsOnlyWhenAllInputsReceived; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputOnlyWhenAllInputsReceived = input.ReadBool(); + break; + } + case 16: { + OutputPacketsOnlyWhenAllInputsReceived = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputOnlyWhenAllInputsReceived = input.ReadBool(); + break; + } + case 16: { + OutputPacketsOnlyWhenAllInputsReceived = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the PacketClonerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(258872085, pb::FieldCodec.ForMessage(2070976682, global::Mediapipe.PacketClonerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs.meta new file mode 100644 index 0000000..71df5a6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketClonerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab81aac3879b8efaeadb953bfa8c0da6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs new file mode 100644 index 0000000..7531b08 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs @@ -0,0 +1,840 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/packet_resampler_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/packet_resampler_calculator.proto + public static partial class PacketResamplerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/packet_resampler_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketResamplerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjxtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9wYWNrZXRfcmVzYW1wbGVy", + "X2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1l", + "d29yay9jYWxjdWxhdG9yLnByb3RvIokECiBQYWNrZXRSZXNhbXBsZXJDYWxj", + "dWxhdG9yT3B0aW9ucxIWCgpmcmFtZV9yYXRlGAEgASgBOgItMRJVCg1vdXRw", + "dXRfaGVhZGVyGAIgASgOMjgubWVkaWFwaXBlLlBhY2tldFJlc2FtcGxlckNh", + "bGN1bGF0b3JPcHRpb25zLk91dHB1dEhlYWRlcjoETk9ORRIfChFmbHVzaF9s", + "YXN0X3BhY2tldBgDIAEoCDoEdHJ1ZRIOCgZqaXR0ZXIYBCABKAESJQoWaml0", + "dGVyX3dpdGhfcmVmbGVjdGlvbhgJIAEoCDoFZmFsc2USJAoVcmVwcm9kdWNp", + "YmxlX3NhbXBsaW5nGAogASgIOgVmYWxzZRIWCg5iYXNlX3RpbWVzdGFtcBgF", + "IAEoAxISCgpzdGFydF90aW1lGAYgASgDEhAKCGVuZF90aW1lGAcgASgDEhsK", + "DHJvdW5kX2xpbWl0cxgIIAEoCDoFZmFsc2UiQgoMT3V0cHV0SGVhZGVyEggK", + "BE5PTkUQABIPCgtQQVNTX0hFQURFUhABEhcKE1VQREFURV9WSURFT19IRUFE", + "RVIQAjJZCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY5N7T", + "LSABKAsyKy5tZWRpYXBpcGUuUGFja2V0UmVzYW1wbGVyQ2FsY3VsYXRvck9w", + "dGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketResamplerCalculatorOptions), global::Mediapipe.PacketResamplerCalculatorOptions.Parser, new[]{ "FrameRate", "OutputHeader", "FlushLastPacket", "Jitter", "JitterWithReflection", "ReproducibleSampling", "BaseTimestamp", "StartTime", "EndTime", "RoundLimits" }, null, new[]{ typeof(global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader) }, new pb::Extension[] { global::Mediapipe.PacketResamplerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class PacketResamplerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketResamplerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketResamplerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketResamplerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketResamplerCalculatorOptions(PacketResamplerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + frameRate_ = other.frameRate_; + outputHeader_ = other.outputHeader_; + flushLastPacket_ = other.flushLastPacket_; + jitter_ = other.jitter_; + jitterWithReflection_ = other.jitterWithReflection_; + reproducibleSampling_ = other.reproducibleSampling_; + baseTimestamp_ = other.baseTimestamp_; + startTime_ = other.startTime_; + endTime_ = other.endTime_; + roundLimits_ = other.roundLimits_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketResamplerCalculatorOptions Clone() { + return new PacketResamplerCalculatorOptions(this); + } + + /// Field number for the "frame_rate" field. + public const int FrameRateFieldNumber = 1; + private readonly static double FrameRateDefaultValue = -1D; + + private double frameRate_; + /// + /// The output frame rate measured in frames per second. + /// + /// The closest packet in time in each period will be chosen. If there + /// is no packet in the period then the most recent packet will be chosen + /// (not the closest in time). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FrameRate { + get { if ((_hasBits0 & 1) != 0) { return frameRate_; } else { return FrameRateDefaultValue; } } + set { + _hasBits0 |= 1; + frameRate_ = value; + } + } + /// Gets whether the "frame_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameRate { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameRate() { + _hasBits0 &= ~1; + } + + /// Field number for the "output_header" field. + public const int OutputHeaderFieldNumber = 2; + private readonly static global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader OutputHeaderDefaultValue = global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader.None; + + private global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader outputHeader_; + /// + /// Whether and what kind of header to place on the output stream. + /// Note, this is about the actual header, not the VIDEO_HEADER stream. + /// If this option is set to UPDATE_VIDEO_HEADER then the header will + /// also be parsed (updated) and passed along to the VIDEO_HEADER stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader OutputHeader { + get { if ((_hasBits0 & 2) != 0) { return outputHeader_; } else { return OutputHeaderDefaultValue; } } + set { + _hasBits0 |= 2; + outputHeader_ = value; + } + } + /// Gets whether the "output_header" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputHeader { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "output_header" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputHeader() { + _hasBits0 &= ~2; + } + + /// Field number for the "flush_last_packet" field. + public const int FlushLastPacketFieldNumber = 3; + private readonly static bool FlushLastPacketDefaultValue = true; + + private bool flushLastPacket_; + /// + /// Flush last packet even if its timestamp is greater than the final stream + /// timestamp. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlushLastPacket { + get { if ((_hasBits0 & 4) != 0) { return flushLastPacket_; } else { return FlushLastPacketDefaultValue; } } + set { + _hasBits0 |= 4; + flushLastPacket_ = value; + } + } + /// Gets whether the "flush_last_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlushLastPacket { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "flush_last_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlushLastPacket() { + _hasBits0 &= ~4; + } + + /// Field number for the "jitter" field. + public const int JitterFieldNumber = 4; + private readonly static double JitterDefaultValue = 0D; + + private double jitter_; + /// + /// Adds jitter to resampling if set, so that Google's sampling is not + /// externally deterministic. + /// + /// When set, the randomizer will be initialized with a seed. Then, the first + /// sample is chosen randomly (uniform distribution) among frames that + /// correspond to timestamps [0, 1/frame_rate). Let the chosen frame + /// correspond to timestamp t. The next frame is chosen randomly (uniform + /// distribution) among frames that correspond to [t+(1-jitter)/frame_rate, + /// t+(1+jitter)/frame_rate]. t is updated and the process is repeated. + /// + /// Valid values are in the range of [0.0, 1.0] with the default being 0.0 (no + /// jitter). A typical value would be a value in the range of 0.1-0.25. + /// + /// Note that this does NOT guarantee the desired frame rate, but if the + /// pseudo-random number generator does its job and the number of frames is + /// sufficiently large, the average frame rate will be close to this value. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Jitter { + get { if ((_hasBits0 & 8) != 0) { return jitter_; } else { return JitterDefaultValue; } } + set { + _hasBits0 |= 8; + jitter_ = value; + } + } + /// Gets whether the "jitter" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasJitter { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "jitter" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearJitter() { + _hasBits0 &= ~8; + } + + /// Field number for the "jitter_with_reflection" field. + public const int JitterWithReflectionFieldNumber = 9; + private readonly static bool JitterWithReflectionDefaultValue = false; + + private bool jitterWithReflection_; + /// + /// Enables reflection when applying jitter. + /// + /// This option is ignored when reproducible_sampling is true, in which case + /// reflection will be used. + /// + /// New use cases should use reproducible_sampling = true, as + /// jitter_with_reflection is deprecated and will be removed at some point. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool JitterWithReflection { + get { if ((_hasBits0 & 256) != 0) { return jitterWithReflection_; } else { return JitterWithReflectionDefaultValue; } } + set { + _hasBits0 |= 256; + jitterWithReflection_ = value; + } + } + /// Gets whether the "jitter_with_reflection" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasJitterWithReflection { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "jitter_with_reflection" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearJitterWithReflection() { + _hasBits0 &= ~256; + } + + /// Field number for the "reproducible_sampling" field. + public const int ReproducibleSamplingFieldNumber = 10; + private readonly static bool ReproducibleSamplingDefaultValue = false; + + private bool reproducibleSampling_; + /// + /// If set, enabled reproducible sampling, allowing frames to be sampled + /// without regards to where the stream starts. See + /// packet_resampler_calculator.h for details. + /// + /// This enables reflection (ignoring jitter_with_reflection setting). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReproducibleSampling { + get { if ((_hasBits0 & 512) != 0) { return reproducibleSampling_; } else { return ReproducibleSamplingDefaultValue; } } + set { + _hasBits0 |= 512; + reproducibleSampling_ = value; + } + } + /// Gets whether the "reproducible_sampling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReproducibleSampling { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "reproducible_sampling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReproducibleSampling() { + _hasBits0 &= ~512; + } + + /// Field number for the "base_timestamp" field. + public const int BaseTimestampFieldNumber = 5; + private readonly static long BaseTimestampDefaultValue = 0L; + + private long baseTimestamp_; + /// + /// If specified, output timestamps are aligned with base_timestamp. + /// Otherwise, they are aligned with the first input timestamp. + /// + /// In order to ensure that the outptut timestamps are reproducible, + /// with round_limits = false, the bounds for input timestamps must include: + /// [start_time - period / 2, end_time + period / 2], + /// with round_limits = true, the bounds for input timestamps must include: + /// [start_time - period, end_time + period], + /// where period = 1 / frame_rate. + /// + /// For example, in PacketResamplerCalculatorOptions specify + /// "start_time: 3000000", and in MediaDecoderOptions specify + /// "start_time: 2999950". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long BaseTimestamp { + get { if ((_hasBits0 & 16) != 0) { return baseTimestamp_; } else { return BaseTimestampDefaultValue; } } + set { + _hasBits0 |= 16; + baseTimestamp_ = value; + } + } + /// Gets whether the "base_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBaseTimestamp { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "base_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBaseTimestamp() { + _hasBits0 &= ~16; + } + + /// Field number for the "start_time" field. + public const int StartTimeFieldNumber = 6; + private readonly static long StartTimeDefaultValue = 0L; + + private long startTime_; + /// + /// If specified, only outputs at/after start_time are included. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long StartTime { + get { if ((_hasBits0 & 32) != 0) { return startTime_; } else { return StartTimeDefaultValue; } } + set { + _hasBits0 |= 32; + startTime_ = value; + } + } + /// Gets whether the "start_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartTime { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "start_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartTime() { + _hasBits0 &= ~32; + } + + /// Field number for the "end_time" field. + public const int EndTimeFieldNumber = 7; + private readonly static long EndTimeDefaultValue = 0L; + + private long endTime_; + /// + /// If specified, only outputs before end_time are included. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long EndTime { + get { if ((_hasBits0 & 64) != 0) { return endTime_; } else { return EndTimeDefaultValue; } } + set { + _hasBits0 |= 64; + endTime_ = value; + } + } + /// Gets whether the "end_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEndTime { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "end_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEndTime() { + _hasBits0 &= ~64; + } + + /// Field number for the "round_limits" field. + public const int RoundLimitsFieldNumber = 8; + private readonly static bool RoundLimitsDefaultValue = false; + + private bool roundLimits_; + /// + /// If set, the output timestamps nearest to start_time and end_time + /// are included in the output, even if the nearest timestamp is not + /// between start_time and end_time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RoundLimits { + get { if ((_hasBits0 & 128) != 0) { return roundLimits_; } else { return RoundLimitsDefaultValue; } } + set { + _hasBits0 |= 128; + roundLimits_ = value; + } + } + /// Gets whether the "round_limits" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRoundLimits { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "round_limits" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRoundLimits() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketResamplerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketResamplerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FrameRate, other.FrameRate)) return false; + if (OutputHeader != other.OutputHeader) return false; + if (FlushLastPacket != other.FlushLastPacket) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Jitter, other.Jitter)) return false; + if (JitterWithReflection != other.JitterWithReflection) return false; + if (ReproducibleSampling != other.ReproducibleSampling) return false; + if (BaseTimestamp != other.BaseTimestamp) return false; + if (StartTime != other.StartTime) return false; + if (EndTime != other.EndTime) return false; + if (RoundLimits != other.RoundLimits) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrameRate) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FrameRate); + if (HasOutputHeader) hash ^= OutputHeader.GetHashCode(); + if (HasFlushLastPacket) hash ^= FlushLastPacket.GetHashCode(); + if (HasJitter) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Jitter); + if (HasJitterWithReflection) hash ^= JitterWithReflection.GetHashCode(); + if (HasReproducibleSampling) hash ^= ReproducibleSampling.GetHashCode(); + if (HasBaseTimestamp) hash ^= BaseTimestamp.GetHashCode(); + if (HasStartTime) hash ^= StartTime.GetHashCode(); + if (HasEndTime) hash ^= EndTime.GetHashCode(); + if (HasRoundLimits) hash ^= RoundLimits.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrameRate) { + output.WriteRawTag(9); + output.WriteDouble(FrameRate); + } + if (HasOutputHeader) { + output.WriteRawTag(16); + output.WriteEnum((int) OutputHeader); + } + if (HasFlushLastPacket) { + output.WriteRawTag(24); + output.WriteBool(FlushLastPacket); + } + if (HasJitter) { + output.WriteRawTag(33); + output.WriteDouble(Jitter); + } + if (HasBaseTimestamp) { + output.WriteRawTag(40); + output.WriteInt64(BaseTimestamp); + } + if (HasStartTime) { + output.WriteRawTag(48); + output.WriteInt64(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(56); + output.WriteInt64(EndTime); + } + if (HasRoundLimits) { + output.WriteRawTag(64); + output.WriteBool(RoundLimits); + } + if (HasJitterWithReflection) { + output.WriteRawTag(72); + output.WriteBool(JitterWithReflection); + } + if (HasReproducibleSampling) { + output.WriteRawTag(80); + output.WriteBool(ReproducibleSampling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrameRate) { + output.WriteRawTag(9); + output.WriteDouble(FrameRate); + } + if (HasOutputHeader) { + output.WriteRawTag(16); + output.WriteEnum((int) OutputHeader); + } + if (HasFlushLastPacket) { + output.WriteRawTag(24); + output.WriteBool(FlushLastPacket); + } + if (HasJitter) { + output.WriteRawTag(33); + output.WriteDouble(Jitter); + } + if (HasBaseTimestamp) { + output.WriteRawTag(40); + output.WriteInt64(BaseTimestamp); + } + if (HasStartTime) { + output.WriteRawTag(48); + output.WriteInt64(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(56); + output.WriteInt64(EndTime); + } + if (HasRoundLimits) { + output.WriteRawTag(64); + output.WriteBool(RoundLimits); + } + if (HasJitterWithReflection) { + output.WriteRawTag(72); + output.WriteBool(JitterWithReflection); + } + if (HasReproducibleSampling) { + output.WriteRawTag(80); + output.WriteBool(ReproducibleSampling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrameRate) { + size += 1 + 8; + } + if (HasOutputHeader) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OutputHeader); + } + if (HasFlushLastPacket) { + size += 1 + 1; + } + if (HasJitter) { + size += 1 + 8; + } + if (HasJitterWithReflection) { + size += 1 + 1; + } + if (HasReproducibleSampling) { + size += 1 + 1; + } + if (HasBaseTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BaseTimestamp); + } + if (HasStartTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime); + } + if (HasEndTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(EndTime); + } + if (HasRoundLimits) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketResamplerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasFrameRate) { + FrameRate = other.FrameRate; + } + if (other.HasOutputHeader) { + OutputHeader = other.OutputHeader; + } + if (other.HasFlushLastPacket) { + FlushLastPacket = other.FlushLastPacket; + } + if (other.HasJitter) { + Jitter = other.Jitter; + } + if (other.HasJitterWithReflection) { + JitterWithReflection = other.JitterWithReflection; + } + if (other.HasReproducibleSampling) { + ReproducibleSampling = other.ReproducibleSampling; + } + if (other.HasBaseTimestamp) { + BaseTimestamp = other.BaseTimestamp; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + if (other.HasRoundLimits) { + RoundLimits = other.RoundLimits; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + FrameRate = input.ReadDouble(); + break; + } + case 16: { + OutputHeader = (global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader) input.ReadEnum(); + break; + } + case 24: { + FlushLastPacket = input.ReadBool(); + break; + } + case 33: { + Jitter = input.ReadDouble(); + break; + } + case 40: { + BaseTimestamp = input.ReadInt64(); + break; + } + case 48: { + StartTime = input.ReadInt64(); + break; + } + case 56: { + EndTime = input.ReadInt64(); + break; + } + case 64: { + RoundLimits = input.ReadBool(); + break; + } + case 72: { + JitterWithReflection = input.ReadBool(); + break; + } + case 80: { + ReproducibleSampling = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + FrameRate = input.ReadDouble(); + break; + } + case 16: { + OutputHeader = (global::Mediapipe.PacketResamplerCalculatorOptions.Types.OutputHeader) input.ReadEnum(); + break; + } + case 24: { + FlushLastPacket = input.ReadBool(); + break; + } + case 33: { + Jitter = input.ReadDouble(); + break; + } + case 40: { + BaseTimestamp = input.ReadInt64(); + break; + } + case 48: { + StartTime = input.ReadInt64(); + break; + } + case 56: { + EndTime = input.ReadInt64(); + break; + } + case 64: { + RoundLimits = input.ReadBool(); + break; + } + case 72: { + JitterWithReflection = input.ReadBool(); + break; + } + case 80: { + ReproducibleSampling = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the PacketResamplerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum OutputHeader { + /// + /// Do not output a header, even if the input contained one. + /// + [pbr::OriginalName("NONE")] None = 0, + /// + /// Pass the header, if the input contained one. + /// + [pbr::OriginalName("PASS_HEADER")] PassHeader = 1, + /// + /// Update the frame rate in the header, which must be of type VideoHeader. + /// + [pbr::OriginalName("UPDATE_VIDEO_HEADER")] UpdateVideoHeader = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the PacketResamplerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(95743844, pb::FieldCodec.ForMessage(765950754, global::Mediapipe.PacketResamplerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs.meta new file mode 100644 index 0000000..72aa2a6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketResamplerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78263d60c583a1cecbc50d299fb69ae7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs new file mode 100644 index 0000000..57f4ea0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs @@ -0,0 +1,583 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/packet_thinner_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/packet_thinner_calculator.proto + public static partial class PacketThinnerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/packet_thinner_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketThinnerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9wYWNrZXRfdGhpbm5lcl9j", + "YWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdv", + "cmsvY2FsY3VsYXRvci5wcm90byLzAgoeUGFja2V0VGhpbm5lckNhbGN1bGF0", + "b3JPcHRpb25zElIKDHRoaW5uZXJfdHlwZRgBIAEoDjI1Lm1lZGlhcGlwZS5Q", + "YWNrZXRUaGlubmVyQ2FsY3VsYXRvck9wdGlvbnMuVGhpbm5lclR5cGU6BUFT", + "WU5DEhEKBnBlcmlvZBgCIAEoAzoBMRISCgpzdGFydF90aW1lGAMgASgDEhAK", + "CGVuZF90aW1lGAQgASgDEiQKFnN5bmNfb3V0cHV0X3RpbWVzdGFtcHMYBSAB", + "KAg6BHRydWUSIAoRdXBkYXRlX2ZyYW1lX3JhdGUYBiABKAg6BWZhbHNlIiIK", + "C1RoaW5uZXJUeXBlEgkKBUFTWU5DEAESCAoEU1lOQxACMlgKA2V4dBIcLm1l", + "ZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiE2MqJASABKAsyKS5tZWRpYXBp", + "cGUuUGFja2V0VGhpbm5lckNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketThinnerCalculatorOptions), global::Mediapipe.PacketThinnerCalculatorOptions.Parser, new[]{ "ThinnerType", "Period", "StartTime", "EndTime", "SyncOutputTimestamps", "UpdateFrameRate" }, null, new[]{ typeof(global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType) }, new pb::Extension[] { global::Mediapipe.PacketThinnerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class PacketThinnerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketThinnerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketThinnerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketThinnerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketThinnerCalculatorOptions(PacketThinnerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + thinnerType_ = other.thinnerType_; + period_ = other.period_; + startTime_ = other.startTime_; + endTime_ = other.endTime_; + syncOutputTimestamps_ = other.syncOutputTimestamps_; + updateFrameRate_ = other.updateFrameRate_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketThinnerCalculatorOptions Clone() { + return new PacketThinnerCalculatorOptions(this); + } + + /// Field number for the "thinner_type" field. + public const int ThinnerTypeFieldNumber = 1; + private readonly static global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType ThinnerTypeDefaultValue = global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType.Async; + + private global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType thinnerType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType ThinnerType { + get { if ((_hasBits0 & 1) != 0) { return thinnerType_; } else { return ThinnerTypeDefaultValue; } } + set { + _hasBits0 |= 1; + thinnerType_ = value; + } + } + /// Gets whether the "thinner_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThinnerType { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "thinner_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThinnerType() { + _hasBits0 &= ~1; + } + + /// Field number for the "period" field. + public const int PeriodFieldNumber = 2; + private readonly static long PeriodDefaultValue = 1L; + + private long period_; + /// + /// The period (in microsecond) specifies the temporal interval during which + /// only a single packet is emitted in the output stream. Has subtly different + /// semantics depending on the thinner type, as follows. + /// + /// Async thinner: this option is a refractory period -- once a packet is + /// emitted, we guarantee that no packets will be emitted for period ticks. + /// + /// Sync thinner: the period specifies a temporal interval during which + /// only one packet is emitted. The emitted packet is guaranteed to be + /// the one closest to the center of the temporal interval (no guarantee on + /// how ties are broken). More specifically, + /// intervals are centered at start_time + i * period + /// (for non-negative integers i). + /// Thus, each interval extends period/2 ticks before and after its center. + /// Additionally, in the sync thinner any packets earlier than start_time + /// are discarded and the thinner calls Close() once timestamp equals or + /// exceeds end_time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Period { + get { if ((_hasBits0 & 2) != 0) { return period_; } else { return PeriodDefaultValue; } } + set { + _hasBits0 |= 2; + period_ = value; + } + } + /// Gets whether the "period" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPeriod { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "period" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPeriod() { + _hasBits0 &= ~2; + } + + /// Field number for the "start_time" field. + public const int StartTimeFieldNumber = 3; + private readonly static long StartTimeDefaultValue = 0L; + + private long startTime_; + /// + /// Packets before start_time and at/after end_time are discarded. + /// Additionally, for a sync thinner, start time specifies the center of + /// time invervals as described above and therefore should be set explicitly. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long StartTime { + get { if ((_hasBits0 & 4) != 0) { return startTime_; } else { return StartTimeDefaultValue; } } + set { + _hasBits0 |= 4; + startTime_ = value; + } + } + /// Gets whether the "start_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartTime { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "start_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartTime() { + _hasBits0 &= ~4; + } + + /// Field number for the "end_time" field. + public const int EndTimeFieldNumber = 4; + private readonly static long EndTimeDefaultValue = 0L; + + private long endTime_; + /// + /// and set to Timestamp::Min() for ASYNC type. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long EndTime { + get { if ((_hasBits0 & 8) != 0) { return endTime_; } else { return EndTimeDefaultValue; } } + set { + _hasBits0 |= 8; + endTime_ = value; + } + } + /// Gets whether the "end_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEndTime { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "end_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEndTime() { + _hasBits0 &= ~8; + } + + /// Field number for the "sync_output_timestamps" field. + public const int SyncOutputTimestampsFieldNumber = 5; + private readonly static bool SyncOutputTimestampsDefaultValue = true; + + private bool syncOutputTimestamps_; + /// + /// Whether the timestamps of packets emitted by sync thinner should + /// correspond to the center of their corresponding temporal interval. + /// If false, packets emitted using original timestamp (as in async thinner). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SyncOutputTimestamps { + get { if ((_hasBits0 & 16) != 0) { return syncOutputTimestamps_; } else { return SyncOutputTimestampsDefaultValue; } } + set { + _hasBits0 |= 16; + syncOutputTimestamps_ = value; + } + } + /// Gets whether the "sync_output_timestamps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSyncOutputTimestamps { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "sync_output_timestamps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSyncOutputTimestamps() { + _hasBits0 &= ~16; + } + + /// Field number for the "update_frame_rate" field. + public const int UpdateFrameRateFieldNumber = 6; + private readonly static bool UpdateFrameRateDefaultValue = false; + + private bool updateFrameRate_; + /// + /// If true, update the frame rate in the header, if it's available, to an + /// estimated frame rate due to the sampling. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UpdateFrameRate { + get { if ((_hasBits0 & 32) != 0) { return updateFrameRate_; } else { return UpdateFrameRateDefaultValue; } } + set { + _hasBits0 |= 32; + updateFrameRate_ = value; + } + } + /// Gets whether the "update_frame_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpdateFrameRate { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "update_frame_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpdateFrameRate() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketThinnerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketThinnerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ThinnerType != other.ThinnerType) return false; + if (Period != other.Period) return false; + if (StartTime != other.StartTime) return false; + if (EndTime != other.EndTime) return false; + if (SyncOutputTimestamps != other.SyncOutputTimestamps) return false; + if (UpdateFrameRate != other.UpdateFrameRate) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasThinnerType) hash ^= ThinnerType.GetHashCode(); + if (HasPeriod) hash ^= Period.GetHashCode(); + if (HasStartTime) hash ^= StartTime.GetHashCode(); + if (HasEndTime) hash ^= EndTime.GetHashCode(); + if (HasSyncOutputTimestamps) hash ^= SyncOutputTimestamps.GetHashCode(); + if (HasUpdateFrameRate) hash ^= UpdateFrameRate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasThinnerType) { + output.WriteRawTag(8); + output.WriteEnum((int) ThinnerType); + } + if (HasPeriod) { + output.WriteRawTag(16); + output.WriteInt64(Period); + } + if (HasStartTime) { + output.WriteRawTag(24); + output.WriteInt64(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(32); + output.WriteInt64(EndTime); + } + if (HasSyncOutputTimestamps) { + output.WriteRawTag(40); + output.WriteBool(SyncOutputTimestamps); + } + if (HasUpdateFrameRate) { + output.WriteRawTag(48); + output.WriteBool(UpdateFrameRate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasThinnerType) { + output.WriteRawTag(8); + output.WriteEnum((int) ThinnerType); + } + if (HasPeriod) { + output.WriteRawTag(16); + output.WriteInt64(Period); + } + if (HasStartTime) { + output.WriteRawTag(24); + output.WriteInt64(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(32); + output.WriteInt64(EndTime); + } + if (HasSyncOutputTimestamps) { + output.WriteRawTag(40); + output.WriteBool(SyncOutputTimestamps); + } + if (HasUpdateFrameRate) { + output.WriteRawTag(48); + output.WriteBool(UpdateFrameRate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasThinnerType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ThinnerType); + } + if (HasPeriod) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Period); + } + if (HasStartTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime); + } + if (HasEndTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(EndTime); + } + if (HasSyncOutputTimestamps) { + size += 1 + 1; + } + if (HasUpdateFrameRate) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketThinnerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasThinnerType) { + ThinnerType = other.ThinnerType; + } + if (other.HasPeriod) { + Period = other.Period; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + if (other.HasSyncOutputTimestamps) { + SyncOutputTimestamps = other.SyncOutputTimestamps; + } + if (other.HasUpdateFrameRate) { + UpdateFrameRate = other.UpdateFrameRate; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ThinnerType = (global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType) input.ReadEnum(); + break; + } + case 16: { + Period = input.ReadInt64(); + break; + } + case 24: { + StartTime = input.ReadInt64(); + break; + } + case 32: { + EndTime = input.ReadInt64(); + break; + } + case 40: { + SyncOutputTimestamps = input.ReadBool(); + break; + } + case 48: { + UpdateFrameRate = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ThinnerType = (global::Mediapipe.PacketThinnerCalculatorOptions.Types.ThinnerType) input.ReadEnum(); + break; + } + case 16: { + Period = input.ReadInt64(); + break; + } + case 24: { + StartTime = input.ReadInt64(); + break; + } + case 32: { + EndTime = input.ReadInt64(); + break; + } + case 40: { + SyncOutputTimestamps = input.ReadBool(); + break; + } + case 48: { + UpdateFrameRate = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the PacketThinnerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum ThinnerType { + /// + /// Asynchronous thinner, described below [default]. + /// + [pbr::OriginalName("ASYNC")] Async = 1, + /// + /// Synchronous thinner, also described below. + /// + [pbr::OriginalName("SYNC")] Sync = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the PacketThinnerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(288533508, pb::FieldCodec.ForMessage(2308268066, global::Mediapipe.PacketThinnerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs.meta new file mode 100644 index 0000000..b56e9e6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/PacketThinnerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f9f3f3eb05e61ed987733ec55b30fbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs new file mode 100644 index 0000000..4e7317e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs @@ -0,0 +1,316 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/quantize_float_vector_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/quantize_float_vector_calculator.proto + public static partial class QuantizeFloatVectorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/quantize_float_vector_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static QuantizeFloatVectorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9xdWFudGl6ZV9mbG9hdF92", + "ZWN0b3JfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ivwEKJFF1YW50aXplRmxvYXRW", + "ZWN0b3JDYWxjdWxhdG9yT3B0aW9ucxIbChNtYXhfcXVhbnRpemVkX3ZhbHVl", + "GAEgASgCEhsKE21pbl9xdWFudGl6ZWRfdmFsdWUYAiABKAIyXQoDZXh0Ehwu", + "bWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGP3u83sgASgLMi8ubWVkaWFw", + "aXBlLlF1YW50aXplRmxvYXRWZWN0b3JDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.QuantizeFloatVectorCalculatorOptions), global::Mediapipe.QuantizeFloatVectorCalculatorOptions.Parser, new[]{ "MaxQuantizedValue", "MinQuantizedValue" }, null, null, new pb::Extension[] { global::Mediapipe.QuantizeFloatVectorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class QuantizeFloatVectorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QuantizeFloatVectorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.QuantizeFloatVectorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public QuantizeFloatVectorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public QuantizeFloatVectorCalculatorOptions(QuantizeFloatVectorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maxQuantizedValue_ = other.maxQuantizedValue_; + minQuantizedValue_ = other.minQuantizedValue_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public QuantizeFloatVectorCalculatorOptions Clone() { + return new QuantizeFloatVectorCalculatorOptions(this); + } + + /// Field number for the "max_quantized_value" field. + public const int MaxQuantizedValueFieldNumber = 1; + private readonly static float MaxQuantizedValueDefaultValue = 0F; + + private float maxQuantizedValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxQuantizedValue { + get { if ((_hasBits0 & 1) != 0) { return maxQuantizedValue_; } else { return MaxQuantizedValueDefaultValue; } } + set { + _hasBits0 |= 1; + maxQuantizedValue_ = value; + } + } + /// Gets whether the "max_quantized_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxQuantizedValue { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "max_quantized_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxQuantizedValue() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_quantized_value" field. + public const int MinQuantizedValueFieldNumber = 2; + private readonly static float MinQuantizedValueDefaultValue = 0F; + + private float minQuantizedValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinQuantizedValue { + get { if ((_hasBits0 & 2) != 0) { return minQuantizedValue_; } else { return MinQuantizedValueDefaultValue; } } + set { + _hasBits0 |= 2; + minQuantizedValue_ = value; + } + } + /// Gets whether the "min_quantized_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinQuantizedValue { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_quantized_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinQuantizedValue() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as QuantizeFloatVectorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(QuantizeFloatVectorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxQuantizedValue, other.MaxQuantizedValue)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinQuantizedValue, other.MinQuantizedValue)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaxQuantizedValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxQuantizedValue); + if (HasMinQuantizedValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinQuantizedValue); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaxQuantizedValue) { + output.WriteRawTag(13); + output.WriteFloat(MaxQuantizedValue); + } + if (HasMinQuantizedValue) { + output.WriteRawTag(21); + output.WriteFloat(MinQuantizedValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaxQuantizedValue) { + output.WriteRawTag(13); + output.WriteFloat(MaxQuantizedValue); + } + if (HasMinQuantizedValue) { + output.WriteRawTag(21); + output.WriteFloat(MinQuantizedValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaxQuantizedValue) { + size += 1 + 4; + } + if (HasMinQuantizedValue) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(QuantizeFloatVectorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaxQuantizedValue) { + MaxQuantizedValue = other.MaxQuantizedValue; + } + if (other.HasMinQuantizedValue) { + MinQuantizedValue = other.MinQuantizedValue; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MaxQuantizedValue = input.ReadFloat(); + break; + } + case 21: { + MinQuantizedValue = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MaxQuantizedValue = input.ReadFloat(); + break; + } + case 21: { + MinQuantizedValue = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the QuantizeFloatVectorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(259848061, pb::FieldCodec.ForMessage(2078784490, global::Mediapipe.QuantizeFloatVectorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs.meta new file mode 100644 index 0000000..e0276b0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/QuantizeFloatVectorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba960b78beaf7eee1855f3bb06bff61c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs new file mode 100644 index 0000000..a61e282 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs @@ -0,0 +1,320 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/sequence_shift_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/sequence_shift_calculator.proto + public static partial class SequenceShiftCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/sequence_shift_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SequenceShiftCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9zZXF1ZW5jZV9zaGlmdF9j", + "YWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdv", + "cmsvY2FsY3VsYXRvci5wcm90byLLAQoeU2VxdWVuY2VTaGlmdENhbGN1bGF0", + "b3JPcHRpb25zEhkKDXBhY2tldF9vZmZzZXQYASABKAU6Ai0xEjUKJmVtaXRf", + "ZW1wdHlfcGFja2V0c19iZWZvcmVfZmlyc3RfcGFja2V0GAIgASgIOgVmYWxz", + "ZTJXCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYh7qpMyAB", + "KAsyKS5tZWRpYXBpcGUuU2VxdWVuY2VTaGlmdENhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SequenceShiftCalculatorOptions), global::Mediapipe.SequenceShiftCalculatorOptions.Parser, new[]{ "PacketOffset", "EmitEmptyPacketsBeforeFirstPacket" }, null, null, new pb::Extension[] { global::Mediapipe.SequenceShiftCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SequenceShiftCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SequenceShiftCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SequenceShiftCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SequenceShiftCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SequenceShiftCalculatorOptions(SequenceShiftCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + packetOffset_ = other.packetOffset_; + emitEmptyPacketsBeforeFirstPacket_ = other.emitEmptyPacketsBeforeFirstPacket_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SequenceShiftCalculatorOptions Clone() { + return new SequenceShiftCalculatorOptions(this); + } + + /// Field number for the "packet_offset" field. + public const int PacketOffsetFieldNumber = 1; + private readonly static int PacketOffsetDefaultValue = -1; + + private int packetOffset_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PacketOffset { + get { if ((_hasBits0 & 1) != 0) { return packetOffset_; } else { return PacketOffsetDefaultValue; } } + set { + _hasBits0 |= 1; + packetOffset_ = value; + } + } + /// Gets whether the "packet_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketOffset { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "packet_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketOffset() { + _hasBits0 &= ~1; + } + + /// Field number for the "emit_empty_packets_before_first_packet" field. + public const int EmitEmptyPacketsBeforeFirstPacketFieldNumber = 2; + private readonly static bool EmitEmptyPacketsBeforeFirstPacketDefaultValue = false; + + private bool emitEmptyPacketsBeforeFirstPacket_; + /// + /// Emits empty packets before the first delayed packet is emitted. Takes + /// effect only when packet offset is set to positive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EmitEmptyPacketsBeforeFirstPacket { + get { if ((_hasBits0 & 2) != 0) { return emitEmptyPacketsBeforeFirstPacket_; } else { return EmitEmptyPacketsBeforeFirstPacketDefaultValue; } } + set { + _hasBits0 |= 2; + emitEmptyPacketsBeforeFirstPacket_ = value; + } + } + /// Gets whether the "emit_empty_packets_before_first_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEmitEmptyPacketsBeforeFirstPacket { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "emit_empty_packets_before_first_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEmitEmptyPacketsBeforeFirstPacket() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SequenceShiftCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SequenceShiftCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (PacketOffset != other.PacketOffset) return false; + if (EmitEmptyPacketsBeforeFirstPacket != other.EmitEmptyPacketsBeforeFirstPacket) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPacketOffset) hash ^= PacketOffset.GetHashCode(); + if (HasEmitEmptyPacketsBeforeFirstPacket) hash ^= EmitEmptyPacketsBeforeFirstPacket.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPacketOffset) { + output.WriteRawTag(8); + output.WriteInt32(PacketOffset); + } + if (HasEmitEmptyPacketsBeforeFirstPacket) { + output.WriteRawTag(16); + output.WriteBool(EmitEmptyPacketsBeforeFirstPacket); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPacketOffset) { + output.WriteRawTag(8); + output.WriteInt32(PacketOffset); + } + if (HasEmitEmptyPacketsBeforeFirstPacket) { + output.WriteRawTag(16); + output.WriteBool(EmitEmptyPacketsBeforeFirstPacket); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPacketOffset) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PacketOffset); + } + if (HasEmitEmptyPacketsBeforeFirstPacket) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SequenceShiftCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasPacketOffset) { + PacketOffset = other.PacketOffset; + } + if (other.HasEmitEmptyPacketsBeforeFirstPacket) { + EmitEmptyPacketsBeforeFirstPacket = other.EmitEmptyPacketsBeforeFirstPacket; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PacketOffset = input.ReadInt32(); + break; + } + case 16: { + EmitEmptyPacketsBeforeFirstPacket = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + PacketOffset = input.ReadInt32(); + break; + } + case 16: { + EmitEmptyPacketsBeforeFirstPacket = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the SequenceShiftCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(107633927, pb::FieldCodec.ForMessage(861071418, global::Mediapipe.SequenceShiftCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs.meta new file mode 100644 index 0000000..43b4ae8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SequenceShiftCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7df2695cc25a7741ebb67a5511e2dabe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs new file mode 100644 index 0000000..a907c67 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs @@ -0,0 +1,615 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/core/split_vector_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/core/split_vector_calculator.proto + public static partial class SplitVectorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/core/split_vector_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SplitVectorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvY29yZS9zcGxpdF92ZWN0b3JfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8iIwoFUmFuZ2USDQoFYmVnaW4YASABKAUSCwoD", + "ZW5kGAIgASgFItQBChxTcGxpdFZlY3RvckNhbGN1bGF0b3JPcHRpb25zEiAK", + "BnJhbmdlcxgBIAMoCzIQLm1lZGlhcGlwZS5SYW5nZRIbCgxlbGVtZW50X29u", + "bHkYAiABKAg6BWZhbHNlEh4KD2NvbWJpbmVfb3V0cHV0cxgDIAEoCDoFZmFs", + "c2UyVQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGI7t2nsg", + "ASgLMicubWVkaWFwaXBlLlNwbGl0VmVjdG9yQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Range), global::Mediapipe.Range.Parser, new[]{ "Begin", "End" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SplitVectorCalculatorOptions), global::Mediapipe.SplitVectorCalculatorOptions.Parser, new[]{ "Ranges", "ElementOnly", "CombineOutputs" }, null, null, new pb::Extension[] { global::Mediapipe.SplitVectorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// A Range {begin, end} specifies beginning ane ending indices to splice a + /// vector. A vector v is spliced to have elements v[begin:(end-1)], i.e., with + /// begin index inclusive and end index exclusive. + /// + public sealed partial class Range : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Range()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SplitVectorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Range() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Range(Range other) : this() { + _hasBits0 = other._hasBits0; + begin_ = other.begin_; + end_ = other.end_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Range Clone() { + return new Range(this); + } + + /// Field number for the "begin" field. + public const int BeginFieldNumber = 1; + private readonly static int BeginDefaultValue = 0; + + private int begin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Begin { + get { if ((_hasBits0 & 1) != 0) { return begin_; } else { return BeginDefaultValue; } } + set { + _hasBits0 |= 1; + begin_ = value; + } + } + /// Gets whether the "begin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBegin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "begin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBegin() { + _hasBits0 &= ~1; + } + + /// Field number for the "end" field. + public const int EndFieldNumber = 2; + private readonly static int EndDefaultValue = 0; + + private int end_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int End { + get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } + set { + _hasBits0 |= 2; + end_ = value; + } + } + /// Gets whether the "end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEnd { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEnd() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Range); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Range other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Begin != other.Begin) return false; + if (End != other.End) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBegin) hash ^= Begin.GetHashCode(); + if (HasEnd) hash ^= End.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBegin) { + output.WriteRawTag(8); + output.WriteInt32(Begin); + } + if (HasEnd) { + output.WriteRawTag(16); + output.WriteInt32(End); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBegin) { + output.WriteRawTag(8); + output.WriteInt32(Begin); + } + if (HasEnd) { + output.WriteRawTag(16); + output.WriteInt32(End); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBegin) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Begin); + } + if (HasEnd) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Range other) { + if (other == null) { + return; + } + if (other.HasBegin) { + Begin = other.Begin; + } + if (other.HasEnd) { + End = other.End; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Begin = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Begin = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SplitVectorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SplitVectorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SplitVectorCalculatorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SplitVectorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SplitVectorCalculatorOptions(SplitVectorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + ranges_ = other.ranges_.Clone(); + elementOnly_ = other.elementOnly_; + combineOutputs_ = other.combineOutputs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SplitVectorCalculatorOptions Clone() { + return new SplitVectorCalculatorOptions(this); + } + + /// Field number for the "ranges" field. + public const int RangesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_ranges_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Range.Parser); + private readonly pbc::RepeatedField ranges_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Ranges { + get { return ranges_; } + } + + /// Field number for the "element_only" field. + public const int ElementOnlyFieldNumber = 2; + private readonly static bool ElementOnlyDefaultValue = false; + + private bool elementOnly_; + /// + /// Specify if single element ranges should be outputted as std::vector<T> or + /// just element of type T. By default, if a range specifies only one element, + /// it is outputted as an std::vector<T>. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ElementOnly { + get { if ((_hasBits0 & 1) != 0) { return elementOnly_; } else { return ElementOnlyDefaultValue; } } + set { + _hasBits0 |= 1; + elementOnly_ = value; + } + } + /// Gets whether the "element_only" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasElementOnly { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "element_only" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearElementOnly() { + _hasBits0 &= ~1; + } + + /// Field number for the "combine_outputs" field. + public const int CombineOutputsFieldNumber = 3; + private readonly static bool CombineOutputsDefaultValue = false; + + private bool combineOutputs_; + /// + /// Combines output elements to one vector. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CombineOutputs { + get { if ((_hasBits0 & 2) != 0) { return combineOutputs_; } else { return CombineOutputsDefaultValue; } } + set { + _hasBits0 |= 2; + combineOutputs_ = value; + } + } + /// Gets whether the "combine_outputs" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCombineOutputs { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "combine_outputs" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCombineOutputs() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SplitVectorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SplitVectorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!ranges_.Equals(other.ranges_)) return false; + if (ElementOnly != other.ElementOnly) return false; + if (CombineOutputs != other.CombineOutputs) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= ranges_.GetHashCode(); + if (HasElementOnly) hash ^= ElementOnly.GetHashCode(); + if (HasCombineOutputs) hash ^= CombineOutputs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + ranges_.WriteTo(output, _repeated_ranges_codec); + if (HasElementOnly) { + output.WriteRawTag(16); + output.WriteBool(ElementOnly); + } + if (HasCombineOutputs) { + output.WriteRawTag(24); + output.WriteBool(CombineOutputs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + ranges_.WriteTo(ref output, _repeated_ranges_codec); + if (HasElementOnly) { + output.WriteRawTag(16); + output.WriteBool(ElementOnly); + } + if (HasCombineOutputs) { + output.WriteRawTag(24); + output.WriteBool(CombineOutputs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += ranges_.CalculateSize(_repeated_ranges_codec); + if (HasElementOnly) { + size += 1 + 1; + } + if (HasCombineOutputs) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SplitVectorCalculatorOptions other) { + if (other == null) { + return; + } + ranges_.Add(other.ranges_); + if (other.HasElementOnly) { + ElementOnly = other.ElementOnly; + } + if (other.HasCombineOutputs) { + CombineOutputs = other.CombineOutputs; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ranges_.AddEntriesFrom(input, _repeated_ranges_codec); + break; + } + case 16: { + ElementOnly = input.ReadBool(); + break; + } + case 24: { + CombineOutputs = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ranges_.AddEntriesFrom(ref input, _repeated_ranges_codec); + break; + } + case 16: { + ElementOnly = input.ReadBool(); + break; + } + case 24: { + CombineOutputs = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the SplitVectorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(259438222, pb::FieldCodec.ForMessage(2075505778, global::Mediapipe.SplitVectorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs.meta new file mode 100644 index 0000000..8ff0e5d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Core/SplitVectorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42c413f9b24c6c63697a6585be7d90ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image.meta new file mode 100644 index 0000000..be32d2a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc9856829bf10e54c80c14a74aa4e3ae +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs new file mode 100644 index 0000000..9a39385 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs @@ -0,0 +1,324 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/bilateral_filter_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/bilateral_filter_calculator.proto + public static partial class BilateralFilterCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/bilateral_filter_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BilateralFilterCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvYmlsYXRlcmFsX2ZpbHRl", + "cl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvY2FsY3VsYXRvci5wcm90byKnAQogQmlsYXRlcmFsRmlsdGVyQ2Fs", + "Y3VsYXRvck9wdGlvbnMSEwoLc2lnbWFfY29sb3IYASABKAISEwoLc2lnbWFf", + "c3BhY2UYAiABKAIyWQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRp", + "b25zGMHv9HkgASgLMisubWVkaWFwaXBlLkJpbGF0ZXJhbEZpbHRlckNhbGN1", + "bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BilateralFilterCalculatorOptions), global::Mediapipe.BilateralFilterCalculatorOptions.Parser, new[]{ "SigmaColor", "SigmaSpace" }, null, null, new pb::Extension[] { global::Mediapipe.BilateralFilterCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class BilateralFilterCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BilateralFilterCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BilateralFilterCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BilateralFilterCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BilateralFilterCalculatorOptions(BilateralFilterCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + sigmaColor_ = other.sigmaColor_; + sigmaSpace_ = other.sigmaSpace_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BilateralFilterCalculatorOptions Clone() { + return new BilateralFilterCalculatorOptions(this); + } + + /// Field number for the "sigma_color" field. + public const int SigmaColorFieldNumber = 1; + private readonly static float SigmaColorDefaultValue = 0F; + + private float sigmaColor_; + /// + /// Max variance in color allowed, based on normalized color values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SigmaColor { + get { if ((_hasBits0 & 1) != 0) { return sigmaColor_; } else { return SigmaColorDefaultValue; } } + set { + _hasBits0 |= 1; + sigmaColor_ = value; + } + } + /// Gets whether the "sigma_color" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSigmaColor { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "sigma_color" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSigmaColor() { + _hasBits0 &= ~1; + } + + /// Field number for the "sigma_space" field. + public const int SigmaSpaceFieldNumber = 2; + private readonly static float SigmaSpaceDefaultValue = 0F; + + private float sigmaSpace_; + /// + /// Window radius. + /// Results in a '(sigma_space*2+1) x (sigma_space*2+1)' size kernel. + /// This should be set based on output image pixel space. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SigmaSpace { + get { if ((_hasBits0 & 2) != 0) { return sigmaSpace_; } else { return SigmaSpaceDefaultValue; } } + set { + _hasBits0 |= 2; + sigmaSpace_ = value; + } + } + /// Gets whether the "sigma_space" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSigmaSpace { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "sigma_space" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSigmaSpace() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BilateralFilterCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BilateralFilterCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SigmaColor, other.SigmaColor)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SigmaSpace, other.SigmaSpace)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasSigmaColor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SigmaColor); + if (HasSigmaSpace) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SigmaSpace); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasSigmaColor) { + output.WriteRawTag(13); + output.WriteFloat(SigmaColor); + } + if (HasSigmaSpace) { + output.WriteRawTag(21); + output.WriteFloat(SigmaSpace); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasSigmaColor) { + output.WriteRawTag(13); + output.WriteFloat(SigmaColor); + } + if (HasSigmaSpace) { + output.WriteRawTag(21); + output.WriteFloat(SigmaSpace); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasSigmaColor) { + size += 1 + 4; + } + if (HasSigmaSpace) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BilateralFilterCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasSigmaColor) { + SigmaColor = other.SigmaColor; + } + if (other.HasSigmaSpace) { + SigmaSpace = other.SigmaSpace; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + SigmaColor = input.ReadFloat(); + break; + } + case 21: { + SigmaSpace = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + SigmaColor = input.ReadFloat(); + break; + } + case 21: { + SigmaSpace = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the BilateralFilterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(255670209, pb::FieldCodec.ForMessage(2045361674, global::Mediapipe.BilateralFilterCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs.meta new file mode 100644 index 0000000..7cacd73 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/BilateralFilterCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae0fb6e19efb6cd89a4b918f64f48880 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs new file mode 100644 index 0000000..e45e52f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs @@ -0,0 +1,433 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/feature_detector_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/feature_detector_calculator.proto + public static partial class FeatureDetectorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/feature_detector_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FeatureDetectorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvZmVhdHVyZV9kZXRlY3Rv", + "cl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvY2FsY3VsYXRvci5wcm90byLkAQogRmVhdHVyZURldGVjdG9yQ2Fs", + "Y3VsYXRvck9wdGlvbnMSFAoMb3V0cHV0X3BhdGNoGAEgASgIEhkKDG1heF9m", + "ZWF0dXJlcxgCIAEoBToDMjAwEhgKDXB5cmFtaWRfbGV2ZWwYAyABKAU6ATQS", + "GQoMc2NhbGVfZmFjdG9yGAQgASgCOgMxLjIyWgoDZXh0EhwubWVkaWFwaXBl", + "LkNhbGN1bGF0b3JPcHRpb25zGLCF9YQBIAEoCzIrLm1lZGlhcGlwZS5GZWF0", + "dXJlRGV0ZWN0b3JDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FeatureDetectorCalculatorOptions), global::Mediapipe.FeatureDetectorCalculatorOptions.Parser, new[]{ "OutputPatch", "MaxFeatures", "PyramidLevel", "ScaleFactor" }, null, null, new pb::Extension[] { global::Mediapipe.FeatureDetectorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FeatureDetectorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeatureDetectorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FeatureDetectorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeatureDetectorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeatureDetectorCalculatorOptions(FeatureDetectorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputPatch_ = other.outputPatch_; + maxFeatures_ = other.maxFeatures_; + pyramidLevel_ = other.pyramidLevel_; + scaleFactor_ = other.scaleFactor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FeatureDetectorCalculatorOptions Clone() { + return new FeatureDetectorCalculatorOptions(this); + } + + /// Field number for the "output_patch" field. + public const int OutputPatchFieldNumber = 1; + private readonly static bool OutputPatchDefaultValue = false; + + private bool outputPatch_; + /// + /// Set to true if output patches, otherwise only output cv::KeyPoint + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputPatch { + get { if ((_hasBits0 & 1) != 0) { return outputPatch_; } else { return OutputPatchDefaultValue; } } + set { + _hasBits0 |= 1; + outputPatch_ = value; + } + } + /// Gets whether the "output_patch" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputPatch { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_patch" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputPatch() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_features" field. + public const int MaxFeaturesFieldNumber = 2; + private readonly static int MaxFeaturesDefaultValue = 200; + + private int maxFeatures_; + /// + /// The max number of detected features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxFeatures { + get { if ((_hasBits0 & 2) != 0) { return maxFeatures_; } else { return MaxFeaturesDefaultValue; } } + set { + _hasBits0 |= 2; + maxFeatures_ = value; + } + } + /// Gets whether the "max_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxFeatures { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxFeatures() { + _hasBits0 &= ~2; + } + + /// Field number for the "pyramid_level" field. + public const int PyramidLevelFieldNumber = 3; + private readonly static int PyramidLevelDefaultValue = 4; + + private int pyramidLevel_; + /// + /// The number of pyramid levels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PyramidLevel { + get { if ((_hasBits0 & 4) != 0) { return pyramidLevel_; } else { return PyramidLevelDefaultValue; } } + set { + _hasBits0 |= 4; + pyramidLevel_ = value; + } + } + /// Gets whether the "pyramid_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPyramidLevel { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "pyramid_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPyramidLevel() { + _hasBits0 &= ~4; + } + + /// Field number for the "scale_factor" field. + public const int ScaleFactorFieldNumber = 4; + private readonly static float ScaleFactorDefaultValue = 1.2F; + + private float scaleFactor_; + /// + /// Pyramid decimation ratio. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ScaleFactor { + get { if ((_hasBits0 & 8) != 0) { return scaleFactor_; } else { return ScaleFactorDefaultValue; } } + set { + _hasBits0 |= 8; + scaleFactor_ = value; + } + } + /// Gets whether the "scale_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleFactor { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "scale_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleFactor() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FeatureDetectorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FeatureDetectorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputPatch != other.OutputPatch) return false; + if (MaxFeatures != other.MaxFeatures) return false; + if (PyramidLevel != other.PyramidLevel) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScaleFactor, other.ScaleFactor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputPatch) hash ^= OutputPatch.GetHashCode(); + if (HasMaxFeatures) hash ^= MaxFeatures.GetHashCode(); + if (HasPyramidLevel) hash ^= PyramidLevel.GetHashCode(); + if (HasScaleFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScaleFactor); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputPatch) { + output.WriteRawTag(8); + output.WriteBool(OutputPatch); + } + if (HasMaxFeatures) { + output.WriteRawTag(16); + output.WriteInt32(MaxFeatures); + } + if (HasPyramidLevel) { + output.WriteRawTag(24); + output.WriteInt32(PyramidLevel); + } + if (HasScaleFactor) { + output.WriteRawTag(37); + output.WriteFloat(ScaleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputPatch) { + output.WriteRawTag(8); + output.WriteBool(OutputPatch); + } + if (HasMaxFeatures) { + output.WriteRawTag(16); + output.WriteInt32(MaxFeatures); + } + if (HasPyramidLevel) { + output.WriteRawTag(24); + output.WriteInt32(PyramidLevel); + } + if (HasScaleFactor) { + output.WriteRawTag(37); + output.WriteFloat(ScaleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputPatch) { + size += 1 + 1; + } + if (HasMaxFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxFeatures); + } + if (HasPyramidLevel) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PyramidLevel); + } + if (HasScaleFactor) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FeatureDetectorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputPatch) { + OutputPatch = other.OutputPatch; + } + if (other.HasMaxFeatures) { + MaxFeatures = other.MaxFeatures; + } + if (other.HasPyramidLevel) { + PyramidLevel = other.PyramidLevel; + } + if (other.HasScaleFactor) { + ScaleFactor = other.ScaleFactor; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputPatch = input.ReadBool(); + break; + } + case 16: { + MaxFeatures = input.ReadInt32(); + break; + } + case 24: { + PyramidLevel = input.ReadInt32(); + break; + } + case 37: { + ScaleFactor = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputPatch = input.ReadBool(); + break; + } + case 16: { + MaxFeatures = input.ReadInt32(); + break; + } + case 24: { + PyramidLevel = input.ReadInt32(); + break; + } + case 37: { + ScaleFactor = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FeatureDetectorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(278741680, pb::FieldCodec.ForMessage(2229933442, global::Mediapipe.FeatureDetectorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs.meta new file mode 100644 index 0000000..5dd1ea1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/FeatureDetectorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1205294725c4a1f6899f24cabc079e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs new file mode 100644 index 0000000..ed5821d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs @@ -0,0 +1,266 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/image_clone_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/image_clone_calculator.proto + public static partial class ImageCloneCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/image_clone_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageCloneCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvaW1hZ2VfY2xvbmVfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8ikgEKG0ltYWdlQ2xvbmVDYWxjdWxhdG9yT3B0", + "aW9ucxIcCg1vdXRwdXRfb25fZ3B1GAEgASgIOgVmYWxzZTJVCgNleHQSHC5t", + "ZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYxubgsQEgASgLMiYubWVkaWFw", + "aXBlLkltYWdlQ2xvbmVDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageCloneCalculatorOptions), global::Mediapipe.ImageCloneCalculatorOptions.Parser, new[]{ "OutputOnGpu" }, null, null, new pb::Extension[] { global::Mediapipe.ImageCloneCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ImageCloneCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageCloneCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageCloneCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCloneCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCloneCalculatorOptions(ImageCloneCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputOnGpu_ = other.outputOnGpu_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCloneCalculatorOptions Clone() { + return new ImageCloneCalculatorOptions(this); + } + + /// Field number for the "output_on_gpu" field. + public const int OutputOnGpuFieldNumber = 1; + private readonly static bool OutputOnGpuDefaultValue = false; + + private bool outputOnGpu_; + /// + /// Whether the output clone should have pixel data already available on GPU. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputOnGpu { + get { if ((_hasBits0 & 1) != 0) { return outputOnGpu_; } else { return OutputOnGpuDefaultValue; } } + set { + _hasBits0 |= 1; + outputOnGpu_ = value; + } + } + /// Gets whether the "output_on_gpu" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputOnGpu { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_on_gpu" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputOnGpu() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageCloneCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageCloneCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputOnGpu != other.OutputOnGpu) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputOnGpu) hash ^= OutputOnGpu.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputOnGpu) { + output.WriteRawTag(8); + output.WriteBool(OutputOnGpu); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputOnGpu) { + output.WriteRawTag(8); + output.WriteBool(OutputOnGpu); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputOnGpu) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageCloneCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputOnGpu) { + OutputOnGpu = other.OutputOnGpu; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputOnGpu = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputOnGpu = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the ImageCloneCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(372781894, pb::FieldCodec.ForMessage(2982255154, global::Mediapipe.ImageCloneCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs.meta new file mode 100644 index 0000000..a3a4622 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCloneCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f92c3cfedbfa9983186e6c08f78d206b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs new file mode 100644 index 0000000..22dd237 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs @@ -0,0 +1,780 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/image_cropping_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/image_cropping_calculator.proto + public static partial class ImageCroppingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/image_cropping_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageCroppingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjttZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvaW1hZ2VfY3JvcHBpbmdf", + "Y2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3", + "b3JrL2NhbGN1bGF0b3IucHJvdG8i5AMKHkltYWdlQ3JvcHBpbmdDYWxjdWxh", + "dG9yT3B0aW9ucxINCgV3aWR0aBgBIAEoBRIOCgZoZWlnaHQYAiABKAUSEwoI", + "cm90YXRpb24YAyABKAI6ATASEgoKbm9ybV93aWR0aBgEIAEoAhITCgtub3Jt", + "X2hlaWdodBgFIAEoAhIYCg1ub3JtX2NlbnRlcl94GAYgASgCOgEwEhgKDW5v", + "cm1fY2VudGVyX3kYByABKAI6ATASVgoLYm9yZGVyX21vZGUYCCABKA4yNC5t", + "ZWRpYXBpcGUuSW1hZ2VDcm9wcGluZ0NhbGN1bGF0b3JPcHRpb25zLkJvcmRl", + "ck1vZGU6C0JPUkRFUl9aRVJPEhgKEG91dHB1dF9tYXhfd2lkdGgYCSABKAUS", + "GQoRb3V0cHV0X21heF9oZWlnaHQYCiABKAUiSwoKQm9yZGVyTW9kZRIWChJC", + "T1JERVJfVU5TUEVDSUZJRUQQABIPCgtCT1JERVJfWkVSTxABEhQKEEJPUkRF", + "Ul9SRVBMSUNBVEUQAjJXCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9w", + "dGlvbnMY39aTfSABKAsyKS5tZWRpYXBpcGUuSW1hZ2VDcm9wcGluZ0NhbGN1", + "bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageCroppingCalculatorOptions), global::Mediapipe.ImageCroppingCalculatorOptions.Parser, new[]{ "Width", "Height", "Rotation", "NormWidth", "NormHeight", "NormCenterX", "NormCenterY", "BorderMode", "OutputMaxWidth", "OutputMaxHeight" }, null, new[]{ typeof(global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode) }, new pb::Extension[] { global::Mediapipe.ImageCroppingCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ImageCroppingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageCroppingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageCroppingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCroppingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCroppingCalculatorOptions(ImageCroppingCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + width_ = other.width_; + height_ = other.height_; + rotation_ = other.rotation_; + normWidth_ = other.normWidth_; + normHeight_ = other.normHeight_; + normCenterX_ = other.normCenterX_; + normCenterY_ = other.normCenterY_; + borderMode_ = other.borderMode_; + outputMaxWidth_ = other.outputMaxWidth_; + outputMaxHeight_ = other.outputMaxHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageCroppingCalculatorOptions Clone() { + return new ImageCroppingCalculatorOptions(this); + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 1; + private readonly static int WidthDefaultValue = 0; + + private int width_; + /// + /// Output texture buffer dimensions. The values defined in the options will be + /// overriden by the WIDTH and HEIGHT input streams if they exist. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 1) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 1; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 2; + private readonly static int HeightDefaultValue = 0; + + private int height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 2) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 2; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 3; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// Rotation angle is counter-clockwise in radian. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 4) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 4; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~4; + } + + /// Field number for the "norm_width" field. + public const int NormWidthFieldNumber = 4; + private readonly static float NormWidthDefaultValue = 0F; + + private float normWidth_; + /// + /// Normalized width and height of the output rect. Value is within [0, 1]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormWidth { + get { if ((_hasBits0 & 8) != 0) { return normWidth_; } else { return NormWidthDefaultValue; } } + set { + _hasBits0 |= 8; + normWidth_ = value; + } + } + /// Gets whether the "norm_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormWidth { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "norm_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormWidth() { + _hasBits0 &= ~8; + } + + /// Field number for the "norm_height" field. + public const int NormHeightFieldNumber = 5; + private readonly static float NormHeightDefaultValue = 0F; + + private float normHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormHeight { + get { if ((_hasBits0 & 16) != 0) { return normHeight_; } else { return NormHeightDefaultValue; } } + set { + _hasBits0 |= 16; + normHeight_ = value; + } + } + /// Gets whether the "norm_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormHeight { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "norm_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormHeight() { + _hasBits0 &= ~16; + } + + /// Field number for the "norm_center_x" field. + public const int NormCenterXFieldNumber = 6; + private readonly static float NormCenterXDefaultValue = 0F; + + private float normCenterX_; + /// + /// Normalized location of the center of the output + /// rectangle in image coordinates. Value is within [0, 1]. + /// The (0, 0) point is at the (top, left) corner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormCenterX { + get { if ((_hasBits0 & 32) != 0) { return normCenterX_; } else { return NormCenterXDefaultValue; } } + set { + _hasBits0 |= 32; + normCenterX_ = value; + } + } + /// Gets whether the "norm_center_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormCenterX { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "norm_center_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormCenterX() { + _hasBits0 &= ~32; + } + + /// Field number for the "norm_center_y" field. + public const int NormCenterYFieldNumber = 7; + private readonly static float NormCenterYDefaultValue = 0F; + + private float normCenterY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormCenterY { + get { if ((_hasBits0 & 64) != 0) { return normCenterY_; } else { return NormCenterYDefaultValue; } } + set { + _hasBits0 |= 64; + normCenterY_ = value; + } + } + /// Gets whether the "norm_center_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormCenterY { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "norm_center_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormCenterY() { + _hasBits0 &= ~64; + } + + /// Field number for the "border_mode" field. + public const int BorderModeFieldNumber = 8; + private readonly static global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode BorderModeDefaultValue = global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode.BorderZero; + + private global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode borderMode_; + /// + /// Specifies behaviour for crops that go beyond image borders. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode BorderMode { + get { if ((_hasBits0 & 128) != 0) { return borderMode_; } else { return BorderModeDefaultValue; } } + set { + _hasBits0 |= 128; + borderMode_ = value; + } + } + /// Gets whether the "border_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBorderMode { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "border_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBorderMode() { + _hasBits0 &= ~128; + } + + /// Field number for the "output_max_width" field. + public const int OutputMaxWidthFieldNumber = 9; + private readonly static int OutputMaxWidthDefaultValue = 0; + + private int outputMaxWidth_; + /// + /// Specifies limits for the size of the output image. It will be scaled down, + /// preserving ratio, to fit within. These do not change which area of the + /// input is selected for cropping. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputMaxWidth { + get { if ((_hasBits0 & 256) != 0) { return outputMaxWidth_; } else { return OutputMaxWidthDefaultValue; } } + set { + _hasBits0 |= 256; + outputMaxWidth_ = value; + } + } + /// Gets whether the "output_max_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputMaxWidth { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "output_max_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputMaxWidth() { + _hasBits0 &= ~256; + } + + /// Field number for the "output_max_height" field. + public const int OutputMaxHeightFieldNumber = 10; + private readonly static int OutputMaxHeightDefaultValue = 0; + + private int outputMaxHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputMaxHeight { + get { if ((_hasBits0 & 512) != 0) { return outputMaxHeight_; } else { return OutputMaxHeightDefaultValue; } } + set { + _hasBits0 |= 512; + outputMaxHeight_ = value; + } + } + /// Gets whether the "output_max_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputMaxHeight { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "output_max_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputMaxHeight() { + _hasBits0 &= ~512; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageCroppingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageCroppingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Width != other.Width) return false; + if (Height != other.Height) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormWidth, other.NormWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormHeight, other.NormHeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormCenterX, other.NormCenterX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormCenterY, other.NormCenterY)) return false; + if (BorderMode != other.BorderMode) return false; + if (OutputMaxWidth != other.OutputMaxWidth) return false; + if (OutputMaxHeight != other.OutputMaxHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (HasNormWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormWidth); + if (HasNormHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormHeight); + if (HasNormCenterX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormCenterX); + if (HasNormCenterY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormCenterY); + if (HasBorderMode) hash ^= BorderMode.GetHashCode(); + if (HasOutputMaxWidth) hash ^= OutputMaxWidth.GetHashCode(); + if (HasOutputMaxHeight) hash ^= OutputMaxHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (HasRotation) { + output.WriteRawTag(29); + output.WriteFloat(Rotation); + } + if (HasNormWidth) { + output.WriteRawTag(37); + output.WriteFloat(NormWidth); + } + if (HasNormHeight) { + output.WriteRawTag(45); + output.WriteFloat(NormHeight); + } + if (HasNormCenterX) { + output.WriteRawTag(53); + output.WriteFloat(NormCenterX); + } + if (HasNormCenterY) { + output.WriteRawTag(61); + output.WriteFloat(NormCenterY); + } + if (HasBorderMode) { + output.WriteRawTag(64); + output.WriteEnum((int) BorderMode); + } + if (HasOutputMaxWidth) { + output.WriteRawTag(72); + output.WriteInt32(OutputMaxWidth); + } + if (HasOutputMaxHeight) { + output.WriteRawTag(80); + output.WriteInt32(OutputMaxHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (HasRotation) { + output.WriteRawTag(29); + output.WriteFloat(Rotation); + } + if (HasNormWidth) { + output.WriteRawTag(37); + output.WriteFloat(NormWidth); + } + if (HasNormHeight) { + output.WriteRawTag(45); + output.WriteFloat(NormHeight); + } + if (HasNormCenterX) { + output.WriteRawTag(53); + output.WriteFloat(NormCenterX); + } + if (HasNormCenterY) { + output.WriteRawTag(61); + output.WriteFloat(NormCenterY); + } + if (HasBorderMode) { + output.WriteRawTag(64); + output.WriteEnum((int) BorderMode); + } + if (HasOutputMaxWidth) { + output.WriteRawTag(72); + output.WriteInt32(OutputMaxWidth); + } + if (HasOutputMaxHeight) { + output.WriteRawTag(80); + output.WriteInt32(OutputMaxHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (HasRotation) { + size += 1 + 4; + } + if (HasNormWidth) { + size += 1 + 4; + } + if (HasNormHeight) { + size += 1 + 4; + } + if (HasNormCenterX) { + size += 1 + 4; + } + if (HasNormCenterY) { + size += 1 + 4; + } + if (HasBorderMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) BorderMode); + } + if (HasOutputMaxWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputMaxWidth); + } + if (HasOutputMaxHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputMaxHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageCroppingCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasNormWidth) { + NormWidth = other.NormWidth; + } + if (other.HasNormHeight) { + NormHeight = other.NormHeight; + } + if (other.HasNormCenterX) { + NormCenterX = other.NormCenterX; + } + if (other.HasNormCenterY) { + NormCenterY = other.NormCenterY; + } + if (other.HasBorderMode) { + BorderMode = other.BorderMode; + } + if (other.HasOutputMaxWidth) { + OutputMaxWidth = other.OutputMaxWidth; + } + if (other.HasOutputMaxHeight) { + OutputMaxHeight = other.OutputMaxHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 29: { + Rotation = input.ReadFloat(); + break; + } + case 37: { + NormWidth = input.ReadFloat(); + break; + } + case 45: { + NormHeight = input.ReadFloat(); + break; + } + case 53: { + NormCenterX = input.ReadFloat(); + break; + } + case 61: { + NormCenterY = input.ReadFloat(); + break; + } + case 64: { + BorderMode = (global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 72: { + OutputMaxWidth = input.ReadInt32(); + break; + } + case 80: { + OutputMaxHeight = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 29: { + Rotation = input.ReadFloat(); + break; + } + case 37: { + NormWidth = input.ReadFloat(); + break; + } + case 45: { + NormHeight = input.ReadFloat(); + break; + } + case 53: { + NormCenterX = input.ReadFloat(); + break; + } + case 61: { + NormCenterY = input.ReadFloat(); + break; + } + case 64: { + BorderMode = (global::Mediapipe.ImageCroppingCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 72: { + OutputMaxWidth = input.ReadInt32(); + break; + } + case 80: { + OutputMaxHeight = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ImageCroppingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum BorderMode { + /// + /// First unspecified value is required by the guideline. See details here: + /// https://developers.google.com/protocol-buffers/docs/style#enums + /// + [pbr::OriginalName("BORDER_UNSPECIFIED")] BorderUnspecified = 0, + [pbr::OriginalName("BORDER_ZERO")] BorderZero = 1, + [pbr::OriginalName("BORDER_REPLICATE")] BorderReplicate = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the ImageCroppingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(262466399, pb::FieldCodec.ForMessage(2099731194, global::Mediapipe.ImageCroppingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs.meta new file mode 100644 index 0000000..6ed54cd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageCroppingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a13242744088532bda684750c576515a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs new file mode 100644 index 0000000..fde8655 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs @@ -0,0 +1,602 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/image_transformation_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/image_transformation_calculator.proto + public static partial class ImageTransformationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/image_transformation_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageTransformationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvaW1hZ2VfdHJhbnNmb3Jt", + "YXRpb25fY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGi9tZWRpYXBpcGUv", + "Y2FsY3VsYXRvcnMvaW1hZ2Uvcm90YXRpb25fbW9kZS5wcm90bxokbWVkaWFw", + "aXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvGh5tZWRpYXBpcGUvZ3B1", + "L3NjYWxlX21vZGUucHJvdG8i/gIKJEltYWdlVHJhbnNmb3JtYXRpb25DYWxj", + "dWxhdG9yT3B0aW9ucxIXCgxvdXRwdXRfd2lkdGgYASABKAU6ATASGAoNb3V0", + "cHV0X2hlaWdodBgCIAEoBToBMBIzCg1yb3RhdGlvbl9tb2RlGAMgASgOMhwu", + "bWVkaWFwaXBlLlJvdGF0aW9uTW9kZS5Nb2RlEh4KD2ZsaXBfdmVydGljYWxs", + "eRgEIAEoCDoFZmFsc2USIAoRZmxpcF9ob3Jpem9udGFsbHkYBSABKAg6BWZh", + "bHNlEi0KCnNjYWxlX21vZGUYBiABKA4yGS5tZWRpYXBpcGUuU2NhbGVNb2Rl", + "Lk1vZGUSHgoQY29uc3RhbnRfcGFkZGluZxgHIAEoCDoEdHJ1ZTJdCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYvv2ReCABKAsyLy5tZWRp", + "YXBpcGUuSW1hZ2VUcmFuc2Zvcm1hdGlvbkNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.RotationModeReflection.Descriptor, global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ScaleModeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageTransformationCalculatorOptions), global::Mediapipe.ImageTransformationCalculatorOptions.Parser, new[]{ "OutputWidth", "OutputHeight", "RotationMode", "FlipVertically", "FlipHorizontally", "ScaleMode", "ConstantPadding" }, null, null, new pb::Extension[] { global::Mediapipe.ImageTransformationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ImageTransformationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageTransformationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageTransformationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageTransformationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageTransformationCalculatorOptions(ImageTransformationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputWidth_ = other.outputWidth_; + outputHeight_ = other.outputHeight_; + rotationMode_ = other.rotationMode_; + flipVertically_ = other.flipVertically_; + flipHorizontally_ = other.flipHorizontally_; + scaleMode_ = other.scaleMode_; + constantPadding_ = other.constantPadding_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageTransformationCalculatorOptions Clone() { + return new ImageTransformationCalculatorOptions(this); + } + + /// Field number for the "output_width" field. + public const int OutputWidthFieldNumber = 1; + private readonly static int OutputWidthDefaultValue = 0; + + private int outputWidth_; + /// + /// Output dimensions. Set to 0 if they should be the same as the input. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputWidth { + get { if ((_hasBits0 & 1) != 0) { return outputWidth_; } else { return OutputWidthDefaultValue; } } + set { + _hasBits0 |= 1; + outputWidth_ = value; + } + } + /// Gets whether the "output_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "output_height" field. + public const int OutputHeightFieldNumber = 2; + private readonly static int OutputHeightDefaultValue = 0; + + private int outputHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputHeight { + get { if ((_hasBits0 & 2) != 0) { return outputHeight_; } else { return OutputHeightDefaultValue; } } + set { + _hasBits0 |= 2; + outputHeight_ = value; + } + } + /// Gets whether the "output_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "output_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "rotation_mode" field. + public const int RotationModeFieldNumber = 3; + private readonly static global::Mediapipe.RotationMode.Types.Mode RotationModeDefaultValue = global::Mediapipe.RotationMode.Types.Mode.Unknown; + + private global::Mediapipe.RotationMode.Types.Mode rotationMode_; + /// + /// Counterclockwise rotation mode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RotationMode.Types.Mode RotationMode { + get { if ((_hasBits0 & 4) != 0) { return rotationMode_; } else { return RotationModeDefaultValue; } } + set { + _hasBits0 |= 4; + rotationMode_ = value; + } + } + /// Gets whether the "rotation_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationMode { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "rotation_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationMode() { + _hasBits0 &= ~4; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 4; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Vertical flipping, applied after rotation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 8) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 8; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~8; + } + + /// Field number for the "flip_horizontally" field. + public const int FlipHorizontallyFieldNumber = 5; + private readonly static bool FlipHorizontallyDefaultValue = false; + + private bool flipHorizontally_; + /// + /// Horizontal flipping, applied after rotation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipHorizontally { + get { if ((_hasBits0 & 16) != 0) { return flipHorizontally_; } else { return FlipHorizontallyDefaultValue; } } + set { + _hasBits0 |= 16; + flipHorizontally_ = value; + } + } + /// Gets whether the "flip_horizontally" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipHorizontally { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "flip_horizontally" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipHorizontally() { + _hasBits0 &= ~16; + } + + /// Field number for the "scale_mode" field. + public const int ScaleModeFieldNumber = 6; + private readonly static global::Mediapipe.ScaleMode.Types.Mode ScaleModeDefaultValue = global::Mediapipe.ScaleMode.Types.Mode.Default; + + private global::Mediapipe.ScaleMode.Types.Mode scaleMode_; + /// + /// Scale mode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ScaleMode.Types.Mode ScaleMode { + get { if ((_hasBits0 & 32) != 0) { return scaleMode_; } else { return ScaleModeDefaultValue; } } + set { + _hasBits0 |= 32; + scaleMode_ = value; + } + } + /// Gets whether the "scale_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleMode { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "scale_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleMode() { + _hasBits0 &= ~32; + } + + /// Field number for the "constant_padding" field. + public const int ConstantPaddingFieldNumber = 7; + private readonly static bool ConstantPaddingDefaultValue = true; + + private bool constantPadding_; + /// + /// Padding type. This option is only used when the scale mode is FIT. + /// Default is to use BORDER_CONSTANT. If set to false, it will use + /// BORDER_REPLICATE instead. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ConstantPadding { + get { if ((_hasBits0 & 64) != 0) { return constantPadding_; } else { return ConstantPaddingDefaultValue; } } + set { + _hasBits0 |= 64; + constantPadding_ = value; + } + } + /// Gets whether the "constant_padding" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasConstantPadding { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "constant_padding" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearConstantPadding() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageTransformationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageTransformationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputWidth != other.OutputWidth) return false; + if (OutputHeight != other.OutputHeight) return false; + if (RotationMode != other.RotationMode) return false; + if (FlipVertically != other.FlipVertically) return false; + if (FlipHorizontally != other.FlipHorizontally) return false; + if (ScaleMode != other.ScaleMode) return false; + if (ConstantPadding != other.ConstantPadding) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputWidth) hash ^= OutputWidth.GetHashCode(); + if (HasOutputHeight) hash ^= OutputHeight.GetHashCode(); + if (HasRotationMode) hash ^= RotationMode.GetHashCode(); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasFlipHorizontally) hash ^= FlipHorizontally.GetHashCode(); + if (HasScaleMode) hash ^= ScaleMode.GetHashCode(); + if (HasConstantPadding) hash ^= ConstantPadding.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputWidth); + } + if (HasOutputHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputHeight); + } + if (HasRotationMode) { + output.WriteRawTag(24); + output.WriteEnum((int) RotationMode); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasFlipHorizontally) { + output.WriteRawTag(40); + output.WriteBool(FlipHorizontally); + } + if (HasScaleMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ScaleMode); + } + if (HasConstantPadding) { + output.WriteRawTag(56); + output.WriteBool(ConstantPadding); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputWidth); + } + if (HasOutputHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputHeight); + } + if (HasRotationMode) { + output.WriteRawTag(24); + output.WriteEnum((int) RotationMode); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasFlipHorizontally) { + output.WriteRawTag(40); + output.WriteBool(FlipHorizontally); + } + if (HasScaleMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ScaleMode); + } + if (HasConstantPadding) { + output.WriteRawTag(56); + output.WriteBool(ConstantPadding); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputWidth); + } + if (HasOutputHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputHeight); + } + if (HasRotationMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RotationMode); + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (HasFlipHorizontally) { + size += 1 + 1; + } + if (HasScaleMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ScaleMode); + } + if (HasConstantPadding) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageTransformationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputWidth) { + OutputWidth = other.OutputWidth; + } + if (other.HasOutputHeight) { + OutputHeight = other.OutputHeight; + } + if (other.HasRotationMode) { + RotationMode = other.RotationMode; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasFlipHorizontally) { + FlipHorizontally = other.FlipHorizontally; + } + if (other.HasScaleMode) { + ScaleMode = other.ScaleMode; + } + if (other.HasConstantPadding) { + ConstantPadding = other.ConstantPadding; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputWidth = input.ReadInt32(); + break; + } + case 16: { + OutputHeight = input.ReadInt32(); + break; + } + case 24: { + RotationMode = (global::Mediapipe.RotationMode.Types.Mode) input.ReadEnum(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 40: { + FlipHorizontally = input.ReadBool(); + break; + } + case 48: { + ScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + case 56: { + ConstantPadding = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputWidth = input.ReadInt32(); + break; + } + case 16: { + OutputHeight = input.ReadInt32(); + break; + } + case 24: { + RotationMode = (global::Mediapipe.RotationMode.Types.Mode) input.ReadEnum(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 40: { + FlipHorizontally = input.ReadBool(); + break; + } + case 48: { + ScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + case 56: { + ConstantPadding = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the ImageTransformationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(251952830, pb::FieldCodec.ForMessage(2015622642, global::Mediapipe.ImageTransformationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs.meta new file mode 100644 index 0000000..d1fd658 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ImageTransformationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71cbf43c2d9742dd5bdc4cc767a65e27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs new file mode 100644 index 0000000..c936de8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs @@ -0,0 +1,282 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/mask_overlay_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/mask_overlay_calculator.proto + public static partial class MaskOverlayCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/mask_overlay_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MaskOverlayCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvbWFza19vdmVybGF5X2Nh", + "bGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9jYWxjdWxhdG9yLnByb3RvIvUBChxNYXNrT3ZlcmxheUNhbGN1bGF0b3JP", + "cHRpb25zEk4KDG1hc2tfY2hhbm5lbBgBIAEoDjIzLm1lZGlhcGlwZS5NYXNr", + "T3ZlcmxheUNhbGN1bGF0b3JPcHRpb25zLk1hc2tDaGFubmVsOgNSRUQiLgoL", + "TWFza0NoYW5uZWwSCwoHVU5LTk9XThAAEgcKA1JFRBABEgkKBUFMUEhBEAIy", + "VQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGILgnHggASgL", + "MicubWVkaWFwaXBlLk1hc2tPdmVybGF5Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MaskOverlayCalculatorOptions), global::Mediapipe.MaskOverlayCalculatorOptions.Parser, new[]{ "MaskChannel" }, null, new[]{ typeof(global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel) }, new pb::Extension[] { global::Mediapipe.MaskOverlayCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class MaskOverlayCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MaskOverlayCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MaskOverlayCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MaskOverlayCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MaskOverlayCalculatorOptions(MaskOverlayCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maskChannel_ = other.maskChannel_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MaskOverlayCalculatorOptions Clone() { + return new MaskOverlayCalculatorOptions(this); + } + + /// Field number for the "mask_channel" field. + public const int MaskChannelFieldNumber = 1; + private readonly static global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel MaskChannelDefaultValue = global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel.Red; + + private global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel maskChannel_; + /// + /// Selects which channel of the MASK input to use for masking. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel MaskChannel { + get { if ((_hasBits0 & 1) != 0) { return maskChannel_; } else { return MaskChannelDefaultValue; } } + set { + _hasBits0 |= 1; + maskChannel_ = value; + } + } + /// Gets whether the "mask_channel" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaskChannel { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "mask_channel" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaskChannel() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MaskOverlayCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MaskOverlayCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MaskChannel != other.MaskChannel) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaskChannel) hash ^= MaskChannel.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaskChannel) { + output.WriteRawTag(8); + output.WriteEnum((int) MaskChannel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaskChannel) { + output.WriteRawTag(8); + output.WriteEnum((int) MaskChannel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaskChannel) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MaskChannel); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MaskOverlayCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaskChannel) { + MaskChannel = other.MaskChannel; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MaskChannel = (global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MaskChannel = (global::Mediapipe.MaskOverlayCalculatorOptions.Types.MaskChannel) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MaskOverlayCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum MaskChannel { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("RED")] Red = 1, + [pbr::OriginalName("ALPHA")] Alpha = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the MaskOverlayCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(252129282, pb::FieldCodec.ForMessage(2017034258, global::Mediapipe.MaskOverlayCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs.meta new file mode 100644 index 0000000..91bd03c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/MaskOverlayCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93fc4fccc95d0e2309b17186e3a78f13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs new file mode 100644 index 0000000..2628031 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs @@ -0,0 +1,270 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/opencv_encoded_image_to_image_frame_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/opencv_encoded_image_to_image_frame_calculator.proto + public static partial class OpencvEncodedImageToImageFrameCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/opencv_encoded_image_to_image_frame_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OpencvEncodedImageToImageFrameCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ClBtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvb3BlbmN2X2VuY29kZWRf", + "aW1hZ2VfdG9faW1hZ2VfZnJhbWVfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFw", + "aXBlGiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8izQEK", + "L09wZW5DdkVuY29kZWRJbWFnZVRvSW1hZ2VGcmFtZUNhbGN1bGF0b3JPcHRp", + "b25zEi8KIGFwcGx5X29yaWVudGF0aW9uX2Zyb21fZXhpZl9kYXRhGAEgASgI", + "OgVmYWxzZTJpCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY", + "jPrYkAEgASgLMjoubWVkaWFwaXBlLk9wZW5DdkVuY29kZWRJbWFnZVRvSW1h", + "Z2VGcmFtZUNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OpenCvEncodedImageToImageFrameCalculatorOptions), global::Mediapipe.OpenCvEncodedImageToImageFrameCalculatorOptions.Parser, new[]{ "ApplyOrientationFromExifData" }, null, null, new pb::Extension[] { global::Mediapipe.OpenCvEncodedImageToImageFrameCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OpenCvEncodedImageToImageFrameCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OpenCvEncodedImageToImageFrameCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.OpencvEncodedImageToImageFrameCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvEncodedImageToImageFrameCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvEncodedImageToImageFrameCalculatorOptions(OpenCvEncodedImageToImageFrameCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + applyOrientationFromExifData_ = other.applyOrientationFromExifData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvEncodedImageToImageFrameCalculatorOptions Clone() { + return new OpenCvEncodedImageToImageFrameCalculatorOptions(this); + } + + /// Field number for the "apply_orientation_from_exif_data" field. + public const int ApplyOrientationFromExifDataFieldNumber = 1; + private readonly static bool ApplyOrientationFromExifDataDefaultValue = false; + + private bool applyOrientationFromExifData_; + /// + /// If set, we will attempt to automatically apply the orientation specified by + /// the image's EXIF data when loading the image. Otherwise, the image data + /// will be loaded as-is. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ApplyOrientationFromExifData { + get { if ((_hasBits0 & 1) != 0) { return applyOrientationFromExifData_; } else { return ApplyOrientationFromExifDataDefaultValue; } } + set { + _hasBits0 |= 1; + applyOrientationFromExifData_ = value; + } + } + /// Gets whether the "apply_orientation_from_exif_data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasApplyOrientationFromExifData { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "apply_orientation_from_exif_data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearApplyOrientationFromExifData() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OpenCvEncodedImageToImageFrameCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OpenCvEncodedImageToImageFrameCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ApplyOrientationFromExifData != other.ApplyOrientationFromExifData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasApplyOrientationFromExifData) hash ^= ApplyOrientationFromExifData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasApplyOrientationFromExifData) { + output.WriteRawTag(8); + output.WriteBool(ApplyOrientationFromExifData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasApplyOrientationFromExifData) { + output.WriteRawTag(8); + output.WriteBool(ApplyOrientationFromExifData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasApplyOrientationFromExifData) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OpenCvEncodedImageToImageFrameCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasApplyOrientationFromExifData) { + ApplyOrientationFromExifData = other.ApplyOrientationFromExifData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ApplyOrientationFromExifData = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ApplyOrientationFromExifData = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the OpenCvEncodedImageToImageFrameCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(303447308, pb::FieldCodec.ForMessage(2427578466, global::Mediapipe.OpenCvEncodedImageToImageFrameCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs.meta new file mode 100644 index 0000000..9cc26e6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvEncodedImageToImageFrameCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f36ff1b55f4876f6299dc7fb94d67ad4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs new file mode 100644 index 0000000..496e46a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs @@ -0,0 +1,662 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/opencv_image_encoder_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/opencv_image_encoder_calculator.proto + public static partial class OpencvImageEncoderCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/opencv_image_encoder_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OpencvImageEncoderCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvb3BlbmN2X2ltYWdlX2Vu", + "Y29kZXJfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ilAEKI09wZW5DdkltYWdlRW5j", + "b2RlckNhbGN1bGF0b3JPcHRpb25zEg8KB3F1YWxpdHkYASABKAUyXAoDZXh0", + "EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGP6wwWwgASgLMi4ubWVk", + "aWFwaXBlLk9wZW5DdkltYWdlRW5jb2RlckNhbGN1bGF0b3JPcHRpb25zIt0B", + "CiNPcGVuQ3ZJbWFnZUVuY29kZXJDYWxjdWxhdG9yUmVzdWx0cxIVCg1lbmNv", + "ZGVkX2ltYWdlGAEgASgMEg4KBmhlaWdodBgCIAEoBRINCgV3aWR0aBgDIAEo", + "BRJNCgpjb2xvcnNwYWNlGAQgASgOMjkubWVkaWFwaXBlLk9wZW5DdkltYWdl", + "RW5jb2RlckNhbGN1bGF0b3JSZXN1bHRzLkNvbG9yU3BhY2UiMQoKQ29sb3JT", + "cGFjZRILCgdVTktOT1dOEAASDQoJR1JBWVNDQUxFEAESBwoDUkdCEAI=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OpenCvImageEncoderCalculatorOptions), global::Mediapipe.OpenCvImageEncoderCalculatorOptions.Parser, new[]{ "Quality" }, null, null, new pb::Extension[] { global::Mediapipe.OpenCvImageEncoderCalculatorOptions.Extensions.Ext }, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OpenCvImageEncoderCalculatorResults), global::Mediapipe.OpenCvImageEncoderCalculatorResults.Parser, new[]{ "EncodedImage", "Height", "Width", "Colorspace" }, null, new[]{ typeof(global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace) }, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OpenCvImageEncoderCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OpenCvImageEncoderCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.OpencvImageEncoderCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorOptions(OpenCvImageEncoderCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + quality_ = other.quality_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorOptions Clone() { + return new OpenCvImageEncoderCalculatorOptions(this); + } + + /// Field number for the "quality" field. + public const int QualityFieldNumber = 1; + private readonly static int QualityDefaultValue = 0; + + private int quality_; + /// + /// Quality of the encoding. An integer between (0, 100]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Quality { + get { if ((_hasBits0 & 1) != 0) { return quality_; } else { return QualityDefaultValue; } } + set { + _hasBits0 |= 1; + quality_ = value; + } + } + /// Gets whether the "quality" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasQuality { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "quality" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearQuality() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OpenCvImageEncoderCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OpenCvImageEncoderCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Quality != other.Quality) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasQuality) hash ^= Quality.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasQuality) { + output.WriteRawTag(8); + output.WriteInt32(Quality); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasQuality) { + output.WriteRawTag(8); + output.WriteInt32(Quality); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasQuality) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Quality); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OpenCvImageEncoderCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasQuality) { + Quality = other.Quality; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Quality = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Quality = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the OpenCvImageEncoderCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(227563646, pb::FieldCodec.ForMessage(1820509170, global::Mediapipe.OpenCvImageEncoderCalculatorOptions.Parser)); + } + #endregion + + } + + /// + /// TODO: Consider renaming it to EncodedImage. + /// + public sealed partial class OpenCvImageEncoderCalculatorResults : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OpenCvImageEncoderCalculatorResults()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.OpencvImageEncoderCalculatorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorResults() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorResults(OpenCvImageEncoderCalculatorResults other) : this() { + _hasBits0 = other._hasBits0; + encodedImage_ = other.encodedImage_; + height_ = other.height_; + width_ = other.width_; + colorspace_ = other.colorspace_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvImageEncoderCalculatorResults Clone() { + return new OpenCvImageEncoderCalculatorResults(this); + } + + /// Field number for the "encoded_image" field. + public const int EncodedImageFieldNumber = 1; + private readonly static pb::ByteString EncodedImageDefaultValue = pb::ByteString.Empty; + + private pb::ByteString encodedImage_; + /// + /// Pixel data encoded as JPEG. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString EncodedImage { + get { return encodedImage_ ?? EncodedImageDefaultValue; } + set { + encodedImage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "encoded_image" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEncodedImage { + get { return encodedImage_ != null; } + } + /// Clears the value of the "encoded_image" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEncodedImage() { + encodedImage_ = null; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 2; + private readonly static int HeightDefaultValue = 0; + + private int height_; + /// + /// Height of the image data under #1 once decoded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 1) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 1; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~1; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 3; + private readonly static int WidthDefaultValue = 0; + + private int width_; + /// + /// Width of the image data under #1 once decoded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 2) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 2; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "colorspace" field. + public const int ColorspaceFieldNumber = 4; + private readonly static global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace ColorspaceDefaultValue = global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace.Unknown; + + private global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace colorspace_; + /// + /// Color space used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace Colorspace { + get { if ((_hasBits0 & 4) != 0) { return colorspace_; } else { return ColorspaceDefaultValue; } } + set { + _hasBits0 |= 4; + colorspace_ = value; + } + } + /// Gets whether the "colorspace" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasColorspace { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "colorspace" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearColorspace() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OpenCvImageEncoderCalculatorResults); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OpenCvImageEncoderCalculatorResults other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (EncodedImage != other.EncodedImage) return false; + if (Height != other.Height) return false; + if (Width != other.Width) return false; + if (Colorspace != other.Colorspace) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasEncodedImage) hash ^= EncodedImage.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasColorspace) hash ^= Colorspace.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasEncodedImage) { + output.WriteRawTag(10); + output.WriteBytes(EncodedImage); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (HasWidth) { + output.WriteRawTag(24); + output.WriteInt32(Width); + } + if (HasColorspace) { + output.WriteRawTag(32); + output.WriteEnum((int) Colorspace); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasEncodedImage) { + output.WriteRawTag(10); + output.WriteBytes(EncodedImage); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (HasWidth) { + output.WriteRawTag(24); + output.WriteInt32(Width); + } + if (HasColorspace) { + output.WriteRawTag(32); + output.WriteEnum((int) Colorspace); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasEncodedImage) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(EncodedImage); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasColorspace) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Colorspace); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OpenCvImageEncoderCalculatorResults other) { + if (other == null) { + return; + } + if (other.HasEncodedImage) { + EncodedImage = other.EncodedImage; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasColorspace) { + Colorspace = other.Colorspace; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + EncodedImage = input.ReadBytes(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 24: { + Width = input.ReadInt32(); + break; + } + case 32: { + Colorspace = (global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + EncodedImage = input.ReadBytes(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 24: { + Width = input.ReadInt32(); + break; + } + case 32: { + Colorspace = (global::Mediapipe.OpenCvImageEncoderCalculatorResults.Types.ColorSpace) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the OpenCvImageEncoderCalculatorResults message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum ColorSpace { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("GRAYSCALE")] Grayscale = 1, + [pbr::OriginalName("RGB")] Rgb = 2, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs.meta new file mode 100644 index 0000000..c75fea7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/OpencvImageEncoderCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc4cda9e025bebabcaf5353ea2ba8e59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs new file mode 100644 index 0000000..8590381 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs @@ -0,0 +1,446 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/recolor_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/recolor_calculator.proto + public static partial class RecolorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/recolor_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RecolorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjRtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2UvcmVjb2xvcl9jYWxjdWxh", + "dG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2Fs", + "Y3VsYXRvci5wcm90bxoabWVkaWFwaXBlL3V0aWwvY29sb3IucHJvdG8iywIK", + "GFJlY29sb3JDYWxjdWxhdG9yT3B0aW9ucxJKCgxtYXNrX2NoYW5uZWwYASAB", + "KA4yLy5tZWRpYXBpcGUuUmVjb2xvckNhbGN1bGF0b3JPcHRpb25zLk1hc2tD", + "aGFubmVsOgNSRUQSHwoFY29sb3IYAiABKAsyEC5tZWRpYXBpcGUuQ29sb3IS", + "GgoLaW52ZXJ0X21hc2sYAyABKAg6BWZhbHNlEiMKFWFkanVzdF93aXRoX2x1", + "bWluYW5jZRgEIAEoCDoEdHJ1ZSIuCgtNYXNrQ2hhbm5lbBILCgdVTktOT1dO", + "EAASBwoDUkVEEAESCQoFQUxQSEEQAjJRCgNleHQSHC5tZWRpYXBpcGUuQ2Fs", + "Y3VsYXRvck9wdGlvbnMYjYS1eCABKAsyIy5tZWRpYXBpcGUuUmVjb2xvckNh", + "bGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RecolorCalculatorOptions), global::Mediapipe.RecolorCalculatorOptions.Parser, new[]{ "MaskChannel", "Color", "InvertMask", "AdjustWithLuminance" }, null, new[]{ typeof(global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel) }, new pb::Extension[] { global::Mediapipe.RecolorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RecolorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RecolorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RecolorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RecolorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RecolorCalculatorOptions(RecolorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + maskChannel_ = other.maskChannel_; + color_ = other.color_ != null ? other.color_.Clone() : null; + invertMask_ = other.invertMask_; + adjustWithLuminance_ = other.adjustWithLuminance_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RecolorCalculatorOptions Clone() { + return new RecolorCalculatorOptions(this); + } + + /// Field number for the "mask_channel" field. + public const int MaskChannelFieldNumber = 1; + private readonly static global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel MaskChannelDefaultValue = global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel.Red; + + private global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel maskChannel_; + /// + /// Selects which channel of the MASK input to use for masking. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel MaskChannel { + get { if ((_hasBits0 & 1) != 0) { return maskChannel_; } else { return MaskChannelDefaultValue; } } + set { + _hasBits0 |= 1; + maskChannel_ = value; + } + } + /// Gets whether the "mask_channel" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaskChannel { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "mask_channel" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaskChannel() { + _hasBits0 &= ~1; + } + + /// Field number for the "color" field. + public const int ColorFieldNumber = 2; + private global::Mediapipe.Color color_; + /// + /// Color to blend into input image where mask is > 0. + /// The blending is based on the input image luminosity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color { + get { return color_; } + set { + color_ = value; + } + } + + /// Field number for the "invert_mask" field. + public const int InvertMaskFieldNumber = 3; + private readonly static bool InvertMaskDefaultValue = false; + + private bool invertMask_; + /// + /// Swap the meaning of mask values for foreground/background. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool InvertMask { + get { if ((_hasBits0 & 2) != 0) { return invertMask_; } else { return InvertMaskDefaultValue; } } + set { + _hasBits0 |= 2; + invertMask_ = value; + } + } + /// Gets whether the "invert_mask" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInvertMask { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "invert_mask" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInvertMask() { + _hasBits0 &= ~2; + } + + /// Field number for the "adjust_with_luminance" field. + public const int AdjustWithLuminanceFieldNumber = 4; + private readonly static bool AdjustWithLuminanceDefaultValue = true; + + private bool adjustWithLuminance_; + /// + /// Whether to use the luminance of the input image to further adjust the + /// blending weight, to help preserve image textures. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AdjustWithLuminance { + get { if ((_hasBits0 & 4) != 0) { return adjustWithLuminance_; } else { return AdjustWithLuminanceDefaultValue; } } + set { + _hasBits0 |= 4; + adjustWithLuminance_ = value; + } + } + /// Gets whether the "adjust_with_luminance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdjustWithLuminance { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "adjust_with_luminance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdjustWithLuminance() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RecolorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RecolorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MaskChannel != other.MaskChannel) return false; + if (!object.Equals(Color, other.Color)) return false; + if (InvertMask != other.InvertMask) return false; + if (AdjustWithLuminance != other.AdjustWithLuminance) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMaskChannel) hash ^= MaskChannel.GetHashCode(); + if (color_ != null) hash ^= Color.GetHashCode(); + if (HasInvertMask) hash ^= InvertMask.GetHashCode(); + if (HasAdjustWithLuminance) hash ^= AdjustWithLuminance.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMaskChannel) { + output.WriteRawTag(8); + output.WriteEnum((int) MaskChannel); + } + if (color_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Color); + } + if (HasInvertMask) { + output.WriteRawTag(24); + output.WriteBool(InvertMask); + } + if (HasAdjustWithLuminance) { + output.WriteRawTag(32); + output.WriteBool(AdjustWithLuminance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMaskChannel) { + output.WriteRawTag(8); + output.WriteEnum((int) MaskChannel); + } + if (color_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Color); + } + if (HasInvertMask) { + output.WriteRawTag(24); + output.WriteBool(InvertMask); + } + if (HasAdjustWithLuminance) { + output.WriteRawTag(32); + output.WriteBool(AdjustWithLuminance); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMaskChannel) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MaskChannel); + } + if (color_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color); + } + if (HasInvertMask) { + size += 1 + 1; + } + if (HasAdjustWithLuminance) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RecolorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMaskChannel) { + MaskChannel = other.MaskChannel; + } + if (other.color_ != null) { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + Color.MergeFrom(other.Color); + } + if (other.HasInvertMask) { + InvertMask = other.InvertMask; + } + if (other.HasAdjustWithLuminance) { + AdjustWithLuminance = other.AdjustWithLuminance; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MaskChannel = (global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel) input.ReadEnum(); + break; + } + case 18: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 24: { + InvertMask = input.ReadBool(); + break; + } + case 32: { + AdjustWithLuminance = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MaskChannel = (global::Mediapipe.RecolorCalculatorOptions.Types.MaskChannel) input.ReadEnum(); + break; + } + case 18: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 24: { + InvertMask = input.ReadBool(); + break; + } + case 32: { + AdjustWithLuminance = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RecolorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum MaskChannel { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("RED")] Red = 1, + [pbr::OriginalName("ALPHA")] Alpha = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the RecolorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(252527117, pb::FieldCodec.ForMessage(2020216938, global::Mediapipe.RecolorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs.meta new file mode 100644 index 0000000..ecec3c5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RecolorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff694e216363cbd5298af642ec6ee04f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs new file mode 100644 index 0000000..d8c3a0b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs @@ -0,0 +1,218 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/rotation_mode.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/rotation_mode.proto + public static partial class RotationModeReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/rotation_mode.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RotationModeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvcm90YXRpb25fbW9kZS5w", + "cm90bxIJbWVkaWFwaXBlImgKDFJvdGF0aW9uTW9kZSJYCgRNb2RlEgsKB1VO", + "S05PV04QABIOCgpST1RBVElPTl8wEAESDwoLUk9UQVRJT05fOTAQAhIQCgxS", + "T1RBVElPTl8xODAQAxIQCgxST1RBVElPTl8yNzAQBEI6CiVjb20uZ29vZ2xl", + "Lm1lZGlhcGlwZS5jYWxjdWxhdG9yLnByb3RvQhFSb3RhdGlvbk1vZGVQcm90", + "bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RotationMode), global::Mediapipe.RotationMode.Parser, null, null, new[]{ typeof(global::Mediapipe.RotationMode.Types.Mode) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Counterclockwise rotation. + /// + public sealed partial class RotationMode : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RotationMode()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RotationModeReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RotationMode() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RotationMode(RotationMode other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RotationMode Clone() { + return new RotationMode(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RotationMode); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RotationMode other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RotationMode other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RotationMode message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Mode { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("ROTATION_0")] Rotation0 = 1, + [pbr::OriginalName("ROTATION_90")] Rotation90 = 2, + [pbr::OriginalName("ROTATION_180")] Rotation180 = 3, + [pbr::OriginalName("ROTATION_270")] Rotation270 = 4, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs.meta new file mode 100644 index 0000000..024fe40 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/RotationMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65197e2f3e760d27e81769f24aa3d458 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs new file mode 100644 index 0000000..491261b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs @@ -0,0 +1,1120 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/scale_image_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/scale_image_calculator.proto + public static partial class ScaleImageCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/scale_image_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ScaleImageCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvc2NhbGVfaW1hZ2VfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8aLm1lZGlhcGlwZS9mcmFtZXdvcmsvZm9ybWF0", + "cy9pbWFnZV9mb3JtYXQucHJvdG8iogYKG1NjYWxlSW1hZ2VDYWxjdWxhdG9y", + "T3B0aW9ucxIUCgx0YXJnZXRfd2lkdGgYASABKAUSFQoNdGFyZ2V0X2hlaWdo", + "dBgCIAEoBRIXCg90YXJnZXRfbWF4X2FyZWEYDyABKAUSIwoVcHJlc2VydmVf", + "YXNwZWN0X3JhdGlvGAMgASgIOgR0cnVlEh4KEG1pbl9hc3BlY3RfcmF0aW8Y", + "BCABKAk6BDkvMTYSHgoQbWF4X2FzcGVjdF9yYXRpbxgFIAEoCToEMTYvORI0", + "Cg1vdXRwdXRfZm9ybWF0GAYgASgOMh0ubWVkaWFwaXBlLkltYWdlRm9ybWF0", + "LkZvcm1hdBJRCglhbGdvcml0aG0YByABKA4yNS5tZWRpYXBpcGUuU2NhbGVJ", + "bWFnZUNhbGN1bGF0b3JPcHRpb25zLlNjYWxlQWxnb3JpdGhtOgdERUZBVUxU", + "Eh4KEmFsaWdubWVudF9ib3VuZGFyeRgIIAEoBToCMTYSIwoVc2V0X2FsaWdu", + "bWVudF9wYWRkaW5nGAkgASgIOgR0cnVlEjIKI09CU09MRVRFX3NraXBfbGlu", + "ZWFyX3JnYl9jb252ZXJzaW9uGAogASgIOgVmYWxzZRImChtwb3N0X3NoYXJw", + "ZW5pbmdfY29lZmZpY2llbnQYCyABKAI6ATASMwoMaW5wdXRfZm9ybWF0GAwg", + "ASgOMh0ubWVkaWFwaXBlLkltYWdlRm9ybWF0LkZvcm1hdBIfChRzY2FsZV90", + "b19tdWx0aXBsZV9vZhgNIAEoBToBMhIYCgl1c2VfYnQ3MDkYDiABKAg6BWZh", + "bHNlImgKDlNjYWxlQWxnb3JpdGhtEgsKB0RFRkFVTFQQABIKCgZMSU5FQVIQ", + "ARIJCgVDVUJJQxACEggKBEFSRUEQAxILCgdMQU5DWk9TEAQSGwoXREVGQVVM", + "VF9XSVRIT1VUX1VQU0NBTEUQBTJUCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3Vs", + "YXRvck9wdGlvbnMYu+XKHyABKAsyJi5tZWRpYXBpcGUuU2NhbGVJbWFnZUNh", + "bGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ImageFormatReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ScaleImageCalculatorOptions), global::Mediapipe.ScaleImageCalculatorOptions.Parser, new[]{ "TargetWidth", "TargetHeight", "TargetMaxArea", "PreserveAspectRatio", "MinAspectRatio", "MaxAspectRatio", "OutputFormat", "Algorithm", "AlignmentBoundary", "SetAlignmentPadding", "OBSOLETESkipLinearRgbConversion", "PostSharpeningCoefficient", "InputFormat", "ScaleToMultipleOf", "UseBt709" }, null, new[]{ typeof(global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm) }, new pb::Extension[] { global::Mediapipe.ScaleImageCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Order of operations. + /// 1) Crop the image to fit within min_aspect_ratio and max_aspect_ratio. + /// 2) Scale and convert the image to fit inside target_width x target_height + /// using the specified scaling algorithm. (maintaining the aspect + /// ratio if preserve_aspect_ratio is true). + /// The output width and height will be divisible by 2, by default. It is + /// possible to output width and height that are odd numbers when the output + /// format is SRGB and the aspect ratio is left unpreserved. See + /// scale_to_multiple_of for details. + /// + public sealed partial class ScaleImageCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScaleImageCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ScaleImageCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleImageCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleImageCalculatorOptions(ScaleImageCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + targetWidth_ = other.targetWidth_; + targetHeight_ = other.targetHeight_; + targetMaxArea_ = other.targetMaxArea_; + preserveAspectRatio_ = other.preserveAspectRatio_; + minAspectRatio_ = other.minAspectRatio_; + maxAspectRatio_ = other.maxAspectRatio_; + outputFormat_ = other.outputFormat_; + algorithm_ = other.algorithm_; + alignmentBoundary_ = other.alignmentBoundary_; + setAlignmentPadding_ = other.setAlignmentPadding_; + oBSOLETESkipLinearRgbConversion_ = other.oBSOLETESkipLinearRgbConversion_; + postSharpeningCoefficient_ = other.postSharpeningCoefficient_; + inputFormat_ = other.inputFormat_; + scaleToMultipleOf_ = other.scaleToMultipleOf_; + useBt709_ = other.useBt709_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleImageCalculatorOptions Clone() { + return new ScaleImageCalculatorOptions(this); + } + + /// Field number for the "target_width" field. + public const int TargetWidthFieldNumber = 1; + private readonly static int TargetWidthDefaultValue = 0; + + private int targetWidth_; + /// + /// Target output width and height. The final output's size may vary + /// depending on the other options below. If unset, use the same width + /// or height as the input. If only one is set then determine the other + /// from the aspect ratio (after cropping). The output width and height + /// will be divisible by 2, by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TargetWidth { + get { if ((_hasBits0 & 1) != 0) { return targetWidth_; } else { return TargetWidthDefaultValue; } } + set { + _hasBits0 |= 1; + targetWidth_ = value; + } + } + /// Gets whether the "target_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "target_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "target_height" field. + public const int TargetHeightFieldNumber = 2; + private readonly static int TargetHeightDefaultValue = 0; + + private int targetHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TargetHeight { + get { if ((_hasBits0 & 2) != 0) { return targetHeight_; } else { return TargetHeightDefaultValue; } } + set { + _hasBits0 |= 2; + targetHeight_ = value; + } + } + /// Gets whether the "target_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "target_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "target_max_area" field. + public const int TargetMaxAreaFieldNumber = 15; + private readonly static int TargetMaxAreaDefaultValue = 0; + + private int targetMaxArea_; + /// + /// If set, then automatically calculates a target_width and target_height that + /// has an area below the target max area. Aspect ratio preservation cannot be + /// disabled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TargetMaxArea { + get { if ((_hasBits0 & 4096) != 0) { return targetMaxArea_; } else { return TargetMaxAreaDefaultValue; } } + set { + _hasBits0 |= 4096; + targetMaxArea_ = value; + } + } + /// Gets whether the "target_max_area" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetMaxArea { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "target_max_area" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetMaxArea() { + _hasBits0 &= ~4096; + } + + /// Field number for the "preserve_aspect_ratio" field. + public const int PreserveAspectRatioFieldNumber = 3; + private readonly static bool PreserveAspectRatioDefaultValue = true; + + private bool preserveAspectRatio_; + /// + /// If true, the image is scaled up or down proportionally so that it + /// fits inside the box represented by target_width and target_height. + /// Otherwise it is scaled to fit target_width and target_height + /// completely. In any case, the aspect ratio that is preserved is + /// that after cropping to the minimum/maximum aspect ratio. Additionally, if + /// true, the output width and height will be divisible by 2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool PreserveAspectRatio { + get { if ((_hasBits0 & 4) != 0) { return preserveAspectRatio_; } else { return PreserveAspectRatioDefaultValue; } } + set { + _hasBits0 |= 4; + preserveAspectRatio_ = value; + } + } + /// Gets whether the "preserve_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPreserveAspectRatio { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "preserve_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPreserveAspectRatio() { + _hasBits0 &= ~4; + } + + /// Field number for the "min_aspect_ratio" field. + public const int MinAspectRatioFieldNumber = 4; + private readonly static string MinAspectRatioDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("OS8xNg=="), 0, 4); + + private string minAspectRatio_; + /// + /// If ratio is positive, crop the image to this minimum and maximum + /// aspect ratio (preserving the center of the frame). This is done + /// before scaling. The string must contain "/", so to disable cropping, + /// set both to "0/1". + /// For example, for a min_aspect_ratio of "9/16" and max of "16/9" the + /// following cropping will occur: + /// 1920x1080 (which is 16:9) is not cropped + /// 640x1024 (which is 10:16) is not cropped + /// 640x320 (which is 2:1) cropped to 568x320 (just under 16/9) + /// 96x480 (which is 1:5), cropped to 96x170 (just over 9/16) + /// The resultant frame will always be between (or at) the + /// min_aspect_ratio and max_aspect_ratio. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string MinAspectRatio { + get { return minAspectRatio_ ?? MinAspectRatioDefaultValue; } + set { + minAspectRatio_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "min_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinAspectRatio { + get { return minAspectRatio_ != null; } + } + /// Clears the value of the "min_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinAspectRatio() { + minAspectRatio_ = null; + } + + /// Field number for the "max_aspect_ratio" field. + public const int MaxAspectRatioFieldNumber = 5; + private readonly static string MaxAspectRatioDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("MTYvOQ=="), 0, 4); + + private string maxAspectRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string MaxAspectRatio { + get { return maxAspectRatio_ ?? MaxAspectRatioDefaultValue; } + set { + maxAspectRatio_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "max_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxAspectRatio { + get { return maxAspectRatio_ != null; } + } + /// Clears the value of the "max_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxAspectRatio() { + maxAspectRatio_ = null; + } + + /// Field number for the "output_format" field. + public const int OutputFormatFieldNumber = 6; + private readonly static global::Mediapipe.ImageFormat.Types.Format OutputFormatDefaultValue = global::Mediapipe.ImageFormat.Types.Format.Unknown; + + private global::Mediapipe.ImageFormat.Types.Format outputFormat_; + /// + /// If unset, use the same format as the input. + /// NOTE: in the current implementation, the output format (either specified + /// in the output_format option or inherited from the input format) must be + /// SRGB. It can be YCBCR420P if the input_format is also the same. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageFormat.Types.Format OutputFormat { + get { if ((_hasBits0 & 8) != 0) { return outputFormat_; } else { return OutputFormatDefaultValue; } } + set { + _hasBits0 |= 8; + outputFormat_ = value; + } + } + /// Gets whether the "output_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputFormat { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "output_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputFormat() { + _hasBits0 &= ~8; + } + + /// Field number for the "algorithm" field. + public const int AlgorithmFieldNumber = 7; + private readonly static global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm AlgorithmDefaultValue = global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm.Default; + + private global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm algorithm_; + /// + /// The upscaling algorithm to use. The default is to use CUBIC. Note that + /// downscaling unconditionally uses DDA; see image_processing:: + /// AffineGammaResizer for documentation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm Algorithm { + get { if ((_hasBits0 & 16) != 0) { return algorithm_; } else { return AlgorithmDefaultValue; } } + set { + _hasBits0 |= 16; + algorithm_ = value; + } + } + /// Gets whether the "algorithm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlgorithm { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "algorithm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlgorithm() { + _hasBits0 &= ~16; + } + + /// Field number for the "alignment_boundary" field. + public const int AlignmentBoundaryFieldNumber = 8; + private readonly static int AlignmentBoundaryDefaultValue = 16; + + private int alignmentBoundary_; + /// + /// The output image will have this alignment. If set to zero, then + /// any alignment could be used. If set to one, the output image will + /// be stored contiguously. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AlignmentBoundary { + get { if ((_hasBits0 & 32) != 0) { return alignmentBoundary_; } else { return AlignmentBoundaryDefaultValue; } } + set { + _hasBits0 |= 32; + alignmentBoundary_ = value; + } + } + /// Gets whether the "alignment_boundary" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlignmentBoundary { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "alignment_boundary" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlignmentBoundary() { + _hasBits0 &= ~32; + } + + /// Field number for the "set_alignment_padding" field. + public const int SetAlignmentPaddingFieldNumber = 9; + private readonly static bool SetAlignmentPaddingDefaultValue = true; + + private bool setAlignmentPadding_; + /// + /// Set the alignment padding area to deterministic values (as opposed + /// to possibly leaving it as uninitialized memory). The padding is + /// the space between the pixel values in a row and the end of the row + /// (which may be different due to alignment requirements on the length + /// of a row). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SetAlignmentPadding { + get { if ((_hasBits0 & 64) != 0) { return setAlignmentPadding_; } else { return SetAlignmentPaddingDefaultValue; } } + set { + _hasBits0 |= 64; + setAlignmentPadding_ = value; + } + } + /// Gets whether the "set_alignment_padding" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSetAlignmentPadding { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "set_alignment_padding" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSetAlignmentPadding() { + _hasBits0 &= ~64; + } + + /// Field number for the "OBSOLETE_skip_linear_rgb_conversion" field. + public const int OBSOLETESkipLinearRgbConversionFieldNumber = 10; + private readonly static bool OBSOLETESkipLinearRgbConversionDefaultValue = false; + + private bool oBSOLETESkipLinearRgbConversion_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OBSOLETESkipLinearRgbConversion { + get { if ((_hasBits0 & 128) != 0) { return oBSOLETESkipLinearRgbConversion_; } else { return OBSOLETESkipLinearRgbConversionDefaultValue; } } + set { + _hasBits0 |= 128; + oBSOLETESkipLinearRgbConversion_ = value; + } + } + /// Gets whether the "OBSOLETE_skip_linear_rgb_conversion" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOBSOLETESkipLinearRgbConversion { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "OBSOLETE_skip_linear_rgb_conversion" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOBSOLETESkipLinearRgbConversion() { + _hasBits0 &= ~128; + } + + /// Field number for the "post_sharpening_coefficient" field. + public const int PostSharpeningCoefficientFieldNumber = 11; + private readonly static float PostSharpeningCoefficientDefaultValue = 0F; + + private float postSharpeningCoefficient_; + /// + /// Applies sharpening for downscaled images as post-processing. See + /// image_processing::AffineGammaResizer for documentation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PostSharpeningCoefficient { + get { if ((_hasBits0 & 256) != 0) { return postSharpeningCoefficient_; } else { return PostSharpeningCoefficientDefaultValue; } } + set { + _hasBits0 |= 256; + postSharpeningCoefficient_ = value; + } + } + /// Gets whether the "post_sharpening_coefficient" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPostSharpeningCoefficient { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "post_sharpening_coefficient" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPostSharpeningCoefficient() { + _hasBits0 &= ~256; + } + + /// Field number for the "input_format" field. + public const int InputFormatFieldNumber = 12; + private readonly static global::Mediapipe.ImageFormat.Types.Format InputFormatDefaultValue = global::Mediapipe.ImageFormat.Types.Format.Unknown; + + private global::Mediapipe.ImageFormat.Types.Format inputFormat_; + /// + /// If input_format is YCBCR420P, input packets contain a YUVImage. If + /// input_format is a format other than YCBCR420P or is unset, input packets + /// contain an ImageFrame. + /// NOTE: in the current implementation, the input format (either specified + /// in the input_format option or inferred from the input packets) must be + /// SRGB or YCBCR420P. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageFormat.Types.Format InputFormat { + get { if ((_hasBits0 & 512) != 0) { return inputFormat_; } else { return InputFormatDefaultValue; } } + set { + _hasBits0 |= 512; + inputFormat_ = value; + } + } + /// Gets whether the "input_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputFormat { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "input_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputFormat() { + _hasBits0 &= ~512; + } + + /// Field number for the "scale_to_multiple_of" field. + public const int ScaleToMultipleOfFieldNumber = 13; + private readonly static int ScaleToMultipleOfDefaultValue = 2; + + private int scaleToMultipleOf_; + /// + /// If set to 2, the target width and height will be rounded-down + /// to the nearest even number. If set to any positive value other than 2, + /// preserve_aspect_ratio must be false and the target width and height will be + /// rounded-down to multiples of the given value. If set to any value less than + /// 1, it will be treated like 1. + /// NOTE: If set to an odd number, the output format must be SRGB. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ScaleToMultipleOf { + get { if ((_hasBits0 & 1024) != 0) { return scaleToMultipleOf_; } else { return ScaleToMultipleOfDefaultValue; } } + set { + _hasBits0 |= 1024; + scaleToMultipleOf_ = value; + } + } + /// Gets whether the "scale_to_multiple_of" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleToMultipleOf { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "scale_to_multiple_of" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleToMultipleOf() { + _hasBits0 &= ~1024; + } + + /// Field number for the "use_bt709" field. + public const int UseBt709FieldNumber = 14; + private readonly static bool UseBt709DefaultValue = false; + + private bool useBt709_; + /// + /// If true, assume the input YUV is BT.709 (this is the HDTV standard, so most + /// content is likely using it). If false use the previous assumption of BT.601 + /// (mid-80s standard). Ideally this information should be contained in the + /// input YUV Frame, but as of 02/06/2019, it's not. Once this info is baked + /// in, this flag becomes useless. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseBt709 { + get { if ((_hasBits0 & 2048) != 0) { return useBt709_; } else { return UseBt709DefaultValue; } } + set { + _hasBits0 |= 2048; + useBt709_ = value; + } + } + /// Gets whether the "use_bt709" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseBt709 { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "use_bt709" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseBt709() { + _hasBits0 &= ~2048; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ScaleImageCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ScaleImageCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TargetWidth != other.TargetWidth) return false; + if (TargetHeight != other.TargetHeight) return false; + if (TargetMaxArea != other.TargetMaxArea) return false; + if (PreserveAspectRatio != other.PreserveAspectRatio) return false; + if (MinAspectRatio != other.MinAspectRatio) return false; + if (MaxAspectRatio != other.MaxAspectRatio) return false; + if (OutputFormat != other.OutputFormat) return false; + if (Algorithm != other.Algorithm) return false; + if (AlignmentBoundary != other.AlignmentBoundary) return false; + if (SetAlignmentPadding != other.SetAlignmentPadding) return false; + if (OBSOLETESkipLinearRgbConversion != other.OBSOLETESkipLinearRgbConversion) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PostSharpeningCoefficient, other.PostSharpeningCoefficient)) return false; + if (InputFormat != other.InputFormat) return false; + if (ScaleToMultipleOf != other.ScaleToMultipleOf) return false; + if (UseBt709 != other.UseBt709) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTargetWidth) hash ^= TargetWidth.GetHashCode(); + if (HasTargetHeight) hash ^= TargetHeight.GetHashCode(); + if (HasTargetMaxArea) hash ^= TargetMaxArea.GetHashCode(); + if (HasPreserveAspectRatio) hash ^= PreserveAspectRatio.GetHashCode(); + if (HasMinAspectRatio) hash ^= MinAspectRatio.GetHashCode(); + if (HasMaxAspectRatio) hash ^= MaxAspectRatio.GetHashCode(); + if (HasOutputFormat) hash ^= OutputFormat.GetHashCode(); + if (HasAlgorithm) hash ^= Algorithm.GetHashCode(); + if (HasAlignmentBoundary) hash ^= AlignmentBoundary.GetHashCode(); + if (HasSetAlignmentPadding) hash ^= SetAlignmentPadding.GetHashCode(); + if (HasOBSOLETESkipLinearRgbConversion) hash ^= OBSOLETESkipLinearRgbConversion.GetHashCode(); + if (HasPostSharpeningCoefficient) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PostSharpeningCoefficient); + if (HasInputFormat) hash ^= InputFormat.GetHashCode(); + if (HasScaleToMultipleOf) hash ^= ScaleToMultipleOf.GetHashCode(); + if (HasUseBt709) hash ^= UseBt709.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTargetWidth) { + output.WriteRawTag(8); + output.WriteInt32(TargetWidth); + } + if (HasTargetHeight) { + output.WriteRawTag(16); + output.WriteInt32(TargetHeight); + } + if (HasPreserveAspectRatio) { + output.WriteRawTag(24); + output.WriteBool(PreserveAspectRatio); + } + if (HasMinAspectRatio) { + output.WriteRawTag(34); + output.WriteString(MinAspectRatio); + } + if (HasMaxAspectRatio) { + output.WriteRawTag(42); + output.WriteString(MaxAspectRatio); + } + if (HasOutputFormat) { + output.WriteRawTag(48); + output.WriteEnum((int) OutputFormat); + } + if (HasAlgorithm) { + output.WriteRawTag(56); + output.WriteEnum((int) Algorithm); + } + if (HasAlignmentBoundary) { + output.WriteRawTag(64); + output.WriteInt32(AlignmentBoundary); + } + if (HasSetAlignmentPadding) { + output.WriteRawTag(72); + output.WriteBool(SetAlignmentPadding); + } + if (HasOBSOLETESkipLinearRgbConversion) { + output.WriteRawTag(80); + output.WriteBool(OBSOLETESkipLinearRgbConversion); + } + if (HasPostSharpeningCoefficient) { + output.WriteRawTag(93); + output.WriteFloat(PostSharpeningCoefficient); + } + if (HasInputFormat) { + output.WriteRawTag(96); + output.WriteEnum((int) InputFormat); + } + if (HasScaleToMultipleOf) { + output.WriteRawTag(104); + output.WriteInt32(ScaleToMultipleOf); + } + if (HasUseBt709) { + output.WriteRawTag(112); + output.WriteBool(UseBt709); + } + if (HasTargetMaxArea) { + output.WriteRawTag(120); + output.WriteInt32(TargetMaxArea); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTargetWidth) { + output.WriteRawTag(8); + output.WriteInt32(TargetWidth); + } + if (HasTargetHeight) { + output.WriteRawTag(16); + output.WriteInt32(TargetHeight); + } + if (HasPreserveAspectRatio) { + output.WriteRawTag(24); + output.WriteBool(PreserveAspectRatio); + } + if (HasMinAspectRatio) { + output.WriteRawTag(34); + output.WriteString(MinAspectRatio); + } + if (HasMaxAspectRatio) { + output.WriteRawTag(42); + output.WriteString(MaxAspectRatio); + } + if (HasOutputFormat) { + output.WriteRawTag(48); + output.WriteEnum((int) OutputFormat); + } + if (HasAlgorithm) { + output.WriteRawTag(56); + output.WriteEnum((int) Algorithm); + } + if (HasAlignmentBoundary) { + output.WriteRawTag(64); + output.WriteInt32(AlignmentBoundary); + } + if (HasSetAlignmentPadding) { + output.WriteRawTag(72); + output.WriteBool(SetAlignmentPadding); + } + if (HasOBSOLETESkipLinearRgbConversion) { + output.WriteRawTag(80); + output.WriteBool(OBSOLETESkipLinearRgbConversion); + } + if (HasPostSharpeningCoefficient) { + output.WriteRawTag(93); + output.WriteFloat(PostSharpeningCoefficient); + } + if (HasInputFormat) { + output.WriteRawTag(96); + output.WriteEnum((int) InputFormat); + } + if (HasScaleToMultipleOf) { + output.WriteRawTag(104); + output.WriteInt32(ScaleToMultipleOf); + } + if (HasUseBt709) { + output.WriteRawTag(112); + output.WriteBool(UseBt709); + } + if (HasTargetMaxArea) { + output.WriteRawTag(120); + output.WriteInt32(TargetMaxArea); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTargetWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TargetWidth); + } + if (HasTargetHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TargetHeight); + } + if (HasTargetMaxArea) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TargetMaxArea); + } + if (HasPreserveAspectRatio) { + size += 1 + 1; + } + if (HasMinAspectRatio) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MinAspectRatio); + } + if (HasMaxAspectRatio) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MaxAspectRatio); + } + if (HasOutputFormat) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OutputFormat); + } + if (HasAlgorithm) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Algorithm); + } + if (HasAlignmentBoundary) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AlignmentBoundary); + } + if (HasSetAlignmentPadding) { + size += 1 + 1; + } + if (HasOBSOLETESkipLinearRgbConversion) { + size += 1 + 1; + } + if (HasPostSharpeningCoefficient) { + size += 1 + 4; + } + if (HasInputFormat) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) InputFormat); + } + if (HasScaleToMultipleOf) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ScaleToMultipleOf); + } + if (HasUseBt709) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ScaleImageCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTargetWidth) { + TargetWidth = other.TargetWidth; + } + if (other.HasTargetHeight) { + TargetHeight = other.TargetHeight; + } + if (other.HasTargetMaxArea) { + TargetMaxArea = other.TargetMaxArea; + } + if (other.HasPreserveAspectRatio) { + PreserveAspectRatio = other.PreserveAspectRatio; + } + if (other.HasMinAspectRatio) { + MinAspectRatio = other.MinAspectRatio; + } + if (other.HasMaxAspectRatio) { + MaxAspectRatio = other.MaxAspectRatio; + } + if (other.HasOutputFormat) { + OutputFormat = other.OutputFormat; + } + if (other.HasAlgorithm) { + Algorithm = other.Algorithm; + } + if (other.HasAlignmentBoundary) { + AlignmentBoundary = other.AlignmentBoundary; + } + if (other.HasSetAlignmentPadding) { + SetAlignmentPadding = other.SetAlignmentPadding; + } + if (other.HasOBSOLETESkipLinearRgbConversion) { + OBSOLETESkipLinearRgbConversion = other.OBSOLETESkipLinearRgbConversion; + } + if (other.HasPostSharpeningCoefficient) { + PostSharpeningCoefficient = other.PostSharpeningCoefficient; + } + if (other.HasInputFormat) { + InputFormat = other.InputFormat; + } + if (other.HasScaleToMultipleOf) { + ScaleToMultipleOf = other.ScaleToMultipleOf; + } + if (other.HasUseBt709) { + UseBt709 = other.UseBt709; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TargetWidth = input.ReadInt32(); + break; + } + case 16: { + TargetHeight = input.ReadInt32(); + break; + } + case 24: { + PreserveAspectRatio = input.ReadBool(); + break; + } + case 34: { + MinAspectRatio = input.ReadString(); + break; + } + case 42: { + MaxAspectRatio = input.ReadString(); + break; + } + case 48: { + OutputFormat = (global::Mediapipe.ImageFormat.Types.Format) input.ReadEnum(); + break; + } + case 56: { + Algorithm = (global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm) input.ReadEnum(); + break; + } + case 64: { + AlignmentBoundary = input.ReadInt32(); + break; + } + case 72: { + SetAlignmentPadding = input.ReadBool(); + break; + } + case 80: { + OBSOLETESkipLinearRgbConversion = input.ReadBool(); + break; + } + case 93: { + PostSharpeningCoefficient = input.ReadFloat(); + break; + } + case 96: { + InputFormat = (global::Mediapipe.ImageFormat.Types.Format) input.ReadEnum(); + break; + } + case 104: { + ScaleToMultipleOf = input.ReadInt32(); + break; + } + case 112: { + UseBt709 = input.ReadBool(); + break; + } + case 120: { + TargetMaxArea = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TargetWidth = input.ReadInt32(); + break; + } + case 16: { + TargetHeight = input.ReadInt32(); + break; + } + case 24: { + PreserveAspectRatio = input.ReadBool(); + break; + } + case 34: { + MinAspectRatio = input.ReadString(); + break; + } + case 42: { + MaxAspectRatio = input.ReadString(); + break; + } + case 48: { + OutputFormat = (global::Mediapipe.ImageFormat.Types.Format) input.ReadEnum(); + break; + } + case 56: { + Algorithm = (global::Mediapipe.ScaleImageCalculatorOptions.Types.ScaleAlgorithm) input.ReadEnum(); + break; + } + case 64: { + AlignmentBoundary = input.ReadInt32(); + break; + } + case 72: { + SetAlignmentPadding = input.ReadBool(); + break; + } + case 80: { + OBSOLETESkipLinearRgbConversion = input.ReadBool(); + break; + } + case 93: { + PostSharpeningCoefficient = input.ReadFloat(); + break; + } + case 96: { + InputFormat = (global::Mediapipe.ImageFormat.Types.Format) input.ReadEnum(); + break; + } + case 104: { + ScaleToMultipleOf = input.ReadInt32(); + break; + } + case 112: { + UseBt709 = input.ReadBool(); + break; + } + case 120: { + TargetMaxArea = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ScaleImageCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum ScaleAlgorithm { + [pbr::OriginalName("DEFAULT")] Default = 0, + [pbr::OriginalName("LINEAR")] Linear = 1, + [pbr::OriginalName("CUBIC")] Cubic = 2, + [pbr::OriginalName("AREA")] Area = 3, + [pbr::OriginalName("LANCZOS")] Lanczos = 4, + /// + /// Option to disallow upscaling. + /// + [pbr::OriginalName("DEFAULT_WITHOUT_UPSCALE")] DefaultWithoutUpscale = 5, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the ScaleImageCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(66237115, pb::FieldCodec.ForMessage(529896922, global::Mediapipe.ScaleImageCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs.meta new file mode 100644 index 0000000..f5afdd2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/ScaleImageCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed5cb62c3265ade729a48a72ff0e314a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs new file mode 100644 index 0000000..6cba7d9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs @@ -0,0 +1,274 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/segmentation_smoothing_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/segmentation_smoothing_calculator.proto + public static partial class SegmentationSmoothingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/segmentation_smoothing_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SegmentationSmoothingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkNtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvc2VnbWVudGF0aW9uX3Nt", + "b290aGluZ19jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlw", + "ZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byKyAQomU2VnbWVudGF0aW9u", + "U21vb3RoaW5nQ2FsY3VsYXRvck9wdGlvbnMSJgobY29tYmluZV93aXRoX3By", + "ZXZpb3VzX3JhdGlvGAEgASgCOgEwMmAKA2V4dBIcLm1lZGlhcGlwZS5DYWxj", + "dWxhdG9yT3B0aW9ucxjomfyzASABKAsyMS5tZWRpYXBpcGUuU2VnbWVudGF0", + "aW9uU21vb3RoaW5nQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SegmentationSmoothingCalculatorOptions), global::Mediapipe.SegmentationSmoothingCalculatorOptions.Parser, new[]{ "CombineWithPreviousRatio" }, null, null, new pb::Extension[] { global::Mediapipe.SegmentationSmoothingCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SegmentationSmoothingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SegmentationSmoothingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SegmentationSmoothingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SegmentationSmoothingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SegmentationSmoothingCalculatorOptions(SegmentationSmoothingCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + combineWithPreviousRatio_ = other.combineWithPreviousRatio_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SegmentationSmoothingCalculatorOptions Clone() { + return new SegmentationSmoothingCalculatorOptions(this); + } + + /// Field number for the "combine_with_previous_ratio" field. + public const int CombineWithPreviousRatioFieldNumber = 1; + private readonly static float CombineWithPreviousRatioDefaultValue = 0F; + + private float combineWithPreviousRatio_; + /// + /// How much to blend in previous mask, based on a probability estimate. + /// Range: [0-1] + /// 0 = Use only current frame (no blending). + /// 1 = Blend in the previous mask based on uncertainty estimate. + /// With ratio at 1, the uncertainty estimate is trusted completely. + /// When uncertainty is high, the previous mask is given higher weight. + /// Therefore, if both ratio and uncertainty are 1, only old mask is used. + /// A pixel is 'uncertain' if its value is close to the middle (0.5 or 127). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CombineWithPreviousRatio { + get { if ((_hasBits0 & 1) != 0) { return combineWithPreviousRatio_; } else { return CombineWithPreviousRatioDefaultValue; } } + set { + _hasBits0 |= 1; + combineWithPreviousRatio_ = value; + } + } + /// Gets whether the "combine_with_previous_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCombineWithPreviousRatio { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "combine_with_previous_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCombineWithPreviousRatio() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SegmentationSmoothingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SegmentationSmoothingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CombineWithPreviousRatio, other.CombineWithPreviousRatio)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCombineWithPreviousRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CombineWithPreviousRatio); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCombineWithPreviousRatio) { + output.WriteRawTag(13); + output.WriteFloat(CombineWithPreviousRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCombineWithPreviousRatio) { + output.WriteRawTag(13); + output.WriteFloat(CombineWithPreviousRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCombineWithPreviousRatio) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SegmentationSmoothingCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasCombineWithPreviousRatio) { + CombineWithPreviousRatio = other.CombineWithPreviousRatio; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + CombineWithPreviousRatio = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + CombineWithPreviousRatio = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the SegmentationSmoothingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(377425128, pb::FieldCodec.ForMessage(3019401026, global::Mediapipe.SegmentationSmoothingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs.meta new file mode 100644 index 0000000..19b4fcd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SegmentationSmoothingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6948ac832e6ad049ba49291fe368dbac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs new file mode 100644 index 0000000..dbc8b7b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs @@ -0,0 +1,267 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/set_alpha_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/set_alpha_calculator.proto + public static partial class SetAlphaCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/set_alpha_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SetAlphaCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjZtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvc2V0X2FscGhhX2NhbGN1", + "bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9j", + "YWxjdWxhdG9yLnByb3RvIogBChlTZXRBbHBoYUNhbGN1bGF0b3JPcHRpb25z", + "EhcKC2FscGhhX3ZhbHVlGAEgASgROgItMTJSCgNleHQSHC5tZWRpYXBpcGUu", + "Q2FsY3VsYXRvck9wdGlvbnMYp+HUdyABKAsyJC5tZWRpYXBpcGUuU2V0QWxw", + "aGFDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SetAlphaCalculatorOptions), global::Mediapipe.SetAlphaCalculatorOptions.Parser, new[]{ "AlphaValue" }, null, null, new pb::Extension[] { global::Mediapipe.SetAlphaCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SetAlphaCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetAlphaCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SetAlphaCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetAlphaCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetAlphaCalculatorOptions(SetAlphaCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + alphaValue_ = other.alphaValue_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SetAlphaCalculatorOptions Clone() { + return new SetAlphaCalculatorOptions(this); + } + + /// Field number for the "alpha_value" field. + public const int AlphaValueFieldNumber = 1; + private readonly static int AlphaValueDefaultValue = -1; + + private int alphaValue_; + /// + /// The value to set the alpha channel to (0-255). + /// This option is ignored when set to -1 (use image mask instead). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AlphaValue { + get { if ((_hasBits0 & 1) != 0) { return alphaValue_; } else { return AlphaValueDefaultValue; } } + set { + _hasBits0 |= 1; + alphaValue_ = value; + } + } + /// Gets whether the "alpha_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlphaValue { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "alpha_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlphaValue() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SetAlphaCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SetAlphaCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AlphaValue != other.AlphaValue) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasAlphaValue) hash ^= AlphaValue.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasAlphaValue) { + output.WriteRawTag(8); + output.WriteSInt32(AlphaValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAlphaValue) { + output.WriteRawTag(8); + output.WriteSInt32(AlphaValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasAlphaValue) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(AlphaValue); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SetAlphaCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasAlphaValue) { + AlphaValue = other.AlphaValue; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + AlphaValue = input.ReadSInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + AlphaValue = input.ReadSInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the SetAlphaCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(250949799, pb::FieldCodec.ForMessage(2007598394, global::Mediapipe.SetAlphaCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs.meta new file mode 100644 index 0000000..10bd07c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/SetAlphaCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc54f36a85ddcff508f2caa3d92d60c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs new file mode 100644 index 0000000..32e11a9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs @@ -0,0 +1,350 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/image/warp_affine_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/image/warp_affine_calculator.proto + public static partial class WarpAffineCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/image/warp_affine_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static WarpAffineCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvaW1hZ2Uvd2FycF9hZmZpbmVfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8aHm1lZGlhcGlwZS9ncHUvZ3B1X29yaWdpbi5w", + "cm90byK4AgobV2FycEFmZmluZUNhbGN1bGF0b3JPcHRpb25zEkYKC2JvcmRl", + "cl9tb2RlGAEgASgOMjEubWVkaWFwaXBlLldhcnBBZmZpbmVDYWxjdWxhdG9y", + "T3B0aW9ucy5Cb3JkZXJNb2RlEi0KCmdwdV9vcmlnaW4YAiABKA4yGS5tZWRp", + "YXBpcGUuR3B1T3JpZ2luLk1vZGUiSwoKQm9yZGVyTW9kZRIWChJCT1JERVJf", + "VU5TUEVDSUZJRUQQABIPCgtCT1JERVJfWkVSTxABEhQKEEJPUkRFUl9SRVBM", + "SUNBVEUQAjJVCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY", + "x7uYsgEgASgLMiYubWVkaWFwaXBlLldhcnBBZmZpbmVDYWxjdWxhdG9yT3B0", + "aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.GpuOriginReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.WarpAffineCalculatorOptions), global::Mediapipe.WarpAffineCalculatorOptions.Parser, new[]{ "BorderMode", "GpuOrigin" }, null, new[]{ typeof(global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode) }, new pb::Extension[] { global::Mediapipe.WarpAffineCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class WarpAffineCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WarpAffineCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.WarpAffineCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WarpAffineCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WarpAffineCalculatorOptions(WarpAffineCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + borderMode_ = other.borderMode_; + gpuOrigin_ = other.gpuOrigin_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WarpAffineCalculatorOptions Clone() { + return new WarpAffineCalculatorOptions(this); + } + + /// Field number for the "border_mode" field. + public const int BorderModeFieldNumber = 1; + private readonly static global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode BorderModeDefaultValue = global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode.BorderUnspecified; + + private global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode borderMode_; + /// + /// Pixel extrapolation method. + /// When converting image to tensor it may happen that tensor needs to read + /// pixels outside image boundaries. Border mode helps to specify how such + /// pixels will be calculated. + /// + /// BORDER_REPLICATE is used by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode BorderMode { + get { if ((_hasBits0 & 1) != 0) { return borderMode_; } else { return BorderModeDefaultValue; } } + set { + _hasBits0 |= 1; + borderMode_ = value; + } + } + /// Gets whether the "border_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBorderMode { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "border_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBorderMode() { + _hasBits0 &= ~1; + } + + /// Field number for the "gpu_origin" field. + public const int GpuOriginFieldNumber = 2; + private readonly static global::Mediapipe.GpuOrigin.Types.Mode GpuOriginDefaultValue = global::Mediapipe.GpuOrigin.Types.Mode.Default; + + private global::Mediapipe.GpuOrigin.Types.Mode gpuOrigin_; + /// + /// For CONVENTIONAL mode for OpenGL, input image starts at bottom and needs + /// to be flipped vertically as tensors are expected to start at top. + /// (DEFAULT or unset interpreted as CONVENTIONAL.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GpuOrigin.Types.Mode GpuOrigin { + get { if ((_hasBits0 & 2) != 0) { return gpuOrigin_; } else { return GpuOriginDefaultValue; } } + set { + _hasBits0 |= 2; + gpuOrigin_ = value; + } + } + /// Gets whether the "gpu_origin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuOrigin { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "gpu_origin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuOrigin() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WarpAffineCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WarpAffineCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BorderMode != other.BorderMode) return false; + if (GpuOrigin != other.GpuOrigin) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBorderMode) hash ^= BorderMode.GetHashCode(); + if (HasGpuOrigin) hash ^= GpuOrigin.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBorderMode) { + output.WriteRawTag(8); + output.WriteEnum((int) BorderMode); + } + if (HasGpuOrigin) { + output.WriteRawTag(16); + output.WriteEnum((int) GpuOrigin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBorderMode) { + output.WriteRawTag(8); + output.WriteEnum((int) BorderMode); + } + if (HasGpuOrigin) { + output.WriteRawTag(16); + output.WriteEnum((int) GpuOrigin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBorderMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) BorderMode); + } + if (HasGpuOrigin) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GpuOrigin); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WarpAffineCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasBorderMode) { + BorderMode = other.BorderMode; + } + if (other.HasGpuOrigin) { + GpuOrigin = other.GpuOrigin; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BorderMode = (global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 16: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + BorderMode = (global::Mediapipe.WarpAffineCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 16: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the WarpAffineCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Pixel extrapolation methods. See @border_mode. + /// + public enum BorderMode { + [pbr::OriginalName("BORDER_UNSPECIFIED")] BorderUnspecified = 0, + [pbr::OriginalName("BORDER_ZERO")] BorderZero = 1, + [pbr::OriginalName("BORDER_REPLICATE")] BorderReplicate = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the WarpAffineCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(373693895, pb::FieldCodec.ForMessage(2989551162, global::Mediapipe.WarpAffineCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs.meta new file mode 100644 index 0000000..1fa95d5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image/WarpAffineCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bcddb40478ed4e9f49e3f62aef287d88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor.meta new file mode 100644 index 0000000..fcfce6b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca93992c93b59b44386424f1a45675d8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs new file mode 100644 index 0000000..152d89b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs @@ -0,0 +1,1498 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/image_to_tensor_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/image_to_tensor_calculator.proto + public static partial class ImageToTensorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/image_to_tensor_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageToTensorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL2ltYWdlX3RvX3RlbnNv", + "cl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvY2FsY3VsYXRvci5wcm90bxoebWVkaWFwaXBlL2dwdS9ncHVfb3Jp", + "Z2luLnByb3RvIqAGCh5JbWFnZVRvVGVuc29yQ2FsY3VsYXRvck9wdGlvbnMS", + "GwoTb3V0cHV0X3RlbnNvcl93aWR0aBgBIAEoBRIcChRvdXRwdXRfdGVuc29y", + "X2hlaWdodBgCIAEoBRIZChFrZWVwX2FzcGVjdF9yYXRpbxgDIAEoCBJZChlv", + "dXRwdXRfdGVuc29yX2Zsb2F0X3JhbmdlGAQgASgLMjQubWVkaWFwaXBlLklt", + "YWdlVG9UZW5zb3JDYWxjdWxhdG9yT3B0aW9ucy5GbG9hdFJhbmdlSAASVQoX", + "b3V0cHV0X3RlbnNvcl9pbnRfcmFuZ2UYByABKAsyMi5tZWRpYXBpcGUuSW1h", + "Z2VUb1RlbnNvckNhbGN1bGF0b3JPcHRpb25zLkludFJhbmdlSAASVwoYb3V0", + "cHV0X3RlbnNvcl91aW50X3JhbmdlGAggASgLMjMubWVkaWFwaXBlLkltYWdl", + "VG9UZW5zb3JDYWxjdWxhdG9yT3B0aW9ucy5VSW50UmFuZ2VIABItCgpncHVf", + "b3JpZ2luGAUgASgOMhkubWVkaWFwaXBlLkdwdU9yaWdpbi5Nb2RlEkkKC2Jv", + "cmRlcl9tb2RlGAYgASgOMjQubWVkaWFwaXBlLkltYWdlVG9UZW5zb3JDYWxj", + "dWxhdG9yT3B0aW9ucy5Cb3JkZXJNb2RlGiYKCkZsb2F0UmFuZ2USCwoDbWlu", + "GAEgASgCEgsKA21heBgCIAEoAhokCghJbnRSYW5nZRILCgNtaW4YASABKAMS", + "CwoDbWF4GAIgASgDGiUKCVVJbnRSYW5nZRILCgNtaW4YASABKAQSCwoDbWF4", + "GAIgASgEIksKCkJvcmRlck1vZGUSFgoSQk9SREVSX1VOU1BFQ0lGSUVEEAAS", + "DwoLQk9SREVSX1pFUk8QARIUChBCT1JERVJfUkVQTElDQVRFEAIyWAoDZXh0", + "EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGNPqt58BIAEoCzIpLm1l", + "ZGlhcGlwZS5JbWFnZVRvVGVuc29yQ2FsY3VsYXRvck9wdGlvbnNCBwoFcmFu", + "Z2U=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.GpuOriginReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageToTensorCalculatorOptions), global::Mediapipe.ImageToTensorCalculatorOptions.Parser, new[]{ "OutputTensorWidth", "OutputTensorHeight", "KeepAspectRatio", "OutputTensorFloatRange", "OutputTensorIntRange", "OutputTensorUintRange", "GpuOrigin", "BorderMode" }, new[]{ "Range" }, new[]{ typeof(global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode) }, new pb::Extension[] { global::Mediapipe.ImageToTensorCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange), global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange.Parser, new[]{ "Min", "Max" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange), global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange.Parser, new[]{ "Min", "Max" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange), global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange.Parser, new[]{ "Min", "Max" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class ImageToTensorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageToTensorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageToTensorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageToTensorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageToTensorCalculatorOptions(ImageToTensorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputTensorWidth_ = other.outputTensorWidth_; + outputTensorHeight_ = other.outputTensorHeight_; + keepAspectRatio_ = other.keepAspectRatio_; + gpuOrigin_ = other.gpuOrigin_; + borderMode_ = other.borderMode_; + switch (other.RangeCase) { + case RangeOneofCase.OutputTensorFloatRange: + OutputTensorFloatRange = other.OutputTensorFloatRange.Clone(); + break; + case RangeOneofCase.OutputTensorIntRange: + OutputTensorIntRange = other.OutputTensorIntRange.Clone(); + break; + case RangeOneofCase.OutputTensorUintRange: + OutputTensorUintRange = other.OutputTensorUintRange.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageToTensorCalculatorOptions Clone() { + return new ImageToTensorCalculatorOptions(this); + } + + /// Field number for the "output_tensor_width" field. + public const int OutputTensorWidthFieldNumber = 1; + private readonly static int OutputTensorWidthDefaultValue = 0; + + private int outputTensorWidth_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputTensorWidth { + get { if ((_hasBits0 & 1) != 0) { return outputTensorWidth_; } else { return OutputTensorWidthDefaultValue; } } + set { + _hasBits0 |= 1; + outputTensorWidth_ = value; + } + } + /// Gets whether the "output_tensor_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputTensorWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_tensor_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputTensorWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "output_tensor_height" field. + public const int OutputTensorHeightFieldNumber = 2; + private readonly static int OutputTensorHeightDefaultValue = 0; + + private int outputTensorHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputTensorHeight { + get { if ((_hasBits0 & 2) != 0) { return outputTensorHeight_; } else { return OutputTensorHeightDefaultValue; } } + set { + _hasBits0 |= 2; + outputTensorHeight_ = value; + } + } + /// Gets whether the "output_tensor_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputTensorHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "output_tensor_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputTensorHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "keep_aspect_ratio" field. + public const int KeepAspectRatioFieldNumber = 3; + private readonly static bool KeepAspectRatioDefaultValue = false; + + private bool keepAspectRatio_; + /// + /// If true, image region will be extracted and copied into tensor keeping + /// region aspect ratio, which usually results in letterbox padding. Otherwise, + /// if false, image region is stretched to fill output tensor fully. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool KeepAspectRatio { + get { if ((_hasBits0 & 4) != 0) { return keepAspectRatio_; } else { return KeepAspectRatioDefaultValue; } } + set { + _hasBits0 |= 4; + keepAspectRatio_ = value; + } + } + /// Gets whether the "keep_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKeepAspectRatio { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "keep_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKeepAspectRatio() { + _hasBits0 &= ~4; + } + + /// Field number for the "output_tensor_float_range" field. + public const int OutputTensorFloatRangeFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange OutputTensorFloatRange { + get { return rangeCase_ == RangeOneofCase.OutputTensorFloatRange ? (global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange) range_ : null; } + set { + range_ = value; + rangeCase_ = value == null ? RangeOneofCase.None : RangeOneofCase.OutputTensorFloatRange; + } + } + + /// Field number for the "output_tensor_int_range" field. + public const int OutputTensorIntRangeFieldNumber = 7; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange OutputTensorIntRange { + get { return rangeCase_ == RangeOneofCase.OutputTensorIntRange ? (global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange) range_ : null; } + set { + range_ = value; + rangeCase_ = value == null ? RangeOneofCase.None : RangeOneofCase.OutputTensorIntRange; + } + } + + /// Field number for the "output_tensor_uint_range" field. + public const int OutputTensorUintRangeFieldNumber = 8; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange OutputTensorUintRange { + get { return rangeCase_ == RangeOneofCase.OutputTensorUintRange ? (global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange) range_ : null; } + set { + range_ = value; + rangeCase_ = value == null ? RangeOneofCase.None : RangeOneofCase.OutputTensorUintRange; + } + } + + /// Field number for the "gpu_origin" field. + public const int GpuOriginFieldNumber = 5; + private readonly static global::Mediapipe.GpuOrigin.Types.Mode GpuOriginDefaultValue = global::Mediapipe.GpuOrigin.Types.Mode.Default; + + private global::Mediapipe.GpuOrigin.Types.Mode gpuOrigin_; + /// + /// For CONVENTIONAL mode for OpenGL, input image starts at bottom and needs + /// to be flipped vertically as tensors are expected to start at top. + /// (DEFAULT or unset interpreted as CONVENTIONAL.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GpuOrigin.Types.Mode GpuOrigin { + get { if ((_hasBits0 & 8) != 0) { return gpuOrigin_; } else { return GpuOriginDefaultValue; } } + set { + _hasBits0 |= 8; + gpuOrigin_ = value; + } + } + /// Gets whether the "gpu_origin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuOrigin { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "gpu_origin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuOrigin() { + _hasBits0 &= ~8; + } + + /// Field number for the "border_mode" field. + public const int BorderModeFieldNumber = 6; + private readonly static global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode BorderModeDefaultValue = global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode.BorderUnspecified; + + private global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode borderMode_; + /// + /// Pixel extrapolation method. + /// When converting image to tensor it may happen that tensor needs to read + /// pixels outside image boundaries. Border mode helps to specify how such + /// pixels will be calculated. + /// + /// BORDER_REPLICATE is used by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode BorderMode { + get { if ((_hasBits0 & 16) != 0) { return borderMode_; } else { return BorderModeDefaultValue; } } + set { + _hasBits0 |= 16; + borderMode_ = value; + } + } + /// Gets whether the "border_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBorderMode { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "border_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBorderMode() { + _hasBits0 &= ~16; + } + + private object range_; + /// Enum of possible cases for the "range" oneof. + public enum RangeOneofCase { + None = 0, + OutputTensorFloatRange = 4, + OutputTensorIntRange = 7, + OutputTensorUintRange = 8, + } + private RangeOneofCase rangeCase_ = RangeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RangeOneofCase RangeCase { + get { return rangeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRange() { + rangeCase_ = RangeOneofCase.None; + range_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageToTensorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageToTensorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputTensorWidth != other.OutputTensorWidth) return false; + if (OutputTensorHeight != other.OutputTensorHeight) return false; + if (KeepAspectRatio != other.KeepAspectRatio) return false; + if (!object.Equals(OutputTensorFloatRange, other.OutputTensorFloatRange)) return false; + if (!object.Equals(OutputTensorIntRange, other.OutputTensorIntRange)) return false; + if (!object.Equals(OutputTensorUintRange, other.OutputTensorUintRange)) return false; + if (GpuOrigin != other.GpuOrigin) return false; + if (BorderMode != other.BorderMode) return false; + if (RangeCase != other.RangeCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputTensorWidth) hash ^= OutputTensorWidth.GetHashCode(); + if (HasOutputTensorHeight) hash ^= OutputTensorHeight.GetHashCode(); + if (HasKeepAspectRatio) hash ^= KeepAspectRatio.GetHashCode(); + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) hash ^= OutputTensorFloatRange.GetHashCode(); + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) hash ^= OutputTensorIntRange.GetHashCode(); + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) hash ^= OutputTensorUintRange.GetHashCode(); + if (HasGpuOrigin) hash ^= GpuOrigin.GetHashCode(); + if (HasBorderMode) hash ^= BorderMode.GetHashCode(); + hash ^= (int) rangeCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputTensorWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputTensorWidth); + } + if (HasOutputTensorHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputTensorHeight); + } + if (HasKeepAspectRatio) { + output.WriteRawTag(24); + output.WriteBool(KeepAspectRatio); + } + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) { + output.WriteRawTag(34); + output.WriteMessage(OutputTensorFloatRange); + } + if (HasGpuOrigin) { + output.WriteRawTag(40); + output.WriteEnum((int) GpuOrigin); + } + if (HasBorderMode) { + output.WriteRawTag(48); + output.WriteEnum((int) BorderMode); + } + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) { + output.WriteRawTag(58); + output.WriteMessage(OutputTensorIntRange); + } + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) { + output.WriteRawTag(66); + output.WriteMessage(OutputTensorUintRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputTensorWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputTensorWidth); + } + if (HasOutputTensorHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputTensorHeight); + } + if (HasKeepAspectRatio) { + output.WriteRawTag(24); + output.WriteBool(KeepAspectRatio); + } + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) { + output.WriteRawTag(34); + output.WriteMessage(OutputTensorFloatRange); + } + if (HasGpuOrigin) { + output.WriteRawTag(40); + output.WriteEnum((int) GpuOrigin); + } + if (HasBorderMode) { + output.WriteRawTag(48); + output.WriteEnum((int) BorderMode); + } + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) { + output.WriteRawTag(58); + output.WriteMessage(OutputTensorIntRange); + } + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) { + output.WriteRawTag(66); + output.WriteMessage(OutputTensorUintRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputTensorWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputTensorWidth); + } + if (HasOutputTensorHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputTensorHeight); + } + if (HasKeepAspectRatio) { + size += 1 + 1; + } + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputTensorFloatRange); + } + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputTensorIntRange); + } + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputTensorUintRange); + } + if (HasGpuOrigin) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GpuOrigin); + } + if (HasBorderMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) BorderMode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageToTensorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputTensorWidth) { + OutputTensorWidth = other.OutputTensorWidth; + } + if (other.HasOutputTensorHeight) { + OutputTensorHeight = other.OutputTensorHeight; + } + if (other.HasKeepAspectRatio) { + KeepAspectRatio = other.KeepAspectRatio; + } + if (other.HasGpuOrigin) { + GpuOrigin = other.GpuOrigin; + } + if (other.HasBorderMode) { + BorderMode = other.BorderMode; + } + switch (other.RangeCase) { + case RangeOneofCase.OutputTensorFloatRange: + if (OutputTensorFloatRange == null) { + OutputTensorFloatRange = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange(); + } + OutputTensorFloatRange.MergeFrom(other.OutputTensorFloatRange); + break; + case RangeOneofCase.OutputTensorIntRange: + if (OutputTensorIntRange == null) { + OutputTensorIntRange = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange(); + } + OutputTensorIntRange.MergeFrom(other.OutputTensorIntRange); + break; + case RangeOneofCase.OutputTensorUintRange: + if (OutputTensorUintRange == null) { + OutputTensorUintRange = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange(); + } + OutputTensorUintRange.MergeFrom(other.OutputTensorUintRange); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputTensorWidth = input.ReadInt32(); + break; + } + case 16: { + OutputTensorHeight = input.ReadInt32(); + break; + } + case 24: { + KeepAspectRatio = input.ReadBool(); + break; + } + case 34: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) { + subBuilder.MergeFrom(OutputTensorFloatRange); + } + input.ReadMessage(subBuilder); + OutputTensorFloatRange = subBuilder; + break; + } + case 40: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 48: { + BorderMode = (global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 58: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) { + subBuilder.MergeFrom(OutputTensorIntRange); + } + input.ReadMessage(subBuilder); + OutputTensorIntRange = subBuilder; + break; + } + case 66: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) { + subBuilder.MergeFrom(OutputTensorUintRange); + } + input.ReadMessage(subBuilder); + OutputTensorUintRange = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputTensorWidth = input.ReadInt32(); + break; + } + case 16: { + OutputTensorHeight = input.ReadInt32(); + break; + } + case 24: { + KeepAspectRatio = input.ReadBool(); + break; + } + case 34: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.FloatRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorFloatRange) { + subBuilder.MergeFrom(OutputTensorFloatRange); + } + input.ReadMessage(subBuilder); + OutputTensorFloatRange = subBuilder; + break; + } + case 40: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 48: { + BorderMode = (global::Mediapipe.ImageToTensorCalculatorOptions.Types.BorderMode) input.ReadEnum(); + break; + } + case 58: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.IntRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorIntRange) { + subBuilder.MergeFrom(OutputTensorIntRange); + } + input.ReadMessage(subBuilder); + OutputTensorIntRange = subBuilder; + break; + } + case 66: { + global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange subBuilder = new global::Mediapipe.ImageToTensorCalculatorOptions.Types.UIntRange(); + if (rangeCase_ == RangeOneofCase.OutputTensorUintRange) { + subBuilder.MergeFrom(OutputTensorUintRange); + } + input.ReadMessage(subBuilder); + OutputTensorUintRange = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ImageToTensorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Pixel extrapolation methods. See @border_mode. + /// + public enum BorderMode { + [pbr::OriginalName("BORDER_UNSPECIFIED")] BorderUnspecified = 0, + [pbr::OriginalName("BORDER_ZERO")] BorderZero = 1, + [pbr::OriginalName("BORDER_REPLICATE")] BorderReplicate = 2, + } + + /// + /// Range of float values [min, max]. + /// min, must be strictly less than max. + /// + public sealed partial class FloatRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FloatRange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageToTensorCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FloatRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FloatRange(FloatRange other) : this() { + _hasBits0 = other._hasBits0; + min_ = other.min_; + max_ = other.max_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FloatRange Clone() { + return new FloatRange(this); + } + + /// Field number for the "min" field. + public const int MinFieldNumber = 1; + private readonly static float MinDefaultValue = 0F; + + private float min_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Min { + get { if ((_hasBits0 & 1) != 0) { return min_; } else { return MinDefaultValue; } } + set { + _hasBits0 |= 1; + min_ = value; + } + } + /// Gets whether the "min" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMin() { + _hasBits0 &= ~1; + } + + /// Field number for the "max" field. + public const int MaxFieldNumber = 2; + private readonly static float MaxDefaultValue = 0F; + + private float max_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Max { + get { if ((_hasBits0 & 2) != 0) { return max_; } else { return MaxDefaultValue; } } + set { + _hasBits0 |= 2; + max_ = value; + } + } + /// Gets whether the "max" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMax { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMax() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FloatRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FloatRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Min, other.Min)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Max, other.Max)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Min); + if (HasMax) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Max); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMin) { + size += 1 + 4; + } + if (HasMax) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FloatRange other) { + if (other == null) { + return; + } + if (other.HasMin) { + Min = other.Min; + } + if (other.HasMax) { + Max = other.Max; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Range of int values [min, max]. + /// min, must be strictly less than max. + /// Please note that IntRange is supported for CPU tensors only. + /// + public sealed partial class IntRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IntRange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageToTensorCalculatorOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IntRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IntRange(IntRange other) : this() { + _hasBits0 = other._hasBits0; + min_ = other.min_; + max_ = other.max_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IntRange Clone() { + return new IntRange(this); + } + + /// Field number for the "min" field. + public const int MinFieldNumber = 1; + private readonly static long MinDefaultValue = 0L; + + private long min_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Min { + get { if ((_hasBits0 & 1) != 0) { return min_; } else { return MinDefaultValue; } } + set { + _hasBits0 |= 1; + min_ = value; + } + } + /// Gets whether the "min" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMin() { + _hasBits0 &= ~1; + } + + /// Field number for the "max" field. + public const int MaxFieldNumber = 2; + private readonly static long MaxDefaultValue = 0L; + + private long max_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Max { + get { if ((_hasBits0 & 2) != 0) { return max_; } else { return MaxDefaultValue; } } + set { + _hasBits0 |= 2; + max_ = value; + } + } + /// Gets whether the "max" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMax { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMax() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IntRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IntRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Min != other.Min) return false; + if (Max != other.Max) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMin) hash ^= Min.GetHashCode(); + if (HasMax) hash ^= Max.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMin) { + output.WriteRawTag(8); + output.WriteInt64(Min); + } + if (HasMax) { + output.WriteRawTag(16); + output.WriteInt64(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMin) { + output.WriteRawTag(8); + output.WriteInt64(Min); + } + if (HasMax) { + output.WriteRawTag(16); + output.WriteInt64(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMin) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Min); + } + if (HasMax) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Max); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IntRange other) { + if (other == null) { + return; + } + if (other.HasMin) { + Min = other.Min; + } + if (other.HasMax) { + Max = other.Max; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Min = input.ReadInt64(); + break; + } + case 16: { + Max = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Min = input.ReadInt64(); + break; + } + case 16: { + Max = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// Range of uint values [min, max]. + /// min, must be strictly less than max. + /// Please note that UIntRange is supported for CPU tensors only. + /// + public sealed partial class UIntRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UIntRange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageToTensorCalculatorOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UIntRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UIntRange(UIntRange other) : this() { + _hasBits0 = other._hasBits0; + min_ = other.min_; + max_ = other.max_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public UIntRange Clone() { + return new UIntRange(this); + } + + /// Field number for the "min" field. + public const int MinFieldNumber = 1; + private readonly static ulong MinDefaultValue = 0UL; + + private ulong min_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong Min { + get { if ((_hasBits0 & 1) != 0) { return min_; } else { return MinDefaultValue; } } + set { + _hasBits0 |= 1; + min_ = value; + } + } + /// Gets whether the "min" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMin() { + _hasBits0 &= ~1; + } + + /// Field number for the "max" field. + public const int MaxFieldNumber = 2; + private readonly static ulong MaxDefaultValue = 0UL; + + private ulong max_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong Max { + get { if ((_hasBits0 & 2) != 0) { return max_; } else { return MaxDefaultValue; } } + set { + _hasBits0 |= 2; + max_ = value; + } + } + /// Gets whether the "max" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMax { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMax() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as UIntRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(UIntRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Min != other.Min) return false; + if (Max != other.Max) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMin) hash ^= Min.GetHashCode(); + if (HasMax) hash ^= Max.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMin) { + output.WriteRawTag(8); + output.WriteUInt64(Min); + } + if (HasMax) { + output.WriteRawTag(16); + output.WriteUInt64(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMin) { + output.WriteRawTag(8); + output.WriteUInt64(Min); + } + if (HasMax) { + output.WriteRawTag(16); + output.WriteUInt64(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMin) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Min); + } + if (HasMax) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Max); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(UIntRange other) { + if (other == null) { + return; + } + if (other.HasMin) { + Min = other.Min; + } + if (other.HasMax) { + Max = other.Max; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Min = input.ReadUInt64(); + break; + } + case 16: { + Max = input.ReadUInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Min = input.ReadUInt64(); + break; + } + case 16: { + Max = input.ReadUInt64(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the ImageToTensorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(334361939, pb::FieldCodec.ForMessage(2674895514, global::Mediapipe.ImageToTensorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs.meta new file mode 100644 index 0000000..466b24b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/ImageToTensorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e9f115502f89560c8a0beea6c84a379 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs new file mode 100644 index 0000000..fe054c1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs @@ -0,0 +1,2228 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/inference_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/inference_calculator.proto + public static partial class InferenceCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/inference_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static InferenceCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjdtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL2luZmVyZW5jZV9jYWxj", + "dWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsv", + "Y2FsY3VsYXRvci5wcm90bxosbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxh", + "dG9yX29wdGlvbnMucHJvdG8ikwkKGkluZmVyZW5jZUNhbGN1bGF0b3JPcHRp", + "b25zEhIKCm1vZGVsX3BhdGgYASABKAkSGgoHdXNlX2dwdRgCIAEoCDoFZmFs", + "c2VCAhgBEhwKCXVzZV9ubmFwaRgDIAEoCDoFZmFsc2VCAhgBEhoKDmNwdV9u", + "dW1fdGhyZWFkGAQgASgFOgItMRJACghkZWxlZ2F0ZRgFIAEoCzIuLm1lZGlh", + "cGlwZS5JbmZlcmVuY2VDYWxjdWxhdG9yT3B0aW9ucy5EZWxlZ2F0ZRryBgoI", + "RGVsZWdhdGUSRwoGdGZsaXRlGAEgASgLMjUubWVkaWFwaXBlLkluZmVyZW5j", + "ZUNhbGN1bGF0b3JPcHRpb25zLkRlbGVnYXRlLlRmTGl0ZUgAEkEKA2dwdRgC", + "IAEoCzIyLm1lZGlhcGlwZS5JbmZlcmVuY2VDYWxjdWxhdG9yT3B0aW9ucy5E", + "ZWxlZ2F0ZS5HcHVIABJFCgVubmFwaRgDIAEoCzI0Lm1lZGlhcGlwZS5JbmZl", + "cmVuY2VDYWxjdWxhdG9yT3B0aW9ucy5EZWxlZ2F0ZS5ObmFwaUgAEkkKB3hu", + "bnBhY2sYBCABKAsyNi5tZWRpYXBpcGUuSW5mZXJlbmNlQ2FsY3VsYXRvck9w", + "dGlvbnMuRGVsZWdhdGUuWG5ucGFja0gAGggKBlRmTGl0ZRrCAwoDR3B1EiMK", + "FHVzZV9hZHZhbmNlZF9ncHVfYXBpGAEgASgIOgVmYWxzZRJICgNhcGkYBCAB", + "KA4yNi5tZWRpYXBpcGUuSW5mZXJlbmNlQ2FsY3VsYXRvck9wdGlvbnMuRGVs", + "ZWdhdGUuR3B1LkFwaToDQU5ZEiIKFGFsbG93X3ByZWNpc2lvbl9sb3NzGAMg", + "ASgIOgR0cnVlEhoKEmNhY2hlZF9rZXJuZWxfcGF0aBgCIAEoCRIcChRzZXJp", + "YWxpemVkX21vZGVsX2RpchgHIAEoCRITCgttb2RlbF90b2tlbhgIIAEoCRJh", + "CgV1c2FnZRgFIAEoDjJBLm1lZGlhcGlwZS5JbmZlcmVuY2VDYWxjdWxhdG9y", + "T3B0aW9ucy5EZWxlZ2F0ZS5HcHUuSW5mZXJlbmNlVXNhZ2U6D1NVU1RBSU5F", + "RF9TUEVFRCImCgNBcGkSBwoDQU5ZEAASCgoGT1BFTkdMEAESCgoGT1BFTkNM", + "EAIiTgoOSW5mZXJlbmNlVXNhZ2USDwoLVU5TUEVDSUZJRUQQABIWChJGQVNU", + "X1NJTkdMRV9BTlNXRVIQARITCg9TVVNUQUlORURfU1BFRUQQAhpJCgVObmFw", + "aRIRCgljYWNoZV9kaXIYASABKAkSEwoLbW9kZWxfdG9rZW4YAiABKAkSGAoQ", + "YWNjZWxlcmF0b3JfbmFtZRgDIAEoCRoiCgdYbm5wYWNrEhcKC251bV90aHJl", + "YWRzGAEgASgFOgItMUIKCghkZWxlZ2F0ZTJUCgNleHQSHC5tZWRpYXBpcGUu", + "Q2FsY3VsYXRvck9wdGlvbnMY99PLoAEgASgLMiUubWVkaWFwaXBlLkluZmVy", + "ZW5jZUNhbGN1bGF0b3JPcHRpb25zQkEKJWNvbS5nb29nbGUubWVkaWFwaXBl", + "LmNhbGN1bGF0b3IucHJvdG9CGEluZmVyZW5jZUNhbGN1bGF0b3JQcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions), global::Mediapipe.InferenceCalculatorOptions.Parser, new[]{ "ModelPath", "UseGpu", "UseNnapi", "CpuNumThread", "Delegate" }, null, null, new pb::Extension[] { global::Mediapipe.InferenceCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate), global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Parser, new[]{ "Tflite", "Gpu", "Nnapi", "Xnnpack" }, new[]{ "Delegate" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite), global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu), global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Parser, new[]{ "UseAdvancedGpuApi", "Api", "AllowPrecisionLoss", "CachedKernelPath", "SerializedModelDir", "ModelToken", "Usage" }, null, new[]{ typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api), typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi), global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi.Parser, new[]{ "CacheDir", "ModelToken", "AcceleratorName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack), global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack.Parser, new[]{ "NumThreads" }, null, null, null, null)})}) + })); + } + #endregion + + } + #region Messages + /// + /// Full Example: + /// + /// node { + /// calculator: "InferenceCalculator" + /// input_stream: "TENSOR_IN:image_tensors" + /// output_stream: "TENSOR_OUT:result_tensors" + /// options { + /// [mediapipe.InferenceCalculatorOptions.ext] { + /// model_path: "model.tflite" + /// delegate { gpu {} } + /// } + /// } + /// } + /// + public sealed partial class InferenceCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InferenceCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InferenceCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InferenceCalculatorOptions(InferenceCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + modelPath_ = other.modelPath_; + useGpu_ = other.useGpu_; + useNnapi_ = other.useNnapi_; + cpuNumThread_ = other.cpuNumThread_; + delegate_ = other.delegate_ != null ? other.delegate_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InferenceCalculatorOptions Clone() { + return new InferenceCalculatorOptions(this); + } + + /// Field number for the "model_path" field. + public const int ModelPathFieldNumber = 1; + private readonly static string ModelPathDefaultValue = ""; + + private string modelPath_; + /// + /// Path to the TF Lite model (ex: /path/to/modelname.tflite). + /// On mobile, this is generally just modelname.tflite. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelPath { + get { return modelPath_ ?? ModelPathDefaultValue; } + set { + modelPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelPath { + get { return modelPath_ != null; } + } + /// Clears the value of the "model_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelPath() { + modelPath_ = null; + } + + /// Field number for the "use_gpu" field. + public const int UseGpuFieldNumber = 2; + private readonly static bool UseGpuDefaultValue = false; + + private bool useGpu_; + /// + /// Whether the TF Lite GPU or CPU backend should be used. Effective only when + /// input tensors are on CPU. For input tensors on GPU, GPU backend is always + /// used. + /// DEPRECATED: configure "delegate" instead. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseGpu { + get { if ((_hasBits0 & 1) != 0) { return useGpu_; } else { return UseGpuDefaultValue; } } + set { + _hasBits0 |= 1; + useGpu_ = value; + } + } + /// Gets whether the "use_gpu" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseGpu { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "use_gpu" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseGpu() { + _hasBits0 &= ~1; + } + + /// Field number for the "use_nnapi" field. + public const int UseNnapiFieldNumber = 3; + private readonly static bool UseNnapiDefaultValue = false; + + private bool useNnapi_; + /// + /// Android only. When true, an NNAPI delegate will be used for inference. + /// If NNAPI is not available, then the default CPU delegate will be used + /// automatically. + /// DEPRECATED: configure "delegate" instead. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseNnapi { + get { if ((_hasBits0 & 2) != 0) { return useNnapi_; } else { return UseNnapiDefaultValue; } } + set { + _hasBits0 |= 2; + useNnapi_ = value; + } + } + /// Gets whether the "use_nnapi" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseNnapi { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "use_nnapi" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseNnapi() { + _hasBits0 &= ~2; + } + + /// Field number for the "cpu_num_thread" field. + public const int CpuNumThreadFieldNumber = 4; + private readonly static int CpuNumThreadDefaultValue = -1; + + private int cpuNumThread_; + /// + /// The number of threads available to the interpreter. Effective only when + /// input tensors are on CPU and 'use_gpu' is false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CpuNumThread { + get { if ((_hasBits0 & 4) != 0) { return cpuNumThread_; } else { return CpuNumThreadDefaultValue; } } + set { + _hasBits0 |= 4; + cpuNumThread_ = value; + } + } + /// Gets whether the "cpu_num_thread" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCpuNumThread { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "cpu_num_thread" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCpuNumThread() { + _hasBits0 &= ~4; + } + + /// Field number for the "delegate" field. + public const int DelegateFieldNumber = 5; + private global::Mediapipe.InferenceCalculatorOptions.Types.Delegate delegate_; + /// + /// TfLite delegate to run inference. + /// If not specified, TFLite GPU delegate is used by default (as if "gpu {}" + /// is specified) unless GPU support is disabled in the build (i.e., with + /// --define MEDIAPIPE_DISABLE_GPU=1), in which case regular TFLite on CPU is + /// used (as if "tflite {}" is specified) except when building with emscripten + /// where xnnpack is used. + /// NOTE: use_gpu/use_nnapi are ignored if specified. (Delegate takes + /// precedence over use_* deprecated options.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate Delegate { + get { return delegate_; } + set { + delegate_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InferenceCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InferenceCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ModelPath != other.ModelPath) return false; + if (UseGpu != other.UseGpu) return false; + if (UseNnapi != other.UseNnapi) return false; + if (CpuNumThread != other.CpuNumThread) return false; + if (!object.Equals(Delegate, other.Delegate)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasModelPath) hash ^= ModelPath.GetHashCode(); + if (HasUseGpu) hash ^= UseGpu.GetHashCode(); + if (HasUseNnapi) hash ^= UseNnapi.GetHashCode(); + if (HasCpuNumThread) hash ^= CpuNumThread.GetHashCode(); + if (delegate_ != null) hash ^= Delegate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (HasUseGpu) { + output.WriteRawTag(16); + output.WriteBool(UseGpu); + } + if (HasUseNnapi) { + output.WriteRawTag(24); + output.WriteBool(UseNnapi); + } + if (HasCpuNumThread) { + output.WriteRawTag(32); + output.WriteInt32(CpuNumThread); + } + if (delegate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Delegate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (HasUseGpu) { + output.WriteRawTag(16); + output.WriteBool(UseGpu); + } + if (HasUseNnapi) { + output.WriteRawTag(24); + output.WriteBool(UseNnapi); + } + if (HasCpuNumThread) { + output.WriteRawTag(32); + output.WriteInt32(CpuNumThread); + } + if (delegate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Delegate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasModelPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelPath); + } + if (HasUseGpu) { + size += 1 + 1; + } + if (HasUseNnapi) { + size += 1 + 1; + } + if (HasCpuNumThread) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CpuNumThread); + } + if (delegate_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Delegate); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InferenceCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasModelPath) { + ModelPath = other.ModelPath; + } + if (other.HasUseGpu) { + UseGpu = other.UseGpu; + } + if (other.HasUseNnapi) { + UseNnapi = other.UseNnapi; + } + if (other.HasCpuNumThread) { + CpuNumThread = other.CpuNumThread; + } + if (other.delegate_ != null) { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + Delegate.MergeFrom(other.Delegate); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 16: { + UseGpu = input.ReadBool(); + break; + } + case 24: { + UseNnapi = input.ReadBool(); + break; + } + case 32: { + CpuNumThread = input.ReadInt32(); + break; + } + case 42: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 16: { + UseGpu = input.ReadBool(); + break; + } + case 24: { + UseNnapi = input.ReadBool(); + break; + } + case 32: { + CpuNumThread = input.ReadInt32(); + break; + } + case 42: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the InferenceCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Delegate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Delegate()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate(Delegate other) : this() { + switch (other.DelegateCase) { + case DelegateOneofCase.Tflite: + Tflite = other.Tflite.Clone(); + break; + case DelegateOneofCase.Gpu: + Gpu = other.Gpu.Clone(); + break; + case DelegateOneofCase.Nnapi: + Nnapi = other.Nnapi.Clone(); + break; + case DelegateOneofCase.Xnnpack: + Xnnpack = other.Xnnpack.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate Clone() { + return new Delegate(this); + } + + /// Field number for the "tflite" field. + public const int TfliteFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite Tflite { + get { return delegateCase_ == DelegateOneofCase.Tflite ? (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Tflite; + } + } + + /// Field number for the "gpu" field. + public const int GpuFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu Gpu { + get { return delegateCase_ == DelegateOneofCase.Gpu ? (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Gpu; + } + } + + /// Field number for the "nnapi" field. + public const int NnapiFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi Nnapi { + get { return delegateCase_ == DelegateOneofCase.Nnapi ? (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Nnapi; + } + } + + /// Field number for the "xnnpack" field. + public const int XnnpackFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack Xnnpack { + get { return delegateCase_ == DelegateOneofCase.Xnnpack ? (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Xnnpack; + } + } + + private object delegate_; + /// Enum of possible cases for the "delegate" oneof. + public enum DelegateOneofCase { + None = 0, + Tflite = 1, + Gpu = 2, + Nnapi = 3, + Xnnpack = 4, + } + private DelegateOneofCase delegateCase_ = DelegateOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DelegateOneofCase DelegateCase { + get { return delegateCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDelegate() { + delegateCase_ = DelegateOneofCase.None; + delegate_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Delegate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Delegate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Tflite, other.Tflite)) return false; + if (!object.Equals(Gpu, other.Gpu)) return false; + if (!object.Equals(Nnapi, other.Nnapi)) return false; + if (!object.Equals(Xnnpack, other.Xnnpack)) return false; + if (DelegateCase != other.DelegateCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (delegateCase_ == DelegateOneofCase.Tflite) hash ^= Tflite.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Gpu) hash ^= Gpu.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Nnapi) hash ^= Nnapi.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) hash ^= Xnnpack.GetHashCode(); + hash ^= (int) delegateCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (delegateCase_ == DelegateOneofCase.Tflite) { + output.WriteRawTag(10); + output.WriteMessage(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + output.WriteRawTag(18); + output.WriteMessage(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + output.WriteRawTag(26); + output.WriteMessage(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + output.WriteRawTag(34); + output.WriteMessage(Xnnpack); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (delegateCase_ == DelegateOneofCase.Tflite) { + output.WriteRawTag(10); + output.WriteMessage(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + output.WriteRawTag(18); + output.WriteMessage(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + output.WriteRawTag(26); + output.WriteMessage(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + output.WriteRawTag(34); + output.WriteMessage(Xnnpack); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (delegateCase_ == DelegateOneofCase.Tflite) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Xnnpack); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Delegate other) { + if (other == null) { + return; + } + switch (other.DelegateCase) { + case DelegateOneofCase.Tflite: + if (Tflite == null) { + Tflite = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + } + Tflite.MergeFrom(other.Tflite); + break; + case DelegateOneofCase.Gpu: + if (Gpu == null) { + Gpu = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + } + Gpu.MergeFrom(other.Gpu); + break; + case DelegateOneofCase.Nnapi: + if (Nnapi == null) { + Nnapi = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + } + Nnapi.MergeFrom(other.Nnapi); + break; + case DelegateOneofCase.Xnnpack: + if (Xnnpack == null) { + Xnnpack = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + } + Xnnpack.MergeFrom(other.Xnnpack); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + if (delegateCase_ == DelegateOneofCase.Tflite) { + subBuilder.MergeFrom(Tflite); + } + input.ReadMessage(subBuilder); + Tflite = subBuilder; + break; + } + case 18: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + if (delegateCase_ == DelegateOneofCase.Gpu) { + subBuilder.MergeFrom(Gpu); + } + input.ReadMessage(subBuilder); + Gpu = subBuilder; + break; + } + case 26: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + if (delegateCase_ == DelegateOneofCase.Nnapi) { + subBuilder.MergeFrom(Nnapi); + } + input.ReadMessage(subBuilder); + Nnapi = subBuilder; + break; + } + case 34: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + subBuilder.MergeFrom(Xnnpack); + } + input.ReadMessage(subBuilder); + Xnnpack = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + if (delegateCase_ == DelegateOneofCase.Tflite) { + subBuilder.MergeFrom(Tflite); + } + input.ReadMessage(subBuilder); + Tflite = subBuilder; + break; + } + case 18: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + if (delegateCase_ == DelegateOneofCase.Gpu) { + subBuilder.MergeFrom(Gpu); + } + input.ReadMessage(subBuilder); + Gpu = subBuilder; + break; + } + case 26: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + if (delegateCase_ == DelegateOneofCase.Nnapi) { + subBuilder.MergeFrom(Nnapi); + } + input.ReadMessage(subBuilder); + Nnapi = subBuilder; + break; + } + case 34: { + global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack subBuilder = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + subBuilder.MergeFrom(Xnnpack); + } + input.ReadMessage(subBuilder); + Xnnpack = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Delegate message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Default inference provided by tflite. + /// + public sealed partial class TfLite : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLite()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite(TfLite other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite Clone() { + return new TfLite(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLite); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLite other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLite other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + /// + /// Delegate to run GPU inference depending on the device. + /// (Can use OpenGl, OpenCl, Metal depending on the device.) + /// + public sealed partial class Gpu : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Gpu()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu(Gpu other) : this() { + _hasBits0 = other._hasBits0; + useAdvancedGpuApi_ = other.useAdvancedGpuApi_; + api_ = other.api_; + allowPrecisionLoss_ = other.allowPrecisionLoss_; + cachedKernelPath_ = other.cachedKernelPath_; + serializedModelDir_ = other.serializedModelDir_; + modelToken_ = other.modelToken_; + usage_ = other.usage_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu Clone() { + return new Gpu(this); + } + + /// Field number for the "use_advanced_gpu_api" field. + public const int UseAdvancedGpuApiFieldNumber = 1; + private readonly static bool UseAdvancedGpuApiDefaultValue = false; + + private bool useAdvancedGpuApi_; + /// + /// Experimental, Android/Linux only. Use TFLite GPU delegate API2 for + /// the NN inference. + /// example: + /// delegate: { gpu { use_advanced_gpu_api: true } } + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseAdvancedGpuApi { + get { if ((_hasBits0 & 1) != 0) { return useAdvancedGpuApi_; } else { return UseAdvancedGpuApiDefaultValue; } } + set { + _hasBits0 |= 1; + useAdvancedGpuApi_ = value; + } + } + /// Gets whether the "use_advanced_gpu_api" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseAdvancedGpuApi { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "use_advanced_gpu_api" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseAdvancedGpuApi() { + _hasBits0 &= ~1; + } + + /// Field number for the "api" field. + public const int ApiFieldNumber = 4; + private readonly static global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api ApiDefaultValue = global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api.Any; + + private global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api api_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api Api { + get { if ((_hasBits0 & 4) != 0) { return api_; } else { return ApiDefaultValue; } } + set { + _hasBits0 |= 4; + api_ = value; + } + } + /// Gets whether the "api" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasApi { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "api" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearApi() { + _hasBits0 &= ~4; + } + + /// Field number for the "allow_precision_loss" field. + public const int AllowPrecisionLossFieldNumber = 3; + private readonly static bool AllowPrecisionLossDefaultValue = true; + + private bool allowPrecisionLoss_; + /// + /// This option is valid for TFLite GPU delegate API2 only, + /// Set to true to use 16-bit float precision. If max precision is needed, + /// set to false for 32-bit float calculations only. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AllowPrecisionLoss { + get { if ((_hasBits0 & 2) != 0) { return allowPrecisionLoss_; } else { return AllowPrecisionLossDefaultValue; } } + set { + _hasBits0 |= 2; + allowPrecisionLoss_ = value; + } + } + /// Gets whether the "allow_precision_loss" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAllowPrecisionLoss { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "allow_precision_loss" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAllowPrecisionLoss() { + _hasBits0 &= ~2; + } + + /// Field number for the "cached_kernel_path" field. + public const int CachedKernelPathFieldNumber = 2; + private readonly static string CachedKernelPathDefaultValue = ""; + + private string cachedKernelPath_; + /// + /// Load pre-compiled serialized binary cache to accelerate init process. + /// Only available for OpenCL delegate on Android. + /// Kernel caching will only be enabled if this path is set. + /// + /// NOTE: binary cache usage may be skipped if valid serialized model, + /// specified by "serialized_model_dir", exists. + /// + /// TODO: update to cached_kernel_dir + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CachedKernelPath { + get { return cachedKernelPath_ ?? CachedKernelPathDefaultValue; } + set { + cachedKernelPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cached_kernel_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCachedKernelPath { + get { return cachedKernelPath_ != null; } + } + /// Clears the value of the "cached_kernel_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCachedKernelPath() { + cachedKernelPath_ = null; + } + + /// Field number for the "serialized_model_dir" field. + public const int SerializedModelDirFieldNumber = 7; + private readonly static string SerializedModelDirDefaultValue = ""; + + private string serializedModelDir_; + /// + /// A dir to load from and save to a pre-compiled serialized model used to + /// accelerate init process. + /// + /// NOTE: available for OpenCL delegate on Android only when + /// "use_advanced_gpu_api" is set to true and "model_token" is set + /// properly. + /// + /// NOTE: serialized model takes precedence over binary cache + /// specified by "cached_kernel_path", which still can be used if + /// serialized model is invalid or missing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SerializedModelDir { + get { return serializedModelDir_ ?? SerializedModelDirDefaultValue; } + set { + serializedModelDir_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "serialized_model_dir" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSerializedModelDir { + get { return serializedModelDir_ != null; } + } + /// Clears the value of the "serialized_model_dir" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSerializedModelDir() { + serializedModelDir_ = null; + } + + /// Field number for the "model_token" field. + public const int ModelTokenFieldNumber = 8; + private readonly static string ModelTokenDefaultValue = ""; + + private string modelToken_; + /// + /// Unique token identifying the model. Used in conjunction with + /// "serialized_model_dir". It is the caller's responsibility to ensure + /// there is no clash of the tokens. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelToken { + get { return modelToken_ ?? ModelTokenDefaultValue; } + set { + modelToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_token" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelToken { + get { return modelToken_ != null; } + } + /// Clears the value of the "model_token" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelToken() { + modelToken_ = null; + } + + /// Field number for the "usage" field. + public const int UsageFieldNumber = 5; + private readonly static global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage UsageDefaultValue = global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage.SustainedSpeed; + + private global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage usage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage Usage { + get { if ((_hasBits0 & 8) != 0) { return usage_; } else { return UsageDefaultValue; } } + set { + _hasBits0 |= 8; + usage_ = value; + } + } + /// Gets whether the "usage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUsage { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "usage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUsage() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Gpu); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Gpu other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UseAdvancedGpuApi != other.UseAdvancedGpuApi) return false; + if (Api != other.Api) return false; + if (AllowPrecisionLoss != other.AllowPrecisionLoss) return false; + if (CachedKernelPath != other.CachedKernelPath) return false; + if (SerializedModelDir != other.SerializedModelDir) return false; + if (ModelToken != other.ModelToken) return false; + if (Usage != other.Usage) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasUseAdvancedGpuApi) hash ^= UseAdvancedGpuApi.GetHashCode(); + if (HasApi) hash ^= Api.GetHashCode(); + if (HasAllowPrecisionLoss) hash ^= AllowPrecisionLoss.GetHashCode(); + if (HasCachedKernelPath) hash ^= CachedKernelPath.GetHashCode(); + if (HasSerializedModelDir) hash ^= SerializedModelDir.GetHashCode(); + if (HasModelToken) hash ^= ModelToken.GetHashCode(); + if (HasUsage) hash ^= Usage.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasUseAdvancedGpuApi) { + output.WriteRawTag(8); + output.WriteBool(UseAdvancedGpuApi); + } + if (HasCachedKernelPath) { + output.WriteRawTag(18); + output.WriteString(CachedKernelPath); + } + if (HasAllowPrecisionLoss) { + output.WriteRawTag(24); + output.WriteBool(AllowPrecisionLoss); + } + if (HasApi) { + output.WriteRawTag(32); + output.WriteEnum((int) Api); + } + if (HasUsage) { + output.WriteRawTag(40); + output.WriteEnum((int) Usage); + } + if (HasSerializedModelDir) { + output.WriteRawTag(58); + output.WriteString(SerializedModelDir); + } + if (HasModelToken) { + output.WriteRawTag(66); + output.WriteString(ModelToken); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasUseAdvancedGpuApi) { + output.WriteRawTag(8); + output.WriteBool(UseAdvancedGpuApi); + } + if (HasCachedKernelPath) { + output.WriteRawTag(18); + output.WriteString(CachedKernelPath); + } + if (HasAllowPrecisionLoss) { + output.WriteRawTag(24); + output.WriteBool(AllowPrecisionLoss); + } + if (HasApi) { + output.WriteRawTag(32); + output.WriteEnum((int) Api); + } + if (HasUsage) { + output.WriteRawTag(40); + output.WriteEnum((int) Usage); + } + if (HasSerializedModelDir) { + output.WriteRawTag(58); + output.WriteString(SerializedModelDir); + } + if (HasModelToken) { + output.WriteRawTag(66); + output.WriteString(ModelToken); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasUseAdvancedGpuApi) { + size += 1 + 1; + } + if (HasApi) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Api); + } + if (HasAllowPrecisionLoss) { + size += 1 + 1; + } + if (HasCachedKernelPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CachedKernelPath); + } + if (HasSerializedModelDir) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializedModelDir); + } + if (HasModelToken) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelToken); + } + if (HasUsage) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Usage); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Gpu other) { + if (other == null) { + return; + } + if (other.HasUseAdvancedGpuApi) { + UseAdvancedGpuApi = other.UseAdvancedGpuApi; + } + if (other.HasApi) { + Api = other.Api; + } + if (other.HasAllowPrecisionLoss) { + AllowPrecisionLoss = other.AllowPrecisionLoss; + } + if (other.HasCachedKernelPath) { + CachedKernelPath = other.CachedKernelPath; + } + if (other.HasSerializedModelDir) { + SerializedModelDir = other.SerializedModelDir; + } + if (other.HasModelToken) { + ModelToken = other.ModelToken; + } + if (other.HasUsage) { + Usage = other.Usage; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + UseAdvancedGpuApi = input.ReadBool(); + break; + } + case 18: { + CachedKernelPath = input.ReadString(); + break; + } + case 24: { + AllowPrecisionLoss = input.ReadBool(); + break; + } + case 32: { + Api = (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api) input.ReadEnum(); + break; + } + case 40: { + Usage = (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) input.ReadEnum(); + break; + } + case 58: { + SerializedModelDir = input.ReadString(); + break; + } + case 66: { + ModelToken = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + UseAdvancedGpuApi = input.ReadBool(); + break; + } + case 18: { + CachedKernelPath = input.ReadString(); + break; + } + case 24: { + AllowPrecisionLoss = input.ReadBool(); + break; + } + case 32: { + Api = (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api) input.ReadEnum(); + break; + } + case 40: { + Usage = (global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) input.ReadEnum(); + break; + } + case 58: { + SerializedModelDir = input.ReadString(); + break; + } + case 66: { + ModelToken = input.ReadString(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Gpu message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// This option is valid for TFLite GPU delegate API2 only, + /// Choose any of available APIs to force running inference using it. + /// + public enum Api { + [pbr::OriginalName("ANY")] Any = 0, + [pbr::OriginalName("OPENGL")] Opengl = 1, + [pbr::OriginalName("OPENCL")] Opencl = 2, + } + + /// + /// Encapsulated compilation/runtime tradeoffs. + /// + public enum InferenceUsage { + [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, + /// + /// InferenceRunner will be used only once. Therefore, it is important to + /// minimize bootstrap time as well. + /// + [pbr::OriginalName("FAST_SINGLE_ANSWER")] FastSingleAnswer = 1, + /// + /// Prefer maximizing the throughput. Same inference runner will be used + /// repeatedly on different inputs. + /// + [pbr::OriginalName("SUSTAINED_SPEED")] SustainedSpeed = 2, + } + + } + #endregion + + } + + /// + /// Android only. + /// + public sealed partial class Nnapi : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Nnapi()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi(Nnapi other) : this() { + cacheDir_ = other.cacheDir_; + modelToken_ = other.modelToken_; + acceleratorName_ = other.acceleratorName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi Clone() { + return new Nnapi(this); + } + + /// Field number for the "cache_dir" field. + public const int CacheDirFieldNumber = 1; + private readonly static string CacheDirDefaultValue = ""; + + private string cacheDir_; + /// + /// Directory to store compilation cache. If unspecified, NNAPI will not + /// try caching the compilation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CacheDir { + get { return cacheDir_ ?? CacheDirDefaultValue; } + set { + cacheDir_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cache_dir" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCacheDir { + get { return cacheDir_ != null; } + } + /// Clears the value of the "cache_dir" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCacheDir() { + cacheDir_ = null; + } + + /// Field number for the "model_token" field. + public const int ModelTokenFieldNumber = 2; + private readonly static string ModelTokenDefaultValue = ""; + + private string modelToken_; + /// + /// Unique token identifying the model. It is the caller's responsibility + /// to ensure there is no clash of the tokens. If unspecified, NNAPI will + /// not try caching the compilation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelToken { + get { return modelToken_ ?? ModelTokenDefaultValue; } + set { + modelToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_token" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelToken { + get { return modelToken_ != null; } + } + /// Clears the value of the "model_token" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelToken() { + modelToken_ = null; + } + + /// Field number for the "accelerator_name" field. + public const int AcceleratorNameFieldNumber = 3; + private readonly static string AcceleratorNameDefaultValue = ""; + + private string acceleratorName_; + /// + /// The name of an accelerator to be used for NNAPI delegate, e.g. + /// "google-edgetpu". When not specified, it will be selected by NNAPI. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string AcceleratorName { + get { return acceleratorName_ ?? AcceleratorNameDefaultValue; } + set { + acceleratorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "accelerator_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAcceleratorName { + get { return acceleratorName_ != null; } + } + /// Clears the value of the "accelerator_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAcceleratorName() { + acceleratorName_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Nnapi); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Nnapi other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CacheDir != other.CacheDir) return false; + if (ModelToken != other.ModelToken) return false; + if (AcceleratorName != other.AcceleratorName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCacheDir) hash ^= CacheDir.GetHashCode(); + if (HasModelToken) hash ^= ModelToken.GetHashCode(); + if (HasAcceleratorName) hash ^= AcceleratorName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCacheDir) { + output.WriteRawTag(10); + output.WriteString(CacheDir); + } + if (HasModelToken) { + output.WriteRawTag(18); + output.WriteString(ModelToken); + } + if (HasAcceleratorName) { + output.WriteRawTag(26); + output.WriteString(AcceleratorName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCacheDir) { + output.WriteRawTag(10); + output.WriteString(CacheDir); + } + if (HasModelToken) { + output.WriteRawTag(18); + output.WriteString(ModelToken); + } + if (HasAcceleratorName) { + output.WriteRawTag(26); + output.WriteString(AcceleratorName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCacheDir) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CacheDir); + } + if (HasModelToken) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelToken); + } + if (HasAcceleratorName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AcceleratorName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Nnapi other) { + if (other == null) { + return; + } + if (other.HasCacheDir) { + CacheDir = other.CacheDir; + } + if (other.HasModelToken) { + ModelToken = other.ModelToken; + } + if (other.HasAcceleratorName) { + AcceleratorName = other.AcceleratorName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + CacheDir = input.ReadString(); + break; + } + case 18: { + ModelToken = input.ReadString(); + break; + } + case 26: { + AcceleratorName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + CacheDir = input.ReadString(); + break; + } + case 18: { + ModelToken = input.ReadString(); + break; + } + case 26: { + AcceleratorName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Xnnpack : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Xnnpack()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.InferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack(Xnnpack other) : this() { + _hasBits0 = other._hasBits0; + numThreads_ = other.numThreads_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack Clone() { + return new Xnnpack(this); + } + + /// Field number for the "num_threads" field. + public const int NumThreadsFieldNumber = 1; + private readonly static int NumThreadsDefaultValue = -1; + + private int numThreads_; + /// + /// Number of threads for XNNPACK delegate. (By default, calculator tries + /// to choose optimal number of threads depending on the device.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumThreads { + get { if ((_hasBits0 & 1) != 0) { return numThreads_; } else { return NumThreadsDefaultValue; } } + set { + _hasBits0 |= 1; + numThreads_ = value; + } + } + /// Gets whether the "num_threads" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumThreads { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_threads" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumThreads() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Xnnpack); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Xnnpack other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumThreads != other.NumThreads) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumThreads) hash ^= NumThreads.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumThreads) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumThreads); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Xnnpack other) { + if (other == null) { + return; + } + if (other.HasNumThreads) { + NumThreads = other.NumThreads; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the InferenceCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(336783863, pb::FieldCodec.ForMessage(2694270906, global::Mediapipe.InferenceCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs.meta new file mode 100644 index 0000000..1a9fd35 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3256e3d4b23c4d787b40f917afe06a43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs new file mode 100644 index 0000000..afcc657 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs @@ -0,0 +1,320 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/landmarks_to_tensor_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/landmarks_to_tensor_calculator.proto + public static partial class LandmarksToTensorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/landmarks_to_tensor_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarksToTensorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL2xhbmRtYXJrc190b190", + "ZW5zb3JfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ipwIKIkxhbmRtYXJrc1RvVGVu", + "c29yQ2FsY3VsYXRvck9wdGlvbnMSSwoKYXR0cmlidXRlcxgBIAMoDjI3Lm1l", + "ZGlhcGlwZS5MYW5kbWFya3NUb1RlbnNvckNhbGN1bGF0b3JPcHRpb25zLkF0", + "dHJpYnV0ZRIWCgdmbGF0dGVuGAIgASgIOgVmYWxzZSI+CglBdHRyaWJ1dGUS", + "BQoBWBAAEgUKAVkQARIFCgFaEAISDgoKVklTSUJJTElUWRADEgwKCFBSRVNF", + "TkNFEAQyXAoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGPum", + "obwBIAEoCzItLm1lZGlhcGlwZS5MYW5kbWFya3NUb1RlbnNvckNhbGN1bGF0", + "b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksToTensorCalculatorOptions), global::Mediapipe.LandmarksToTensorCalculatorOptions.Parser, new[]{ "Attributes", "Flatten" }, null, new[]{ typeof(global::Mediapipe.LandmarksToTensorCalculatorOptions.Types.Attribute) }, new pb::Extension[] { global::Mediapipe.LandmarksToTensorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarksToTensorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksToTensorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksToTensorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToTensorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToTensorCalculatorOptions(LandmarksToTensorCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + attributes_ = other.attributes_.Clone(); + flatten_ = other.flatten_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToTensorCalculatorOptions Clone() { + return new LandmarksToTensorCalculatorOptions(this); + } + + /// Field number for the "attributes" field. + public const int AttributesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_attributes_codec + = pb::FieldCodec.ForEnum(8, x => (int) x, x => (global::Mediapipe.LandmarksToTensorCalculatorOptions.Types.Attribute) x); + private readonly pbc::RepeatedField attributes_ = new pbc::RepeatedField(); + /// + /// Subset and order of attributes as they should appear in the output Tensor. + /// Should contain at least one attribute. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Attributes { + get { return attributes_; } + } + + /// Field number for the "flatten" field. + public const int FlattenFieldNumber = 2; + private readonly static bool FlattenDefaultValue = false; + + private bool flatten_; + /// + /// Collapses all landmark attributes into a one dimensional tensor (i.e. + /// switches from (n_landmarks, n_attributes) to (n_landmarks * n_attributes) + /// representation). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Flatten { + get { if ((_hasBits0 & 1) != 0) { return flatten_; } else { return FlattenDefaultValue; } } + set { + _hasBits0 |= 1; + flatten_ = value; + } + } + /// Gets whether the "flatten" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlatten { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "flatten" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlatten() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksToTensorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksToTensorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!attributes_.Equals(other.attributes_)) return false; + if (Flatten != other.Flatten) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= attributes_.GetHashCode(); + if (HasFlatten) hash ^= Flatten.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + attributes_.WriteTo(output, _repeated_attributes_codec); + if (HasFlatten) { + output.WriteRawTag(16); + output.WriteBool(Flatten); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + attributes_.WriteTo(ref output, _repeated_attributes_codec); + if (HasFlatten) { + output.WriteRawTag(16); + output.WriteBool(Flatten); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += attributes_.CalculateSize(_repeated_attributes_codec); + if (HasFlatten) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksToTensorCalculatorOptions other) { + if (other == null) { + return; + } + attributes_.Add(other.attributes_); + if (other.HasFlatten) { + Flatten = other.Flatten; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + attributes_.AddEntriesFrom(input, _repeated_attributes_codec); + break; + } + case 16: { + Flatten = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + attributes_.AddEntriesFrom(ref input, _repeated_attributes_codec); + break; + } + case 16: { + Flatten = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LandmarksToTensorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Attribute { + [pbr::OriginalName("X")] X = 0, + [pbr::OriginalName("Y")] Y = 1, + [pbr::OriginalName("Z")] Z = 2, + [pbr::OriginalName("VISIBILITY")] Visibility = 3, + [pbr::OriginalName("PRESENCE")] Presence = 4, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the LandmarksToTensorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(394810235, pb::FieldCodec.ForMessage(3158481882, global::Mediapipe.LandmarksToTensorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs.meta new file mode 100644 index 0000000..3f38777 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/LandmarksToTensorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0326f0a81c523eba6b036d2280b33062 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs new file mode 100644 index 0000000..67ef27f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs @@ -0,0 +1,1000 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensor_converter_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensor_converter_calculator.proto + public static partial class TensorConverterCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensor_converter_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorConverterCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcl9jb252ZXJ0", + "ZXJfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ihQQKIFRlbnNvckNvbnZlcnRlckNh", + "bGN1bGF0b3JPcHRpb25zEhkKC3plcm9fY2VudGVyGAEgASgIOgR0cnVlEicK", + "GHVzZV9jdXN0b21fbm9ybWFsaXphdGlvbhgGIAEoCDoFZmFsc2USFgoKY3Vz", + "dG9tX2RpdhgHIAEoAjoCLTESFgoKY3VzdG9tX3N1YhgIIAEoAjoCLTESHgoP", + "ZmxpcF92ZXJ0aWNhbGx5GAIgASgIOgVmYWxzZRIbChBtYXhfbnVtX2NoYW5u", + "ZWxzGAMgASgFOgEzEh8KEHJvd19tYWpvcl9tYXRyaXgYBCABKAg6BWZhbHNl", + "EiQKFXVzZV9xdWFudGl6ZWRfdGVuc29ycxgFIAEoCDoFZmFsc2USXwoZb3V0", + "cHV0X3RlbnNvcl9mbG9hdF9yYW5nZRgJIAEoCzI8Lm1lZGlhcGlwZS5UZW5z", + "b3JDb252ZXJ0ZXJDYWxjdWxhdG9yT3B0aW9ucy5UZW5zb3JGbG9hdFJhbmdl", + "GiwKEFRlbnNvckZsb2F0UmFuZ2USCwoDbWluGAEgASgCEgsKA21heBgCIAEo", + "AjJaCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYrY2MoAEg", + "ASgLMisubWVkaWFwaXBlLlRlbnNvckNvbnZlcnRlckNhbGN1bGF0b3JPcHRp", + "b25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorConverterCalculatorOptions), global::Mediapipe.TensorConverterCalculatorOptions.Parser, new[]{ "ZeroCenter", "UseCustomNormalization", "CustomDiv", "CustomSub", "FlipVertically", "MaxNumChannels", "RowMajorMatrix", "UseQuantizedTensors", "OutputTensorFloatRange" }, null, null, new pb::Extension[] { global::Mediapipe.TensorConverterCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange), global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange.Parser, new[]{ "Min", "Max" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Full Example: + /// + /// node { + /// calculator: "TensorConverterCalculator" + /// input_stream: "IMAGE_IN:input_image" + /// output_stream: "TENSOR_OUT:image_tensor" + /// options { + /// [mediapipe.TensorConverterCalculatorOptions.ext] { + /// zero_center: true + /// } + /// } + /// } + /// + public sealed partial class TensorConverterCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorConverterCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorConverterCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorConverterCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorConverterCalculatorOptions(TensorConverterCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + zeroCenter_ = other.zeroCenter_; + useCustomNormalization_ = other.useCustomNormalization_; + customDiv_ = other.customDiv_; + customSub_ = other.customSub_; + flipVertically_ = other.flipVertically_; + maxNumChannels_ = other.maxNumChannels_; + rowMajorMatrix_ = other.rowMajorMatrix_; + useQuantizedTensors_ = other.useQuantizedTensors_; + outputTensorFloatRange_ = other.outputTensorFloatRange_ != null ? other.outputTensorFloatRange_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorConverterCalculatorOptions Clone() { + return new TensorConverterCalculatorOptions(this); + } + + /// Field number for the "zero_center" field. + public const int ZeroCenterFieldNumber = 1; + private readonly static bool ZeroCenterDefaultValue = true; + + private bool zeroCenter_; + /// + /// Choose normalization mode for output (not applied for Matrix inputs). + /// true = [-1,1] + /// false = [0,1] + /// Ignored if using quantization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ZeroCenter { + get { if ((_hasBits0 & 1) != 0) { return zeroCenter_; } else { return ZeroCenterDefaultValue; } } + set { + _hasBits0 |= 1; + zeroCenter_ = value; + } + } + /// Gets whether the "zero_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZeroCenter { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "zero_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZeroCenter() { + _hasBits0 &= ~1; + } + + /// Field number for the "use_custom_normalization" field. + public const int UseCustomNormalizationFieldNumber = 6; + private readonly static bool UseCustomNormalizationDefaultValue = false; + + private bool useCustomNormalization_; + /// + /// Custom settings to override the internal scaling factors `div` and `sub`. + /// Both values must be set to non-negative values. Will only take effect on + /// CPU AND when |use_custom_normalization| is set to true. When these custom + /// values take effect, the |zero_center| setting above will be overriden, and + /// the normalized_value will be calculated as: + /// normalized_value = input / custom_div - custom_sub. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseCustomNormalization { + get { if ((_hasBits0 & 32) != 0) { return useCustomNormalization_; } else { return UseCustomNormalizationDefaultValue; } } + set { + _hasBits0 |= 32; + useCustomNormalization_ = value; + } + } + /// Gets whether the "use_custom_normalization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseCustomNormalization { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "use_custom_normalization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseCustomNormalization() { + _hasBits0 &= ~32; + } + + /// Field number for the "custom_div" field. + public const int CustomDivFieldNumber = 7; + private readonly static float CustomDivDefaultValue = -1F; + + private float customDiv_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CustomDiv { + get { if ((_hasBits0 & 64) != 0) { return customDiv_; } else { return CustomDivDefaultValue; } } + set { + _hasBits0 |= 64; + customDiv_ = value; + } + } + /// Gets whether the "custom_div" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCustomDiv { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "custom_div" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCustomDiv() { + _hasBits0 &= ~64; + } + + /// Field number for the "custom_sub" field. + public const int CustomSubFieldNumber = 8; + private readonly static float CustomSubDefaultValue = -1F; + + private float customSub_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CustomSub { + get { if ((_hasBits0 & 128) != 0) { return customSub_; } else { return CustomSubDefaultValue; } } + set { + _hasBits0 |= 128; + customSub_ = value; + } + } + /// Gets whether the "custom_sub" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCustomSub { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "custom_sub" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCustomSub() { + _hasBits0 &= ~128; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 2; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the input image should be flipped vertically (along the + /// y-direction). This is useful, for example, when the input image is defined + /// with a coordinate system where the origin is at the bottom-left corner + /// (e.g., in OpenGL) whereas the ML model expects an image with a top-left + /// origin. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 2) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 2; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_num_channels" field. + public const int MaxNumChannelsFieldNumber = 3; + private readonly static int MaxNumChannelsDefaultValue = 3; + + private int maxNumChannels_; + /// + /// Controls how many channels of the input image get passed through to the + /// tensor. Valid values are 1,3,4 only. Ignored for iOS GPU. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxNumChannels { + get { if ((_hasBits0 & 4) != 0) { return maxNumChannels_; } else { return MaxNumChannelsDefaultValue; } } + set { + _hasBits0 |= 4; + maxNumChannels_ = value; + } + } + /// Gets whether the "max_num_channels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxNumChannels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_num_channels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxNumChannels() { + _hasBits0 &= ~4; + } + + /// Field number for the "row_major_matrix" field. + public const int RowMajorMatrixFieldNumber = 4; + private readonly static bool RowMajorMatrixDefaultValue = false; + + private bool rowMajorMatrix_; + /// + /// The calculator expects Matrix inputs to be in column-major order. Set + /// row_major_matrix to true if the inputs are in row-major order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RowMajorMatrix { + get { if ((_hasBits0 & 8) != 0) { return rowMajorMatrix_; } else { return RowMajorMatrixDefaultValue; } } + set { + _hasBits0 |= 8; + rowMajorMatrix_ = value; + } + } + /// Gets whether the "row_major_matrix" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRowMajorMatrix { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "row_major_matrix" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRowMajorMatrix() { + _hasBits0 &= ~8; + } + + /// Field number for the "use_quantized_tensors" field. + public const int UseQuantizedTensorsFieldNumber = 5; + private readonly static bool UseQuantizedTensorsDefaultValue = false; + + private bool useQuantizedTensors_; + /// + /// Quantization option (CPU only). + /// When true, output kUint8 tensor instead of kFloat32. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseQuantizedTensors { + get { if ((_hasBits0 & 16) != 0) { return useQuantizedTensors_; } else { return UseQuantizedTensorsDefaultValue; } } + set { + _hasBits0 |= 16; + useQuantizedTensors_ = value; + } + } + /// Gets whether the "use_quantized_tensors" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseQuantizedTensors { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "use_quantized_tensors" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseQuantizedTensors() { + _hasBits0 &= ~16; + } + + /// Field number for the "output_tensor_float_range" field. + public const int OutputTensorFloatRangeFieldNumber = 9; + private global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange outputTensorFloatRange_; + /// + /// Normalization option. + /// Setting normalization_range results in the values normalized to + /// the range [output_tensor_float_range.min, output_tensor_float_range.max]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange OutputTensorFloatRange { + get { return outputTensorFloatRange_; } + set { + outputTensorFloatRange_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorConverterCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorConverterCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ZeroCenter != other.ZeroCenter) return false; + if (UseCustomNormalization != other.UseCustomNormalization) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CustomDiv, other.CustomDiv)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CustomSub, other.CustomSub)) return false; + if (FlipVertically != other.FlipVertically) return false; + if (MaxNumChannels != other.MaxNumChannels) return false; + if (RowMajorMatrix != other.RowMajorMatrix) return false; + if (UseQuantizedTensors != other.UseQuantizedTensors) return false; + if (!object.Equals(OutputTensorFloatRange, other.OutputTensorFloatRange)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasZeroCenter) hash ^= ZeroCenter.GetHashCode(); + if (HasUseCustomNormalization) hash ^= UseCustomNormalization.GetHashCode(); + if (HasCustomDiv) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CustomDiv); + if (HasCustomSub) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CustomSub); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasMaxNumChannels) hash ^= MaxNumChannels.GetHashCode(); + if (HasRowMajorMatrix) hash ^= RowMajorMatrix.GetHashCode(); + if (HasUseQuantizedTensors) hash ^= UseQuantizedTensors.GetHashCode(); + if (outputTensorFloatRange_ != null) hash ^= OutputTensorFloatRange.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasZeroCenter) { + output.WriteRawTag(8); + output.WriteBool(ZeroCenter); + } + if (HasFlipVertically) { + output.WriteRawTag(16); + output.WriteBool(FlipVertically); + } + if (HasMaxNumChannels) { + output.WriteRawTag(24); + output.WriteInt32(MaxNumChannels); + } + if (HasRowMajorMatrix) { + output.WriteRawTag(32); + output.WriteBool(RowMajorMatrix); + } + if (HasUseQuantizedTensors) { + output.WriteRawTag(40); + output.WriteBool(UseQuantizedTensors); + } + if (HasUseCustomNormalization) { + output.WriteRawTag(48); + output.WriteBool(UseCustomNormalization); + } + if (HasCustomDiv) { + output.WriteRawTag(61); + output.WriteFloat(CustomDiv); + } + if (HasCustomSub) { + output.WriteRawTag(69); + output.WriteFloat(CustomSub); + } + if (outputTensorFloatRange_ != null) { + output.WriteRawTag(74); + output.WriteMessage(OutputTensorFloatRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasZeroCenter) { + output.WriteRawTag(8); + output.WriteBool(ZeroCenter); + } + if (HasFlipVertically) { + output.WriteRawTag(16); + output.WriteBool(FlipVertically); + } + if (HasMaxNumChannels) { + output.WriteRawTag(24); + output.WriteInt32(MaxNumChannels); + } + if (HasRowMajorMatrix) { + output.WriteRawTag(32); + output.WriteBool(RowMajorMatrix); + } + if (HasUseQuantizedTensors) { + output.WriteRawTag(40); + output.WriteBool(UseQuantizedTensors); + } + if (HasUseCustomNormalization) { + output.WriteRawTag(48); + output.WriteBool(UseCustomNormalization); + } + if (HasCustomDiv) { + output.WriteRawTag(61); + output.WriteFloat(CustomDiv); + } + if (HasCustomSub) { + output.WriteRawTag(69); + output.WriteFloat(CustomSub); + } + if (outputTensorFloatRange_ != null) { + output.WriteRawTag(74); + output.WriteMessage(OutputTensorFloatRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasZeroCenter) { + size += 1 + 1; + } + if (HasUseCustomNormalization) { + size += 1 + 1; + } + if (HasCustomDiv) { + size += 1 + 4; + } + if (HasCustomSub) { + size += 1 + 4; + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (HasMaxNumChannels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumChannels); + } + if (HasRowMajorMatrix) { + size += 1 + 1; + } + if (HasUseQuantizedTensors) { + size += 1 + 1; + } + if (outputTensorFloatRange_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputTensorFloatRange); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorConverterCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasZeroCenter) { + ZeroCenter = other.ZeroCenter; + } + if (other.HasUseCustomNormalization) { + UseCustomNormalization = other.UseCustomNormalization; + } + if (other.HasCustomDiv) { + CustomDiv = other.CustomDiv; + } + if (other.HasCustomSub) { + CustomSub = other.CustomSub; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasMaxNumChannels) { + MaxNumChannels = other.MaxNumChannels; + } + if (other.HasRowMajorMatrix) { + RowMajorMatrix = other.RowMajorMatrix; + } + if (other.HasUseQuantizedTensors) { + UseQuantizedTensors = other.UseQuantizedTensors; + } + if (other.outputTensorFloatRange_ != null) { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange(); + } + OutputTensorFloatRange.MergeFrom(other.OutputTensorFloatRange); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ZeroCenter = input.ReadBool(); + break; + } + case 16: { + FlipVertically = input.ReadBool(); + break; + } + case 24: { + MaxNumChannels = input.ReadInt32(); + break; + } + case 32: { + RowMajorMatrix = input.ReadBool(); + break; + } + case 40: { + UseQuantizedTensors = input.ReadBool(); + break; + } + case 48: { + UseCustomNormalization = input.ReadBool(); + break; + } + case 61: { + CustomDiv = input.ReadFloat(); + break; + } + case 69: { + CustomSub = input.ReadFloat(); + break; + } + case 74: { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange(); + } + input.ReadMessage(OutputTensorFloatRange); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ZeroCenter = input.ReadBool(); + break; + } + case 16: { + FlipVertically = input.ReadBool(); + break; + } + case 24: { + MaxNumChannels = input.ReadInt32(); + break; + } + case 32: { + RowMajorMatrix = input.ReadBool(); + break; + } + case 40: { + UseQuantizedTensors = input.ReadBool(); + break; + } + case 48: { + UseCustomNormalization = input.ReadBool(); + break; + } + case 61: { + CustomDiv = input.ReadFloat(); + break; + } + case 69: { + CustomSub = input.ReadFloat(); + break; + } + case 74: { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TensorConverterCalculatorOptions.Types.TensorFloatRange(); + } + input.ReadMessage(OutputTensorFloatRange); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorConverterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class TensorFloatRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorFloatRange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorConverterCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange(TensorFloatRange other) : this() { + _hasBits0 = other._hasBits0; + min_ = other.min_; + max_ = other.max_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange Clone() { + return new TensorFloatRange(this); + } + + /// Field number for the "min" field. + public const int MinFieldNumber = 1; + private readonly static float MinDefaultValue = 0F; + + private float min_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Min { + get { if ((_hasBits0 & 1) != 0) { return min_; } else { return MinDefaultValue; } } + set { + _hasBits0 |= 1; + min_ = value; + } + } + /// Gets whether the "min" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMin() { + _hasBits0 &= ~1; + } + + /// Field number for the "max" field. + public const int MaxFieldNumber = 2; + private readonly static float MaxDefaultValue = 0F; + + private float max_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Max { + get { if ((_hasBits0 & 2) != 0) { return max_; } else { return MaxDefaultValue; } } + set { + _hasBits0 |= 2; + max_ = value; + } + } + /// Gets whether the "max" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMax { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMax() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorFloatRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorFloatRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Min, other.Min)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Max, other.Max)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Min); + if (HasMax) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Max); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMin) { + size += 1 + 4; + } + if (HasMax) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorFloatRange other) { + if (other == null) { + return; + } + if (other.HasMin) { + Min = other.Min; + } + if (other.HasMax) { + Max = other.Max; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorConverterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(335742637, pb::FieldCodec.ForMessage(2685941098, global::Mediapipe.TensorConverterCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs.meta new file mode 100644 index 0000000..c697505 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorConverterCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a13cce7db0933956f80e556f6fe51b9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs new file mode 100644 index 0000000..e9a8725 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs @@ -0,0 +1,1108 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensors_to_classification_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensors_to_classification_calculator.proto + public static partial class TensorsToClassificationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensors_to_classification_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToClassificationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkdtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcnNfdG9fY2xh", + "c3NpZmljYXRpb25fY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRp", + "YXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8aHm1lZGlhcGlwZS91", + "dGlsL2xhYmVsX21hcC5wcm90byLHBQooVGVuc29yc1RvQ2xhc3NpZmljYXRp", + "b25DYWxjdWxhdG9yT3B0aW9ucxIbChNtaW5fc2NvcmVfdGhyZXNob2xkGAEg", + "ASgCEg0KBXRvcF9rGAIgASgFEiAKGHNvcnRfYnlfZGVzY2VuZGluZ19zY29y", + "ZRgJIAEoCBIWCg5sYWJlbF9tYXBfcGF0aBgDIAEoCRJPCglsYWJlbF9tYXAY", + "BSABKAsyPC5tZWRpYXBpcGUuVGVuc29yc1RvQ2xhc3NpZmljYXRpb25DYWxj", + "dWxhdG9yT3B0aW9ucy5MYWJlbE1hcBJYCgtsYWJlbF9pdGVtcxgGIAMoCzJD", + "Lm1lZGlhcGlwZS5UZW5zb3JzVG9DbGFzc2lmaWNhdGlvbkNhbGN1bGF0b3JP", + "cHRpb25zLkxhYmVsSXRlbXNFbnRyeRIdChViaW5hcnlfY2xhc3NpZmljYXRp", + "b24YBCABKAgSGgoOaWdub3JlX2NsYXNzZXMYByADKAVCAhABEhkKDWFsbG93", + "X2NsYXNzZXMYCCADKAVCAhABGoMBCghMYWJlbE1hcBJTCgdlbnRyaWVzGAEg", + "AygLMkIubWVkaWFwaXBlLlRlbnNvcnNUb0NsYXNzaWZpY2F0aW9uQ2FsY3Vs", + "YXRvck9wdGlvbnMuTGFiZWxNYXAuRW50cnkaIgoFRW50cnkSCgoCaWQYASAB", + "KAUSDQoFbGFiZWwYAiABKAkaSgoPTGFiZWxJdGVtc0VudHJ5EgsKA2tleRgB", + "IAEoAxImCgV2YWx1ZRgCIAEoCzIXLm1lZGlhcGlwZS5MYWJlbE1hcEl0ZW06", + "AjgBMmIKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiujYyg", + "ASABKAsyMy5tZWRpYXBpcGUuVGVuc29yc1RvQ2xhc3NpZmljYXRpb25DYWxj", + "dWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.LabelMapReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToClassificationCalculatorOptions), global::Mediapipe.TensorsToClassificationCalculatorOptions.Parser, new[]{ "MinScoreThreshold", "TopK", "SortByDescendingScore", "LabelMapPath", "LabelMap", "LabelItems", "BinaryClassification", "IgnoreClasses", "AllowClasses" }, null, null, new pb::Extension[] { global::Mediapipe.TensorsToClassificationCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap), global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap.Parser, new[]{ "Entries" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap.Types.Entry), global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap.Types.Entry.Parser, new[]{ "Id", "Label" }, null, null, null, null)}), + null, }) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToClassificationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToClassificationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToClassificationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToClassificationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToClassificationCalculatorOptions(TensorsToClassificationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minScoreThreshold_ = other.minScoreThreshold_; + topK_ = other.topK_; + sortByDescendingScore_ = other.sortByDescendingScore_; + labelMapPath_ = other.labelMapPath_; + labelMap_ = other.labelMap_ != null ? other.labelMap_.Clone() : null; + labelItems_ = other.labelItems_.Clone(); + binaryClassification_ = other.binaryClassification_; + ignoreClasses_ = other.ignoreClasses_.Clone(); + allowClasses_ = other.allowClasses_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToClassificationCalculatorOptions Clone() { + return new TensorsToClassificationCalculatorOptions(this); + } + + /// Field number for the "min_score_threshold" field. + public const int MinScoreThresholdFieldNumber = 1; + private readonly static float MinScoreThresholdDefaultValue = 0F; + + private float minScoreThreshold_; + /// + /// Score threshold for perserving the class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThreshold { + get { if ((_hasBits0 & 1) != 0) { return minScoreThreshold_; } else { return MinScoreThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + minScoreThreshold_ = value; + } + } + /// Gets whether the "min_score_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_score_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "top_k" field. + public const int TopKFieldNumber = 2; + private readonly static int TopKDefaultValue = 0; + + private int topK_; + /// + /// Number of highest scoring labels to output. If top_k is not positive then + /// all labels are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TopK { + get { if ((_hasBits0 & 2) != 0) { return topK_; } else { return TopKDefaultValue; } } + set { + _hasBits0 |= 2; + topK_ = value; + } + } + /// Gets whether the "top_k" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopK { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "top_k" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopK() { + _hasBits0 &= ~2; + } + + /// Field number for the "sort_by_descending_score" field. + public const int SortByDescendingScoreFieldNumber = 9; + private readonly static bool SortByDescendingScoreDefaultValue = false; + + private bool sortByDescendingScore_; + /// + /// Whether results should be sorted by descending score. By default, results + /// may or may not be sorted: setting this to true guarantees that the returned + /// results will be sorted by descending score. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SortByDescendingScore { + get { if ((_hasBits0 & 8) != 0) { return sortByDescendingScore_; } else { return SortByDescendingScoreDefaultValue; } } + set { + _hasBits0 |= 8; + sortByDescendingScore_ = value; + } + } + /// Gets whether the "sort_by_descending_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSortByDescendingScore { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "sort_by_descending_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSortByDescendingScore() { + _hasBits0 &= ~8; + } + + /// Field number for the "label_map_path" field. + public const int LabelMapPathFieldNumber = 3; + private readonly static string LabelMapPathDefaultValue = ""; + + private string labelMapPath_; + /// + /// Path to a label map file for getting the actual name of class ids. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string LabelMapPath { + get { return labelMapPath_ ?? LabelMapPathDefaultValue; } + set { + labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label_map_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelMapPath { + get { return labelMapPath_ != null; } + } + /// Clears the value of the "label_map_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelMapPath() { + labelMapPath_ = null; + } + + /// Field number for the "label_map" field. + public const int LabelMapFieldNumber = 5; + private global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap labelMap_; + /// + /// Label map. (Can be used instead of label_map_path.) + /// NOTE: either "label_map_path" or "label_items", if specified, takes + /// precedence over "label_map". + /// Deprecated: please use `label_items` instead. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap LabelMap { + get { return labelMap_; } + set { + labelMap_ = value; + } + } + + /// Field number for the "label_items" field. + public const int LabelItemsFieldNumber = 6; + private static readonly pbc::MapField.Codec _map_labelItems_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForMessage(18, global::Mediapipe.LabelMapItem.Parser), 50); + private readonly pbc::MapField labelItems_ = new pbc::MapField(); + /// + /// Label items. (Can be used instead of label_map_path.) + /// NOTE: "label_map_path", if specified, takes precedence over "label_items". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField LabelItems { + get { return labelItems_; } + } + + /// Field number for the "binary_classification" field. + public const int BinaryClassificationFieldNumber = 4; + private readonly static bool BinaryClassificationDefaultValue = false; + + private bool binaryClassification_; + /// + /// Whether the input is a single float for binary classification. + /// When true, only a single float is expected in the input tensor and the + /// label map, if provided, is expected to have exactly two labels. + /// The single score(float) represent the probability of first label, and + /// 1 - score is the probabilility of the second label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BinaryClassification { + get { if ((_hasBits0 & 4) != 0) { return binaryClassification_; } else { return BinaryClassificationDefaultValue; } } + set { + _hasBits0 |= 4; + binaryClassification_ = value; + } + } + /// Gets whether the "binary_classification" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBinaryClassification { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "binary_classification" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBinaryClassification() { + _hasBits0 &= ~4; + } + + /// Field number for the "ignore_classes" field. + public const int IgnoreClassesFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_ignoreClasses_codec + = pb::FieldCodec.ForInt32(58); + private readonly pbc::RepeatedField ignoreClasses_ = new pbc::RepeatedField(); + /// + /// The ids of classes that should be ignored during decoding the score for + /// each classification. If `ignore_classes` is specified, all the other + /// classes that are not in the `ignore_class` field will be considered during + /// decoding. `ignore_classes` and `allow_classes` are mutually exclusive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IgnoreClasses { + get { return ignoreClasses_; } + } + + /// Field number for the "allow_classes" field. + public const int AllowClassesFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_allowClasses_codec + = pb::FieldCodec.ForInt32(66); + private readonly pbc::RepeatedField allowClasses_ = new pbc::RepeatedField(); + /// + /// The ids of classes that will be allowed during decoding the score for + /// each classification. If `allow_classes` is specified, all the other classes + /// that are not in the `allow_classes` field will be completely ignored. + /// `ignore_classes` and `allow_classes` are mutually exclusive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AllowClasses { + get { return allowClasses_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToClassificationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToClassificationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThreshold, other.MinScoreThreshold)) return false; + if (TopK != other.TopK) return false; + if (SortByDescendingScore != other.SortByDescendingScore) return false; + if (LabelMapPath != other.LabelMapPath) return false; + if (!object.Equals(LabelMap, other.LabelMap)) return false; + if (!LabelItems.Equals(other.LabelItems)) return false; + if (BinaryClassification != other.BinaryClassification) return false; + if(!ignoreClasses_.Equals(other.ignoreClasses_)) return false; + if(!allowClasses_.Equals(other.allowClasses_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinScoreThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThreshold); + if (HasTopK) hash ^= TopK.GetHashCode(); + if (HasSortByDescendingScore) hash ^= SortByDescendingScore.GetHashCode(); + if (HasLabelMapPath) hash ^= LabelMapPath.GetHashCode(); + if (labelMap_ != null) hash ^= LabelMap.GetHashCode(); + hash ^= LabelItems.GetHashCode(); + if (HasBinaryClassification) hash ^= BinaryClassification.GetHashCode(); + hash ^= ignoreClasses_.GetHashCode(); + hash ^= allowClasses_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinScoreThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinScoreThreshold); + } + if (HasTopK) { + output.WriteRawTag(16); + output.WriteInt32(TopK); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (HasBinaryClassification) { + output.WriteRawTag(32); + output.WriteBool(BinaryClassification); + } + if (labelMap_ != null) { + output.WriteRawTag(42); + output.WriteMessage(LabelMap); + } + labelItems_.WriteTo(output, _map_labelItems_codec); + ignoreClasses_.WriteTo(output, _repeated_ignoreClasses_codec); + allowClasses_.WriteTo(output, _repeated_allowClasses_codec); + if (HasSortByDescendingScore) { + output.WriteRawTag(72); + output.WriteBool(SortByDescendingScore); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinScoreThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinScoreThreshold); + } + if (HasTopK) { + output.WriteRawTag(16); + output.WriteInt32(TopK); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (HasBinaryClassification) { + output.WriteRawTag(32); + output.WriteBool(BinaryClassification); + } + if (labelMap_ != null) { + output.WriteRawTag(42); + output.WriteMessage(LabelMap); + } + labelItems_.WriteTo(ref output, _map_labelItems_codec); + ignoreClasses_.WriteTo(ref output, _repeated_ignoreClasses_codec); + allowClasses_.WriteTo(ref output, _repeated_allowClasses_codec); + if (HasSortByDescendingScore) { + output.WriteRawTag(72); + output.WriteBool(SortByDescendingScore); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinScoreThreshold) { + size += 1 + 4; + } + if (HasTopK) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TopK); + } + if (HasSortByDescendingScore) { + size += 1 + 1; + } + if (HasLabelMapPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath); + } + if (labelMap_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LabelMap); + } + size += labelItems_.CalculateSize(_map_labelItems_codec); + if (HasBinaryClassification) { + size += 1 + 1; + } + size += ignoreClasses_.CalculateSize(_repeated_ignoreClasses_codec); + size += allowClasses_.CalculateSize(_repeated_allowClasses_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToClassificationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinScoreThreshold) { + MinScoreThreshold = other.MinScoreThreshold; + } + if (other.HasTopK) { + TopK = other.TopK; + } + if (other.HasSortByDescendingScore) { + SortByDescendingScore = other.SortByDescendingScore; + } + if (other.HasLabelMapPath) { + LabelMapPath = other.LabelMapPath; + } + if (other.labelMap_ != null) { + if (labelMap_ == null) { + LabelMap = new global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap(); + } + LabelMap.MergeFrom(other.LabelMap); + } + labelItems_.Add(other.labelItems_); + if (other.HasBinaryClassification) { + BinaryClassification = other.BinaryClassification; + } + ignoreClasses_.Add(other.ignoreClasses_); + allowClasses_.Add(other.allowClasses_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 16: { + TopK = input.ReadInt32(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + case 32: { + BinaryClassification = input.ReadBool(); + break; + } + case 42: { + if (labelMap_ == null) { + LabelMap = new global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap(); + } + input.ReadMessage(LabelMap); + break; + } + case 50: { + labelItems_.AddEntriesFrom(input, _map_labelItems_codec); + break; + } + case 58: + case 56: { + ignoreClasses_.AddEntriesFrom(input, _repeated_ignoreClasses_codec); + break; + } + case 66: + case 64: { + allowClasses_.AddEntriesFrom(input, _repeated_allowClasses_codec); + break; + } + case 72: { + SortByDescendingScore = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 16: { + TopK = input.ReadInt32(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + case 32: { + BinaryClassification = input.ReadBool(); + break; + } + case 42: { + if (labelMap_ == null) { + LabelMap = new global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap(); + } + input.ReadMessage(LabelMap); + break; + } + case 50: { + labelItems_.AddEntriesFrom(ref input, _map_labelItems_codec); + break; + } + case 58: + case 56: { + ignoreClasses_.AddEntriesFrom(ref input, _repeated_ignoreClasses_codec); + break; + } + case 66: + case 64: { + allowClasses_.AddEntriesFrom(ref input, _repeated_allowClasses_codec); + break; + } + case 72: { + SortByDescendingScore = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorsToClassificationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class LabelMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LabelMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToClassificationCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMap(LabelMap other) : this() { + entries_ = other.entries_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMap Clone() { + return new LabelMap(this); + } + + /// Field number for the "entries" field. + public const int EntriesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_entries_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap.Types.Entry.Parser); + private readonly pbc::RepeatedField entries_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Entries { + get { return entries_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LabelMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LabelMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!entries_.Equals(other.entries_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= entries_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + entries_.WriteTo(output, _repeated_entries_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + entries_.WriteTo(ref output, _repeated_entries_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += entries_.CalculateSize(_repeated_entries_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LabelMap other) { + if (other == null) { + return; + } + entries_.Add(other.entries_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + entries_.AddEntriesFrom(input, _repeated_entries_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + entries_.AddEntriesFrom(ref input, _repeated_entries_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LabelMap message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Entry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Entry()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToClassificationCalculatorOptions.Types.LabelMap.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Entry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Entry(Entry other) : this() { + _hasBits0 = other._hasBits0; + id_ = other.id_; + label_ = other.label_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Entry Clone() { + return new Entry(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private readonly static int IdDefaultValue = 0; + + private int id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 1) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 1; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~1; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 2; + private readonly static string LabelDefaultValue = ""; + + private string label_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Entry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Entry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (Label != other.Label) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasId) hash ^= Id.GetHashCode(); + if (HasLabel) hash ^= Label.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasLabel) { + output.WriteRawTag(18); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasLabel) { + output.WriteRawTag(18); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Entry other) { + if (other == null) { + return; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasLabel) { + Label = other.Label; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + Label = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + Label = input.ReadString(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToClassificationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(335742638, pb::FieldCodec.ForMessage(2685941106, global::Mediapipe.TensorsToClassificationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs.meta new file mode 100644 index 0000000..1202f2b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToClassificationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c0a4f87db5935480aa4d5dd359f85e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs new file mode 100644 index 0000000..ffba35d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs @@ -0,0 +1,2209 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensors_to_detections_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensors_to_detections_calculator.proto + public static partial class TensorsToDetectionsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensors_to_detections_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToDetectionsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkNtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcnNfdG9fZGV0", + "ZWN0aW9uc19jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlw", + "ZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byL9CAokVGVuc29yc1RvRGV0", + "ZWN0aW9uc0NhbGN1bGF0b3JPcHRpb25zEhMKC251bV9jbGFzc2VzGAEgASgF", + "EhEKCW51bV9ib3hlcxgCIAEoBRISCgpudW1fY29vcmRzGAMgASgFEh0KFWtl", + "eXBvaW50X2Nvb3JkX29mZnNldBgJIAEoBRIYCg1udW1fa2V5cG9pbnRzGAog", + "ASgFOgEwEiIKF251bV92YWx1ZXNfcGVyX2tleXBvaW50GAsgASgFOgEyEhsK", + "EGJveF9jb29yZF9vZmZzZXQYDCABKAU6ATASEgoHeF9zY2FsZRgEIAEoAjoB", + "MBISCgd5X3NjYWxlGAUgASgCOgEwEhIKB3dfc2NhbGUYBiABKAI6ATASEgoH", + "aF9zY2FsZRgHIAEoAjoBMBIsCh1hcHBseV9leHBvbmVudGlhbF9vbl9ib3hf", + "c2l6ZRgNIAEoCDoFZmFsc2USIwoUcmV2ZXJzZV9vdXRwdXRfb3JkZXIYDiAB", + "KAg6BWZhbHNlEhYKDmlnbm9yZV9jbGFzc2VzGAggAygFEhkKDWFsbG93X2Ns", + "YXNzZXMYFSADKAVCAhABEhwKDXNpZ21vaWRfc2NvcmUYDyABKAg6BWZhbHNl", + "Eh0KFXNjb3JlX2NsaXBwaW5nX3RocmVzaBgQIAEoAhIeCg9mbGlwX3ZlcnRp", + "Y2FsbHkYEiABKAg6BWZhbHNlEhgKEG1pbl9zY29yZV90aHJlc2gYEyABKAIS", + "FwoLbWF4X3Jlc3VsdHMYFCABKAU6Ai0xElUKDnRlbnNvcl9tYXBwaW5nGBYg", + "ASgLMj0ubWVkaWFwaXBlLlRlbnNvcnNUb0RldGVjdGlvbnNDYWxjdWxhdG9y", + "T3B0aW9ucy5UZW5zb3JNYXBwaW5nEmYKFmJveF9ib3VuZGFyaWVzX2luZGlj", + "ZXMYFyABKAsyRC5tZWRpYXBpcGUuVGVuc29yc1RvRGV0ZWN0aW9uc0NhbGN1", + "bGF0b3JPcHRpb25zLkJveEJvdW5kYXJpZXNJbmRpY2VzSAAargEKDVRlbnNv", + "ck1hcHBpbmcSHwoXZGV0ZWN0aW9uc190ZW5zb3JfaW5kZXgYASABKAUSHAoU", + "Y2xhc3Nlc190ZW5zb3JfaW5kZXgYAiABKAUSGwoTc2NvcmVzX3RlbnNvcl9p", + "bmRleBgDIAEoBRIjChtudW1fZGV0ZWN0aW9uc190ZW5zb3JfaW5kZXgYBCAB", + "KAUSHAoUYW5jaG9yc190ZW5zb3JfaW5kZXgYBSABKAUaWgoUQm94Qm91bmRh", + "cmllc0luZGljZXMSDwoEeW1pbhgBIAEoBToBMBIPCgR4bWluGAIgASgFOgEx", + "Eg8KBHltYXgYAyABKAU6ATISDwoEeG1heBgEIAEoBToBMzJeCgNleHQSHC5t", + "ZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYr42MoAEgASgLMi8ubWVkaWFw", + "aXBlLlRlbnNvcnNUb0RldGVjdGlvbnNDYWxjdWxhdG9yT3B0aW9uc0INCgti", + "b3hfaW5kaWNlcw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToDetectionsCalculatorOptions), global::Mediapipe.TensorsToDetectionsCalculatorOptions.Parser, new[]{ "NumClasses", "NumBoxes", "NumCoords", "KeypointCoordOffset", "NumKeypoints", "NumValuesPerKeypoint", "BoxCoordOffset", "XScale", "YScale", "WScale", "HScale", "ApplyExponentialOnBoxSize", "ReverseOutputOrder", "IgnoreClasses", "AllowClasses", "SigmoidScore", "ScoreClippingThresh", "FlipVertically", "MinScoreThresh", "MaxResults", "TensorMapping", "BoxBoundariesIndices" }, new[]{ "BoxIndices" }, null, new pb::Extension[] { global::Mediapipe.TensorsToDetectionsCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping), global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping.Parser, new[]{ "DetectionsTensorIndex", "ClassesTensorIndex", "ScoresTensorIndex", "NumDetectionsTensorIndex", "AnchorsTensorIndex" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices), global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices.Parser, new[]{ "Ymin", "Xmin", "Ymax", "Xmax" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToDetectionsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToDetectionsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToDetectionsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToDetectionsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToDetectionsCalculatorOptions(TensorsToDetectionsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numClasses_ = other.numClasses_; + numBoxes_ = other.numBoxes_; + numCoords_ = other.numCoords_; + keypointCoordOffset_ = other.keypointCoordOffset_; + numKeypoints_ = other.numKeypoints_; + numValuesPerKeypoint_ = other.numValuesPerKeypoint_; + boxCoordOffset_ = other.boxCoordOffset_; + xScale_ = other.xScale_; + yScale_ = other.yScale_; + wScale_ = other.wScale_; + hScale_ = other.hScale_; + applyExponentialOnBoxSize_ = other.applyExponentialOnBoxSize_; + reverseOutputOrder_ = other.reverseOutputOrder_; + ignoreClasses_ = other.ignoreClasses_.Clone(); + allowClasses_ = other.allowClasses_.Clone(); + sigmoidScore_ = other.sigmoidScore_; + scoreClippingThresh_ = other.scoreClippingThresh_; + flipVertically_ = other.flipVertically_; + minScoreThresh_ = other.minScoreThresh_; + maxResults_ = other.maxResults_; + tensorMapping_ = other.tensorMapping_ != null ? other.tensorMapping_.Clone() : null; + switch (other.BoxIndicesCase) { + case BoxIndicesOneofCase.BoxBoundariesIndices: + BoxBoundariesIndices = other.BoxBoundariesIndices.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToDetectionsCalculatorOptions Clone() { + return new TensorsToDetectionsCalculatorOptions(this); + } + + /// Field number for the "num_classes" field. + public const int NumClassesFieldNumber = 1; + private readonly static int NumClassesDefaultValue = 0; + + private int numClasses_; + /// + /// [Required] The number of output classes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumClasses { + get { if ((_hasBits0 & 1) != 0) { return numClasses_; } else { return NumClassesDefaultValue; } } + set { + _hasBits0 |= 1; + numClasses_ = value; + } + } + /// Gets whether the "num_classes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumClasses { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_classes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumClasses() { + _hasBits0 &= ~1; + } + + /// Field number for the "num_boxes" field. + public const int NumBoxesFieldNumber = 2; + private readonly static int NumBoxesDefaultValue = 0; + + private int numBoxes_; + /// + /// [Required] The number of output boxes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumBoxes { + get { if ((_hasBits0 & 2) != 0) { return numBoxes_; } else { return NumBoxesDefaultValue; } } + set { + _hasBits0 |= 2; + numBoxes_ = value; + } + } + /// Gets whether the "num_boxes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumBoxes { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_boxes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumBoxes() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_coords" field. + public const int NumCoordsFieldNumber = 3; + private readonly static int NumCoordsDefaultValue = 0; + + private int numCoords_; + /// + /// [Required] The number of output values per boxes predicted by the detection + /// model. The values contain bounding boxes, keypoints, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumCoords { + get { if ((_hasBits0 & 4) != 0) { return numCoords_; } else { return NumCoordsDefaultValue; } } + set { + _hasBits0 |= 4; + numCoords_ = value; + } + } + /// Gets whether the "num_coords" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumCoords { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_coords" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumCoords() { + _hasBits0 &= ~4; + } + + /// Field number for the "keypoint_coord_offset" field. + public const int KeypointCoordOffsetFieldNumber = 9; + private readonly static int KeypointCoordOffsetDefaultValue = 0; + + private int keypointCoordOffset_; + /// + /// The offset of keypoint coordinates in the location tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int KeypointCoordOffset { + get { if ((_hasBits0 & 128) != 0) { return keypointCoordOffset_; } else { return KeypointCoordOffsetDefaultValue; } } + set { + _hasBits0 |= 128; + keypointCoordOffset_ = value; + } + } + /// Gets whether the "keypoint_coord_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKeypointCoordOffset { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "keypoint_coord_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKeypointCoordOffset() { + _hasBits0 &= ~128; + } + + /// Field number for the "num_keypoints" field. + public const int NumKeypointsFieldNumber = 10; + private readonly static int NumKeypointsDefaultValue = 0; + + private int numKeypoints_; + /// + /// The number of predicted keypoints. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumKeypoints { + get { if ((_hasBits0 & 256) != 0) { return numKeypoints_; } else { return NumKeypointsDefaultValue; } } + set { + _hasBits0 |= 256; + numKeypoints_ = value; + } + } + /// Gets whether the "num_keypoints" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumKeypoints { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "num_keypoints" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumKeypoints() { + _hasBits0 &= ~256; + } + + /// Field number for the "num_values_per_keypoint" field. + public const int NumValuesPerKeypointFieldNumber = 11; + private readonly static int NumValuesPerKeypointDefaultValue = 2; + + private int numValuesPerKeypoint_; + /// + /// The dimension of each keypoint, e.g. number of values predicted for each + /// keypoint. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumValuesPerKeypoint { + get { if ((_hasBits0 & 512) != 0) { return numValuesPerKeypoint_; } else { return NumValuesPerKeypointDefaultValue; } } + set { + _hasBits0 |= 512; + numValuesPerKeypoint_ = value; + } + } + /// Gets whether the "num_values_per_keypoint" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumValuesPerKeypoint { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "num_values_per_keypoint" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumValuesPerKeypoint() { + _hasBits0 &= ~512; + } + + /// Field number for the "box_coord_offset" field. + public const int BoxCoordOffsetFieldNumber = 12; + private readonly static int BoxCoordOffsetDefaultValue = 0; + + private int boxCoordOffset_; + /// + /// The offset of box coordinates in the location tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BoxCoordOffset { + get { if ((_hasBits0 & 1024) != 0) { return boxCoordOffset_; } else { return BoxCoordOffsetDefaultValue; } } + set { + _hasBits0 |= 1024; + boxCoordOffset_ = value; + } + } + /// Gets whether the "box_coord_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoxCoordOffset { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "box_coord_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxCoordOffset() { + _hasBits0 &= ~1024; + } + + /// Field number for the "x_scale" field. + public const int XScaleFieldNumber = 4; + private readonly static float XScaleDefaultValue = 0F; + + private float xScale_; + /// + /// Parameters for decoding SSD detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float XScale { + get { if ((_hasBits0 & 8) != 0) { return xScale_; } else { return XScaleDefaultValue; } } + set { + _hasBits0 |= 8; + xScale_ = value; + } + } + /// Gets whether the "x_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXScale { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "x_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXScale() { + _hasBits0 &= ~8; + } + + /// Field number for the "y_scale" field. + public const int YScaleFieldNumber = 5; + private readonly static float YScaleDefaultValue = 0F; + + private float yScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float YScale { + get { if ((_hasBits0 & 16) != 0) { return yScale_; } else { return YScaleDefaultValue; } } + set { + _hasBits0 |= 16; + yScale_ = value; + } + } + /// Gets whether the "y_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "y_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "w_scale" field. + public const int WScaleFieldNumber = 6; + private readonly static float WScaleDefaultValue = 0F; + + private float wScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float WScale { + get { if ((_hasBits0 & 32) != 0) { return wScale_; } else { return WScaleDefaultValue; } } + set { + _hasBits0 |= 32; + wScale_ = value; + } + } + /// Gets whether the "w_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWScale { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "w_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWScale() { + _hasBits0 &= ~32; + } + + /// Field number for the "h_scale" field. + public const int HScaleFieldNumber = 7; + private readonly static float HScaleDefaultValue = 0F; + + private float hScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HScale { + get { if ((_hasBits0 & 64) != 0) { return hScale_; } else { return HScaleDefaultValue; } } + set { + _hasBits0 |= 64; + hScale_ = value; + } + } + /// Gets whether the "h_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHScale { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "h_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHScale() { + _hasBits0 &= ~64; + } + + /// Field number for the "apply_exponential_on_box_size" field. + public const int ApplyExponentialOnBoxSizeFieldNumber = 13; + private readonly static bool ApplyExponentialOnBoxSizeDefaultValue = false; + + private bool applyExponentialOnBoxSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ApplyExponentialOnBoxSize { + get { if ((_hasBits0 & 2048) != 0) { return applyExponentialOnBoxSize_; } else { return ApplyExponentialOnBoxSizeDefaultValue; } } + set { + _hasBits0 |= 2048; + applyExponentialOnBoxSize_ = value; + } + } + /// Gets whether the "apply_exponential_on_box_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasApplyExponentialOnBoxSize { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "apply_exponential_on_box_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearApplyExponentialOnBoxSize() { + _hasBits0 &= ~2048; + } + + /// Field number for the "reverse_output_order" field. + public const int ReverseOutputOrderFieldNumber = 14; + private readonly static bool ReverseOutputOrderDefaultValue = false; + + private bool reverseOutputOrder_; + /// + /// Whether to reverse the order of predicted x, y from output. + /// If false, the order is [y_center, x_center, h, w], if true the order is + /// [x_center, y_center, w, h]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReverseOutputOrder { + get { if ((_hasBits0 & 4096) != 0) { return reverseOutputOrder_; } else { return ReverseOutputOrderDefaultValue; } } + set { + _hasBits0 |= 4096; + reverseOutputOrder_ = value; + } + } + /// Gets whether the "reverse_output_order" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReverseOutputOrder { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "reverse_output_order" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReverseOutputOrder() { + _hasBits0 &= ~4096; + } + + /// Field number for the "ignore_classes" field. + public const int IgnoreClassesFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_ignoreClasses_codec + = pb::FieldCodec.ForInt32(64); + private readonly pbc::RepeatedField ignoreClasses_ = new pbc::RepeatedField(); + /// + /// The ids of classes that should be ignored during decoding the score for + /// each predicted box. Can be overridden with IGNORE_CLASSES side packet. + /// `ignore_classes` and `allow_classes` are mutually exclusive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IgnoreClasses { + get { return ignoreClasses_; } + } + + /// Field number for the "allow_classes" field. + public const int AllowClassesFieldNumber = 21; + private static readonly pb::FieldCodec _repeated_allowClasses_codec + = pb::FieldCodec.ForInt32(170); + private readonly pbc::RepeatedField allowClasses_ = new pbc::RepeatedField(); + /// + /// The ids of classes that should be allowed during decoding the score for + /// each predicted box. `ignore_classes` and `allow_classes` are mutually + /// exclusive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AllowClasses { + get { return allowClasses_; } + } + + /// Field number for the "sigmoid_score" field. + public const int SigmoidScoreFieldNumber = 15; + private readonly static bool SigmoidScoreDefaultValue = false; + + private bool sigmoidScore_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SigmoidScore { + get { if ((_hasBits0 & 8192) != 0) { return sigmoidScore_; } else { return SigmoidScoreDefaultValue; } } + set { + _hasBits0 |= 8192; + sigmoidScore_ = value; + } + } + /// Gets whether the "sigmoid_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSigmoidScore { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "sigmoid_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSigmoidScore() { + _hasBits0 &= ~8192; + } + + /// Field number for the "score_clipping_thresh" field. + public const int ScoreClippingThreshFieldNumber = 16; + private readonly static float ScoreClippingThreshDefaultValue = 0F; + + private float scoreClippingThresh_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ScoreClippingThresh { + get { if ((_hasBits0 & 16384) != 0) { return scoreClippingThresh_; } else { return ScoreClippingThreshDefaultValue; } } + set { + _hasBits0 |= 16384; + scoreClippingThresh_ = value; + } + } + /// Gets whether the "score_clipping_thresh" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScoreClippingThresh { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "score_clipping_thresh" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScoreClippingThresh() { + _hasBits0 &= ~16384; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 18; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// vertically (along the y-direction). This is useful, for example, when the + /// input tensors represent detections defined with a coordinate system where + /// the origin is at the top-left corner, whereas the desired detection + /// representation has a bottom-left origin (e.g., in OpenGL). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 32768) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 32768; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~32768; + } + + /// Field number for the "min_score_thresh" field. + public const int MinScoreThreshFieldNumber = 19; + private readonly static float MinScoreThreshDefaultValue = 0F; + + private float minScoreThresh_; + /// + /// Score threshold for perserving decoded detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThresh { + get { if ((_hasBits0 & 65536) != 0) { return minScoreThresh_; } else { return MinScoreThreshDefaultValue; } } + set { + _hasBits0 |= 65536; + minScoreThresh_ = value; + } + } + /// Gets whether the "min_score_thresh" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThresh { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "min_score_thresh" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThresh() { + _hasBits0 &= ~65536; + } + + /// Field number for the "max_results" field. + public const int MaxResultsFieldNumber = 20; + private readonly static int MaxResultsDefaultValue = -1; + + private int maxResults_; + /// + /// The maximum number of the detection results to return. If < 0, all + /// available results will be returned. + /// For the detection models that have built-in non max suppression op, the + /// output detections are the top-scored results. Otherwise, the output + /// detections are the first N results that have higher scores than + /// `min_score_thresh`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxResults { + get { if ((_hasBits0 & 131072) != 0) { return maxResults_; } else { return MaxResultsDefaultValue; } } + set { + _hasBits0 |= 131072; + maxResults_ = value; + } + } + /// Gets whether the "max_results" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxResults { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "max_results" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxResults() { + _hasBits0 &= ~131072; + } + + /// Field number for the "tensor_mapping" field. + public const int TensorMappingFieldNumber = 22; + private global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping tensorMapping_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping TensorMapping { + get { return tensorMapping_; } + set { + tensorMapping_ = value; + } + } + + /// Field number for the "box_boundaries_indices" field. + public const int BoxBoundariesIndicesFieldNumber = 23; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices BoxBoundariesIndices { + get { return boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices ? (global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices) boxIndices_ : null; } + set { + boxIndices_ = value; + boxIndicesCase_ = value == null ? BoxIndicesOneofCase.None : BoxIndicesOneofCase.BoxBoundariesIndices; + } + } + + private object boxIndices_; + /// Enum of possible cases for the "box_indices" oneof. + public enum BoxIndicesOneofCase { + None = 0, + BoxBoundariesIndices = 23, + } + private BoxIndicesOneofCase boxIndicesCase_ = BoxIndicesOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxIndicesOneofCase BoxIndicesCase { + get { return boxIndicesCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxIndices() { + boxIndicesCase_ = BoxIndicesOneofCase.None; + boxIndices_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToDetectionsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToDetectionsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumClasses != other.NumClasses) return false; + if (NumBoxes != other.NumBoxes) return false; + if (NumCoords != other.NumCoords) return false; + if (KeypointCoordOffset != other.KeypointCoordOffset) return false; + if (NumKeypoints != other.NumKeypoints) return false; + if (NumValuesPerKeypoint != other.NumValuesPerKeypoint) return false; + if (BoxCoordOffset != other.BoxCoordOffset) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XScale, other.XScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YScale, other.YScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WScale, other.WScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HScale, other.HScale)) return false; + if (ApplyExponentialOnBoxSize != other.ApplyExponentialOnBoxSize) return false; + if (ReverseOutputOrder != other.ReverseOutputOrder) return false; + if(!ignoreClasses_.Equals(other.ignoreClasses_)) return false; + if(!allowClasses_.Equals(other.allowClasses_)) return false; + if (SigmoidScore != other.SigmoidScore) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScoreClippingThresh, other.ScoreClippingThresh)) return false; + if (FlipVertically != other.FlipVertically) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThresh, other.MinScoreThresh)) return false; + if (MaxResults != other.MaxResults) return false; + if (!object.Equals(TensorMapping, other.TensorMapping)) return false; + if (!object.Equals(BoxBoundariesIndices, other.BoxBoundariesIndices)) return false; + if (BoxIndicesCase != other.BoxIndicesCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumClasses) hash ^= NumClasses.GetHashCode(); + if (HasNumBoxes) hash ^= NumBoxes.GetHashCode(); + if (HasNumCoords) hash ^= NumCoords.GetHashCode(); + if (HasKeypointCoordOffset) hash ^= KeypointCoordOffset.GetHashCode(); + if (HasNumKeypoints) hash ^= NumKeypoints.GetHashCode(); + if (HasNumValuesPerKeypoint) hash ^= NumValuesPerKeypoint.GetHashCode(); + if (HasBoxCoordOffset) hash ^= BoxCoordOffset.GetHashCode(); + if (HasXScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XScale); + if (HasYScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YScale); + if (HasWScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WScale); + if (HasHScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HScale); + if (HasApplyExponentialOnBoxSize) hash ^= ApplyExponentialOnBoxSize.GetHashCode(); + if (HasReverseOutputOrder) hash ^= ReverseOutputOrder.GetHashCode(); + hash ^= ignoreClasses_.GetHashCode(); + hash ^= allowClasses_.GetHashCode(); + if (HasSigmoidScore) hash ^= SigmoidScore.GetHashCode(); + if (HasScoreClippingThresh) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScoreClippingThresh); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasMinScoreThresh) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThresh); + if (HasMaxResults) hash ^= MaxResults.GetHashCode(); + if (tensorMapping_ != null) hash ^= TensorMapping.GetHashCode(); + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) hash ^= BoxBoundariesIndices.GetHashCode(); + hash ^= (int) boxIndicesCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumBoxes) { + output.WriteRawTag(16); + output.WriteInt32(NumBoxes); + } + if (HasNumCoords) { + output.WriteRawTag(24); + output.WriteInt32(NumCoords); + } + if (HasXScale) { + output.WriteRawTag(37); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(45); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(53); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(61); + output.WriteFloat(HScale); + } + ignoreClasses_.WriteTo(output, _repeated_ignoreClasses_codec); + if (HasKeypointCoordOffset) { + output.WriteRawTag(72); + output.WriteInt32(KeypointCoordOffset); + } + if (HasNumKeypoints) { + output.WriteRawTag(80); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(88); + output.WriteInt32(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + output.WriteRawTag(96); + output.WriteInt32(BoxCoordOffset); + } + if (HasApplyExponentialOnBoxSize) { + output.WriteRawTag(104); + output.WriteBool(ApplyExponentialOnBoxSize); + } + if (HasReverseOutputOrder) { + output.WriteRawTag(112); + output.WriteBool(ReverseOutputOrder); + } + if (HasSigmoidScore) { + output.WriteRawTag(120); + output.WriteBool(SigmoidScore); + } + if (HasScoreClippingThresh) { + output.WriteRawTag(133, 1); + output.WriteFloat(ScoreClippingThresh); + } + if (HasFlipVertically) { + output.WriteRawTag(144, 1); + output.WriteBool(FlipVertically); + } + if (HasMinScoreThresh) { + output.WriteRawTag(157, 1); + output.WriteFloat(MinScoreThresh); + } + if (HasMaxResults) { + output.WriteRawTag(160, 1); + output.WriteInt32(MaxResults); + } + allowClasses_.WriteTo(output, _repeated_allowClasses_codec); + if (tensorMapping_ != null) { + output.WriteRawTag(178, 1); + output.WriteMessage(TensorMapping); + } + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) { + output.WriteRawTag(186, 1); + output.WriteMessage(BoxBoundariesIndices); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumBoxes) { + output.WriteRawTag(16); + output.WriteInt32(NumBoxes); + } + if (HasNumCoords) { + output.WriteRawTag(24); + output.WriteInt32(NumCoords); + } + if (HasXScale) { + output.WriteRawTag(37); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(45); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(53); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(61); + output.WriteFloat(HScale); + } + ignoreClasses_.WriteTo(ref output, _repeated_ignoreClasses_codec); + if (HasKeypointCoordOffset) { + output.WriteRawTag(72); + output.WriteInt32(KeypointCoordOffset); + } + if (HasNumKeypoints) { + output.WriteRawTag(80); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(88); + output.WriteInt32(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + output.WriteRawTag(96); + output.WriteInt32(BoxCoordOffset); + } + if (HasApplyExponentialOnBoxSize) { + output.WriteRawTag(104); + output.WriteBool(ApplyExponentialOnBoxSize); + } + if (HasReverseOutputOrder) { + output.WriteRawTag(112); + output.WriteBool(ReverseOutputOrder); + } + if (HasSigmoidScore) { + output.WriteRawTag(120); + output.WriteBool(SigmoidScore); + } + if (HasScoreClippingThresh) { + output.WriteRawTag(133, 1); + output.WriteFloat(ScoreClippingThresh); + } + if (HasFlipVertically) { + output.WriteRawTag(144, 1); + output.WriteBool(FlipVertically); + } + if (HasMinScoreThresh) { + output.WriteRawTag(157, 1); + output.WriteFloat(MinScoreThresh); + } + if (HasMaxResults) { + output.WriteRawTag(160, 1); + output.WriteInt32(MaxResults); + } + allowClasses_.WriteTo(ref output, _repeated_allowClasses_codec); + if (tensorMapping_ != null) { + output.WriteRawTag(178, 1); + output.WriteMessage(TensorMapping); + } + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) { + output.WriteRawTag(186, 1); + output.WriteMessage(BoxBoundariesIndices); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumClasses) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumClasses); + } + if (HasNumBoxes) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumBoxes); + } + if (HasNumCoords) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumCoords); + } + if (HasKeypointCoordOffset) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(KeypointCoordOffset); + } + if (HasNumKeypoints) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCoordOffset); + } + if (HasXScale) { + size += 1 + 4; + } + if (HasYScale) { + size += 1 + 4; + } + if (HasWScale) { + size += 1 + 4; + } + if (HasHScale) { + size += 1 + 4; + } + if (HasApplyExponentialOnBoxSize) { + size += 1 + 1; + } + if (HasReverseOutputOrder) { + size += 1 + 1; + } + size += ignoreClasses_.CalculateSize(_repeated_ignoreClasses_codec); + size += allowClasses_.CalculateSize(_repeated_allowClasses_codec); + if (HasSigmoidScore) { + size += 1 + 1; + } + if (HasScoreClippingThresh) { + size += 2 + 4; + } + if (HasFlipVertically) { + size += 2 + 1; + } + if (HasMinScoreThresh) { + size += 2 + 4; + } + if (HasMaxResults) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxResults); + } + if (tensorMapping_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(TensorMapping); + } + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(BoxBoundariesIndices); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToDetectionsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumClasses) { + NumClasses = other.NumClasses; + } + if (other.HasNumBoxes) { + NumBoxes = other.NumBoxes; + } + if (other.HasNumCoords) { + NumCoords = other.NumCoords; + } + if (other.HasKeypointCoordOffset) { + KeypointCoordOffset = other.KeypointCoordOffset; + } + if (other.HasNumKeypoints) { + NumKeypoints = other.NumKeypoints; + } + if (other.HasNumValuesPerKeypoint) { + NumValuesPerKeypoint = other.NumValuesPerKeypoint; + } + if (other.HasBoxCoordOffset) { + BoxCoordOffset = other.BoxCoordOffset; + } + if (other.HasXScale) { + XScale = other.XScale; + } + if (other.HasYScale) { + YScale = other.YScale; + } + if (other.HasWScale) { + WScale = other.WScale; + } + if (other.HasHScale) { + HScale = other.HScale; + } + if (other.HasApplyExponentialOnBoxSize) { + ApplyExponentialOnBoxSize = other.ApplyExponentialOnBoxSize; + } + if (other.HasReverseOutputOrder) { + ReverseOutputOrder = other.ReverseOutputOrder; + } + ignoreClasses_.Add(other.ignoreClasses_); + allowClasses_.Add(other.allowClasses_); + if (other.HasSigmoidScore) { + SigmoidScore = other.SigmoidScore; + } + if (other.HasScoreClippingThresh) { + ScoreClippingThresh = other.ScoreClippingThresh; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasMinScoreThresh) { + MinScoreThresh = other.MinScoreThresh; + } + if (other.HasMaxResults) { + MaxResults = other.MaxResults; + } + if (other.tensorMapping_ != null) { + if (tensorMapping_ == null) { + TensorMapping = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping(); + } + TensorMapping.MergeFrom(other.TensorMapping); + } + switch (other.BoxIndicesCase) { + case BoxIndicesOneofCase.BoxBoundariesIndices: + if (BoxBoundariesIndices == null) { + BoxBoundariesIndices = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices(); + } + BoxBoundariesIndices.MergeFrom(other.BoxBoundariesIndices); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumBoxes = input.ReadInt32(); + break; + } + case 24: { + NumCoords = input.ReadInt32(); + break; + } + case 37: { + XScale = input.ReadFloat(); + break; + } + case 45: { + YScale = input.ReadFloat(); + break; + } + case 53: { + WScale = input.ReadFloat(); + break; + } + case 61: { + HScale = input.ReadFloat(); + break; + } + case 66: + case 64: { + ignoreClasses_.AddEntriesFrom(input, _repeated_ignoreClasses_codec); + break; + } + case 72: { + KeypointCoordOffset = input.ReadInt32(); + break; + } + case 80: { + NumKeypoints = input.ReadInt32(); + break; + } + case 88: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 96: { + BoxCoordOffset = input.ReadInt32(); + break; + } + case 104: { + ApplyExponentialOnBoxSize = input.ReadBool(); + break; + } + case 112: { + ReverseOutputOrder = input.ReadBool(); + break; + } + case 120: { + SigmoidScore = input.ReadBool(); + break; + } + case 133: { + ScoreClippingThresh = input.ReadFloat(); + break; + } + case 144: { + FlipVertically = input.ReadBool(); + break; + } + case 157: { + MinScoreThresh = input.ReadFloat(); + break; + } + case 160: { + MaxResults = input.ReadInt32(); + break; + } + case 170: + case 168: { + allowClasses_.AddEntriesFrom(input, _repeated_allowClasses_codec); + break; + } + case 178: { + if (tensorMapping_ == null) { + TensorMapping = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping(); + } + input.ReadMessage(TensorMapping); + break; + } + case 186: { + global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices subBuilder = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices(); + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) { + subBuilder.MergeFrom(BoxBoundariesIndices); + } + input.ReadMessage(subBuilder); + BoxBoundariesIndices = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumBoxes = input.ReadInt32(); + break; + } + case 24: { + NumCoords = input.ReadInt32(); + break; + } + case 37: { + XScale = input.ReadFloat(); + break; + } + case 45: { + YScale = input.ReadFloat(); + break; + } + case 53: { + WScale = input.ReadFloat(); + break; + } + case 61: { + HScale = input.ReadFloat(); + break; + } + case 66: + case 64: { + ignoreClasses_.AddEntriesFrom(ref input, _repeated_ignoreClasses_codec); + break; + } + case 72: { + KeypointCoordOffset = input.ReadInt32(); + break; + } + case 80: { + NumKeypoints = input.ReadInt32(); + break; + } + case 88: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 96: { + BoxCoordOffset = input.ReadInt32(); + break; + } + case 104: { + ApplyExponentialOnBoxSize = input.ReadBool(); + break; + } + case 112: { + ReverseOutputOrder = input.ReadBool(); + break; + } + case 120: { + SigmoidScore = input.ReadBool(); + break; + } + case 133: { + ScoreClippingThresh = input.ReadFloat(); + break; + } + case 144: { + FlipVertically = input.ReadBool(); + break; + } + case 157: { + MinScoreThresh = input.ReadFloat(); + break; + } + case 160: { + MaxResults = input.ReadInt32(); + break; + } + case 170: + case 168: { + allowClasses_.AddEntriesFrom(ref input, _repeated_allowClasses_codec); + break; + } + case 178: { + if (tensorMapping_ == null) { + TensorMapping = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.TensorMapping(); + } + input.ReadMessage(TensorMapping); + break; + } + case 186: { + global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices subBuilder = new global::Mediapipe.TensorsToDetectionsCalculatorOptions.Types.BoxBoundariesIndices(); + if (boxIndicesCase_ == BoxIndicesOneofCase.BoxBoundariesIndices) { + subBuilder.MergeFrom(BoxBoundariesIndices); + } + input.ReadMessage(subBuilder); + BoxBoundariesIndices = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorsToDetectionsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The custom model output tensor mapping. + /// The indices of the "detections" tensor and the "scores" tensor are always + /// required. If the model outputs an "anchors" tensor, `anchors_tensor_index` + /// must be specified. If the model outputs both "classes" tensor and "number + /// of detections" tensors, `classes_tensor_index` and + /// `num_detections_tensor_index` must be set. + /// + public sealed partial class TensorMapping : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorMapping()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToDetectionsCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorMapping() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorMapping(TensorMapping other) : this() { + _hasBits0 = other._hasBits0; + detectionsTensorIndex_ = other.detectionsTensorIndex_; + classesTensorIndex_ = other.classesTensorIndex_; + scoresTensorIndex_ = other.scoresTensorIndex_; + numDetectionsTensorIndex_ = other.numDetectionsTensorIndex_; + anchorsTensorIndex_ = other.anchorsTensorIndex_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorMapping Clone() { + return new TensorMapping(this); + } + + /// Field number for the "detections_tensor_index" field. + public const int DetectionsTensorIndexFieldNumber = 1; + private readonly static int DetectionsTensorIndexDefaultValue = 0; + + private int detectionsTensorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DetectionsTensorIndex { + get { if ((_hasBits0 & 1) != 0) { return detectionsTensorIndex_; } else { return DetectionsTensorIndexDefaultValue; } } + set { + _hasBits0 |= 1; + detectionsTensorIndex_ = value; + } + } + /// Gets whether the "detections_tensor_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDetectionsTensorIndex { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "detections_tensor_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDetectionsTensorIndex() { + _hasBits0 &= ~1; + } + + /// Field number for the "classes_tensor_index" field. + public const int ClassesTensorIndexFieldNumber = 2; + private readonly static int ClassesTensorIndexDefaultValue = 0; + + private int classesTensorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ClassesTensorIndex { + get { if ((_hasBits0 & 2) != 0) { return classesTensorIndex_; } else { return ClassesTensorIndexDefaultValue; } } + set { + _hasBits0 |= 2; + classesTensorIndex_ = value; + } + } + /// Gets whether the "classes_tensor_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClassesTensorIndex { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "classes_tensor_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClassesTensorIndex() { + _hasBits0 &= ~2; + } + + /// Field number for the "scores_tensor_index" field. + public const int ScoresTensorIndexFieldNumber = 3; + private readonly static int ScoresTensorIndexDefaultValue = 0; + + private int scoresTensorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ScoresTensorIndex { + get { if ((_hasBits0 & 4) != 0) { return scoresTensorIndex_; } else { return ScoresTensorIndexDefaultValue; } } + set { + _hasBits0 |= 4; + scoresTensorIndex_ = value; + } + } + /// Gets whether the "scores_tensor_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScoresTensorIndex { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "scores_tensor_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScoresTensorIndex() { + _hasBits0 &= ~4; + } + + /// Field number for the "num_detections_tensor_index" field. + public const int NumDetectionsTensorIndexFieldNumber = 4; + private readonly static int NumDetectionsTensorIndexDefaultValue = 0; + + private int numDetectionsTensorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumDetectionsTensorIndex { + get { if ((_hasBits0 & 8) != 0) { return numDetectionsTensorIndex_; } else { return NumDetectionsTensorIndexDefaultValue; } } + set { + _hasBits0 |= 8; + numDetectionsTensorIndex_ = value; + } + } + /// Gets whether the "num_detections_tensor_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumDetectionsTensorIndex { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "num_detections_tensor_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumDetectionsTensorIndex() { + _hasBits0 &= ~8; + } + + /// Field number for the "anchors_tensor_index" field. + public const int AnchorsTensorIndexFieldNumber = 5; + private readonly static int AnchorsTensorIndexDefaultValue = 0; + + private int anchorsTensorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AnchorsTensorIndex { + get { if ((_hasBits0 & 16) != 0) { return anchorsTensorIndex_; } else { return AnchorsTensorIndexDefaultValue; } } + set { + _hasBits0 |= 16; + anchorsTensorIndex_ = value; + } + } + /// Gets whether the "anchors_tensor_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnchorsTensorIndex { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "anchors_tensor_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnchorsTensorIndex() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorMapping); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorMapping other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DetectionsTensorIndex != other.DetectionsTensorIndex) return false; + if (ClassesTensorIndex != other.ClassesTensorIndex) return false; + if (ScoresTensorIndex != other.ScoresTensorIndex) return false; + if (NumDetectionsTensorIndex != other.NumDetectionsTensorIndex) return false; + if (AnchorsTensorIndex != other.AnchorsTensorIndex) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDetectionsTensorIndex) hash ^= DetectionsTensorIndex.GetHashCode(); + if (HasClassesTensorIndex) hash ^= ClassesTensorIndex.GetHashCode(); + if (HasScoresTensorIndex) hash ^= ScoresTensorIndex.GetHashCode(); + if (HasNumDetectionsTensorIndex) hash ^= NumDetectionsTensorIndex.GetHashCode(); + if (HasAnchorsTensorIndex) hash ^= AnchorsTensorIndex.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDetectionsTensorIndex) { + output.WriteRawTag(8); + output.WriteInt32(DetectionsTensorIndex); + } + if (HasClassesTensorIndex) { + output.WriteRawTag(16); + output.WriteInt32(ClassesTensorIndex); + } + if (HasScoresTensorIndex) { + output.WriteRawTag(24); + output.WriteInt32(ScoresTensorIndex); + } + if (HasNumDetectionsTensorIndex) { + output.WriteRawTag(32); + output.WriteInt32(NumDetectionsTensorIndex); + } + if (HasAnchorsTensorIndex) { + output.WriteRawTag(40); + output.WriteInt32(AnchorsTensorIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDetectionsTensorIndex) { + output.WriteRawTag(8); + output.WriteInt32(DetectionsTensorIndex); + } + if (HasClassesTensorIndex) { + output.WriteRawTag(16); + output.WriteInt32(ClassesTensorIndex); + } + if (HasScoresTensorIndex) { + output.WriteRawTag(24); + output.WriteInt32(ScoresTensorIndex); + } + if (HasNumDetectionsTensorIndex) { + output.WriteRawTag(32); + output.WriteInt32(NumDetectionsTensorIndex); + } + if (HasAnchorsTensorIndex) { + output.WriteRawTag(40); + output.WriteInt32(AnchorsTensorIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDetectionsTensorIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DetectionsTensorIndex); + } + if (HasClassesTensorIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ClassesTensorIndex); + } + if (HasScoresTensorIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ScoresTensorIndex); + } + if (HasNumDetectionsTensorIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumDetectionsTensorIndex); + } + if (HasAnchorsTensorIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AnchorsTensorIndex); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorMapping other) { + if (other == null) { + return; + } + if (other.HasDetectionsTensorIndex) { + DetectionsTensorIndex = other.DetectionsTensorIndex; + } + if (other.HasClassesTensorIndex) { + ClassesTensorIndex = other.ClassesTensorIndex; + } + if (other.HasScoresTensorIndex) { + ScoresTensorIndex = other.ScoresTensorIndex; + } + if (other.HasNumDetectionsTensorIndex) { + NumDetectionsTensorIndex = other.NumDetectionsTensorIndex; + } + if (other.HasAnchorsTensorIndex) { + AnchorsTensorIndex = other.AnchorsTensorIndex; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DetectionsTensorIndex = input.ReadInt32(); + break; + } + case 16: { + ClassesTensorIndex = input.ReadInt32(); + break; + } + case 24: { + ScoresTensorIndex = input.ReadInt32(); + break; + } + case 32: { + NumDetectionsTensorIndex = input.ReadInt32(); + break; + } + case 40: { + AnchorsTensorIndex = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + DetectionsTensorIndex = input.ReadInt32(); + break; + } + case 16: { + ClassesTensorIndex = input.ReadInt32(); + break; + } + case 24: { + ScoresTensorIndex = input.ReadInt32(); + break; + } + case 32: { + NumDetectionsTensorIndex = input.ReadInt32(); + break; + } + case 40: { + AnchorsTensorIndex = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// Represents the bounding box by using the combination of boundaries, + /// {ymin, xmin, ymax, xmax}. + /// The default order is {ymin, xmin, ymax, xmax}. + /// + public sealed partial class BoxBoundariesIndices : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxBoundariesIndices()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToDetectionsCalculatorOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxBoundariesIndices() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxBoundariesIndices(BoxBoundariesIndices other) : this() { + _hasBits0 = other._hasBits0; + ymin_ = other.ymin_; + xmin_ = other.xmin_; + ymax_ = other.ymax_; + xmax_ = other.xmax_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxBoundariesIndices Clone() { + return new BoxBoundariesIndices(this); + } + + /// Field number for the "ymin" field. + public const int YminFieldNumber = 1; + private readonly static int YminDefaultValue = 0; + + private int ymin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Ymin { + get { if ((_hasBits0 & 1) != 0) { return ymin_; } else { return YminDefaultValue; } } + set { + _hasBits0 |= 1; + ymin_ = value; + } + } + /// Gets whether the "ymin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYmin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "ymin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYmin() { + _hasBits0 &= ~1; + } + + /// Field number for the "xmin" field. + public const int XminFieldNumber = 2; + private readonly static int XminDefaultValue = 1; + + private int xmin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Xmin { + get { if ((_hasBits0 & 2) != 0) { return xmin_; } else { return XminDefaultValue; } } + set { + _hasBits0 |= 2; + xmin_ = value; + } + } + /// Gets whether the "xmin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXmin { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "xmin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXmin() { + _hasBits0 &= ~2; + } + + /// Field number for the "ymax" field. + public const int YmaxFieldNumber = 3; + private readonly static int YmaxDefaultValue = 2; + + private int ymax_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Ymax { + get { if ((_hasBits0 & 4) != 0) { return ymax_; } else { return YmaxDefaultValue; } } + set { + _hasBits0 |= 4; + ymax_ = value; + } + } + /// Gets whether the "ymax" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYmax { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "ymax" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYmax() { + _hasBits0 &= ~4; + } + + /// Field number for the "xmax" field. + public const int XmaxFieldNumber = 4; + private readonly static int XmaxDefaultValue = 3; + + private int xmax_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Xmax { + get { if ((_hasBits0 & 8) != 0) { return xmax_; } else { return XmaxDefaultValue; } } + set { + _hasBits0 |= 8; + xmax_ = value; + } + } + /// Gets whether the "xmax" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXmax { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "xmax" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXmax() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxBoundariesIndices); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxBoundariesIndices other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Ymin != other.Ymin) return false; + if (Xmin != other.Xmin) return false; + if (Ymax != other.Ymax) return false; + if (Xmax != other.Xmax) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasYmin) hash ^= Ymin.GetHashCode(); + if (HasXmin) hash ^= Xmin.GetHashCode(); + if (HasYmax) hash ^= Ymax.GetHashCode(); + if (HasXmax) hash ^= Xmax.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasYmin) { + output.WriteRawTag(8); + output.WriteInt32(Ymin); + } + if (HasXmin) { + output.WriteRawTag(16); + output.WriteInt32(Xmin); + } + if (HasYmax) { + output.WriteRawTag(24); + output.WriteInt32(Ymax); + } + if (HasXmax) { + output.WriteRawTag(32); + output.WriteInt32(Xmax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasYmin) { + output.WriteRawTag(8); + output.WriteInt32(Ymin); + } + if (HasXmin) { + output.WriteRawTag(16); + output.WriteInt32(Xmin); + } + if (HasYmax) { + output.WriteRawTag(24); + output.WriteInt32(Ymax); + } + if (HasXmax) { + output.WriteRawTag(32); + output.WriteInt32(Xmax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasYmin) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Ymin); + } + if (HasXmin) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Xmin); + } + if (HasYmax) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Ymax); + } + if (HasXmax) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Xmax); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxBoundariesIndices other) { + if (other == null) { + return; + } + if (other.HasYmin) { + Ymin = other.Ymin; + } + if (other.HasXmin) { + Xmin = other.Xmin; + } + if (other.HasYmax) { + Ymax = other.Ymax; + } + if (other.HasXmax) { + Xmax = other.Xmax; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Ymin = input.ReadInt32(); + break; + } + case 16: { + Xmin = input.ReadInt32(); + break; + } + case 24: { + Ymax = input.ReadInt32(); + break; + } + case 32: { + Xmax = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Ymin = input.ReadInt32(); + break; + } + case 16: { + Xmin = input.ReadInt32(); + break; + } + case 24: { + Ymax = input.ReadInt32(); + break; + } + case 32: { + Xmax = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToDetectionsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(335742639, pb::FieldCodec.ForMessage(2685941114, global::Mediapipe.TensorsToDetectionsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs.meta new file mode 100644 index 0000000..52f9728 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToDetectionsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b0f773471b719b5f803cac686ec7653 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs new file mode 100644 index 0000000..02fadb9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs @@ -0,0 +1,282 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensors_to_floats_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensors_to_floats_calculator.proto + public static partial class TensorsToFloatsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensors_to_floats_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToFloatsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcnNfdG9fZmxv", + "YXRzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIvUBCiBUZW5zb3JzVG9GbG9hdHND", + "YWxjdWxhdG9yT3B0aW9ucxJQCgphY3RpdmF0aW9uGAEgASgOMjYubWVkaWFw", + "aXBlLlRlbnNvcnNUb0Zsb2F0c0NhbGN1bGF0b3JPcHRpb25zLkFjdGl2YXRp", + "b246BE5PTkUiIwoKQWN0aXZhdGlvbhIICgROT05FEAASCwoHU0lHTU9JRBAB", + "MloKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjrwuWjASAB", + "KAsyKy5tZWRpYXBpcGUuVGVuc29yc1RvRmxvYXRzQ2FsY3VsYXRvck9wdGlv", + "bnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToFloatsCalculatorOptions), global::Mediapipe.TensorsToFloatsCalculatorOptions.Parser, new[]{ "Activation" }, null, new[]{ typeof(global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation) }, new pb::Extension[] { global::Mediapipe.TensorsToFloatsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToFloatsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToFloatsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToFloatsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToFloatsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToFloatsCalculatorOptions(TensorsToFloatsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + activation_ = other.activation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToFloatsCalculatorOptions Clone() { + return new TensorsToFloatsCalculatorOptions(this); + } + + /// Field number for the "activation" field. + public const int ActivationFieldNumber = 1; + private readonly static global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation ActivationDefaultValue = global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation activation_; + /// + /// Apply activation function to the floats. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation Activation { + get { if ((_hasBits0 & 1) != 0) { return activation_; } else { return ActivationDefaultValue; } } + set { + _hasBits0 |= 1; + activation_ = value; + } + } + /// Gets whether the "activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivation { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivation() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToFloatsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToFloatsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Activation != other.Activation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasActivation) hash ^= Activation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasActivation) { + output.WriteRawTag(8); + output.WriteEnum((int) Activation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasActivation) { + output.WriteRawTag(8); + output.WriteEnum((int) Activation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Activation); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToFloatsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasActivation) { + Activation = other.Activation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Activation = (global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Activation = (global::Mediapipe.TensorsToFloatsCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorsToFloatsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Activation { + [pbr::OriginalName("NONE")] None = 0, + [pbr::OriginalName("SIGMOID")] Sigmoid = 1, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToFloatsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(343499115, pb::FieldCodec.ForMessage(2747992922, global::Mediapipe.TensorsToFloatsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs.meta new file mode 100644 index 0000000..847fbfb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToFloatsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5420969ccb190f91580f7d4197868cf1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs new file mode 100644 index 0000000..14be32e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs @@ -0,0 +1,681 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensors_to_landmarks_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensors_to_landmarks_calculator.proto + public static partial class TensorsToLandmarksCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensors_to_landmarks_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToLandmarksCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkJtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcnNfdG9fbGFu", + "ZG1hcmtzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBl", + "L2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIo8ECiNUZW5zb3JzVG9MYW5k", + "bWFya3NDYWxjdWxhdG9yT3B0aW9ucxIVCg1udW1fbGFuZG1hcmtzGAEgASgF", + "EhkKEWlucHV0X2ltYWdlX3dpZHRoGAIgASgFEhoKEmlucHV0X2ltYWdlX2hl", + "aWdodBgDIAEoBRIeCg9mbGlwX3ZlcnRpY2FsbHkYBCABKAg6BWZhbHNlEiAK", + "EWZsaXBfaG9yaXpvbnRhbGx5GAYgASgIOgVmYWxzZRIWCgtub3JtYWxpemVf", + "ehgFIAEoAjoBMRJeChV2aXNpYmlsaXR5X2FjdGl2YXRpb24YByABKA4yOS5t", + "ZWRpYXBpcGUuVGVuc29yc1RvTGFuZG1hcmtzQ2FsY3VsYXRvck9wdGlvbnMu", + "QWN0aXZhdGlvbjoETk9ORRJcChNwcmVzZW5jZV9hY3RpdmF0aW9uGAggASgO", + "MjkubWVkaWFwaXBlLlRlbnNvcnNUb0xhbmRtYXJrc0NhbGN1bGF0b3JPcHRp", + "b25zLkFjdGl2YXRpb246BE5PTkUiIwoKQWN0aXZhdGlvbhIICgROT05FEAAS", + "CwoHU0lHTU9JRBABMl0KA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0", + "aW9ucxiwjYygASABKAsyLi5tZWRpYXBpcGUuVGVuc29yc1RvTGFuZG1hcmtz", + "Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToLandmarksCalculatorOptions), global::Mediapipe.TensorsToLandmarksCalculatorOptions.Parser, new[]{ "NumLandmarks", "InputImageWidth", "InputImageHeight", "FlipVertically", "FlipHorizontally", "NormalizeZ", "VisibilityActivation", "PresenceActivation" }, null, new[]{ typeof(global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation) }, new pb::Extension[] { global::Mediapipe.TensorsToLandmarksCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToLandmarksCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToLandmarksCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToLandmarksCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToLandmarksCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToLandmarksCalculatorOptions(TensorsToLandmarksCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numLandmarks_ = other.numLandmarks_; + inputImageWidth_ = other.inputImageWidth_; + inputImageHeight_ = other.inputImageHeight_; + flipVertically_ = other.flipVertically_; + flipHorizontally_ = other.flipHorizontally_; + normalizeZ_ = other.normalizeZ_; + visibilityActivation_ = other.visibilityActivation_; + presenceActivation_ = other.presenceActivation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToLandmarksCalculatorOptions Clone() { + return new TensorsToLandmarksCalculatorOptions(this); + } + + /// Field number for the "num_landmarks" field. + public const int NumLandmarksFieldNumber = 1; + private readonly static int NumLandmarksDefaultValue = 0; + + private int numLandmarks_; + /// + /// [Required] Number of landmarks from the output of the model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumLandmarks { + get { if ((_hasBits0 & 1) != 0) { return numLandmarks_; } else { return NumLandmarksDefaultValue; } } + set { + _hasBits0 |= 1; + numLandmarks_ = value; + } + } + /// Gets whether the "num_landmarks" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumLandmarks { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_landmarks" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumLandmarks() { + _hasBits0 &= ~1; + } + + /// Field number for the "input_image_width" field. + public const int InputImageWidthFieldNumber = 2; + private readonly static int InputImageWidthDefaultValue = 0; + + private int inputImageWidth_; + /// + /// Size of the input image for the model. These options are used only when + /// normalized landmarks are needed. Z coordinate is scaled as X assuming + /// a weak perspective projection camera model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputImageWidth { + get { if ((_hasBits0 & 2) != 0) { return inputImageWidth_; } else { return InputImageWidthDefaultValue; } } + set { + _hasBits0 |= 2; + inputImageWidth_ = value; + } + } + /// Gets whether the "input_image_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputImageWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "input_image_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputImageWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "input_image_height" field. + public const int InputImageHeightFieldNumber = 3; + private readonly static int InputImageHeightDefaultValue = 0; + + private int inputImageHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputImageHeight { + get { if ((_hasBits0 & 4) != 0) { return inputImageHeight_; } else { return InputImageHeightDefaultValue; } } + set { + _hasBits0 |= 4; + inputImageHeight_ = value; + } + } + /// Gets whether the "input_image_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputImageHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "input_image_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputImageHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 4; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// vertically (along the y-direction). This is useful, for example, when the + /// input tensors represent detections defined with a coordinate system where + /// the origin is at the top-left corner, whereas the desired detection + /// representation has a bottom-left origin (e.g., in OpenGL). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 8) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 8; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~8; + } + + /// Field number for the "flip_horizontally" field. + public const int FlipHorizontallyFieldNumber = 6; + private readonly static bool FlipHorizontallyDefaultValue = false; + + private bool flipHorizontally_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// horizontally (along the x-direction). This is useful, for example, when the + /// input image is horizontally flipped in ImageTransformationCalculator + /// beforehand. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipHorizontally { + get { if ((_hasBits0 & 32) != 0) { return flipHorizontally_; } else { return FlipHorizontallyDefaultValue; } } + set { + _hasBits0 |= 32; + flipHorizontally_ = value; + } + } + /// Gets whether the "flip_horizontally" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipHorizontally { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "flip_horizontally" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipHorizontally() { + _hasBits0 &= ~32; + } + + /// Field number for the "normalize_z" field. + public const int NormalizeZFieldNumber = 5; + private readonly static float NormalizeZDefaultValue = 1F; + + private float normalizeZ_; + /// + /// A value that Z coordinates should be divided by. This option is used only + /// when normalized landmarks are needed. It is applied in addition to Z + /// coordinate being re-scaled as X. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizeZ { + get { if ((_hasBits0 & 16) != 0) { return normalizeZ_; } else { return NormalizeZDefaultValue; } } + set { + _hasBits0 |= 16; + normalizeZ_ = value; + } + } + /// Gets whether the "normalize_z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizeZ { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalize_z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizeZ() { + _hasBits0 &= ~16; + } + + /// Field number for the "visibility_activation" field. + public const int VisibilityActivationFieldNumber = 7; + private readonly static global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation VisibilityActivationDefaultValue = global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation visibilityActivation_; + /// + /// Apply activation function to the tensor representing landmark visibility. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation VisibilityActivation { + get { if ((_hasBits0 & 64) != 0) { return visibilityActivation_; } else { return VisibilityActivationDefaultValue; } } + set { + _hasBits0 |= 64; + visibilityActivation_ = value; + } + } + /// Gets whether the "visibility_activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisibilityActivation { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "visibility_activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisibilityActivation() { + _hasBits0 &= ~64; + } + + /// Field number for the "presence_activation" field. + public const int PresenceActivationFieldNumber = 8; + private readonly static global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation PresenceActivationDefaultValue = global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation presenceActivation_; + /// + /// Apply activation function to the tensor representing landmark presence. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation PresenceActivation { + get { if ((_hasBits0 & 128) != 0) { return presenceActivation_; } else { return PresenceActivationDefaultValue; } } + set { + _hasBits0 |= 128; + presenceActivation_ = value; + } + } + /// Gets whether the "presence_activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPresenceActivation { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "presence_activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPresenceActivation() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToLandmarksCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToLandmarksCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumLandmarks != other.NumLandmarks) return false; + if (InputImageWidth != other.InputImageWidth) return false; + if (InputImageHeight != other.InputImageHeight) return false; + if (FlipVertically != other.FlipVertically) return false; + if (FlipHorizontally != other.FlipHorizontally) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizeZ, other.NormalizeZ)) return false; + if (VisibilityActivation != other.VisibilityActivation) return false; + if (PresenceActivation != other.PresenceActivation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumLandmarks) hash ^= NumLandmarks.GetHashCode(); + if (HasInputImageWidth) hash ^= InputImageWidth.GetHashCode(); + if (HasInputImageHeight) hash ^= InputImageHeight.GetHashCode(); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasFlipHorizontally) hash ^= FlipHorizontally.GetHashCode(); + if (HasNormalizeZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizeZ); + if (HasVisibilityActivation) hash ^= VisibilityActivation.GetHashCode(); + if (HasPresenceActivation) hash ^= PresenceActivation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumLandmarks) { + output.WriteRawTag(8); + output.WriteInt32(NumLandmarks); + } + if (HasInputImageWidth) { + output.WriteRawTag(16); + output.WriteInt32(InputImageWidth); + } + if (HasInputImageHeight) { + output.WriteRawTag(24); + output.WriteInt32(InputImageHeight); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasNormalizeZ) { + output.WriteRawTag(45); + output.WriteFloat(NormalizeZ); + } + if (HasFlipHorizontally) { + output.WriteRawTag(48); + output.WriteBool(FlipHorizontally); + } + if (HasVisibilityActivation) { + output.WriteRawTag(56); + output.WriteEnum((int) VisibilityActivation); + } + if (HasPresenceActivation) { + output.WriteRawTag(64); + output.WriteEnum((int) PresenceActivation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumLandmarks) { + output.WriteRawTag(8); + output.WriteInt32(NumLandmarks); + } + if (HasInputImageWidth) { + output.WriteRawTag(16); + output.WriteInt32(InputImageWidth); + } + if (HasInputImageHeight) { + output.WriteRawTag(24); + output.WriteInt32(InputImageHeight); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasNormalizeZ) { + output.WriteRawTag(45); + output.WriteFloat(NormalizeZ); + } + if (HasFlipHorizontally) { + output.WriteRawTag(48); + output.WriteBool(FlipHorizontally); + } + if (HasVisibilityActivation) { + output.WriteRawTag(56); + output.WriteEnum((int) VisibilityActivation); + } + if (HasPresenceActivation) { + output.WriteRawTag(64); + output.WriteEnum((int) PresenceActivation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumLandmarks) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLandmarks); + } + if (HasInputImageWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputImageWidth); + } + if (HasInputImageHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputImageHeight); + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (HasFlipHorizontally) { + size += 1 + 1; + } + if (HasNormalizeZ) { + size += 1 + 4; + } + if (HasVisibilityActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) VisibilityActivation); + } + if (HasPresenceActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PresenceActivation); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToLandmarksCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumLandmarks) { + NumLandmarks = other.NumLandmarks; + } + if (other.HasInputImageWidth) { + InputImageWidth = other.InputImageWidth; + } + if (other.HasInputImageHeight) { + InputImageHeight = other.InputImageHeight; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasFlipHorizontally) { + FlipHorizontally = other.FlipHorizontally; + } + if (other.HasNormalizeZ) { + NormalizeZ = other.NormalizeZ; + } + if (other.HasVisibilityActivation) { + VisibilityActivation = other.VisibilityActivation; + } + if (other.HasPresenceActivation) { + PresenceActivation = other.PresenceActivation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumLandmarks = input.ReadInt32(); + break; + } + case 16: { + InputImageWidth = input.ReadInt32(); + break; + } + case 24: { + InputImageHeight = input.ReadInt32(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 45: { + NormalizeZ = input.ReadFloat(); + break; + } + case 48: { + FlipHorizontally = input.ReadBool(); + break; + } + case 56: { + VisibilityActivation = (global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 64: { + PresenceActivation = (global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumLandmarks = input.ReadInt32(); + break; + } + case 16: { + InputImageWidth = input.ReadInt32(); + break; + } + case 24: { + InputImageHeight = input.ReadInt32(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 45: { + NormalizeZ = input.ReadFloat(); + break; + } + case 48: { + FlipHorizontally = input.ReadBool(); + break; + } + case 56: { + VisibilityActivation = (global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 64: { + PresenceActivation = (global::Mediapipe.TensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorsToLandmarksCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Activation { + [pbr::OriginalName("NONE")] None = 0, + [pbr::OriginalName("SIGMOID")] Sigmoid = 1, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToLandmarksCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(335742640, pb::FieldCodec.ForMessage(2685941122, global::Mediapipe.TensorsToLandmarksCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs.meta new file mode 100644 index 0000000..c05964c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToLandmarksCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fea323e94e522d3038aae28af9499f4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs new file mode 100644 index 0000000..4753138 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs @@ -0,0 +1,413 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tensor/tensors_to_segmentation_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tensor/tensors_to_segmentation_calculator.proto + public static partial class TensorsToSegmentationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tensor/tensors_to_segmentation_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToSegmentationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkVtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGVuc29yL3RlbnNvcnNfdG9fc2Vn", + "bWVudGF0aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFw", + "aXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvGh5tZWRpYXBpcGUvZ3B1", + "L2dwdV9vcmlnaW4ucHJvdG8i4gIKJlRlbnNvcnNUb1NlZ21lbnRhdGlvbkNh", + "bGN1bGF0b3JPcHRpb25zEi0KCmdwdV9vcmlnaW4YASABKA4yGS5tZWRpYXBp", + "cGUuR3B1T3JpZ2luLk1vZGUSVgoKYWN0aXZhdGlvbhgCIAEoDjI8Lm1lZGlh", + "cGlwZS5UZW5zb3JzVG9TZWdtZW50YXRpb25DYWxjdWxhdG9yT3B0aW9ucy5B", + "Y3RpdmF0aW9uOgROT05FEh0KEm91dHB1dF9sYXllcl9pbmRleBgDIAEoBToB", + "MSIwCgpBY3RpdmF0aW9uEggKBE5PTkUQABILCgdTSUdNT0lEEAESCwoHU09G", + "VE1BWBACMmAKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjC", + "kb6yASABKAsyMS5tZWRpYXBpcGUuVGVuc29yc1RvU2VnbWVudGF0aW9uQ2Fs", + "Y3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.GpuOriginReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToSegmentationCalculatorOptions), global::Mediapipe.TensorsToSegmentationCalculatorOptions.Parser, new[]{ "GpuOrigin", "Activation", "OutputLayerIndex" }, null, new[]{ typeof(global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation) }, new pb::Extension[] { global::Mediapipe.TensorsToSegmentationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToSegmentationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToSegmentationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToSegmentationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToSegmentationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToSegmentationCalculatorOptions(TensorsToSegmentationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + gpuOrigin_ = other.gpuOrigin_; + activation_ = other.activation_; + outputLayerIndex_ = other.outputLayerIndex_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToSegmentationCalculatorOptions Clone() { + return new TensorsToSegmentationCalculatorOptions(this); + } + + /// Field number for the "gpu_origin" field. + public const int GpuOriginFieldNumber = 1; + private readonly static global::Mediapipe.GpuOrigin.Types.Mode GpuOriginDefaultValue = global::Mediapipe.GpuOrigin.Types.Mode.Default; + + private global::Mediapipe.GpuOrigin.Types.Mode gpuOrigin_; + /// + /// For CONVENTIONAL mode in OpenGL, textures start at bottom and needs + /// to be flipped vertically as tensors are expected to start at top. + /// (DEFAULT or unset is interpreted as CONVENTIONAL.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GpuOrigin.Types.Mode GpuOrigin { + get { if ((_hasBits0 & 1) != 0) { return gpuOrigin_; } else { return GpuOriginDefaultValue; } } + set { + _hasBits0 |= 1; + gpuOrigin_ = value; + } + } + /// Gets whether the "gpu_origin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuOrigin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "gpu_origin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuOrigin() { + _hasBits0 &= ~1; + } + + /// Field number for the "activation" field. + public const int ActivationFieldNumber = 2; + private readonly static global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation ActivationDefaultValue = global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation activation_; + /// + /// Activation function to apply to input tensor. + /// Softmax requires a 2-channel tensor, see output_layer_index below. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation Activation { + get { if ((_hasBits0 & 2) != 0) { return activation_; } else { return ActivationDefaultValue; } } + set { + _hasBits0 |= 2; + activation_ = value; + } + } + /// Gets whether the "activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivation { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivation() { + _hasBits0 &= ~2; + } + + /// Field number for the "output_layer_index" field. + public const int OutputLayerIndexFieldNumber = 3; + private readonly static int OutputLayerIndexDefaultValue = 1; + + private int outputLayerIndex_; + /// + /// Channel to use for processing tensor. + /// Only applies when using activation=SOFTMAX. + /// Works on two channel input tensor only. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputLayerIndex { + get { if ((_hasBits0 & 4) != 0) { return outputLayerIndex_; } else { return OutputLayerIndexDefaultValue; } } + set { + _hasBits0 |= 4; + outputLayerIndex_ = value; + } + } + /// Gets whether the "output_layer_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputLayerIndex { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "output_layer_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputLayerIndex() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToSegmentationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToSegmentationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (GpuOrigin != other.GpuOrigin) return false; + if (Activation != other.Activation) return false; + if (OutputLayerIndex != other.OutputLayerIndex) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasGpuOrigin) hash ^= GpuOrigin.GetHashCode(); + if (HasActivation) hash ^= Activation.GetHashCode(); + if (HasOutputLayerIndex) hash ^= OutputLayerIndex.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasGpuOrigin) { + output.WriteRawTag(8); + output.WriteEnum((int) GpuOrigin); + } + if (HasActivation) { + output.WriteRawTag(16); + output.WriteEnum((int) Activation); + } + if (HasOutputLayerIndex) { + output.WriteRawTag(24); + output.WriteInt32(OutputLayerIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasGpuOrigin) { + output.WriteRawTag(8); + output.WriteEnum((int) GpuOrigin); + } + if (HasActivation) { + output.WriteRawTag(16); + output.WriteEnum((int) Activation); + } + if (HasOutputLayerIndex) { + output.WriteRawTag(24); + output.WriteInt32(OutputLayerIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasGpuOrigin) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GpuOrigin); + } + if (HasActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Activation); + } + if (HasOutputLayerIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputLayerIndex); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToSegmentationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasGpuOrigin) { + GpuOrigin = other.GpuOrigin; + } + if (other.HasActivation) { + Activation = other.Activation; + } + if (other.HasOutputLayerIndex) { + OutputLayerIndex = other.OutputLayerIndex; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 16: { + Activation = (global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 24: { + OutputLayerIndex = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 16: { + Activation = (global::Mediapipe.TensorsToSegmentationCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 24: { + OutputLayerIndex = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TensorsToSegmentationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Supported activation functions for filtering. + /// + public enum Activation { + /// + /// Assumes 1-channel input tensor. + /// + [pbr::OriginalName("NONE")] None = 0, + /// + /// Assumes 1-channel input tensor. + /// + [pbr::OriginalName("SIGMOID")] Sigmoid = 1, + /// + /// Assumes 2-channel input tensor. + /// + [pbr::OriginalName("SOFTMAX")] Softmax = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToSegmentationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(374311106, pb::FieldCodec.ForMessage(2994488850, global::Mediapipe.TensorsToSegmentationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs.meta new file mode 100644 index 0000000..a139be0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/TensorsToSegmentationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dad231bfe2acc7960b90dd4b89e28bc8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite.meta new file mode 100644 index 0000000..6509904 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c70a523b89fe1346a5e5f94170fd843 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs new file mode 100644 index 0000000..cfa6bbe --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs @@ -0,0 +1,1242 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/ssd_anchors_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/ssd_anchors_calculator.proto + public static partial class SsdAnchorsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/ssd_anchors_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SsdAnchorsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3NzZF9hbmNob3JzX2Nh", + "bGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9jYWxjdWxhdG9yLnByb3RvIq0FChtTc2RBbmNob3JzQ2FsY3VsYXRvck9w", + "dGlvbnMSGAoQaW5wdXRfc2l6ZV93aWR0aBgBIAEoBRIZChFpbnB1dF9zaXpl", + "X2hlaWdodBgCIAEoBRIRCgltaW5fc2NhbGUYAyABKAISEQoJbWF4X3NjYWxl", + "GAQgASgCEhwKD2FuY2hvcl9vZmZzZXRfeBgFIAEoAjoDMC41EhwKD2FuY2hv", + "cl9vZmZzZXRfeRgGIAEoAjoDMC41EhIKCm51bV9sYXllcnMYByABKAUSGQoR", + "ZmVhdHVyZV9tYXBfd2lkdGgYCCADKAUSGgoSZmVhdHVyZV9tYXBfaGVpZ2h0", + "GAkgAygFEg8KB3N0cmlkZXMYCiADKAUSFQoNYXNwZWN0X3JhdGlvcxgLIAMo", + "AhIrChxyZWR1Y2VfYm94ZXNfaW5fbG93ZXN0X2xheWVyGAwgASgIOgVmYWxz", + "ZRIqCh9pbnRlcnBvbGF0ZWRfc2NhbGVfYXNwZWN0X3JhdGlvGA0gASgCOgEx", + "EiAKEWZpeGVkX2FuY2hvcl9zaXplGA4gASgIOgVmYWxzZRIrChxtdWx0aXNj", + "YWxlX2FuY2hvcl9nZW5lcmF0aW9uGA8gASgIOgVmYWxzZRIUCgltaW5fbGV2", + "ZWwYECABKAU6ATMSFAoJbWF4X2xldmVsGBEgASgFOgE3EhcKDGFuY2hvcl9z", + "Y2FsZRgSIAEoAjoBNBIcChFzY2FsZXNfcGVyX29jdGF2ZRgTIAEoBToBMhIj", + "ChVub3JtYWxpemVfY29vcmRpbmF0ZXMYFCABKAg6BHRydWUyVAoDZXh0Ehwu", + "bWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGP+483UgASgLMiYubWVkaWFw", + "aXBlLlNzZEFuY2hvcnNDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SsdAnchorsCalculatorOptions), global::Mediapipe.SsdAnchorsCalculatorOptions.Parser, new[]{ "InputSizeWidth", "InputSizeHeight", "MinScale", "MaxScale", "AnchorOffsetX", "AnchorOffsetY", "NumLayers", "FeatureMapWidth", "FeatureMapHeight", "Strides", "AspectRatios", "ReduceBoxesInLowestLayer", "InterpolatedScaleAspectRatio", "FixedAnchorSize", "MultiscaleAnchorGeneration", "MinLevel", "MaxLevel", "AnchorScale", "ScalesPerOctave", "NormalizeCoordinates" }, null, null, new pb::Extension[] { global::Mediapipe.SsdAnchorsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options to generate anchors for SSD object detection models. + /// + public sealed partial class SsdAnchorsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SsdAnchorsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.SsdAnchorsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SsdAnchorsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SsdAnchorsCalculatorOptions(SsdAnchorsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + inputSizeWidth_ = other.inputSizeWidth_; + inputSizeHeight_ = other.inputSizeHeight_; + minScale_ = other.minScale_; + maxScale_ = other.maxScale_; + anchorOffsetX_ = other.anchorOffsetX_; + anchorOffsetY_ = other.anchorOffsetY_; + numLayers_ = other.numLayers_; + featureMapWidth_ = other.featureMapWidth_.Clone(); + featureMapHeight_ = other.featureMapHeight_.Clone(); + strides_ = other.strides_.Clone(); + aspectRatios_ = other.aspectRatios_.Clone(); + reduceBoxesInLowestLayer_ = other.reduceBoxesInLowestLayer_; + interpolatedScaleAspectRatio_ = other.interpolatedScaleAspectRatio_; + fixedAnchorSize_ = other.fixedAnchorSize_; + multiscaleAnchorGeneration_ = other.multiscaleAnchorGeneration_; + minLevel_ = other.minLevel_; + maxLevel_ = other.maxLevel_; + anchorScale_ = other.anchorScale_; + scalesPerOctave_ = other.scalesPerOctave_; + normalizeCoordinates_ = other.normalizeCoordinates_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SsdAnchorsCalculatorOptions Clone() { + return new SsdAnchorsCalculatorOptions(this); + } + + /// Field number for the "input_size_width" field. + public const int InputSizeWidthFieldNumber = 1; + private readonly static int InputSizeWidthDefaultValue = 0; + + private int inputSizeWidth_; + /// + /// Size of input images. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputSizeWidth { + get { if ((_hasBits0 & 1) != 0) { return inputSizeWidth_; } else { return InputSizeWidthDefaultValue; } } + set { + _hasBits0 |= 1; + inputSizeWidth_ = value; + } + } + /// Gets whether the "input_size_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputSizeWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "input_size_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputSizeWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "input_size_height" field. + public const int InputSizeHeightFieldNumber = 2; + private readonly static int InputSizeHeightDefaultValue = 0; + + private int inputSizeHeight_; + /// + /// required + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputSizeHeight { + get { if ((_hasBits0 & 2) != 0) { return inputSizeHeight_; } else { return InputSizeHeightDefaultValue; } } + set { + _hasBits0 |= 2; + inputSizeHeight_ = value; + } + } + /// Gets whether the "input_size_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputSizeHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "input_size_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputSizeHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_scale" field. + public const int MinScaleFieldNumber = 3; + private readonly static float MinScaleDefaultValue = 0F; + + private float minScale_; + /// + /// Min and max scales for generating anchor boxes on feature maps. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScale { + get { if ((_hasBits0 & 4) != 0) { return minScale_; } else { return MinScaleDefaultValue; } } + set { + _hasBits0 |= 4; + minScale_ = value; + } + } + /// Gets whether the "min_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScale() { + _hasBits0 &= ~4; + } + + /// Field number for the "max_scale" field. + public const int MaxScaleFieldNumber = 4; + private readonly static float MaxScaleDefaultValue = 0F; + + private float maxScale_; + /// + /// required + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxScale { + get { if ((_hasBits0 & 8) != 0) { return maxScale_; } else { return MaxScaleDefaultValue; } } + set { + _hasBits0 |= 8; + maxScale_ = value; + } + } + /// Gets whether the "max_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxScale { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "max_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxScale() { + _hasBits0 &= ~8; + } + + /// Field number for the "anchor_offset_x" field. + public const int AnchorOffsetXFieldNumber = 5; + private readonly static float AnchorOffsetXDefaultValue = 0.5F; + + private float anchorOffsetX_; + /// + /// The offset for the center of anchors. The value is in the scale of stride. + /// E.g. 0.5 meaning 0.5 * |current_stride| in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AnchorOffsetX { + get { if ((_hasBits0 & 16) != 0) { return anchorOffsetX_; } else { return AnchorOffsetXDefaultValue; } } + set { + _hasBits0 |= 16; + anchorOffsetX_ = value; + } + } + /// Gets whether the "anchor_offset_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnchorOffsetX { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "anchor_offset_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnchorOffsetX() { + _hasBits0 &= ~16; + } + + /// Field number for the "anchor_offset_y" field. + public const int AnchorOffsetYFieldNumber = 6; + private readonly static float AnchorOffsetYDefaultValue = 0.5F; + + private float anchorOffsetY_; + /// + /// required + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AnchorOffsetY { + get { if ((_hasBits0 & 32) != 0) { return anchorOffsetY_; } else { return AnchorOffsetYDefaultValue; } } + set { + _hasBits0 |= 32; + anchorOffsetY_ = value; + } + } + /// Gets whether the "anchor_offset_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnchorOffsetY { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "anchor_offset_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnchorOffsetY() { + _hasBits0 &= ~32; + } + + /// Field number for the "num_layers" field. + public const int NumLayersFieldNumber = 7; + private readonly static int NumLayersDefaultValue = 0; + + private int numLayers_; + /// + /// Number of output feature maps to generate the anchors on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumLayers { + get { if ((_hasBits0 & 64) != 0) { return numLayers_; } else { return NumLayersDefaultValue; } } + set { + _hasBits0 |= 64; + numLayers_ = value; + } + } + /// Gets whether the "num_layers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumLayers { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "num_layers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumLayers() { + _hasBits0 &= ~64; + } + + /// Field number for the "feature_map_width" field. + public const int FeatureMapWidthFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_featureMapWidth_codec + = pb::FieldCodec.ForInt32(64); + private readonly pbc::RepeatedField featureMapWidth_ = new pbc::RepeatedField(); + /// + /// Sizes of output feature maps to create anchors. Either feature_map size or + /// stride should be provided. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField FeatureMapWidth { + get { return featureMapWidth_; } + } + + /// Field number for the "feature_map_height" field. + public const int FeatureMapHeightFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_featureMapHeight_codec + = pb::FieldCodec.ForInt32(72); + private readonly pbc::RepeatedField featureMapHeight_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField FeatureMapHeight { + get { return featureMapHeight_; } + } + + /// Field number for the "strides" field. + public const int StridesFieldNumber = 10; + private static readonly pb::FieldCodec _repeated_strides_codec + = pb::FieldCodec.ForInt32(80); + private readonly pbc::RepeatedField strides_ = new pbc::RepeatedField(); + /// + /// Strides of each output feature maps. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Strides { + get { return strides_; } + } + + /// Field number for the "aspect_ratios" field. + public const int AspectRatiosFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_aspectRatios_codec + = pb::FieldCodec.ForFloat(93); + private readonly pbc::RepeatedField aspectRatios_ = new pbc::RepeatedField(); + /// + /// List of different aspect ratio to generate anchors. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AspectRatios { + get { return aspectRatios_; } + } + + /// Field number for the "reduce_boxes_in_lowest_layer" field. + public const int ReduceBoxesInLowestLayerFieldNumber = 12; + private readonly static bool ReduceBoxesInLowestLayerDefaultValue = false; + + private bool reduceBoxesInLowestLayer_; + /// + /// A boolean to indicate whether the fixed 3 boxes per location is used in the + /// lowest layer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReduceBoxesInLowestLayer { + get { if ((_hasBits0 & 128) != 0) { return reduceBoxesInLowestLayer_; } else { return ReduceBoxesInLowestLayerDefaultValue; } } + set { + _hasBits0 |= 128; + reduceBoxesInLowestLayer_ = value; + } + } + /// Gets whether the "reduce_boxes_in_lowest_layer" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReduceBoxesInLowestLayer { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "reduce_boxes_in_lowest_layer" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReduceBoxesInLowestLayer() { + _hasBits0 &= ~128; + } + + /// Field number for the "interpolated_scale_aspect_ratio" field. + public const int InterpolatedScaleAspectRatioFieldNumber = 13; + private readonly static float InterpolatedScaleAspectRatioDefaultValue = 1F; + + private float interpolatedScaleAspectRatio_; + /// + /// An additional anchor is added with this aspect ratio and a scale + /// interpolated between the scale for a layer and the scale for the next layer + /// (1.0 for the last layer). This anchor is not included if this value is 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InterpolatedScaleAspectRatio { + get { if ((_hasBits0 & 256) != 0) { return interpolatedScaleAspectRatio_; } else { return InterpolatedScaleAspectRatioDefaultValue; } } + set { + _hasBits0 |= 256; + interpolatedScaleAspectRatio_ = value; + } + } + /// Gets whether the "interpolated_scale_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInterpolatedScaleAspectRatio { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "interpolated_scale_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInterpolatedScaleAspectRatio() { + _hasBits0 &= ~256; + } + + /// Field number for the "fixed_anchor_size" field. + public const int FixedAnchorSizeFieldNumber = 14; + private readonly static bool FixedAnchorSizeDefaultValue = false; + + private bool fixedAnchorSize_; + /// + /// Whether use fixed width and height (e.g. both 1.0f) for each anchor. + /// This option can be used when the predicted anchor width and height are in + /// pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FixedAnchorSize { + get { if ((_hasBits0 & 512) != 0) { return fixedAnchorSize_; } else { return FixedAnchorSizeDefaultValue; } } + set { + _hasBits0 |= 512; + fixedAnchorSize_ = value; + } + } + /// Gets whether the "fixed_anchor_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFixedAnchorSize { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "fixed_anchor_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFixedAnchorSize() { + _hasBits0 &= ~512; + } + + /// Field number for the "multiscale_anchor_generation" field. + public const int MultiscaleAnchorGenerationFieldNumber = 15; + private readonly static bool MultiscaleAnchorGenerationDefaultValue = false; + + private bool multiscaleAnchorGeneration_; + /// + /// Generates grid anchors on the fly corresponding to multiple CNN layers as + /// described in: + /// "Focal Loss for Dense Object Detection" (https://arxiv.org/abs/1708.02002) + /// T.-Y. Lin, P. Goyal, R. Girshick, K. He, P. Dollar + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool MultiscaleAnchorGeneration { + get { if ((_hasBits0 & 1024) != 0) { return multiscaleAnchorGeneration_; } else { return MultiscaleAnchorGenerationDefaultValue; } } + set { + _hasBits0 |= 1024; + multiscaleAnchorGeneration_ = value; + } + } + /// Gets whether the "multiscale_anchor_generation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMultiscaleAnchorGeneration { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "multiscale_anchor_generation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMultiscaleAnchorGeneration() { + _hasBits0 &= ~1024; + } + + /// Field number for the "min_level" field. + public const int MinLevelFieldNumber = 16; + private readonly static int MinLevelDefaultValue = 3; + + private int minLevel_; + /// + /// minimum level in feature pyramid + /// for multiscale_anchor_generation only! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinLevel { + get { if ((_hasBits0 & 2048) != 0) { return minLevel_; } else { return MinLevelDefaultValue; } } + set { + _hasBits0 |= 2048; + minLevel_ = value; + } + } + /// Gets whether the "min_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinLevel { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "min_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinLevel() { + _hasBits0 &= ~2048; + } + + /// Field number for the "max_level" field. + public const int MaxLevelFieldNumber = 17; + private readonly static int MaxLevelDefaultValue = 7; + + private int maxLevel_; + /// + /// maximum level in feature pyramid + /// for multiscale_anchor_generation only! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxLevel { + get { if ((_hasBits0 & 4096) != 0) { return maxLevel_; } else { return MaxLevelDefaultValue; } } + set { + _hasBits0 |= 4096; + maxLevel_ = value; + } + } + /// Gets whether the "max_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxLevel { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "max_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxLevel() { + _hasBits0 &= ~4096; + } + + /// Field number for the "anchor_scale" field. + public const int AnchorScaleFieldNumber = 18; + private readonly static float AnchorScaleDefaultValue = 4F; + + private float anchorScale_; + /// + /// Scale of anchor to feature stride + /// for multiscale_anchor_generation only! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AnchorScale { + get { if ((_hasBits0 & 8192) != 0) { return anchorScale_; } else { return AnchorScaleDefaultValue; } } + set { + _hasBits0 |= 8192; + anchorScale_ = value; + } + } + /// Gets whether the "anchor_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnchorScale { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "anchor_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnchorScale() { + _hasBits0 &= ~8192; + } + + /// Field number for the "scales_per_octave" field. + public const int ScalesPerOctaveFieldNumber = 19; + private readonly static int ScalesPerOctaveDefaultValue = 2; + + private int scalesPerOctave_; + /// + /// Number of intermediate scale each scale octave + /// for multiscale_anchor_generation only! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ScalesPerOctave { + get { if ((_hasBits0 & 16384) != 0) { return scalesPerOctave_; } else { return ScalesPerOctaveDefaultValue; } } + set { + _hasBits0 |= 16384; + scalesPerOctave_ = value; + } + } + /// Gets whether the "scales_per_octave" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScalesPerOctave { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "scales_per_octave" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScalesPerOctave() { + _hasBits0 &= ~16384; + } + + /// Field number for the "normalize_coordinates" field. + public const int NormalizeCoordinatesFieldNumber = 20; + private readonly static bool NormalizeCoordinatesDefaultValue = true; + + private bool normalizeCoordinates_; + /// + /// Whether to produce anchors in normalized coordinates. + /// for multiscale_anchor_generation only! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool NormalizeCoordinates { + get { if ((_hasBits0 & 32768) != 0) { return normalizeCoordinates_; } else { return NormalizeCoordinatesDefaultValue; } } + set { + _hasBits0 |= 32768; + normalizeCoordinates_ = value; + } + } + /// Gets whether the "normalize_coordinates" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizeCoordinates { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "normalize_coordinates" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizeCoordinates() { + _hasBits0 &= ~32768; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SsdAnchorsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SsdAnchorsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InputSizeWidth != other.InputSizeWidth) return false; + if (InputSizeHeight != other.InputSizeHeight) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScale, other.MinScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxScale, other.MaxScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AnchorOffsetX, other.AnchorOffsetX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AnchorOffsetY, other.AnchorOffsetY)) return false; + if (NumLayers != other.NumLayers) return false; + if(!featureMapWidth_.Equals(other.featureMapWidth_)) return false; + if(!featureMapHeight_.Equals(other.featureMapHeight_)) return false; + if(!strides_.Equals(other.strides_)) return false; + if(!aspectRatios_.Equals(other.aspectRatios_)) return false; + if (ReduceBoxesInLowestLayer != other.ReduceBoxesInLowestLayer) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InterpolatedScaleAspectRatio, other.InterpolatedScaleAspectRatio)) return false; + if (FixedAnchorSize != other.FixedAnchorSize) return false; + if (MultiscaleAnchorGeneration != other.MultiscaleAnchorGeneration) return false; + if (MinLevel != other.MinLevel) return false; + if (MaxLevel != other.MaxLevel) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AnchorScale, other.AnchorScale)) return false; + if (ScalesPerOctave != other.ScalesPerOctave) return false; + if (NormalizeCoordinates != other.NormalizeCoordinates) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasInputSizeWidth) hash ^= InputSizeWidth.GetHashCode(); + if (HasInputSizeHeight) hash ^= InputSizeHeight.GetHashCode(); + if (HasMinScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScale); + if (HasMaxScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxScale); + if (HasAnchorOffsetX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorOffsetX); + if (HasAnchorOffsetY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorOffsetY); + if (HasNumLayers) hash ^= NumLayers.GetHashCode(); + hash ^= featureMapWidth_.GetHashCode(); + hash ^= featureMapHeight_.GetHashCode(); + hash ^= strides_.GetHashCode(); + hash ^= aspectRatios_.GetHashCode(); + if (HasReduceBoxesInLowestLayer) hash ^= ReduceBoxesInLowestLayer.GetHashCode(); + if (HasInterpolatedScaleAspectRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InterpolatedScaleAspectRatio); + if (HasFixedAnchorSize) hash ^= FixedAnchorSize.GetHashCode(); + if (HasMultiscaleAnchorGeneration) hash ^= MultiscaleAnchorGeneration.GetHashCode(); + if (HasMinLevel) hash ^= MinLevel.GetHashCode(); + if (HasMaxLevel) hash ^= MaxLevel.GetHashCode(); + if (HasAnchorScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorScale); + if (HasScalesPerOctave) hash ^= ScalesPerOctave.GetHashCode(); + if (HasNormalizeCoordinates) hash ^= NormalizeCoordinates.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasInputSizeWidth) { + output.WriteRawTag(8); + output.WriteInt32(InputSizeWidth); + } + if (HasInputSizeHeight) { + output.WriteRawTag(16); + output.WriteInt32(InputSizeHeight); + } + if (HasMinScale) { + output.WriteRawTag(29); + output.WriteFloat(MinScale); + } + if (HasMaxScale) { + output.WriteRawTag(37); + output.WriteFloat(MaxScale); + } + if (HasAnchorOffsetX) { + output.WriteRawTag(45); + output.WriteFloat(AnchorOffsetX); + } + if (HasAnchorOffsetY) { + output.WriteRawTag(53); + output.WriteFloat(AnchorOffsetY); + } + if (HasNumLayers) { + output.WriteRawTag(56); + output.WriteInt32(NumLayers); + } + featureMapWidth_.WriteTo(output, _repeated_featureMapWidth_codec); + featureMapHeight_.WriteTo(output, _repeated_featureMapHeight_codec); + strides_.WriteTo(output, _repeated_strides_codec); + aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec); + if (HasReduceBoxesInLowestLayer) { + output.WriteRawTag(96); + output.WriteBool(ReduceBoxesInLowestLayer); + } + if (HasInterpolatedScaleAspectRatio) { + output.WriteRawTag(109); + output.WriteFloat(InterpolatedScaleAspectRatio); + } + if (HasFixedAnchorSize) { + output.WriteRawTag(112); + output.WriteBool(FixedAnchorSize); + } + if (HasMultiscaleAnchorGeneration) { + output.WriteRawTag(120); + output.WriteBool(MultiscaleAnchorGeneration); + } + if (HasMinLevel) { + output.WriteRawTag(128, 1); + output.WriteInt32(MinLevel); + } + if (HasMaxLevel) { + output.WriteRawTag(136, 1); + output.WriteInt32(MaxLevel); + } + if (HasAnchorScale) { + output.WriteRawTag(149, 1); + output.WriteFloat(AnchorScale); + } + if (HasScalesPerOctave) { + output.WriteRawTag(152, 1); + output.WriteInt32(ScalesPerOctave); + } + if (HasNormalizeCoordinates) { + output.WriteRawTag(160, 1); + output.WriteBool(NormalizeCoordinates); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasInputSizeWidth) { + output.WriteRawTag(8); + output.WriteInt32(InputSizeWidth); + } + if (HasInputSizeHeight) { + output.WriteRawTag(16); + output.WriteInt32(InputSizeHeight); + } + if (HasMinScale) { + output.WriteRawTag(29); + output.WriteFloat(MinScale); + } + if (HasMaxScale) { + output.WriteRawTag(37); + output.WriteFloat(MaxScale); + } + if (HasAnchorOffsetX) { + output.WriteRawTag(45); + output.WriteFloat(AnchorOffsetX); + } + if (HasAnchorOffsetY) { + output.WriteRawTag(53); + output.WriteFloat(AnchorOffsetY); + } + if (HasNumLayers) { + output.WriteRawTag(56); + output.WriteInt32(NumLayers); + } + featureMapWidth_.WriteTo(ref output, _repeated_featureMapWidth_codec); + featureMapHeight_.WriteTo(ref output, _repeated_featureMapHeight_codec); + strides_.WriteTo(ref output, _repeated_strides_codec); + aspectRatios_.WriteTo(ref output, _repeated_aspectRatios_codec); + if (HasReduceBoxesInLowestLayer) { + output.WriteRawTag(96); + output.WriteBool(ReduceBoxesInLowestLayer); + } + if (HasInterpolatedScaleAspectRatio) { + output.WriteRawTag(109); + output.WriteFloat(InterpolatedScaleAspectRatio); + } + if (HasFixedAnchorSize) { + output.WriteRawTag(112); + output.WriteBool(FixedAnchorSize); + } + if (HasMultiscaleAnchorGeneration) { + output.WriteRawTag(120); + output.WriteBool(MultiscaleAnchorGeneration); + } + if (HasMinLevel) { + output.WriteRawTag(128, 1); + output.WriteInt32(MinLevel); + } + if (HasMaxLevel) { + output.WriteRawTag(136, 1); + output.WriteInt32(MaxLevel); + } + if (HasAnchorScale) { + output.WriteRawTag(149, 1); + output.WriteFloat(AnchorScale); + } + if (HasScalesPerOctave) { + output.WriteRawTag(152, 1); + output.WriteInt32(ScalesPerOctave); + } + if (HasNormalizeCoordinates) { + output.WriteRawTag(160, 1); + output.WriteBool(NormalizeCoordinates); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasInputSizeWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputSizeWidth); + } + if (HasInputSizeHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputSizeHeight); + } + if (HasMinScale) { + size += 1 + 4; + } + if (HasMaxScale) { + size += 1 + 4; + } + if (HasAnchorOffsetX) { + size += 1 + 4; + } + if (HasAnchorOffsetY) { + size += 1 + 4; + } + if (HasNumLayers) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLayers); + } + size += featureMapWidth_.CalculateSize(_repeated_featureMapWidth_codec); + size += featureMapHeight_.CalculateSize(_repeated_featureMapHeight_codec); + size += strides_.CalculateSize(_repeated_strides_codec); + size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec); + if (HasReduceBoxesInLowestLayer) { + size += 1 + 1; + } + if (HasInterpolatedScaleAspectRatio) { + size += 1 + 4; + } + if (HasFixedAnchorSize) { + size += 1 + 1; + } + if (HasMultiscaleAnchorGeneration) { + size += 1 + 1; + } + if (HasMinLevel) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MinLevel); + } + if (HasMaxLevel) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxLevel); + } + if (HasAnchorScale) { + size += 2 + 4; + } + if (HasScalesPerOctave) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(ScalesPerOctave); + } + if (HasNormalizeCoordinates) { + size += 2 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SsdAnchorsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasInputSizeWidth) { + InputSizeWidth = other.InputSizeWidth; + } + if (other.HasInputSizeHeight) { + InputSizeHeight = other.InputSizeHeight; + } + if (other.HasMinScale) { + MinScale = other.MinScale; + } + if (other.HasMaxScale) { + MaxScale = other.MaxScale; + } + if (other.HasAnchorOffsetX) { + AnchorOffsetX = other.AnchorOffsetX; + } + if (other.HasAnchorOffsetY) { + AnchorOffsetY = other.AnchorOffsetY; + } + if (other.HasNumLayers) { + NumLayers = other.NumLayers; + } + featureMapWidth_.Add(other.featureMapWidth_); + featureMapHeight_.Add(other.featureMapHeight_); + strides_.Add(other.strides_); + aspectRatios_.Add(other.aspectRatios_); + if (other.HasReduceBoxesInLowestLayer) { + ReduceBoxesInLowestLayer = other.ReduceBoxesInLowestLayer; + } + if (other.HasInterpolatedScaleAspectRatio) { + InterpolatedScaleAspectRatio = other.InterpolatedScaleAspectRatio; + } + if (other.HasFixedAnchorSize) { + FixedAnchorSize = other.FixedAnchorSize; + } + if (other.HasMultiscaleAnchorGeneration) { + MultiscaleAnchorGeneration = other.MultiscaleAnchorGeneration; + } + if (other.HasMinLevel) { + MinLevel = other.MinLevel; + } + if (other.HasMaxLevel) { + MaxLevel = other.MaxLevel; + } + if (other.HasAnchorScale) { + AnchorScale = other.AnchorScale; + } + if (other.HasScalesPerOctave) { + ScalesPerOctave = other.ScalesPerOctave; + } + if (other.HasNormalizeCoordinates) { + NormalizeCoordinates = other.NormalizeCoordinates; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + InputSizeWidth = input.ReadInt32(); + break; + } + case 16: { + InputSizeHeight = input.ReadInt32(); + break; + } + case 29: { + MinScale = input.ReadFloat(); + break; + } + case 37: { + MaxScale = input.ReadFloat(); + break; + } + case 45: { + AnchorOffsetX = input.ReadFloat(); + break; + } + case 53: { + AnchorOffsetY = input.ReadFloat(); + break; + } + case 56: { + NumLayers = input.ReadInt32(); + break; + } + case 66: + case 64: { + featureMapWidth_.AddEntriesFrom(input, _repeated_featureMapWidth_codec); + break; + } + case 74: + case 72: { + featureMapHeight_.AddEntriesFrom(input, _repeated_featureMapHeight_codec); + break; + } + case 82: + case 80: { + strides_.AddEntriesFrom(input, _repeated_strides_codec); + break; + } + case 90: + case 93: { + aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec); + break; + } + case 96: { + ReduceBoxesInLowestLayer = input.ReadBool(); + break; + } + case 109: { + InterpolatedScaleAspectRatio = input.ReadFloat(); + break; + } + case 112: { + FixedAnchorSize = input.ReadBool(); + break; + } + case 120: { + MultiscaleAnchorGeneration = input.ReadBool(); + break; + } + case 128: { + MinLevel = input.ReadInt32(); + break; + } + case 136: { + MaxLevel = input.ReadInt32(); + break; + } + case 149: { + AnchorScale = input.ReadFloat(); + break; + } + case 152: { + ScalesPerOctave = input.ReadInt32(); + break; + } + case 160: { + NormalizeCoordinates = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + InputSizeWidth = input.ReadInt32(); + break; + } + case 16: { + InputSizeHeight = input.ReadInt32(); + break; + } + case 29: { + MinScale = input.ReadFloat(); + break; + } + case 37: { + MaxScale = input.ReadFloat(); + break; + } + case 45: { + AnchorOffsetX = input.ReadFloat(); + break; + } + case 53: { + AnchorOffsetY = input.ReadFloat(); + break; + } + case 56: { + NumLayers = input.ReadInt32(); + break; + } + case 66: + case 64: { + featureMapWidth_.AddEntriesFrom(ref input, _repeated_featureMapWidth_codec); + break; + } + case 74: + case 72: { + featureMapHeight_.AddEntriesFrom(ref input, _repeated_featureMapHeight_codec); + break; + } + case 82: + case 80: { + strides_.AddEntriesFrom(ref input, _repeated_strides_codec); + break; + } + case 90: + case 93: { + aspectRatios_.AddEntriesFrom(ref input, _repeated_aspectRatios_codec); + break; + } + case 96: { + ReduceBoxesInLowestLayer = input.ReadBool(); + break; + } + case 109: { + InterpolatedScaleAspectRatio = input.ReadFloat(); + break; + } + case 112: { + FixedAnchorSize = input.ReadBool(); + break; + } + case 120: { + MultiscaleAnchorGeneration = input.ReadBool(); + break; + } + case 128: { + MinLevel = input.ReadInt32(); + break; + } + case 136: { + MaxLevel = input.ReadInt32(); + break; + } + case 149: { + AnchorScale = input.ReadFloat(); + break; + } + case 152: { + ScalesPerOctave = input.ReadInt32(); + break; + } + case 160: { + NormalizeCoordinates = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the SsdAnchorsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(247258239, pb::FieldCodec.ForMessage(1978065914, global::Mediapipe.SsdAnchorsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs.meta new file mode 100644 index 0000000..4c46299 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/SsdAnchorsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e225e9e02519f985b786b4135bdd064 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs new file mode 100644 index 0000000..05d5d1b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs @@ -0,0 +1,1000 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_converter_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_converter_calculator.proto + public static partial class TfliteConverterCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_converter_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteConverterCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV9jb252ZXJ0", + "ZXJfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ihAQKIFRmTGl0ZUNvbnZlcnRlckNh", + "bGN1bGF0b3JPcHRpb25zEhkKC3plcm9fY2VudGVyGAEgASgIOgR0cnVlEicK", + "GHVzZV9jdXN0b21fbm9ybWFsaXphdGlvbhgGIAEoCDoFZmFsc2USFgoKY3Vz", + "dG9tX2RpdhgHIAEoAjoCLTESFgoKY3VzdG9tX3N1YhgIIAEoAjoCLTESHgoP", + "ZmxpcF92ZXJ0aWNhbGx5GAIgASgIOgVmYWxzZRIbChBtYXhfbnVtX2NoYW5u", + "ZWxzGAMgASgFOgEzEh8KEHJvd19tYWpvcl9tYXRyaXgYBCABKAg6BWZhbHNl", + "EiQKFXVzZV9xdWFudGl6ZWRfdGVuc29ycxgFIAEoCDoFZmFsc2USXwoZb3V0", + "cHV0X3RlbnNvcl9mbG9hdF9yYW5nZRgJIAEoCzI8Lm1lZGlhcGlwZS5UZkxp", + "dGVDb252ZXJ0ZXJDYWxjdWxhdG9yT3B0aW9ucy5UZW5zb3JGbG9hdFJhbmdl", + "GiwKEFRlbnNvckZsb2F0UmFuZ2USCwoDbWluGAEgASgCEgsKA21heBgCIAEo", + "AjJZCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYxcObdSAB", + "KAsyKy5tZWRpYXBpcGUuVGZMaXRlQ29udmVydGVyQ2FsY3VsYXRvck9wdGlv", + "bnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteConverterCalculatorOptions), global::Mediapipe.TfLiteConverterCalculatorOptions.Parser, new[]{ "ZeroCenter", "UseCustomNormalization", "CustomDiv", "CustomSub", "FlipVertically", "MaxNumChannels", "RowMajorMatrix", "UseQuantizedTensors", "OutputTensorFloatRange" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteConverterCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange), global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange.Parser, new[]{ "Min", "Max" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Full Example: + /// + /// node { + /// calculator: "TfLiteConverterCalculator" + /// input_stream: "IMAGE_IN:input_image" + /// output_stream: "TENSOR_OUT:image_tensor" + /// options { + /// [mediapipe.TfLiteConverterCalculatorOptions.ext] { + /// zero_center: true + /// } + /// } + /// } + /// + public sealed partial class TfLiteConverterCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteConverterCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteConverterCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteConverterCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteConverterCalculatorOptions(TfLiteConverterCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + zeroCenter_ = other.zeroCenter_; + useCustomNormalization_ = other.useCustomNormalization_; + customDiv_ = other.customDiv_; + customSub_ = other.customSub_; + flipVertically_ = other.flipVertically_; + maxNumChannels_ = other.maxNumChannels_; + rowMajorMatrix_ = other.rowMajorMatrix_; + useQuantizedTensors_ = other.useQuantizedTensors_; + outputTensorFloatRange_ = other.outputTensorFloatRange_ != null ? other.outputTensorFloatRange_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteConverterCalculatorOptions Clone() { + return new TfLiteConverterCalculatorOptions(this); + } + + /// Field number for the "zero_center" field. + public const int ZeroCenterFieldNumber = 1; + private readonly static bool ZeroCenterDefaultValue = true; + + private bool zeroCenter_; + /// + /// Choose normalization mode for output (not applied for Matrix inputs). + /// true = [-1,1] + /// false = [0,1] + /// Ignored if using quantization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ZeroCenter { + get { if ((_hasBits0 & 1) != 0) { return zeroCenter_; } else { return ZeroCenterDefaultValue; } } + set { + _hasBits0 |= 1; + zeroCenter_ = value; + } + } + /// Gets whether the "zero_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZeroCenter { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "zero_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZeroCenter() { + _hasBits0 &= ~1; + } + + /// Field number for the "use_custom_normalization" field. + public const int UseCustomNormalizationFieldNumber = 6; + private readonly static bool UseCustomNormalizationDefaultValue = false; + + private bool useCustomNormalization_; + /// + /// Custom settings to override the internal scaling factors `div` and `sub`. + /// Both values must be set to non-negative values. Will only take effect on + /// CPU AND when |use_custom_normalization| is set to true. When these custom + /// values take effect, the |zero_center| setting above will be overriden, and + /// the normalized_value will be calculated as: + /// normalized_value = input / custom_div - custom_sub. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseCustomNormalization { + get { if ((_hasBits0 & 32) != 0) { return useCustomNormalization_; } else { return UseCustomNormalizationDefaultValue; } } + set { + _hasBits0 |= 32; + useCustomNormalization_ = value; + } + } + /// Gets whether the "use_custom_normalization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseCustomNormalization { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "use_custom_normalization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseCustomNormalization() { + _hasBits0 &= ~32; + } + + /// Field number for the "custom_div" field. + public const int CustomDivFieldNumber = 7; + private readonly static float CustomDivDefaultValue = -1F; + + private float customDiv_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CustomDiv { + get { if ((_hasBits0 & 64) != 0) { return customDiv_; } else { return CustomDivDefaultValue; } } + set { + _hasBits0 |= 64; + customDiv_ = value; + } + } + /// Gets whether the "custom_div" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCustomDiv { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "custom_div" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCustomDiv() { + _hasBits0 &= ~64; + } + + /// Field number for the "custom_sub" field. + public const int CustomSubFieldNumber = 8; + private readonly static float CustomSubDefaultValue = -1F; + + private float customSub_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CustomSub { + get { if ((_hasBits0 & 128) != 0) { return customSub_; } else { return CustomSubDefaultValue; } } + set { + _hasBits0 |= 128; + customSub_ = value; + } + } + /// Gets whether the "custom_sub" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCustomSub { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "custom_sub" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCustomSub() { + _hasBits0 &= ~128; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 2; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the input image should be flipped vertically (along the + /// y-direction). This is useful, for example, when the input image is defined + /// with a coordinate system where the origin is at the bottom-left corner + /// (e.g., in OpenGL) whereas the ML model expects an image with a top-left + /// origin. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 2) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 2; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_num_channels" field. + public const int MaxNumChannelsFieldNumber = 3; + private readonly static int MaxNumChannelsDefaultValue = 3; + + private int maxNumChannels_; + /// + /// Controls how many channels of the input image get passed through to the + /// tensor. Valid values are 1,3,4 only. Ignored for iOS GPU. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxNumChannels { + get { if ((_hasBits0 & 4) != 0) { return maxNumChannels_; } else { return MaxNumChannelsDefaultValue; } } + set { + _hasBits0 |= 4; + maxNumChannels_ = value; + } + } + /// Gets whether the "max_num_channels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxNumChannels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_num_channels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxNumChannels() { + _hasBits0 &= ~4; + } + + /// Field number for the "row_major_matrix" field. + public const int RowMajorMatrixFieldNumber = 4; + private readonly static bool RowMajorMatrixDefaultValue = false; + + private bool rowMajorMatrix_; + /// + /// The calculator expects Matrix inputs to be in column-major order. Set + /// row_major_matrix to true if the inputs are in row-major order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RowMajorMatrix { + get { if ((_hasBits0 & 8) != 0) { return rowMajorMatrix_; } else { return RowMajorMatrixDefaultValue; } } + set { + _hasBits0 |= 8; + rowMajorMatrix_ = value; + } + } + /// Gets whether the "row_major_matrix" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRowMajorMatrix { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "row_major_matrix" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRowMajorMatrix() { + _hasBits0 &= ~8; + } + + /// Field number for the "use_quantized_tensors" field. + public const int UseQuantizedTensorsFieldNumber = 5; + private readonly static bool UseQuantizedTensorsDefaultValue = false; + + private bool useQuantizedTensors_; + /// + /// Quantization option (CPU only). + /// When true, output kTfLiteUInt8 tensor instead of kTfLiteFloat32. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseQuantizedTensors { + get { if ((_hasBits0 & 16) != 0) { return useQuantizedTensors_; } else { return UseQuantizedTensorsDefaultValue; } } + set { + _hasBits0 |= 16; + useQuantizedTensors_ = value; + } + } + /// Gets whether the "use_quantized_tensors" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseQuantizedTensors { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "use_quantized_tensors" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseQuantizedTensors() { + _hasBits0 &= ~16; + } + + /// Field number for the "output_tensor_float_range" field. + public const int OutputTensorFloatRangeFieldNumber = 9; + private global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange outputTensorFloatRange_; + /// + /// Normalization option. + /// Setting normalization_range results in the values normalized to + /// the range [output_tensor_float_range.min, output_tensor_float_range.max]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange OutputTensorFloatRange { + get { return outputTensorFloatRange_; } + set { + outputTensorFloatRange_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteConverterCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteConverterCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ZeroCenter != other.ZeroCenter) return false; + if (UseCustomNormalization != other.UseCustomNormalization) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CustomDiv, other.CustomDiv)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CustomSub, other.CustomSub)) return false; + if (FlipVertically != other.FlipVertically) return false; + if (MaxNumChannels != other.MaxNumChannels) return false; + if (RowMajorMatrix != other.RowMajorMatrix) return false; + if (UseQuantizedTensors != other.UseQuantizedTensors) return false; + if (!object.Equals(OutputTensorFloatRange, other.OutputTensorFloatRange)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasZeroCenter) hash ^= ZeroCenter.GetHashCode(); + if (HasUseCustomNormalization) hash ^= UseCustomNormalization.GetHashCode(); + if (HasCustomDiv) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CustomDiv); + if (HasCustomSub) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CustomSub); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasMaxNumChannels) hash ^= MaxNumChannels.GetHashCode(); + if (HasRowMajorMatrix) hash ^= RowMajorMatrix.GetHashCode(); + if (HasUseQuantizedTensors) hash ^= UseQuantizedTensors.GetHashCode(); + if (outputTensorFloatRange_ != null) hash ^= OutputTensorFloatRange.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasZeroCenter) { + output.WriteRawTag(8); + output.WriteBool(ZeroCenter); + } + if (HasFlipVertically) { + output.WriteRawTag(16); + output.WriteBool(FlipVertically); + } + if (HasMaxNumChannels) { + output.WriteRawTag(24); + output.WriteInt32(MaxNumChannels); + } + if (HasRowMajorMatrix) { + output.WriteRawTag(32); + output.WriteBool(RowMajorMatrix); + } + if (HasUseQuantizedTensors) { + output.WriteRawTag(40); + output.WriteBool(UseQuantizedTensors); + } + if (HasUseCustomNormalization) { + output.WriteRawTag(48); + output.WriteBool(UseCustomNormalization); + } + if (HasCustomDiv) { + output.WriteRawTag(61); + output.WriteFloat(CustomDiv); + } + if (HasCustomSub) { + output.WriteRawTag(69); + output.WriteFloat(CustomSub); + } + if (outputTensorFloatRange_ != null) { + output.WriteRawTag(74); + output.WriteMessage(OutputTensorFloatRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasZeroCenter) { + output.WriteRawTag(8); + output.WriteBool(ZeroCenter); + } + if (HasFlipVertically) { + output.WriteRawTag(16); + output.WriteBool(FlipVertically); + } + if (HasMaxNumChannels) { + output.WriteRawTag(24); + output.WriteInt32(MaxNumChannels); + } + if (HasRowMajorMatrix) { + output.WriteRawTag(32); + output.WriteBool(RowMajorMatrix); + } + if (HasUseQuantizedTensors) { + output.WriteRawTag(40); + output.WriteBool(UseQuantizedTensors); + } + if (HasUseCustomNormalization) { + output.WriteRawTag(48); + output.WriteBool(UseCustomNormalization); + } + if (HasCustomDiv) { + output.WriteRawTag(61); + output.WriteFloat(CustomDiv); + } + if (HasCustomSub) { + output.WriteRawTag(69); + output.WriteFloat(CustomSub); + } + if (outputTensorFloatRange_ != null) { + output.WriteRawTag(74); + output.WriteMessage(OutputTensorFloatRange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasZeroCenter) { + size += 1 + 1; + } + if (HasUseCustomNormalization) { + size += 1 + 1; + } + if (HasCustomDiv) { + size += 1 + 4; + } + if (HasCustomSub) { + size += 1 + 4; + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (HasMaxNumChannels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumChannels); + } + if (HasRowMajorMatrix) { + size += 1 + 1; + } + if (HasUseQuantizedTensors) { + size += 1 + 1; + } + if (outputTensorFloatRange_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputTensorFloatRange); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteConverterCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasZeroCenter) { + ZeroCenter = other.ZeroCenter; + } + if (other.HasUseCustomNormalization) { + UseCustomNormalization = other.UseCustomNormalization; + } + if (other.HasCustomDiv) { + CustomDiv = other.CustomDiv; + } + if (other.HasCustomSub) { + CustomSub = other.CustomSub; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasMaxNumChannels) { + MaxNumChannels = other.MaxNumChannels; + } + if (other.HasRowMajorMatrix) { + RowMajorMatrix = other.RowMajorMatrix; + } + if (other.HasUseQuantizedTensors) { + UseQuantizedTensors = other.UseQuantizedTensors; + } + if (other.outputTensorFloatRange_ != null) { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange(); + } + OutputTensorFloatRange.MergeFrom(other.OutputTensorFloatRange); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ZeroCenter = input.ReadBool(); + break; + } + case 16: { + FlipVertically = input.ReadBool(); + break; + } + case 24: { + MaxNumChannels = input.ReadInt32(); + break; + } + case 32: { + RowMajorMatrix = input.ReadBool(); + break; + } + case 40: { + UseQuantizedTensors = input.ReadBool(); + break; + } + case 48: { + UseCustomNormalization = input.ReadBool(); + break; + } + case 61: { + CustomDiv = input.ReadFloat(); + break; + } + case 69: { + CustomSub = input.ReadFloat(); + break; + } + case 74: { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange(); + } + input.ReadMessage(OutputTensorFloatRange); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ZeroCenter = input.ReadBool(); + break; + } + case 16: { + FlipVertically = input.ReadBool(); + break; + } + case 24: { + MaxNumChannels = input.ReadInt32(); + break; + } + case 32: { + RowMajorMatrix = input.ReadBool(); + break; + } + case 40: { + UseQuantizedTensors = input.ReadBool(); + break; + } + case 48: { + UseCustomNormalization = input.ReadBool(); + break; + } + case 61: { + CustomDiv = input.ReadFloat(); + break; + } + case 69: { + CustomSub = input.ReadFloat(); + break; + } + case 74: { + if (outputTensorFloatRange_ == null) { + OutputTensorFloatRange = new global::Mediapipe.TfLiteConverterCalculatorOptions.Types.TensorFloatRange(); + } + input.ReadMessage(OutputTensorFloatRange); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TfLiteConverterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class TensorFloatRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorFloatRange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteConverterCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange(TensorFloatRange other) : this() { + _hasBits0 = other._hasBits0; + min_ = other.min_; + max_ = other.max_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorFloatRange Clone() { + return new TensorFloatRange(this); + } + + /// Field number for the "min" field. + public const int MinFieldNumber = 1; + private readonly static float MinDefaultValue = 0F; + + private float min_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Min { + get { if ((_hasBits0 & 1) != 0) { return min_; } else { return MinDefaultValue; } } + set { + _hasBits0 |= 1; + min_ = value; + } + } + /// Gets whether the "min" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMin() { + _hasBits0 &= ~1; + } + + /// Field number for the "max" field. + public const int MaxFieldNumber = 2; + private readonly static float MaxDefaultValue = 0F; + + private float max_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Max { + get { if ((_hasBits0 & 2) != 0) { return max_; } else { return MaxDefaultValue; } } + set { + _hasBits0 |= 2; + max_ = value; + } + } + /// Gets whether the "max" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMax { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMax() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorFloatRange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorFloatRange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Min, other.Min)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Max, other.Max)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Min); + if (HasMax) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Max); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMin) { + output.WriteRawTag(13); + output.WriteFloat(Min); + } + if (HasMax) { + output.WriteRawTag(21); + output.WriteFloat(Max); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMin) { + size += 1 + 4; + } + if (HasMax) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorFloatRange other) { + if (other == null) { + return; + } + if (other.HasMin) { + Min = other.Min; + } + if (other.HasMax) { + Max = other.Max; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Min = input.ReadFloat(); + break; + } + case 21: { + Max = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteConverterCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(245817797, pb::FieldCodec.ForMessage(1966542378, global::Mediapipe.TfLiteConverterCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs.meta new file mode 100644 index 0000000..9c5ae01 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteConverterCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7b2f368f8e7e27c0b2c507600a5aff4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs new file mode 100644 index 0000000..d51594a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs @@ -0,0 +1,270 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_custom_op_resolver_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_custom_op_resolver_calculator.proto + public static partial class TfliteCustomOpResolverCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_custom_op_resolver_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteCustomOpResolverCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkdtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV9jdXN0b21f", + "b3BfcmVzb2x2ZXJfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRp", + "YXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8iowEKJ1RmTGl0ZUN1", + "c3RvbU9wUmVzb2x2ZXJDYWxjdWxhdG9yT3B0aW9ucxIWCgd1c2VfZ3B1GAEg", + "ASgIOgVmYWxzZTJgCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlv", + "bnMYgZqaeCABKAsyMi5tZWRpYXBpcGUuVGZMaXRlQ3VzdG9tT3BSZXNvbHZl", + "ckNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteCustomOpResolverCalculatorOptions), global::Mediapipe.TfLiteCustomOpResolverCalculatorOptions.Parser, new[]{ "UseGpu" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteCustomOpResolverCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options to generate an op resolver for running TfLite inference. + /// + public sealed partial class TfLiteCustomOpResolverCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteCustomOpResolverCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteCustomOpResolverCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteCustomOpResolverCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteCustomOpResolverCalculatorOptions(TfLiteCustomOpResolverCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + useGpu_ = other.useGpu_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteCustomOpResolverCalculatorOptions Clone() { + return new TfLiteCustomOpResolverCalculatorOptions(this); + } + + /// Field number for the "use_gpu" field. + public const int UseGpuFieldNumber = 1; + private readonly static bool UseGpuDefaultValue = false; + + private bool useGpu_; + /// + /// Flag for using GPU inference which uses the correspondent op resolver. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseGpu { + get { if ((_hasBits0 & 1) != 0) { return useGpu_; } else { return UseGpuDefaultValue; } } + set { + _hasBits0 |= 1; + useGpu_ = value; + } + } + /// Gets whether the "use_gpu" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseGpu { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "use_gpu" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseGpu() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteCustomOpResolverCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteCustomOpResolverCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UseGpu != other.UseGpu) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasUseGpu) hash ^= UseGpu.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasUseGpu) { + output.WriteRawTag(8); + output.WriteBool(UseGpu); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasUseGpu) { + output.WriteRawTag(8); + output.WriteBool(UseGpu); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasUseGpu) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteCustomOpResolverCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasUseGpu) { + UseGpu = other.UseGpu; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + UseGpu = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + UseGpu = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteCustomOpResolverCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(252087553, pb::FieldCodec.ForMessage(2016700426, global::Mediapipe.TfLiteCustomOpResolverCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs.meta new file mode 100644 index 0000000..2611da4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteCustomOpResolverCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 144f1e034de2f8487be64ddc71703605 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs new file mode 100644 index 0000000..113760e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs @@ -0,0 +1,2046 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_inference_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_inference_calculator.proto + public static partial class TfliteInferenceCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_inference_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteInferenceCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV9pbmZlcmVu", + "Y2VfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3IucHJvdG8i+wgKIFRmTGl0ZUluZmVyZW5jZUNh", + "bGN1bGF0b3JPcHRpb25zEhIKCm1vZGVsX3BhdGgYASABKAkSGgoHdXNlX2dw", + "dRgCIAEoCDoFZmFsc2VCAhgBEhwKCXVzZV9ubmFwaRgDIAEoCDoFZmFsc2VC", + "AhgBEhoKDmNwdV9udW1fdGhyZWFkGAQgASgFOgItMRJGCghkZWxlZ2F0ZRgF", + "IAEoCzI0Lm1lZGlhcGlwZS5UZkxpdGVJbmZlcmVuY2VDYWxjdWxhdG9yT3B0", + "aW9ucy5EZWxlZ2F0ZRrJBgoIRGVsZWdhdGUSTQoGdGZsaXRlGAEgASgLMjsu", + "bWVkaWFwaXBlLlRmTGl0ZUluZmVyZW5jZUNhbGN1bGF0b3JPcHRpb25zLkRl", + "bGVnYXRlLlRmTGl0ZUgAEkcKA2dwdRgCIAEoCzI4Lm1lZGlhcGlwZS5UZkxp", + "dGVJbmZlcmVuY2VDYWxjdWxhdG9yT3B0aW9ucy5EZWxlZ2F0ZS5HcHVIABJL", + "CgVubmFwaRgDIAEoCzI6Lm1lZGlhcGlwZS5UZkxpdGVJbmZlcmVuY2VDYWxj", + "dWxhdG9yT3B0aW9ucy5EZWxlZ2F0ZS5ObmFwaUgAEk8KB3hubnBhY2sYBCAB", + "KAsyPC5tZWRpYXBpcGUuVGZMaXRlSW5mZXJlbmNlQ2FsY3VsYXRvck9wdGlv", + "bnMuRGVsZWdhdGUuWG5ucGFja0gAGggKBlRmTGl0ZRqbAwoDR3B1EiMKFHVz", + "ZV9hZHZhbmNlZF9ncHVfYXBpGAEgASgIOgVmYWxzZRJOCgNhcGkYBCABKA4y", + "PC5tZWRpYXBpcGUuVGZMaXRlSW5mZXJlbmNlQ2FsY3VsYXRvck9wdGlvbnMu", + "RGVsZWdhdGUuR3B1LkFwaToDQU5ZEiIKFGFsbG93X3ByZWNpc2lvbl9sb3Nz", + "GAMgASgIOgR0cnVlEhoKEmNhY2hlZF9rZXJuZWxfcGF0aBgCIAEoCRJnCgV1", + "c2FnZRgFIAEoDjJHLm1lZGlhcGlwZS5UZkxpdGVJbmZlcmVuY2VDYWxjdWxh", + "dG9yT3B0aW9ucy5EZWxlZ2F0ZS5HcHUuSW5mZXJlbmNlVXNhZ2U6D1NVU1RB", + "SU5FRF9TUEVFRCImCgNBcGkSBwoDQU5ZEAASCgoGT1BFTkdMEAESCgoGT1BF", + "TkNMEAIiTgoOSW5mZXJlbmNlVXNhZ2USDwoLVU5TUEVDSUZJRUQQABIWChJG", + "QVNUX1NJTkdMRV9BTlNXRVIQARITCg9TVVNUQUlORURfU1BFRUQQAhovCgVO", + "bmFwaRIRCgljYWNoZV9kaXIYASABKAkSEwoLbW9kZWxfdG9rZW4YAiABKAka", + "IgoHWG5ucGFjaxIXCgtudW1fdGhyZWFkcxgBIAEoBToCLTFCCgoIZGVsZWdh", + "dGUyWQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGM2Pwm8g", + "ASgLMisubWVkaWFwaXBlLlRmTGl0ZUluZmVyZW5jZUNhbGN1bGF0b3JPcHRp", + "b25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions), global::Mediapipe.TfLiteInferenceCalculatorOptions.Parser, new[]{ "ModelPath", "UseGpu", "UseNnapi", "CpuNumThread", "Delegate" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteInferenceCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate), global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Parser, new[]{ "Tflite", "Gpu", "Nnapi", "Xnnpack" }, new[]{ "Delegate" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite), global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu), global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Parser, new[]{ "UseAdvancedGpuApi", "Api", "AllowPrecisionLoss", "CachedKernelPath", "Usage" }, null, new[]{ typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api), typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi), global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi.Parser, new[]{ "CacheDir", "ModelToken" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack), global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack.Parser, new[]{ "NumThreads" }, null, null, null, null)})}) + })); + } + #endregion + + } + #region Messages + /// + /// Full Example: + /// + /// node { + /// calculator: "TfLiteInferenceCalculator" + /// input_stream: "TENSOR_IN:image_tensors" + /// output_stream: "TENSOR_OUT:result_tensors" + /// options { + /// [mediapipe.TfLiteInferenceCalculatorOptions.ext] { + /// model_path: "model.tflite" + /// delegate { gpu {} } + /// } + /// } + /// } + /// + public sealed partial class TfLiteInferenceCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteInferenceCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteInferenceCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteInferenceCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteInferenceCalculatorOptions(TfLiteInferenceCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + modelPath_ = other.modelPath_; + useGpu_ = other.useGpu_; + useNnapi_ = other.useNnapi_; + cpuNumThread_ = other.cpuNumThread_; + delegate_ = other.delegate_ != null ? other.delegate_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteInferenceCalculatorOptions Clone() { + return new TfLiteInferenceCalculatorOptions(this); + } + + /// Field number for the "model_path" field. + public const int ModelPathFieldNumber = 1; + private readonly static string ModelPathDefaultValue = ""; + + private string modelPath_; + /// + /// Path to the TF Lite model (ex: /path/to/modelname.tflite). + /// On mobile, this is generally just modelname.tflite. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelPath { + get { return modelPath_ ?? ModelPathDefaultValue; } + set { + modelPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelPath { + get { return modelPath_ != null; } + } + /// Clears the value of the "model_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelPath() { + modelPath_ = null; + } + + /// Field number for the "use_gpu" field. + public const int UseGpuFieldNumber = 2; + private readonly static bool UseGpuDefaultValue = false; + + private bool useGpu_; + /// + /// Whether the TF Lite GPU or CPU backend should be used. Effective only when + /// input tensors are on CPU. For input tensors on GPU, GPU backend is always + /// used. + /// DEPRECATED: configure "delegate" instead. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseGpu { + get { if ((_hasBits0 & 1) != 0) { return useGpu_; } else { return UseGpuDefaultValue; } } + set { + _hasBits0 |= 1; + useGpu_ = value; + } + } + /// Gets whether the "use_gpu" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseGpu { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "use_gpu" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseGpu() { + _hasBits0 &= ~1; + } + + /// Field number for the "use_nnapi" field. + public const int UseNnapiFieldNumber = 3; + private readonly static bool UseNnapiDefaultValue = false; + + private bool useNnapi_; + /// + /// Android only. When true, an NNAPI delegate will be used for inference. + /// If NNAPI is not available, then the default CPU delegate will be used + /// automatically. + /// DEPRECATED: configure "delegate" instead. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseNnapi { + get { if ((_hasBits0 & 2) != 0) { return useNnapi_; } else { return UseNnapiDefaultValue; } } + set { + _hasBits0 |= 2; + useNnapi_ = value; + } + } + /// Gets whether the "use_nnapi" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseNnapi { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "use_nnapi" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseNnapi() { + _hasBits0 &= ~2; + } + + /// Field number for the "cpu_num_thread" field. + public const int CpuNumThreadFieldNumber = 4; + private readonly static int CpuNumThreadDefaultValue = -1; + + private int cpuNumThread_; + /// + /// The number of threads available to the interpreter. Effective only when + /// input tensors are on CPU and 'use_gpu' is false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CpuNumThread { + get { if ((_hasBits0 & 4) != 0) { return cpuNumThread_; } else { return CpuNumThreadDefaultValue; } } + set { + _hasBits0 |= 4; + cpuNumThread_ = value; + } + } + /// Gets whether the "cpu_num_thread" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCpuNumThread { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "cpu_num_thread" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCpuNumThread() { + _hasBits0 &= ~4; + } + + /// Field number for the "delegate" field. + public const int DelegateFieldNumber = 5; + private global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate delegate_; + /// + /// TfLite delegate to run inference. + /// If not specified, when any of the input and output is on GPU (i.e, using + /// the TENSORS_GPU tag) TFLite GPU delegate is used (as if "gpu {}" is + /// specified), or otherwise regular TFLite on CPU is used (as if "tflite {}" + /// is specified) except when building with emscripten where xnnpack is used. + /// NOTE: use_gpu/use_nnapi are ignored if specified. (Delegate takes + /// precedence over use_* deprecated options.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate Delegate { + get { return delegate_; } + set { + delegate_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteInferenceCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteInferenceCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ModelPath != other.ModelPath) return false; + if (UseGpu != other.UseGpu) return false; + if (UseNnapi != other.UseNnapi) return false; + if (CpuNumThread != other.CpuNumThread) return false; + if (!object.Equals(Delegate, other.Delegate)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasModelPath) hash ^= ModelPath.GetHashCode(); + if (HasUseGpu) hash ^= UseGpu.GetHashCode(); + if (HasUseNnapi) hash ^= UseNnapi.GetHashCode(); + if (HasCpuNumThread) hash ^= CpuNumThread.GetHashCode(); + if (delegate_ != null) hash ^= Delegate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (HasUseGpu) { + output.WriteRawTag(16); + output.WriteBool(UseGpu); + } + if (HasUseNnapi) { + output.WriteRawTag(24); + output.WriteBool(UseNnapi); + } + if (HasCpuNumThread) { + output.WriteRawTag(32); + output.WriteInt32(CpuNumThread); + } + if (delegate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Delegate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (HasUseGpu) { + output.WriteRawTag(16); + output.WriteBool(UseGpu); + } + if (HasUseNnapi) { + output.WriteRawTag(24); + output.WriteBool(UseNnapi); + } + if (HasCpuNumThread) { + output.WriteRawTag(32); + output.WriteInt32(CpuNumThread); + } + if (delegate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Delegate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasModelPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelPath); + } + if (HasUseGpu) { + size += 1 + 1; + } + if (HasUseNnapi) { + size += 1 + 1; + } + if (HasCpuNumThread) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CpuNumThread); + } + if (delegate_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Delegate); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteInferenceCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasModelPath) { + ModelPath = other.ModelPath; + } + if (other.HasUseGpu) { + UseGpu = other.UseGpu; + } + if (other.HasUseNnapi) { + UseNnapi = other.UseNnapi; + } + if (other.HasCpuNumThread) { + CpuNumThread = other.CpuNumThread; + } + if (other.delegate_ != null) { + if (delegate_ == null) { + Delegate = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate(); + } + Delegate.MergeFrom(other.Delegate); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 16: { + UseGpu = input.ReadBool(); + break; + } + case 24: { + UseNnapi = input.ReadBool(); + break; + } + case 32: { + CpuNumThread = input.ReadInt32(); + break; + } + case 42: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 16: { + UseGpu = input.ReadBool(); + break; + } + case 24: { + UseNnapi = input.ReadBool(); + break; + } + case 32: { + CpuNumThread = input.ReadInt32(); + break; + } + case 42: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TfLiteInferenceCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Delegate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Delegate()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteInferenceCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate(Delegate other) : this() { + switch (other.DelegateCase) { + case DelegateOneofCase.Tflite: + Tflite = other.Tflite.Clone(); + break; + case DelegateOneofCase.Gpu: + Gpu = other.Gpu.Clone(); + break; + case DelegateOneofCase.Nnapi: + Nnapi = other.Nnapi.Clone(); + break; + case DelegateOneofCase.Xnnpack: + Xnnpack = other.Xnnpack.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Delegate Clone() { + return new Delegate(this); + } + + /// Field number for the "tflite" field. + public const int TfliteFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite Tflite { + get { return delegateCase_ == DelegateOneofCase.Tflite ? (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Tflite; + } + } + + /// Field number for the "gpu" field. + public const int GpuFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu Gpu { + get { return delegateCase_ == DelegateOneofCase.Gpu ? (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Gpu; + } + } + + /// Field number for the "nnapi" field. + public const int NnapiFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi Nnapi { + get { return delegateCase_ == DelegateOneofCase.Nnapi ? (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Nnapi; + } + } + + /// Field number for the "xnnpack" field. + public const int XnnpackFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack Xnnpack { + get { return delegateCase_ == DelegateOneofCase.Xnnpack ? (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack) delegate_ : null; } + set { + delegate_ = value; + delegateCase_ = value == null ? DelegateOneofCase.None : DelegateOneofCase.Xnnpack; + } + } + + private object delegate_; + /// Enum of possible cases for the "delegate" oneof. + public enum DelegateOneofCase { + None = 0, + Tflite = 1, + Gpu = 2, + Nnapi = 3, + Xnnpack = 4, + } + private DelegateOneofCase delegateCase_ = DelegateOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DelegateOneofCase DelegateCase { + get { return delegateCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDelegate() { + delegateCase_ = DelegateOneofCase.None; + delegate_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Delegate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Delegate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Tflite, other.Tflite)) return false; + if (!object.Equals(Gpu, other.Gpu)) return false; + if (!object.Equals(Nnapi, other.Nnapi)) return false; + if (!object.Equals(Xnnpack, other.Xnnpack)) return false; + if (DelegateCase != other.DelegateCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (delegateCase_ == DelegateOneofCase.Tflite) hash ^= Tflite.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Gpu) hash ^= Gpu.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Nnapi) hash ^= Nnapi.GetHashCode(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) hash ^= Xnnpack.GetHashCode(); + hash ^= (int) delegateCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (delegateCase_ == DelegateOneofCase.Tflite) { + output.WriteRawTag(10); + output.WriteMessage(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + output.WriteRawTag(18); + output.WriteMessage(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + output.WriteRawTag(26); + output.WriteMessage(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + output.WriteRawTag(34); + output.WriteMessage(Xnnpack); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (delegateCase_ == DelegateOneofCase.Tflite) { + output.WriteRawTag(10); + output.WriteMessage(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + output.WriteRawTag(18); + output.WriteMessage(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + output.WriteRawTag(26); + output.WriteMessage(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + output.WriteRawTag(34); + output.WriteMessage(Xnnpack); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (delegateCase_ == DelegateOneofCase.Tflite) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tflite); + } + if (delegateCase_ == DelegateOneofCase.Gpu) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gpu); + } + if (delegateCase_ == DelegateOneofCase.Nnapi) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Nnapi); + } + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Xnnpack); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Delegate other) { + if (other == null) { + return; + } + switch (other.DelegateCase) { + case DelegateOneofCase.Tflite: + if (Tflite == null) { + Tflite = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + } + Tflite.MergeFrom(other.Tflite); + break; + case DelegateOneofCase.Gpu: + if (Gpu == null) { + Gpu = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + } + Gpu.MergeFrom(other.Gpu); + break; + case DelegateOneofCase.Nnapi: + if (Nnapi == null) { + Nnapi = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + } + Nnapi.MergeFrom(other.Nnapi); + break; + case DelegateOneofCase.Xnnpack: + if (Xnnpack == null) { + Xnnpack = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + } + Xnnpack.MergeFrom(other.Xnnpack); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + if (delegateCase_ == DelegateOneofCase.Tflite) { + subBuilder.MergeFrom(Tflite); + } + input.ReadMessage(subBuilder); + Tflite = subBuilder; + break; + } + case 18: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + if (delegateCase_ == DelegateOneofCase.Gpu) { + subBuilder.MergeFrom(Gpu); + } + input.ReadMessage(subBuilder); + Gpu = subBuilder; + break; + } + case 26: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + if (delegateCase_ == DelegateOneofCase.Nnapi) { + subBuilder.MergeFrom(Nnapi); + } + input.ReadMessage(subBuilder); + Nnapi = subBuilder; + break; + } + case 34: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + subBuilder.MergeFrom(Xnnpack); + } + input.ReadMessage(subBuilder); + Xnnpack = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.TfLite(); + if (delegateCase_ == DelegateOneofCase.Tflite) { + subBuilder.MergeFrom(Tflite); + } + input.ReadMessage(subBuilder); + Tflite = subBuilder; + break; + } + case 18: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu(); + if (delegateCase_ == DelegateOneofCase.Gpu) { + subBuilder.MergeFrom(Gpu); + } + input.ReadMessage(subBuilder); + Gpu = subBuilder; + break; + } + case 26: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Nnapi(); + if (delegateCase_ == DelegateOneofCase.Nnapi) { + subBuilder.MergeFrom(Nnapi); + } + input.ReadMessage(subBuilder); + Nnapi = subBuilder; + break; + } + case 34: { + global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack subBuilder = new global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Xnnpack(); + if (delegateCase_ == DelegateOneofCase.Xnnpack) { + subBuilder.MergeFrom(Xnnpack); + } + input.ReadMessage(subBuilder); + Xnnpack = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Delegate message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Default inference provided by tflite. + /// + public sealed partial class TfLite : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLite()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite(TfLite other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLite Clone() { + return new TfLite(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLite); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLite other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLite other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + /// + /// Delegate to run GPU inference depending on the device. + /// (Can use OpenGl, OpenCl, Metal depending on the device.) + /// + public sealed partial class Gpu : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Gpu()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu(Gpu other) : this() { + _hasBits0 = other._hasBits0; + useAdvancedGpuApi_ = other.useAdvancedGpuApi_; + api_ = other.api_; + allowPrecisionLoss_ = other.allowPrecisionLoss_; + cachedKernelPath_ = other.cachedKernelPath_; + usage_ = other.usage_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Gpu Clone() { + return new Gpu(this); + } + + /// Field number for the "use_advanced_gpu_api" field. + public const int UseAdvancedGpuApiFieldNumber = 1; + private readonly static bool UseAdvancedGpuApiDefaultValue = false; + + private bool useAdvancedGpuApi_; + /// + /// Experimental, Android/Linux only. Use TFLite GPU delegate API2 for + /// the NN inference. + /// example: + /// delegate: { gpu { use_advanced_gpu_api: true } } + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseAdvancedGpuApi { + get { if ((_hasBits0 & 1) != 0) { return useAdvancedGpuApi_; } else { return UseAdvancedGpuApiDefaultValue; } } + set { + _hasBits0 |= 1; + useAdvancedGpuApi_ = value; + } + } + /// Gets whether the "use_advanced_gpu_api" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseAdvancedGpuApi { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "use_advanced_gpu_api" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseAdvancedGpuApi() { + _hasBits0 &= ~1; + } + + /// Field number for the "api" field. + public const int ApiFieldNumber = 4; + private readonly static global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api ApiDefaultValue = global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api.Any; + + private global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api api_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api Api { + get { if ((_hasBits0 & 4) != 0) { return api_; } else { return ApiDefaultValue; } } + set { + _hasBits0 |= 4; + api_ = value; + } + } + /// Gets whether the "api" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasApi { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "api" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearApi() { + _hasBits0 &= ~4; + } + + /// Field number for the "allow_precision_loss" field. + public const int AllowPrecisionLossFieldNumber = 3; + private readonly static bool AllowPrecisionLossDefaultValue = true; + + private bool allowPrecisionLoss_; + /// + /// This option is valid for TFLite GPU delegate API2 only, + /// Set to true to use 16-bit float precision. If max precision is needed, + /// set to false for 32-bit float calculations only. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AllowPrecisionLoss { + get { if ((_hasBits0 & 2) != 0) { return allowPrecisionLoss_; } else { return AllowPrecisionLossDefaultValue; } } + set { + _hasBits0 |= 2; + allowPrecisionLoss_ = value; + } + } + /// Gets whether the "allow_precision_loss" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAllowPrecisionLoss { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "allow_precision_loss" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAllowPrecisionLoss() { + _hasBits0 &= ~2; + } + + /// Field number for the "cached_kernel_path" field. + public const int CachedKernelPathFieldNumber = 2; + private readonly static string CachedKernelPathDefaultValue = ""; + + private string cachedKernelPath_; + /// + /// Load pre-compiled serialized binary cache to accelerate init process. + /// Only available for OpenCL delegate on Android. + /// Kernel caching will only be enabled if this path is set. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CachedKernelPath { + get { return cachedKernelPath_ ?? CachedKernelPathDefaultValue; } + set { + cachedKernelPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cached_kernel_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCachedKernelPath { + get { return cachedKernelPath_ != null; } + } + /// Clears the value of the "cached_kernel_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCachedKernelPath() { + cachedKernelPath_ = null; + } + + /// Field number for the "usage" field. + public const int UsageFieldNumber = 5; + private readonly static global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage UsageDefaultValue = global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage.SustainedSpeed; + + private global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage usage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage Usage { + get { if ((_hasBits0 & 8) != 0) { return usage_; } else { return UsageDefaultValue; } } + set { + _hasBits0 |= 8; + usage_ = value; + } + } + /// Gets whether the "usage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUsage { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "usage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUsage() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Gpu); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Gpu other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UseAdvancedGpuApi != other.UseAdvancedGpuApi) return false; + if (Api != other.Api) return false; + if (AllowPrecisionLoss != other.AllowPrecisionLoss) return false; + if (CachedKernelPath != other.CachedKernelPath) return false; + if (Usage != other.Usage) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasUseAdvancedGpuApi) hash ^= UseAdvancedGpuApi.GetHashCode(); + if (HasApi) hash ^= Api.GetHashCode(); + if (HasAllowPrecisionLoss) hash ^= AllowPrecisionLoss.GetHashCode(); + if (HasCachedKernelPath) hash ^= CachedKernelPath.GetHashCode(); + if (HasUsage) hash ^= Usage.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasUseAdvancedGpuApi) { + output.WriteRawTag(8); + output.WriteBool(UseAdvancedGpuApi); + } + if (HasCachedKernelPath) { + output.WriteRawTag(18); + output.WriteString(CachedKernelPath); + } + if (HasAllowPrecisionLoss) { + output.WriteRawTag(24); + output.WriteBool(AllowPrecisionLoss); + } + if (HasApi) { + output.WriteRawTag(32); + output.WriteEnum((int) Api); + } + if (HasUsage) { + output.WriteRawTag(40); + output.WriteEnum((int) Usage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasUseAdvancedGpuApi) { + output.WriteRawTag(8); + output.WriteBool(UseAdvancedGpuApi); + } + if (HasCachedKernelPath) { + output.WriteRawTag(18); + output.WriteString(CachedKernelPath); + } + if (HasAllowPrecisionLoss) { + output.WriteRawTag(24); + output.WriteBool(AllowPrecisionLoss); + } + if (HasApi) { + output.WriteRawTag(32); + output.WriteEnum((int) Api); + } + if (HasUsage) { + output.WriteRawTag(40); + output.WriteEnum((int) Usage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasUseAdvancedGpuApi) { + size += 1 + 1; + } + if (HasApi) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Api); + } + if (HasAllowPrecisionLoss) { + size += 1 + 1; + } + if (HasCachedKernelPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CachedKernelPath); + } + if (HasUsage) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Usage); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Gpu other) { + if (other == null) { + return; + } + if (other.HasUseAdvancedGpuApi) { + UseAdvancedGpuApi = other.UseAdvancedGpuApi; + } + if (other.HasApi) { + Api = other.Api; + } + if (other.HasAllowPrecisionLoss) { + AllowPrecisionLoss = other.AllowPrecisionLoss; + } + if (other.HasCachedKernelPath) { + CachedKernelPath = other.CachedKernelPath; + } + if (other.HasUsage) { + Usage = other.Usage; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + UseAdvancedGpuApi = input.ReadBool(); + break; + } + case 18: { + CachedKernelPath = input.ReadString(); + break; + } + case 24: { + AllowPrecisionLoss = input.ReadBool(); + break; + } + case 32: { + Api = (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api) input.ReadEnum(); + break; + } + case 40: { + Usage = (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + UseAdvancedGpuApi = input.ReadBool(); + break; + } + case 18: { + CachedKernelPath = input.ReadString(); + break; + } + case 24: { + AllowPrecisionLoss = input.ReadBool(); + break; + } + case 32: { + Api = (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.Api) input.ReadEnum(); + break; + } + case 40: { + Usage = (global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Types.Gpu.Types.InferenceUsage) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Gpu message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// This option is valid for TFLite GPU delegate API2 only, + /// Choose any of available APIs to force running inference using it. + /// + public enum Api { + [pbr::OriginalName("ANY")] Any = 0, + [pbr::OriginalName("OPENGL")] Opengl = 1, + [pbr::OriginalName("OPENCL")] Opencl = 2, + } + + /// + /// Encapsulated compilation/runtime tradeoffs. + /// + public enum InferenceUsage { + [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, + /// + /// InferenceRunner will be used only once. Therefore, it is important to + /// minimize bootstrap time as well. + /// + [pbr::OriginalName("FAST_SINGLE_ANSWER")] FastSingleAnswer = 1, + /// + /// Prefer maximizing the throughput. Same inference runner will be used + /// repeatedly on different inputs. + /// + [pbr::OriginalName("SUSTAINED_SPEED")] SustainedSpeed = 2, + } + + } + #endregion + + } + + /// + /// Android only. + /// + public sealed partial class Nnapi : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Nnapi()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi(Nnapi other) : this() { + cacheDir_ = other.cacheDir_; + modelToken_ = other.modelToken_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Nnapi Clone() { + return new Nnapi(this); + } + + /// Field number for the "cache_dir" field. + public const int CacheDirFieldNumber = 1; + private readonly static string CacheDirDefaultValue = ""; + + private string cacheDir_; + /// + /// Directory to store compilation cache. If unspecified, NNAPI will not + /// try caching the compilation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CacheDir { + get { return cacheDir_ ?? CacheDirDefaultValue; } + set { + cacheDir_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cache_dir" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCacheDir { + get { return cacheDir_ != null; } + } + /// Clears the value of the "cache_dir" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCacheDir() { + cacheDir_ = null; + } + + /// Field number for the "model_token" field. + public const int ModelTokenFieldNumber = 2; + private readonly static string ModelTokenDefaultValue = ""; + + private string modelToken_; + /// + /// Unique token identifying the model. It is the caller's responsibility + /// to ensure there is no clash of the tokens. If unspecified, NNAPI will + /// not try caching the compilation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelToken { + get { return modelToken_ ?? ModelTokenDefaultValue; } + set { + modelToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_token" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelToken { + get { return modelToken_ != null; } + } + /// Clears the value of the "model_token" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelToken() { + modelToken_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Nnapi); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Nnapi other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CacheDir != other.CacheDir) return false; + if (ModelToken != other.ModelToken) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCacheDir) hash ^= CacheDir.GetHashCode(); + if (HasModelToken) hash ^= ModelToken.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCacheDir) { + output.WriteRawTag(10); + output.WriteString(CacheDir); + } + if (HasModelToken) { + output.WriteRawTag(18); + output.WriteString(ModelToken); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCacheDir) { + output.WriteRawTag(10); + output.WriteString(CacheDir); + } + if (HasModelToken) { + output.WriteRawTag(18); + output.WriteString(ModelToken); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCacheDir) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CacheDir); + } + if (HasModelToken) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelToken); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Nnapi other) { + if (other == null) { + return; + } + if (other.HasCacheDir) { + CacheDir = other.CacheDir; + } + if (other.HasModelToken) { + ModelToken = other.ModelToken; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + CacheDir = input.ReadString(); + break; + } + case 18: { + ModelToken = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + CacheDir = input.ReadString(); + break; + } + case 18: { + ModelToken = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Xnnpack : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Xnnpack()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfLiteInferenceCalculatorOptions.Types.Delegate.Descriptor.NestedTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack(Xnnpack other) : this() { + _hasBits0 = other._hasBits0; + numThreads_ = other.numThreads_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Xnnpack Clone() { + return new Xnnpack(this); + } + + /// Field number for the "num_threads" field. + public const int NumThreadsFieldNumber = 1; + private readonly static int NumThreadsDefaultValue = -1; + + private int numThreads_; + /// + /// Number of threads for XNNPACK delegate. (By default, calculator tries + /// to choose optimal number of threads depending on the device.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumThreads { + get { if ((_hasBits0 & 1) != 0) { return numThreads_; } else { return NumThreadsDefaultValue; } } + set { + _hasBits0 |= 1; + numThreads_ = value; + } + } + /// Gets whether the "num_threads" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumThreads { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_threads" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumThreads() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Xnnpack); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Xnnpack other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumThreads != other.NumThreads) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumThreads) hash ^= NumThreads.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumThreads) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumThreads); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Xnnpack other) { + if (other == null) { + return; + } + if (other.HasNumThreads) { + NumThreads = other.NumThreads; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteInferenceCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(233867213, pb::FieldCodec.ForMessage(1870937706, global::Mediapipe.TfLiteInferenceCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs.meta new file mode 100644 index 0000000..0d6ae0f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteInferenceCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a2bf1f6f18cb129dbfa6dcff4455c4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs new file mode 100644 index 0000000..baddc1b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs @@ -0,0 +1,438 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_tensors_to_classification_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_tensors_to_classification_calculator.proto + public static partial class TfliteTensorsToClassificationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_tensors_to_classification_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteTensorsToClassificationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ck5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV90ZW5zb3Jz", + "X3RvX2NsYXNzaWZpY2F0aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlw", + "ZRokbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIvwBCi5U", + "ZkxpdGVUZW5zb3JzVG9DbGFzc2lmaWNhdGlvbkNhbGN1bGF0b3JPcHRpb25z", + "EhsKE21pbl9zY29yZV90aHJlc2hvbGQYASABKAISDQoFdG9wX2sYAiABKAUS", + "FgoObGFiZWxfbWFwX3BhdGgYAyABKAkSHQoVYmluYXJ5X2NsYXNzaWZpY2F0", + "aW9uGAQgASgIMmcKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9u", + "cxjn3YN/IAEoCzI5Lm1lZGlhcGlwZS5UZkxpdGVUZW5zb3JzVG9DbGFzc2lm", + "aWNhdGlvbkNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteTensorsToClassificationCalculatorOptions), global::Mediapipe.TfLiteTensorsToClassificationCalculatorOptions.Parser, new[]{ "MinScoreThreshold", "TopK", "LabelMapPath", "BinaryClassification" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteTensorsToClassificationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TfLiteTensorsToClassificationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteTensorsToClassificationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteTensorsToClassificationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToClassificationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToClassificationCalculatorOptions(TfLiteTensorsToClassificationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minScoreThreshold_ = other.minScoreThreshold_; + topK_ = other.topK_; + labelMapPath_ = other.labelMapPath_; + binaryClassification_ = other.binaryClassification_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToClassificationCalculatorOptions Clone() { + return new TfLiteTensorsToClassificationCalculatorOptions(this); + } + + /// Field number for the "min_score_threshold" field. + public const int MinScoreThresholdFieldNumber = 1; + private readonly static float MinScoreThresholdDefaultValue = 0F; + + private float minScoreThreshold_; + /// + /// Score threshold for perserving the class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThreshold { + get { if ((_hasBits0 & 1) != 0) { return minScoreThreshold_; } else { return MinScoreThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + minScoreThreshold_ = value; + } + } + /// Gets whether the "min_score_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_score_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "top_k" field. + public const int TopKFieldNumber = 2; + private readonly static int TopKDefaultValue = 0; + + private int topK_; + /// + /// Number of highest scoring labels to output. If top_k is not positive then + /// all labels are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TopK { + get { if ((_hasBits0 & 2) != 0) { return topK_; } else { return TopKDefaultValue; } } + set { + _hasBits0 |= 2; + topK_ = value; + } + } + /// Gets whether the "top_k" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopK { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "top_k" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopK() { + _hasBits0 &= ~2; + } + + /// Field number for the "label_map_path" field. + public const int LabelMapPathFieldNumber = 3; + private readonly static string LabelMapPathDefaultValue = ""; + + private string labelMapPath_; + /// + /// Path to a label map file for getting the actual name of class ids. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string LabelMapPath { + get { return labelMapPath_ ?? LabelMapPathDefaultValue; } + set { + labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label_map_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelMapPath { + get { return labelMapPath_ != null; } + } + /// Clears the value of the "label_map_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelMapPath() { + labelMapPath_ = null; + } + + /// Field number for the "binary_classification" field. + public const int BinaryClassificationFieldNumber = 4; + private readonly static bool BinaryClassificationDefaultValue = false; + + private bool binaryClassification_; + /// + /// Whether the input is a single float for binary classification. + /// When true, only a single float is expected in the input tensor and the + /// label map, if provided, is expected to have exactly two labels. + /// The single score(float) represent the probability of first label, and + /// 1 - score is the probabilility of the second label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BinaryClassification { + get { if ((_hasBits0 & 4) != 0) { return binaryClassification_; } else { return BinaryClassificationDefaultValue; } } + set { + _hasBits0 |= 4; + binaryClassification_ = value; + } + } + /// Gets whether the "binary_classification" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBinaryClassification { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "binary_classification" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBinaryClassification() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteTensorsToClassificationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteTensorsToClassificationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThreshold, other.MinScoreThreshold)) return false; + if (TopK != other.TopK) return false; + if (LabelMapPath != other.LabelMapPath) return false; + if (BinaryClassification != other.BinaryClassification) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinScoreThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThreshold); + if (HasTopK) hash ^= TopK.GetHashCode(); + if (HasLabelMapPath) hash ^= LabelMapPath.GetHashCode(); + if (HasBinaryClassification) hash ^= BinaryClassification.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinScoreThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinScoreThreshold); + } + if (HasTopK) { + output.WriteRawTag(16); + output.WriteInt32(TopK); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (HasBinaryClassification) { + output.WriteRawTag(32); + output.WriteBool(BinaryClassification); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinScoreThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinScoreThreshold); + } + if (HasTopK) { + output.WriteRawTag(16); + output.WriteInt32(TopK); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (HasBinaryClassification) { + output.WriteRawTag(32); + output.WriteBool(BinaryClassification); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinScoreThreshold) { + size += 1 + 4; + } + if (HasTopK) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TopK); + } + if (HasLabelMapPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath); + } + if (HasBinaryClassification) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteTensorsToClassificationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinScoreThreshold) { + MinScoreThreshold = other.MinScoreThreshold; + } + if (other.HasTopK) { + TopK = other.TopK; + } + if (other.HasLabelMapPath) { + LabelMapPath = other.LabelMapPath; + } + if (other.HasBinaryClassification) { + BinaryClassification = other.BinaryClassification; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 16: { + TopK = input.ReadInt32(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + case 32: { + BinaryClassification = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 16: { + TopK = input.ReadInt32(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + case 32: { + BinaryClassification = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteTensorsToClassificationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(266399463, pb::FieldCodec.ForMessage(2131195706, global::Mediapipe.TfLiteTensorsToClassificationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs.meta new file mode 100644 index 0000000..0b7e011 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToClassificationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa4dd627052aca64a2ce23226d87ddb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs new file mode 100644 index 0000000..3cd67c2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs @@ -0,0 +1,1179 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.proto + public static partial class TfliteTensorsToDetectionsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteTensorsToDetectionsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkptZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV90ZW5zb3Jz", + "X3RvX2RldGVjdGlvbnNfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRt", + "ZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8i+QQKKlRmTGl0", + "ZVRlbnNvcnNUb0RldGVjdGlvbnNDYWxjdWxhdG9yT3B0aW9ucxITCgtudW1f", + "Y2xhc3NlcxgBIAEoBRIRCgludW1fYm94ZXMYAiABKAUSEgoKbnVtX2Nvb3Jk", + "cxgDIAEoBRIdChVrZXlwb2ludF9jb29yZF9vZmZzZXQYCSABKAUSGAoNbnVt", + "X2tleXBvaW50cxgKIAEoBToBMBIiChdudW1fdmFsdWVzX3Blcl9rZXlwb2lu", + "dBgLIAEoBToBMhIbChBib3hfY29vcmRfb2Zmc2V0GAwgASgFOgEwEhIKB3hf", + "c2NhbGUYBCABKAI6ATASEgoHeV9zY2FsZRgFIAEoAjoBMBISCgd3X3NjYWxl", + "GAYgASgCOgEwEhIKB2hfc2NhbGUYByABKAI6ATASLAodYXBwbHlfZXhwb25l", + "bnRpYWxfb25fYm94X3NpemUYDSABKAg6BWZhbHNlEiMKFHJldmVyc2Vfb3V0", + "cHV0X29yZGVyGA4gASgIOgVmYWxzZRIWCg5pZ25vcmVfY2xhc3NlcxgIIAMo", + "BRIcCg1zaWdtb2lkX3Njb3JlGA8gASgIOgVmYWxzZRIdChVzY29yZV9jbGlw", + "cGluZ190aHJlc2gYECABKAISHgoPZmxpcF92ZXJ0aWNhbGx5GBIgASgIOgVm", + "YWxzZRIYChBtaW5fc2NvcmVfdGhyZXNoGBMgASgCMmMKA2V4dBIcLm1lZGlh", + "cGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiYisZ1IAEoCzI1Lm1lZGlhcGlwZS5U", + "ZkxpdGVUZW5zb3JzVG9EZXRlY3Rpb25zQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteTensorsToDetectionsCalculatorOptions), global::Mediapipe.TfLiteTensorsToDetectionsCalculatorOptions.Parser, new[]{ "NumClasses", "NumBoxes", "NumCoords", "KeypointCoordOffset", "NumKeypoints", "NumValuesPerKeypoint", "BoxCoordOffset", "XScale", "YScale", "WScale", "HScale", "ApplyExponentialOnBoxSize", "ReverseOutputOrder", "IgnoreClasses", "SigmoidScore", "ScoreClippingThresh", "FlipVertically", "MinScoreThresh" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteTensorsToDetectionsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TfLiteTensorsToDetectionsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteTensorsToDetectionsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteTensorsToDetectionsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToDetectionsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToDetectionsCalculatorOptions(TfLiteTensorsToDetectionsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numClasses_ = other.numClasses_; + numBoxes_ = other.numBoxes_; + numCoords_ = other.numCoords_; + keypointCoordOffset_ = other.keypointCoordOffset_; + numKeypoints_ = other.numKeypoints_; + numValuesPerKeypoint_ = other.numValuesPerKeypoint_; + boxCoordOffset_ = other.boxCoordOffset_; + xScale_ = other.xScale_; + yScale_ = other.yScale_; + wScale_ = other.wScale_; + hScale_ = other.hScale_; + applyExponentialOnBoxSize_ = other.applyExponentialOnBoxSize_; + reverseOutputOrder_ = other.reverseOutputOrder_; + ignoreClasses_ = other.ignoreClasses_.Clone(); + sigmoidScore_ = other.sigmoidScore_; + scoreClippingThresh_ = other.scoreClippingThresh_; + flipVertically_ = other.flipVertically_; + minScoreThresh_ = other.minScoreThresh_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToDetectionsCalculatorOptions Clone() { + return new TfLiteTensorsToDetectionsCalculatorOptions(this); + } + + /// Field number for the "num_classes" field. + public const int NumClassesFieldNumber = 1; + private readonly static int NumClassesDefaultValue = 0; + + private int numClasses_; + /// + /// The number of output classes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumClasses { + get { if ((_hasBits0 & 1) != 0) { return numClasses_; } else { return NumClassesDefaultValue; } } + set { + _hasBits0 |= 1; + numClasses_ = value; + } + } + /// Gets whether the "num_classes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumClasses { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_classes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumClasses() { + _hasBits0 &= ~1; + } + + /// Field number for the "num_boxes" field. + public const int NumBoxesFieldNumber = 2; + private readonly static int NumBoxesDefaultValue = 0; + + private int numBoxes_; + /// + /// The number of output boxes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumBoxes { + get { if ((_hasBits0 & 2) != 0) { return numBoxes_; } else { return NumBoxesDefaultValue; } } + set { + _hasBits0 |= 2; + numBoxes_ = value; + } + } + /// Gets whether the "num_boxes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumBoxes { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_boxes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumBoxes() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_coords" field. + public const int NumCoordsFieldNumber = 3; + private readonly static int NumCoordsDefaultValue = 0; + + private int numCoords_; + /// + /// The number of output values per boxes predicted by the detection model. The + /// values contain bounding boxes, keypoints, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumCoords { + get { if ((_hasBits0 & 4) != 0) { return numCoords_; } else { return NumCoordsDefaultValue; } } + set { + _hasBits0 |= 4; + numCoords_ = value; + } + } + /// Gets whether the "num_coords" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumCoords { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_coords" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumCoords() { + _hasBits0 &= ~4; + } + + /// Field number for the "keypoint_coord_offset" field. + public const int KeypointCoordOffsetFieldNumber = 9; + private readonly static int KeypointCoordOffsetDefaultValue = 0; + + private int keypointCoordOffset_; + /// + /// The offset of keypoint coordinates in the location tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int KeypointCoordOffset { + get { if ((_hasBits0 & 128) != 0) { return keypointCoordOffset_; } else { return KeypointCoordOffsetDefaultValue; } } + set { + _hasBits0 |= 128; + keypointCoordOffset_ = value; + } + } + /// Gets whether the "keypoint_coord_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKeypointCoordOffset { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "keypoint_coord_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKeypointCoordOffset() { + _hasBits0 &= ~128; + } + + /// Field number for the "num_keypoints" field. + public const int NumKeypointsFieldNumber = 10; + private readonly static int NumKeypointsDefaultValue = 0; + + private int numKeypoints_; + /// + /// The number of predicted keypoints. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumKeypoints { + get { if ((_hasBits0 & 256) != 0) { return numKeypoints_; } else { return NumKeypointsDefaultValue; } } + set { + _hasBits0 |= 256; + numKeypoints_ = value; + } + } + /// Gets whether the "num_keypoints" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumKeypoints { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "num_keypoints" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumKeypoints() { + _hasBits0 &= ~256; + } + + /// Field number for the "num_values_per_keypoint" field. + public const int NumValuesPerKeypointFieldNumber = 11; + private readonly static int NumValuesPerKeypointDefaultValue = 2; + + private int numValuesPerKeypoint_; + /// + /// The dimension of each keypoint, e.g. number of values predicted for each + /// keypoint. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumValuesPerKeypoint { + get { if ((_hasBits0 & 512) != 0) { return numValuesPerKeypoint_; } else { return NumValuesPerKeypointDefaultValue; } } + set { + _hasBits0 |= 512; + numValuesPerKeypoint_ = value; + } + } + /// Gets whether the "num_values_per_keypoint" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumValuesPerKeypoint { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "num_values_per_keypoint" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumValuesPerKeypoint() { + _hasBits0 &= ~512; + } + + /// Field number for the "box_coord_offset" field. + public const int BoxCoordOffsetFieldNumber = 12; + private readonly static int BoxCoordOffsetDefaultValue = 0; + + private int boxCoordOffset_; + /// + /// The offset of box coordinates in the location tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BoxCoordOffset { + get { if ((_hasBits0 & 1024) != 0) { return boxCoordOffset_; } else { return BoxCoordOffsetDefaultValue; } } + set { + _hasBits0 |= 1024; + boxCoordOffset_ = value; + } + } + /// Gets whether the "box_coord_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoxCoordOffset { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "box_coord_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxCoordOffset() { + _hasBits0 &= ~1024; + } + + /// Field number for the "x_scale" field. + public const int XScaleFieldNumber = 4; + private readonly static float XScaleDefaultValue = 0F; + + private float xScale_; + /// + /// Parameters for decoding SSD detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float XScale { + get { if ((_hasBits0 & 8) != 0) { return xScale_; } else { return XScaleDefaultValue; } } + set { + _hasBits0 |= 8; + xScale_ = value; + } + } + /// Gets whether the "x_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXScale { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "x_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXScale() { + _hasBits0 &= ~8; + } + + /// Field number for the "y_scale" field. + public const int YScaleFieldNumber = 5; + private readonly static float YScaleDefaultValue = 0F; + + private float yScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float YScale { + get { if ((_hasBits0 & 16) != 0) { return yScale_; } else { return YScaleDefaultValue; } } + set { + _hasBits0 |= 16; + yScale_ = value; + } + } + /// Gets whether the "y_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "y_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "w_scale" field. + public const int WScaleFieldNumber = 6; + private readonly static float WScaleDefaultValue = 0F; + + private float wScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float WScale { + get { if ((_hasBits0 & 32) != 0) { return wScale_; } else { return WScaleDefaultValue; } } + set { + _hasBits0 |= 32; + wScale_ = value; + } + } + /// Gets whether the "w_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWScale { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "w_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWScale() { + _hasBits0 &= ~32; + } + + /// Field number for the "h_scale" field. + public const int HScaleFieldNumber = 7; + private readonly static float HScaleDefaultValue = 0F; + + private float hScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HScale { + get { if ((_hasBits0 & 64) != 0) { return hScale_; } else { return HScaleDefaultValue; } } + set { + _hasBits0 |= 64; + hScale_ = value; + } + } + /// Gets whether the "h_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHScale { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "h_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHScale() { + _hasBits0 &= ~64; + } + + /// Field number for the "apply_exponential_on_box_size" field. + public const int ApplyExponentialOnBoxSizeFieldNumber = 13; + private readonly static bool ApplyExponentialOnBoxSizeDefaultValue = false; + + private bool applyExponentialOnBoxSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ApplyExponentialOnBoxSize { + get { if ((_hasBits0 & 2048) != 0) { return applyExponentialOnBoxSize_; } else { return ApplyExponentialOnBoxSizeDefaultValue; } } + set { + _hasBits0 |= 2048; + applyExponentialOnBoxSize_ = value; + } + } + /// Gets whether the "apply_exponential_on_box_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasApplyExponentialOnBoxSize { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "apply_exponential_on_box_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearApplyExponentialOnBoxSize() { + _hasBits0 &= ~2048; + } + + /// Field number for the "reverse_output_order" field. + public const int ReverseOutputOrderFieldNumber = 14; + private readonly static bool ReverseOutputOrderDefaultValue = false; + + private bool reverseOutputOrder_; + /// + /// Whether to reverse the order of predicted x, y from output. + /// If false, the order is [y_center, x_center, h, w], if true the order is + /// [x_center, y_center, w, h]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReverseOutputOrder { + get { if ((_hasBits0 & 4096) != 0) { return reverseOutputOrder_; } else { return ReverseOutputOrderDefaultValue; } } + set { + _hasBits0 |= 4096; + reverseOutputOrder_ = value; + } + } + /// Gets whether the "reverse_output_order" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReverseOutputOrder { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "reverse_output_order" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReverseOutputOrder() { + _hasBits0 &= ~4096; + } + + /// Field number for the "ignore_classes" field. + public const int IgnoreClassesFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_ignoreClasses_codec + = pb::FieldCodec.ForInt32(64); + private readonly pbc::RepeatedField ignoreClasses_ = new pbc::RepeatedField(); + /// + /// The ids of classes that should be ignored during decoding the score for + /// each predicted box. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IgnoreClasses { + get { return ignoreClasses_; } + } + + /// Field number for the "sigmoid_score" field. + public const int SigmoidScoreFieldNumber = 15; + private readonly static bool SigmoidScoreDefaultValue = false; + + private bool sigmoidScore_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SigmoidScore { + get { if ((_hasBits0 & 8192) != 0) { return sigmoidScore_; } else { return SigmoidScoreDefaultValue; } } + set { + _hasBits0 |= 8192; + sigmoidScore_ = value; + } + } + /// Gets whether the "sigmoid_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSigmoidScore { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "sigmoid_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSigmoidScore() { + _hasBits0 &= ~8192; + } + + /// Field number for the "score_clipping_thresh" field. + public const int ScoreClippingThreshFieldNumber = 16; + private readonly static float ScoreClippingThreshDefaultValue = 0F; + + private float scoreClippingThresh_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ScoreClippingThresh { + get { if ((_hasBits0 & 16384) != 0) { return scoreClippingThresh_; } else { return ScoreClippingThreshDefaultValue; } } + set { + _hasBits0 |= 16384; + scoreClippingThresh_ = value; + } + } + /// Gets whether the "score_clipping_thresh" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScoreClippingThresh { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "score_clipping_thresh" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScoreClippingThresh() { + _hasBits0 &= ~16384; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 18; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// vertically (along the y-direction). This is useful, for example, when the + /// input tensors represent detections defined with a coordinate system where + /// the origin is at the top-left corner, whereas the desired detection + /// representation has a bottom-left origin (e.g., in OpenGL). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 32768) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 32768; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~32768; + } + + /// Field number for the "min_score_thresh" field. + public const int MinScoreThreshFieldNumber = 19; + private readonly static float MinScoreThreshDefaultValue = 0F; + + private float minScoreThresh_; + /// + /// Score threshold for perserving decoded detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThresh { + get { if ((_hasBits0 & 65536) != 0) { return minScoreThresh_; } else { return MinScoreThreshDefaultValue; } } + set { + _hasBits0 |= 65536; + minScoreThresh_ = value; + } + } + /// Gets whether the "min_score_thresh" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThresh { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "min_score_thresh" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThresh() { + _hasBits0 &= ~65536; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteTensorsToDetectionsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteTensorsToDetectionsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumClasses != other.NumClasses) return false; + if (NumBoxes != other.NumBoxes) return false; + if (NumCoords != other.NumCoords) return false; + if (KeypointCoordOffset != other.KeypointCoordOffset) return false; + if (NumKeypoints != other.NumKeypoints) return false; + if (NumValuesPerKeypoint != other.NumValuesPerKeypoint) return false; + if (BoxCoordOffset != other.BoxCoordOffset) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XScale, other.XScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YScale, other.YScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WScale, other.WScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HScale, other.HScale)) return false; + if (ApplyExponentialOnBoxSize != other.ApplyExponentialOnBoxSize) return false; + if (ReverseOutputOrder != other.ReverseOutputOrder) return false; + if(!ignoreClasses_.Equals(other.ignoreClasses_)) return false; + if (SigmoidScore != other.SigmoidScore) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScoreClippingThresh, other.ScoreClippingThresh)) return false; + if (FlipVertically != other.FlipVertically) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThresh, other.MinScoreThresh)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumClasses) hash ^= NumClasses.GetHashCode(); + if (HasNumBoxes) hash ^= NumBoxes.GetHashCode(); + if (HasNumCoords) hash ^= NumCoords.GetHashCode(); + if (HasKeypointCoordOffset) hash ^= KeypointCoordOffset.GetHashCode(); + if (HasNumKeypoints) hash ^= NumKeypoints.GetHashCode(); + if (HasNumValuesPerKeypoint) hash ^= NumValuesPerKeypoint.GetHashCode(); + if (HasBoxCoordOffset) hash ^= BoxCoordOffset.GetHashCode(); + if (HasXScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XScale); + if (HasYScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YScale); + if (HasWScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WScale); + if (HasHScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HScale); + if (HasApplyExponentialOnBoxSize) hash ^= ApplyExponentialOnBoxSize.GetHashCode(); + if (HasReverseOutputOrder) hash ^= ReverseOutputOrder.GetHashCode(); + hash ^= ignoreClasses_.GetHashCode(); + if (HasSigmoidScore) hash ^= SigmoidScore.GetHashCode(); + if (HasScoreClippingThresh) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScoreClippingThresh); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasMinScoreThresh) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThresh); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumBoxes) { + output.WriteRawTag(16); + output.WriteInt32(NumBoxes); + } + if (HasNumCoords) { + output.WriteRawTag(24); + output.WriteInt32(NumCoords); + } + if (HasXScale) { + output.WriteRawTag(37); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(45); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(53); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(61); + output.WriteFloat(HScale); + } + ignoreClasses_.WriteTo(output, _repeated_ignoreClasses_codec); + if (HasKeypointCoordOffset) { + output.WriteRawTag(72); + output.WriteInt32(KeypointCoordOffset); + } + if (HasNumKeypoints) { + output.WriteRawTag(80); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(88); + output.WriteInt32(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + output.WriteRawTag(96); + output.WriteInt32(BoxCoordOffset); + } + if (HasApplyExponentialOnBoxSize) { + output.WriteRawTag(104); + output.WriteBool(ApplyExponentialOnBoxSize); + } + if (HasReverseOutputOrder) { + output.WriteRawTag(112); + output.WriteBool(ReverseOutputOrder); + } + if (HasSigmoidScore) { + output.WriteRawTag(120); + output.WriteBool(SigmoidScore); + } + if (HasScoreClippingThresh) { + output.WriteRawTag(133, 1); + output.WriteFloat(ScoreClippingThresh); + } + if (HasFlipVertically) { + output.WriteRawTag(144, 1); + output.WriteBool(FlipVertically); + } + if (HasMinScoreThresh) { + output.WriteRawTag(157, 1); + output.WriteFloat(MinScoreThresh); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumBoxes) { + output.WriteRawTag(16); + output.WriteInt32(NumBoxes); + } + if (HasNumCoords) { + output.WriteRawTag(24); + output.WriteInt32(NumCoords); + } + if (HasXScale) { + output.WriteRawTag(37); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(45); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(53); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(61); + output.WriteFloat(HScale); + } + ignoreClasses_.WriteTo(ref output, _repeated_ignoreClasses_codec); + if (HasKeypointCoordOffset) { + output.WriteRawTag(72); + output.WriteInt32(KeypointCoordOffset); + } + if (HasNumKeypoints) { + output.WriteRawTag(80); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(88); + output.WriteInt32(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + output.WriteRawTag(96); + output.WriteInt32(BoxCoordOffset); + } + if (HasApplyExponentialOnBoxSize) { + output.WriteRawTag(104); + output.WriteBool(ApplyExponentialOnBoxSize); + } + if (HasReverseOutputOrder) { + output.WriteRawTag(112); + output.WriteBool(ReverseOutputOrder); + } + if (HasSigmoidScore) { + output.WriteRawTag(120); + output.WriteBool(SigmoidScore); + } + if (HasScoreClippingThresh) { + output.WriteRawTag(133, 1); + output.WriteFloat(ScoreClippingThresh); + } + if (HasFlipVertically) { + output.WriteRawTag(144, 1); + output.WriteBool(FlipVertically); + } + if (HasMinScoreThresh) { + output.WriteRawTag(157, 1); + output.WriteFloat(MinScoreThresh); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumClasses) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumClasses); + } + if (HasNumBoxes) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumBoxes); + } + if (HasNumCoords) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumCoords); + } + if (HasKeypointCoordOffset) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(KeypointCoordOffset); + } + if (HasNumKeypoints) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumValuesPerKeypoint); + } + if (HasBoxCoordOffset) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCoordOffset); + } + if (HasXScale) { + size += 1 + 4; + } + if (HasYScale) { + size += 1 + 4; + } + if (HasWScale) { + size += 1 + 4; + } + if (HasHScale) { + size += 1 + 4; + } + if (HasApplyExponentialOnBoxSize) { + size += 1 + 1; + } + if (HasReverseOutputOrder) { + size += 1 + 1; + } + size += ignoreClasses_.CalculateSize(_repeated_ignoreClasses_codec); + if (HasSigmoidScore) { + size += 1 + 1; + } + if (HasScoreClippingThresh) { + size += 2 + 4; + } + if (HasFlipVertically) { + size += 2 + 1; + } + if (HasMinScoreThresh) { + size += 2 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteTensorsToDetectionsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumClasses) { + NumClasses = other.NumClasses; + } + if (other.HasNumBoxes) { + NumBoxes = other.NumBoxes; + } + if (other.HasNumCoords) { + NumCoords = other.NumCoords; + } + if (other.HasKeypointCoordOffset) { + KeypointCoordOffset = other.KeypointCoordOffset; + } + if (other.HasNumKeypoints) { + NumKeypoints = other.NumKeypoints; + } + if (other.HasNumValuesPerKeypoint) { + NumValuesPerKeypoint = other.NumValuesPerKeypoint; + } + if (other.HasBoxCoordOffset) { + BoxCoordOffset = other.BoxCoordOffset; + } + if (other.HasXScale) { + XScale = other.XScale; + } + if (other.HasYScale) { + YScale = other.YScale; + } + if (other.HasWScale) { + WScale = other.WScale; + } + if (other.HasHScale) { + HScale = other.HScale; + } + if (other.HasApplyExponentialOnBoxSize) { + ApplyExponentialOnBoxSize = other.ApplyExponentialOnBoxSize; + } + if (other.HasReverseOutputOrder) { + ReverseOutputOrder = other.ReverseOutputOrder; + } + ignoreClasses_.Add(other.ignoreClasses_); + if (other.HasSigmoidScore) { + SigmoidScore = other.SigmoidScore; + } + if (other.HasScoreClippingThresh) { + ScoreClippingThresh = other.ScoreClippingThresh; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasMinScoreThresh) { + MinScoreThresh = other.MinScoreThresh; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumBoxes = input.ReadInt32(); + break; + } + case 24: { + NumCoords = input.ReadInt32(); + break; + } + case 37: { + XScale = input.ReadFloat(); + break; + } + case 45: { + YScale = input.ReadFloat(); + break; + } + case 53: { + WScale = input.ReadFloat(); + break; + } + case 61: { + HScale = input.ReadFloat(); + break; + } + case 66: + case 64: { + ignoreClasses_.AddEntriesFrom(input, _repeated_ignoreClasses_codec); + break; + } + case 72: { + KeypointCoordOffset = input.ReadInt32(); + break; + } + case 80: { + NumKeypoints = input.ReadInt32(); + break; + } + case 88: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 96: { + BoxCoordOffset = input.ReadInt32(); + break; + } + case 104: { + ApplyExponentialOnBoxSize = input.ReadBool(); + break; + } + case 112: { + ReverseOutputOrder = input.ReadBool(); + break; + } + case 120: { + SigmoidScore = input.ReadBool(); + break; + } + case 133: { + ScoreClippingThresh = input.ReadFloat(); + break; + } + case 144: { + FlipVertically = input.ReadBool(); + break; + } + case 157: { + MinScoreThresh = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumBoxes = input.ReadInt32(); + break; + } + case 24: { + NumCoords = input.ReadInt32(); + break; + } + case 37: { + XScale = input.ReadFloat(); + break; + } + case 45: { + YScale = input.ReadFloat(); + break; + } + case 53: { + WScale = input.ReadFloat(); + break; + } + case 61: { + HScale = input.ReadFloat(); + break; + } + case 66: + case 64: { + ignoreClasses_.AddEntriesFrom(ref input, _repeated_ignoreClasses_codec); + break; + } + case 72: { + KeypointCoordOffset = input.ReadInt32(); + break; + } + case 80: { + NumKeypoints = input.ReadInt32(); + break; + } + case 88: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 96: { + BoxCoordOffset = input.ReadInt32(); + break; + } + case 104: { + ApplyExponentialOnBoxSize = input.ReadBool(); + break; + } + case 112: { + ReverseOutputOrder = input.ReadBool(); + break; + } + case 120: { + SigmoidScore = input.ReadBool(); + break; + } + case 133: { + ScoreClippingThresh = input.ReadFloat(); + break; + } + case 144: { + FlipVertically = input.ReadBool(); + break; + } + case 157: { + MinScoreThresh = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteTensorsToDetectionsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(246514968, pb::FieldCodec.ForMessage(1972119746, global::Mediapipe.TfLiteTensorsToDetectionsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs.meta new file mode 100644 index 0000000..a25f49b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToDetectionsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f2c19171d3384a4e95e02f1507cd9e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs new file mode 100644 index 0000000..994866f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs @@ -0,0 +1,682 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_tensors_to_landmarks_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_tensors_to_landmarks_calculator.proto + public static partial class TfliteTensorsToLandmarksCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_tensors_to_landmarks_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteTensorsToLandmarksCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkltZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV90ZW5zb3Jz", + "X3RvX2xhbmRtYXJrc19jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1l", + "ZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byKmBAopVGZMaXRl", + "VGVuc29yc1RvTGFuZG1hcmtzQ2FsY3VsYXRvck9wdGlvbnMSFQoNbnVtX2xh", + "bmRtYXJrcxgBIAEoBRIZChFpbnB1dF9pbWFnZV93aWR0aBgCIAEoBRIaChJp", + "bnB1dF9pbWFnZV9oZWlnaHQYAyABKAUSHgoPZmxpcF92ZXJ0aWNhbGx5GAQg", + "ASgIOgVmYWxzZRIgChFmbGlwX2hvcml6b250YWxseRgGIAEoCDoFZmFsc2US", + "FgoLbm9ybWFsaXplX3oYBSABKAI6ATESZAoVdmlzaWJpbGl0eV9hY3RpdmF0", + "aW9uGAcgASgOMj8ubWVkaWFwaXBlLlRmTGl0ZVRlbnNvcnNUb0xhbmRtYXJr", + "c0NhbGN1bGF0b3JPcHRpb25zLkFjdGl2YXRpb246BE5PTkUSYgoTcHJlc2Vu", + "Y2VfYWN0aXZhdGlvbhgIIAEoDjI/Lm1lZGlhcGlwZS5UZkxpdGVUZW5zb3Jz", + "VG9MYW5kbWFya3NDYWxjdWxhdG9yT3B0aW9ucy5BY3RpdmF0aW9uOgROT05F", + "IiMKCkFjdGl2YXRpb24SCAoETk9ORRAAEgsKB1NJR01PSUQQATJiCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYyuDeeiABKAsyNC5tZWRp", + "YXBpcGUuVGZMaXRlVGVuc29yc1RvTGFuZG1hcmtzQ2FsY3VsYXRvck9wdGlv", + "bnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions), global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Parser, new[]{ "NumLandmarks", "InputImageWidth", "InputImageHeight", "FlipVertically", "FlipHorizontally", "NormalizeZ", "VisibilityActivation", "PresenceActivation" }, null, new[]{ typeof(global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation) }, new pb::Extension[] { global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TfLiteTensorsToLandmarksCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteTensorsToLandmarksCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteTensorsToLandmarksCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToLandmarksCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToLandmarksCalculatorOptions(TfLiteTensorsToLandmarksCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numLandmarks_ = other.numLandmarks_; + inputImageWidth_ = other.inputImageWidth_; + inputImageHeight_ = other.inputImageHeight_; + flipVertically_ = other.flipVertically_; + flipHorizontally_ = other.flipHorizontally_; + normalizeZ_ = other.normalizeZ_; + visibilityActivation_ = other.visibilityActivation_; + presenceActivation_ = other.presenceActivation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToLandmarksCalculatorOptions Clone() { + return new TfLiteTensorsToLandmarksCalculatorOptions(this); + } + + /// Field number for the "num_landmarks" field. + public const int NumLandmarksFieldNumber = 1; + private readonly static int NumLandmarksDefaultValue = 0; + + private int numLandmarks_; + /// + /// Number of landmarks from the output of the model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumLandmarks { + get { if ((_hasBits0 & 1) != 0) { return numLandmarks_; } else { return NumLandmarksDefaultValue; } } + set { + _hasBits0 |= 1; + numLandmarks_ = value; + } + } + /// Gets whether the "num_landmarks" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumLandmarks { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_landmarks" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumLandmarks() { + _hasBits0 &= ~1; + } + + /// Field number for the "input_image_width" field. + public const int InputImageWidthFieldNumber = 2; + private readonly static int InputImageWidthDefaultValue = 0; + + private int inputImageWidth_; + /// + /// Size of the input image for the model. These options are used only when + /// normalized landmarks are needed. Z coordinate is scaled as X assuming + /// a weak perspective projection camera model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputImageWidth { + get { if ((_hasBits0 & 2) != 0) { return inputImageWidth_; } else { return InputImageWidthDefaultValue; } } + set { + _hasBits0 |= 2; + inputImageWidth_ = value; + } + } + /// Gets whether the "input_image_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputImageWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "input_image_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputImageWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "input_image_height" field. + public const int InputImageHeightFieldNumber = 3; + private readonly static int InputImageHeightDefaultValue = 0; + + private int inputImageHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InputImageHeight { + get { if ((_hasBits0 & 4) != 0) { return inputImageHeight_; } else { return InputImageHeightDefaultValue; } } + set { + _hasBits0 |= 4; + inputImageHeight_ = value; + } + } + /// Gets whether the "input_image_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputImageHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "input_image_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputImageHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 4; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// vertically (along the y-direction). This is useful, for example, when the + /// input tensors represent detections defined with a coordinate system where + /// the origin is at the top-left corner, whereas the desired detection + /// representation has a bottom-left origin (e.g., in OpenGL). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 8) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 8; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~8; + } + + /// Field number for the "flip_horizontally" field. + public const int FlipHorizontallyFieldNumber = 6; + private readonly static bool FlipHorizontallyDefaultValue = false; + + private bool flipHorizontally_; + /// + /// Whether the detection coordinates from the input tensors should be flipped + /// horizontally (along the x-direction). This is useful, for example, when the + /// input image is horizontally flipped in ImageTransformationCalculator + /// beforehand. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipHorizontally { + get { if ((_hasBits0 & 32) != 0) { return flipHorizontally_; } else { return FlipHorizontallyDefaultValue; } } + set { + _hasBits0 |= 32; + flipHorizontally_ = value; + } + } + /// Gets whether the "flip_horizontally" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipHorizontally { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "flip_horizontally" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipHorizontally() { + _hasBits0 &= ~32; + } + + /// Field number for the "normalize_z" field. + public const int NormalizeZFieldNumber = 5; + private readonly static float NormalizeZDefaultValue = 1F; + + private float normalizeZ_; + /// + /// A value that Z coordinates should be divided by. This option is used only + /// when normalized landmarks are needed. It is applied in addition to Z + /// coordinate being re-scaled as X. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizeZ { + get { if ((_hasBits0 & 16) != 0) { return normalizeZ_; } else { return NormalizeZDefaultValue; } } + set { + _hasBits0 |= 16; + normalizeZ_ = value; + } + } + /// Gets whether the "normalize_z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizeZ { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalize_z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizeZ() { + _hasBits0 &= ~16; + } + + /// Field number for the "visibility_activation" field. + public const int VisibilityActivationFieldNumber = 7; + private readonly static global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation VisibilityActivationDefaultValue = global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation visibilityActivation_; + /// + /// Apply activation function to the tensor representing landmark visibility. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation VisibilityActivation { + get { if ((_hasBits0 & 64) != 0) { return visibilityActivation_; } else { return VisibilityActivationDefaultValue; } } + set { + _hasBits0 |= 64; + visibilityActivation_ = value; + } + } + /// Gets whether the "visibility_activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisibilityActivation { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "visibility_activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisibilityActivation() { + _hasBits0 &= ~64; + } + + /// Field number for the "presence_activation" field. + public const int PresenceActivationFieldNumber = 8; + private readonly static global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation PresenceActivationDefaultValue = global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation.None; + + private global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation presenceActivation_; + /// + /// Apply activation function to the tensor representing landmark presence. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation PresenceActivation { + get { if ((_hasBits0 & 128) != 0) { return presenceActivation_; } else { return PresenceActivationDefaultValue; } } + set { + _hasBits0 |= 128; + presenceActivation_ = value; + } + } + /// Gets whether the "presence_activation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPresenceActivation { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "presence_activation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPresenceActivation() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteTensorsToLandmarksCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteTensorsToLandmarksCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumLandmarks != other.NumLandmarks) return false; + if (InputImageWidth != other.InputImageWidth) return false; + if (InputImageHeight != other.InputImageHeight) return false; + if (FlipVertically != other.FlipVertically) return false; + if (FlipHorizontally != other.FlipHorizontally) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizeZ, other.NormalizeZ)) return false; + if (VisibilityActivation != other.VisibilityActivation) return false; + if (PresenceActivation != other.PresenceActivation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumLandmarks) hash ^= NumLandmarks.GetHashCode(); + if (HasInputImageWidth) hash ^= InputImageWidth.GetHashCode(); + if (HasInputImageHeight) hash ^= InputImageHeight.GetHashCode(); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (HasFlipHorizontally) hash ^= FlipHorizontally.GetHashCode(); + if (HasNormalizeZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizeZ); + if (HasVisibilityActivation) hash ^= VisibilityActivation.GetHashCode(); + if (HasPresenceActivation) hash ^= PresenceActivation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumLandmarks) { + output.WriteRawTag(8); + output.WriteInt32(NumLandmarks); + } + if (HasInputImageWidth) { + output.WriteRawTag(16); + output.WriteInt32(InputImageWidth); + } + if (HasInputImageHeight) { + output.WriteRawTag(24); + output.WriteInt32(InputImageHeight); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasNormalizeZ) { + output.WriteRawTag(45); + output.WriteFloat(NormalizeZ); + } + if (HasFlipHorizontally) { + output.WriteRawTag(48); + output.WriteBool(FlipHorizontally); + } + if (HasVisibilityActivation) { + output.WriteRawTag(56); + output.WriteEnum((int) VisibilityActivation); + } + if (HasPresenceActivation) { + output.WriteRawTag(64); + output.WriteEnum((int) PresenceActivation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumLandmarks) { + output.WriteRawTag(8); + output.WriteInt32(NumLandmarks); + } + if (HasInputImageWidth) { + output.WriteRawTag(16); + output.WriteInt32(InputImageWidth); + } + if (HasInputImageHeight) { + output.WriteRawTag(24); + output.WriteInt32(InputImageHeight); + } + if (HasFlipVertically) { + output.WriteRawTag(32); + output.WriteBool(FlipVertically); + } + if (HasNormalizeZ) { + output.WriteRawTag(45); + output.WriteFloat(NormalizeZ); + } + if (HasFlipHorizontally) { + output.WriteRawTag(48); + output.WriteBool(FlipHorizontally); + } + if (HasVisibilityActivation) { + output.WriteRawTag(56); + output.WriteEnum((int) VisibilityActivation); + } + if (HasPresenceActivation) { + output.WriteRawTag(64); + output.WriteEnum((int) PresenceActivation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumLandmarks) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLandmarks); + } + if (HasInputImageWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputImageWidth); + } + if (HasInputImageHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputImageHeight); + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (HasFlipHorizontally) { + size += 1 + 1; + } + if (HasNormalizeZ) { + size += 1 + 4; + } + if (HasVisibilityActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) VisibilityActivation); + } + if (HasPresenceActivation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PresenceActivation); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteTensorsToLandmarksCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumLandmarks) { + NumLandmarks = other.NumLandmarks; + } + if (other.HasInputImageWidth) { + InputImageWidth = other.InputImageWidth; + } + if (other.HasInputImageHeight) { + InputImageHeight = other.InputImageHeight; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + if (other.HasFlipHorizontally) { + FlipHorizontally = other.FlipHorizontally; + } + if (other.HasNormalizeZ) { + NormalizeZ = other.NormalizeZ; + } + if (other.HasVisibilityActivation) { + VisibilityActivation = other.VisibilityActivation; + } + if (other.HasPresenceActivation) { + PresenceActivation = other.PresenceActivation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumLandmarks = input.ReadInt32(); + break; + } + case 16: { + InputImageWidth = input.ReadInt32(); + break; + } + case 24: { + InputImageHeight = input.ReadInt32(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 45: { + NormalizeZ = input.ReadFloat(); + break; + } + case 48: { + FlipHorizontally = input.ReadBool(); + break; + } + case 56: { + VisibilityActivation = (global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 64: { + PresenceActivation = (global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumLandmarks = input.ReadInt32(); + break; + } + case 16: { + InputImageWidth = input.ReadInt32(); + break; + } + case 24: { + InputImageHeight = input.ReadInt32(); + break; + } + case 32: { + FlipVertically = input.ReadBool(); + break; + } + case 45: { + NormalizeZ = input.ReadFloat(); + break; + } + case 48: { + FlipHorizontally = input.ReadBool(); + break; + } + case 56: { + VisibilityActivation = (global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + case 64: { + PresenceActivation = (global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Types.Activation) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TfLiteTensorsToLandmarksCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Activation { + [pbr::OriginalName("NONE")] None = 0, + [pbr::OriginalName("SIGMOID")] Sigmoid = 1, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteTensorsToLandmarksCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(257405002, pb::FieldCodec.ForMessage(2059240018, global::Mediapipe.TfLiteTensorsToLandmarksCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs.meta new file mode 100644 index 0000000..3b0dd3e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToLandmarksCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52844e1e379393aefb93922f09d6c720 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs new file mode 100644 index 0000000..5bdfd06 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs @@ -0,0 +1,546 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/tflite/tflite_tensors_to_segmentation_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/tflite/tflite_tensors_to_segmentation_calculator.proto + public static partial class TfliteTensorsToSegmentationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/tflite/tflite_tensors_to_segmentation_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteTensorsToSegmentationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkxtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdGZsaXRlL3RmbGl0ZV90ZW5zb3Jz", + "X3RvX3NlZ21lbnRhdGlvbl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUa", + "JG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byK7AgosVGZM", + "aXRlVGVuc29yc1RvU2VnbWVudGF0aW9uQ2FsY3VsYXRvck9wdGlvbnMSFAoM", + "dGVuc29yX3dpZHRoGAEgASgFEhUKDXRlbnNvcl9oZWlnaHQYAiABKAUSFwoP", + "dGVuc29yX2NoYW5uZWxzGAMgASgFEiYKG2NvbWJpbmVfd2l0aF9wcmV2aW91", + "c19yYXRpbxgEIAEoAjoBMRIdChJvdXRwdXRfbGF5ZXJfaW5kZXgYBSABKAU6", + "ATESFwoPZmxpcF92ZXJ0aWNhbGx5GAYgASgIMmUKA2V4dBIcLm1lZGlhcGlw", + "ZS5DYWxjdWxhdG9yT3B0aW9ucxjK+7R4IAEoCzI3Lm1lZGlhcGlwZS5UZkxp", + "dGVUZW5zb3JzVG9TZWdtZW50YXRpb25DYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteTensorsToSegmentationCalculatorOptions), global::Mediapipe.TfLiteTensorsToSegmentationCalculatorOptions.Parser, new[]{ "TensorWidth", "TensorHeight", "TensorChannels", "CombineWithPreviousRatio", "OutputLayerIndex", "FlipVertically" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteTensorsToSegmentationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TfLiteTensorsToSegmentationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteTensorsToSegmentationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteTensorsToSegmentationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToSegmentationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToSegmentationCalculatorOptions(TfLiteTensorsToSegmentationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + tensorWidth_ = other.tensorWidth_; + tensorHeight_ = other.tensorHeight_; + tensorChannels_ = other.tensorChannels_; + combineWithPreviousRatio_ = other.combineWithPreviousRatio_; + outputLayerIndex_ = other.outputLayerIndex_; + flipVertically_ = other.flipVertically_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToSegmentationCalculatorOptions Clone() { + return new TfLiteTensorsToSegmentationCalculatorOptions(this); + } + + /// Field number for the "tensor_width" field. + public const int TensorWidthFieldNumber = 1; + private readonly static int TensorWidthDefaultValue = 0; + + private int tensorWidth_; + /// + /// Dimensions of input segmentation tensor to process. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TensorWidth { + get { if ((_hasBits0 & 1) != 0) { return tensorWidth_; } else { return TensorWidthDefaultValue; } } + set { + _hasBits0 |= 1; + tensorWidth_ = value; + } + } + /// Gets whether the "tensor_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTensorWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "tensor_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTensorWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "tensor_height" field. + public const int TensorHeightFieldNumber = 2; + private readonly static int TensorHeightDefaultValue = 0; + + private int tensorHeight_; + /// + /// required + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TensorHeight { + get { if ((_hasBits0 & 2) != 0) { return tensorHeight_; } else { return TensorHeightDefaultValue; } } + set { + _hasBits0 |= 2; + tensorHeight_ = value; + } + } + /// Gets whether the "tensor_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTensorHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "tensor_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTensorHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "tensor_channels" field. + public const int TensorChannelsFieldNumber = 3; + private readonly static int TensorChannelsDefaultValue = 0; + + private int tensorChannels_; + /// + /// required + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TensorChannels { + get { if ((_hasBits0 & 4) != 0) { return tensorChannels_; } else { return TensorChannelsDefaultValue; } } + set { + _hasBits0 |= 4; + tensorChannels_ = value; + } + } + /// Gets whether the "tensor_channels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTensorChannels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "tensor_channels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTensorChannels() { + _hasBits0 &= ~4; + } + + /// Field number for the "combine_with_previous_ratio" field. + public const int CombineWithPreviousRatioFieldNumber = 4; + private readonly static float CombineWithPreviousRatioDefaultValue = 1F; + + private float combineWithPreviousRatio_; + /// + /// How much to use previous mask when computing current one; range [0-1]. + /// This is a tradeoff between responsiveness (0.0) and accuracy (1.0). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CombineWithPreviousRatio { + get { if ((_hasBits0 & 8) != 0) { return combineWithPreviousRatio_; } else { return CombineWithPreviousRatioDefaultValue; } } + set { + _hasBits0 |= 8; + combineWithPreviousRatio_ = value; + } + } + /// Gets whether the "combine_with_previous_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCombineWithPreviousRatio { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "combine_with_previous_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCombineWithPreviousRatio() { + _hasBits0 &= ~8; + } + + /// Field number for the "output_layer_index" field. + public const int OutputLayerIndexFieldNumber = 5; + private readonly static int OutputLayerIndexDefaultValue = 1; + + private int outputLayerIndex_; + /// + /// Model specific: Channel to use for processing tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputLayerIndex { + get { if ((_hasBits0 & 16) != 0) { return outputLayerIndex_; } else { return OutputLayerIndexDefaultValue; } } + set { + _hasBits0 |= 16; + outputLayerIndex_ = value; + } + } + /// Gets whether the "output_layer_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputLayerIndex { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "output_layer_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputLayerIndex() { + _hasBits0 &= ~16; + } + + /// Field number for the "flip_vertically" field. + public const int FlipVerticallyFieldNumber = 6; + private readonly static bool FlipVerticallyDefaultValue = false; + + private bool flipVertically_; + /// + /// Flip result image mask along y-axis. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertically { + get { if ((_hasBits0 & 32) != 0) { return flipVertically_; } else { return FlipVerticallyDefaultValue; } } + set { + _hasBits0 |= 32; + flipVertically_ = value; + } + } + /// Gets whether the "flip_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertically { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "flip_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertically() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteTensorsToSegmentationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteTensorsToSegmentationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TensorWidth != other.TensorWidth) return false; + if (TensorHeight != other.TensorHeight) return false; + if (TensorChannels != other.TensorChannels) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CombineWithPreviousRatio, other.CombineWithPreviousRatio)) return false; + if (OutputLayerIndex != other.OutputLayerIndex) return false; + if (FlipVertically != other.FlipVertically) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTensorWidth) hash ^= TensorWidth.GetHashCode(); + if (HasTensorHeight) hash ^= TensorHeight.GetHashCode(); + if (HasTensorChannels) hash ^= TensorChannels.GetHashCode(); + if (HasCombineWithPreviousRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CombineWithPreviousRatio); + if (HasOutputLayerIndex) hash ^= OutputLayerIndex.GetHashCode(); + if (HasFlipVertically) hash ^= FlipVertically.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTensorWidth) { + output.WriteRawTag(8); + output.WriteInt32(TensorWidth); + } + if (HasTensorHeight) { + output.WriteRawTag(16); + output.WriteInt32(TensorHeight); + } + if (HasTensorChannels) { + output.WriteRawTag(24); + output.WriteInt32(TensorChannels); + } + if (HasCombineWithPreviousRatio) { + output.WriteRawTag(37); + output.WriteFloat(CombineWithPreviousRatio); + } + if (HasOutputLayerIndex) { + output.WriteRawTag(40); + output.WriteInt32(OutputLayerIndex); + } + if (HasFlipVertically) { + output.WriteRawTag(48); + output.WriteBool(FlipVertically); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTensorWidth) { + output.WriteRawTag(8); + output.WriteInt32(TensorWidth); + } + if (HasTensorHeight) { + output.WriteRawTag(16); + output.WriteInt32(TensorHeight); + } + if (HasTensorChannels) { + output.WriteRawTag(24); + output.WriteInt32(TensorChannels); + } + if (HasCombineWithPreviousRatio) { + output.WriteRawTag(37); + output.WriteFloat(CombineWithPreviousRatio); + } + if (HasOutputLayerIndex) { + output.WriteRawTag(40); + output.WriteInt32(OutputLayerIndex); + } + if (HasFlipVertically) { + output.WriteRawTag(48); + output.WriteBool(FlipVertically); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTensorWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TensorWidth); + } + if (HasTensorHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TensorHeight); + } + if (HasTensorChannels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TensorChannels); + } + if (HasCombineWithPreviousRatio) { + size += 1 + 4; + } + if (HasOutputLayerIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputLayerIndex); + } + if (HasFlipVertically) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteTensorsToSegmentationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTensorWidth) { + TensorWidth = other.TensorWidth; + } + if (other.HasTensorHeight) { + TensorHeight = other.TensorHeight; + } + if (other.HasTensorChannels) { + TensorChannels = other.TensorChannels; + } + if (other.HasCombineWithPreviousRatio) { + CombineWithPreviousRatio = other.CombineWithPreviousRatio; + } + if (other.HasOutputLayerIndex) { + OutputLayerIndex = other.OutputLayerIndex; + } + if (other.HasFlipVertically) { + FlipVertically = other.FlipVertically; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TensorWidth = input.ReadInt32(); + break; + } + case 16: { + TensorHeight = input.ReadInt32(); + break; + } + case 24: { + TensorChannels = input.ReadInt32(); + break; + } + case 37: { + CombineWithPreviousRatio = input.ReadFloat(); + break; + } + case 40: { + OutputLayerIndex = input.ReadInt32(); + break; + } + case 48: { + FlipVertically = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TensorWidth = input.ReadInt32(); + break; + } + case 16: { + TensorHeight = input.ReadInt32(); + break; + } + case 24: { + TensorChannels = input.ReadInt32(); + break; + } + case 37: { + CombineWithPreviousRatio = input.ReadFloat(); + break; + } + case 40: { + OutputLayerIndex = input.ReadInt32(); + break; + } + case 48: { + FlipVertically = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteTensorsToSegmentationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(252526026, pb::FieldCodec.ForMessage(2020208210, global::Mediapipe.TfLiteTensorsToSegmentationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs.meta new file mode 100644 index 0000000..559f9bb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tflite/TfliteTensorsToSegmentationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a98aa11cb63ebc2ec8ed09953882168b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util.meta new file mode 100644 index 0000000..78b10c1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cbe75cdb100c07344b9d373c32d9c265 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs new file mode 100644 index 0000000..dda7e70 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs @@ -0,0 +1,550 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/annotation_overlay_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/annotation_overlay_calculator.proto + public static partial class AnnotationOverlayCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/annotation_overlay_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AnnotationOverlayCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9hbm5vdGF0aW9uX292ZXJs", + "YXlfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3IucHJvdG8aGm1lZGlhcGlwZS91dGlsL2NvbG9y", + "LnByb3RvItICCiJBbm5vdGF0aW9uT3ZlcmxheUNhbGN1bGF0b3JPcHRpb25z", + "Eh0KD2NhbnZhc193aWR0aF9weBgCIAEoBToEMTkyMBIeChBjYW52YXNfaGVp", + "Z2h0X3B4GAMgASgFOgQxMDgwEiYKDGNhbnZhc19jb2xvchgEIAEoCzIQLm1l", + "ZGlhcGlwZS5Db2xvchIjChRmbGlwX3RleHRfdmVydGljYWxseRgFIAEoCDoF", + "ZmFsc2USJgoYZ3B1X3VzZXNfdG9wX2xlZnRfb3JpZ2luGAYgASgIOgR0cnVl", + "EhsKEGdwdV9zY2FsZV9mYWN0b3IYByABKAI6ATEyWwoDZXh0EhwubWVkaWFw", + "aXBlLkNhbGN1bGF0b3JPcHRpb25zGIfwv3cgASgLMi0ubWVkaWFwaXBlLkFu", + "bm90YXRpb25PdmVybGF5Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AnnotationOverlayCalculatorOptions), global::Mediapipe.AnnotationOverlayCalculatorOptions.Parser, new[]{ "CanvasWidthPx", "CanvasHeightPx", "CanvasColor", "FlipTextVertically", "GpuUsesTopLeftOrigin", "GpuScaleFactor" }, null, null, new pb::Extension[] { global::Mediapipe.AnnotationOverlayCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options for the AnnotationOverlayCalculator. + /// + public sealed partial class AnnotationOverlayCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AnnotationOverlayCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationOverlayCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotationOverlayCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotationOverlayCalculatorOptions(AnnotationOverlayCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + canvasWidthPx_ = other.canvasWidthPx_; + canvasHeightPx_ = other.canvasHeightPx_; + canvasColor_ = other.canvasColor_ != null ? other.canvasColor_.Clone() : null; + flipTextVertically_ = other.flipTextVertically_; + gpuUsesTopLeftOrigin_ = other.gpuUsesTopLeftOrigin_; + gpuScaleFactor_ = other.gpuScaleFactor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotationOverlayCalculatorOptions Clone() { + return new AnnotationOverlayCalculatorOptions(this); + } + + /// Field number for the "canvas_width_px" field. + public const int CanvasWidthPxFieldNumber = 2; + private readonly static int CanvasWidthPxDefaultValue = 1920; + + private int canvasWidthPx_; + /// + /// The canvas width and height in pixels, and the background color. These + /// options are used only if an input stream of ImageFrame isn't provided to + /// the renderer calculator. If an input stream of ImageFrame is provided, then + /// the calculator renders the annotations on top of the provided image, else a + /// canvas is created with the dimensions and background color specified in + /// these options and the annotations are rendered on top of this canvas. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CanvasWidthPx { + get { if ((_hasBits0 & 1) != 0) { return canvasWidthPx_; } else { return CanvasWidthPxDefaultValue; } } + set { + _hasBits0 |= 1; + canvasWidthPx_ = value; + } + } + /// Gets whether the "canvas_width_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCanvasWidthPx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "canvas_width_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCanvasWidthPx() { + _hasBits0 &= ~1; + } + + /// Field number for the "canvas_height_px" field. + public const int CanvasHeightPxFieldNumber = 3; + private readonly static int CanvasHeightPxDefaultValue = 1080; + + private int canvasHeightPx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CanvasHeightPx { + get { if ((_hasBits0 & 2) != 0) { return canvasHeightPx_; } else { return CanvasHeightPxDefaultValue; } } + set { + _hasBits0 |= 2; + canvasHeightPx_ = value; + } + } + /// Gets whether the "canvas_height_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCanvasHeightPx { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "canvas_height_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCanvasHeightPx() { + _hasBits0 &= ~2; + } + + /// Field number for the "canvas_color" field. + public const int CanvasColorFieldNumber = 4; + private global::Mediapipe.Color canvasColor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color CanvasColor { + get { return canvasColor_; } + set { + canvasColor_ = value; + } + } + + /// Field number for the "flip_text_vertically" field. + public const int FlipTextVerticallyFieldNumber = 5; + private readonly static bool FlipTextVerticallyDefaultValue = false; + + private bool flipTextVertically_; + /// + /// Whether text should be rendered upside down. When it's set to false, text + /// is rendered normally assuming the underlying image has its origin at the + /// top-left corner. Therefore, for images with the origin at the bottom-left + /// corner this should be set to true. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipTextVertically { + get { if ((_hasBits0 & 4) != 0) { return flipTextVertically_; } else { return FlipTextVerticallyDefaultValue; } } + set { + _hasBits0 |= 4; + flipTextVertically_ = value; + } + } + /// Gets whether the "flip_text_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipTextVertically { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "flip_text_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipTextVertically() { + _hasBits0 &= ~4; + } + + /// Field number for the "gpu_uses_top_left_origin" field. + public const int GpuUsesTopLeftOriginFieldNumber = 6; + private readonly static bool GpuUsesTopLeftOriginDefaultValue = true; + + private bool gpuUsesTopLeftOrigin_; + /// + /// Whether input stream IMAGE_GPU (OpenGL texture) has bottom-left or top-left + /// origin. (Historically, OpenGL uses bottom left origin, but most MediaPipe + /// examples expect textures to have top-left origin.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool GpuUsesTopLeftOrigin { + get { if ((_hasBits0 & 8) != 0) { return gpuUsesTopLeftOrigin_; } else { return GpuUsesTopLeftOriginDefaultValue; } } + set { + _hasBits0 |= 8; + gpuUsesTopLeftOrigin_ = value; + } + } + /// Gets whether the "gpu_uses_top_left_origin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuUsesTopLeftOrigin { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "gpu_uses_top_left_origin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuUsesTopLeftOrigin() { + _hasBits0 &= ~8; + } + + /// Field number for the "gpu_scale_factor" field. + public const int GpuScaleFactorFieldNumber = 7; + private readonly static float GpuScaleFactorDefaultValue = 1F; + + private float gpuScaleFactor_; + /// + /// Scale factor for intermediate image for GPU rendering. + /// This can be used to speed up annotation by drawing the annotation on an + /// intermediate image with a reduced scale, e.g. 0.5 (of the input image width + /// and height), before resizing and overlaying it on top of the input image. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GpuScaleFactor { + get { if ((_hasBits0 & 16) != 0) { return gpuScaleFactor_; } else { return GpuScaleFactorDefaultValue; } } + set { + _hasBits0 |= 16; + gpuScaleFactor_ = value; + } + } + /// Gets whether the "gpu_scale_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuScaleFactor { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "gpu_scale_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuScaleFactor() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AnnotationOverlayCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AnnotationOverlayCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CanvasWidthPx != other.CanvasWidthPx) return false; + if (CanvasHeightPx != other.CanvasHeightPx) return false; + if (!object.Equals(CanvasColor, other.CanvasColor)) return false; + if (FlipTextVertically != other.FlipTextVertically) return false; + if (GpuUsesTopLeftOrigin != other.GpuUsesTopLeftOrigin) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GpuScaleFactor, other.GpuScaleFactor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCanvasWidthPx) hash ^= CanvasWidthPx.GetHashCode(); + if (HasCanvasHeightPx) hash ^= CanvasHeightPx.GetHashCode(); + if (canvasColor_ != null) hash ^= CanvasColor.GetHashCode(); + if (HasFlipTextVertically) hash ^= FlipTextVertically.GetHashCode(); + if (HasGpuUsesTopLeftOrigin) hash ^= GpuUsesTopLeftOrigin.GetHashCode(); + if (HasGpuScaleFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GpuScaleFactor); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCanvasWidthPx) { + output.WriteRawTag(16); + output.WriteInt32(CanvasWidthPx); + } + if (HasCanvasHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(CanvasHeightPx); + } + if (canvasColor_ != null) { + output.WriteRawTag(34); + output.WriteMessage(CanvasColor); + } + if (HasFlipTextVertically) { + output.WriteRawTag(40); + output.WriteBool(FlipTextVertically); + } + if (HasGpuUsesTopLeftOrigin) { + output.WriteRawTag(48); + output.WriteBool(GpuUsesTopLeftOrigin); + } + if (HasGpuScaleFactor) { + output.WriteRawTag(61); + output.WriteFloat(GpuScaleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCanvasWidthPx) { + output.WriteRawTag(16); + output.WriteInt32(CanvasWidthPx); + } + if (HasCanvasHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(CanvasHeightPx); + } + if (canvasColor_ != null) { + output.WriteRawTag(34); + output.WriteMessage(CanvasColor); + } + if (HasFlipTextVertically) { + output.WriteRawTag(40); + output.WriteBool(FlipTextVertically); + } + if (HasGpuUsesTopLeftOrigin) { + output.WriteRawTag(48); + output.WriteBool(GpuUsesTopLeftOrigin); + } + if (HasGpuScaleFactor) { + output.WriteRawTag(61); + output.WriteFloat(GpuScaleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCanvasWidthPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CanvasWidthPx); + } + if (HasCanvasHeightPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CanvasHeightPx); + } + if (canvasColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CanvasColor); + } + if (HasFlipTextVertically) { + size += 1 + 1; + } + if (HasGpuUsesTopLeftOrigin) { + size += 1 + 1; + } + if (HasGpuScaleFactor) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AnnotationOverlayCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasCanvasWidthPx) { + CanvasWidthPx = other.CanvasWidthPx; + } + if (other.HasCanvasHeightPx) { + CanvasHeightPx = other.CanvasHeightPx; + } + if (other.canvasColor_ != null) { + if (canvasColor_ == null) { + CanvasColor = new global::Mediapipe.Color(); + } + CanvasColor.MergeFrom(other.CanvasColor); + } + if (other.HasFlipTextVertically) { + FlipTextVertically = other.FlipTextVertically; + } + if (other.HasGpuUsesTopLeftOrigin) { + GpuUsesTopLeftOrigin = other.GpuUsesTopLeftOrigin; + } + if (other.HasGpuScaleFactor) { + GpuScaleFactor = other.GpuScaleFactor; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + CanvasWidthPx = input.ReadInt32(); + break; + } + case 24: { + CanvasHeightPx = input.ReadInt32(); + break; + } + case 34: { + if (canvasColor_ == null) { + CanvasColor = new global::Mediapipe.Color(); + } + input.ReadMessage(CanvasColor); + break; + } + case 40: { + FlipTextVertically = input.ReadBool(); + break; + } + case 48: { + GpuUsesTopLeftOrigin = input.ReadBool(); + break; + } + case 61: { + GpuScaleFactor = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16: { + CanvasWidthPx = input.ReadInt32(); + break; + } + case 24: { + CanvasHeightPx = input.ReadInt32(); + break; + } + case 34: { + if (canvasColor_ == null) { + CanvasColor = new global::Mediapipe.Color(); + } + input.ReadMessage(CanvasColor); + break; + } + case 40: { + FlipTextVertically = input.ReadBool(); + break; + } + case 48: { + GpuUsesTopLeftOrigin = input.ReadBool(); + break; + } + case 61: { + GpuScaleFactor = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the AnnotationOverlayCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(250607623, pb::FieldCodec.ForMessage(2004860986, global::Mediapipe.AnnotationOverlayCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs.meta new file mode 100644 index 0000000..93a5c5c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AnnotationOverlayCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fff2f7b8f06e229a4aa450a9b6b74c8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs new file mode 100644 index 0000000..d899933 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs @@ -0,0 +1,263 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/association_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/association_calculator.proto + public static partial class AssociationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/association_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AssociationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjdtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9hc3NvY2lhdGlvbl9jYWxj", + "dWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsv", + "Y2FsY3VsYXRvci5wcm90byKbAQocQXNzb2NpYXRpb25DYWxjdWxhdG9yT3B0", + "aW9ucxIjChhtaW5fc2ltaWxhcml0eV90aHJlc2hvbGQYASABKAI6ATEyVgoD", + "ZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGO+kmIMBIAEoCzIn", + "Lm1lZGlhcGlwZS5Bc3NvY2lhdGlvbkNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AssociationCalculatorOptions), global::Mediapipe.AssociationCalculatorOptions.Parser, new[]{ "MinSimilarityThreshold" }, null, null, new pb::Extension[] { global::Mediapipe.AssociationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class AssociationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AssociationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AssociationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociationCalculatorOptions(AssociationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minSimilarityThreshold_ = other.minSimilarityThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociationCalculatorOptions Clone() { + return new AssociationCalculatorOptions(this); + } + + /// Field number for the "min_similarity_threshold" field. + public const int MinSimilarityThresholdFieldNumber = 1; + private readonly static float MinSimilarityThresholdDefaultValue = 1F; + + private float minSimilarityThreshold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinSimilarityThreshold { + get { if ((_hasBits0 & 1) != 0) { return minSimilarityThreshold_; } else { return MinSimilarityThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + minSimilarityThreshold_ = value; + } + } + /// Gets whether the "min_similarity_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinSimilarityThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_similarity_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinSimilarityThreshold() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AssociationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AssociationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinSimilarityThreshold, other.MinSimilarityThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinSimilarityThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinSimilarityThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinSimilarityThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinSimilarityThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinSimilarityThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MinSimilarityThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinSimilarityThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AssociationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinSimilarityThreshold) { + MinSimilarityThreshold = other.MinSimilarityThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinSimilarityThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinSimilarityThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the AssociationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(275124847, pb::FieldCodec.ForMessage(2200998778, global::Mediapipe.AssociationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs.meta new file mode 100644 index 0000000..69fdbc9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/AssociationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5bb6bacc9e2a14719818f4c64c3c7f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs new file mode 100644 index 0000000..8f3b21d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs @@ -0,0 +1,389 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/detection_label_id_to_text_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/detection_label_id_to_text_calculator.proto + public static partial class DetectionLabelIdToTextCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/detection_label_id_to_text_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DetectionLabelIdToTextCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkZtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9kZXRlY3Rpb25fbGFiZWxf", + "aWRfdG9fdGV4dF9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlh", + "cGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90bxoebWVkaWFwaXBlL3V0", + "aWwvbGFiZWxfbWFwLnByb3RvIu4CCidEZXRlY3Rpb25MYWJlbElkVG9UZXh0", + "Q2FsY3VsYXRvck9wdGlvbnMSFgoObGFiZWxfbWFwX3BhdGgYASABKAkSDQoF", + "bGFiZWwYAiADKAkSFQoNa2VlcF9sYWJlbF9pZBgDIAEoCBJXCgtsYWJlbF9p", + "dGVtcxgEIAMoCzJCLm1lZGlhcGlwZS5EZXRlY3Rpb25MYWJlbElkVG9UZXh0", + "Q2FsY3VsYXRvck9wdGlvbnMuTGFiZWxJdGVtc0VudHJ5GkoKD0xhYmVsSXRl", + "bXNFbnRyeRILCgNrZXkYASABKAMSJgoFdmFsdWUYAiABKAsyFy5tZWRpYXBp", + "cGUuTGFiZWxNYXBJdGVtOgI4ATJgCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3Vs", + "YXRvck9wdGlvbnMYsIuOeCABKAsyMi5tZWRpYXBpcGUuRGV0ZWN0aW9uTGFi", + "ZWxJZFRvVGV4dENhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.LabelMapReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.DetectionLabelIdToTextCalculatorOptions), global::Mediapipe.DetectionLabelIdToTextCalculatorOptions.Parser, new[]{ "LabelMapPath", "Label", "KeepLabelId", "LabelItems" }, null, null, new pb::Extension[] { global::Mediapipe.DetectionLabelIdToTextCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { null, }) + })); + } + #endregion + + } + #region Messages + public sealed partial class DetectionLabelIdToTextCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DetectionLabelIdToTextCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DetectionLabelIdToTextCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionLabelIdToTextCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionLabelIdToTextCalculatorOptions(DetectionLabelIdToTextCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + labelMapPath_ = other.labelMapPath_; + label_ = other.label_.Clone(); + keepLabelId_ = other.keepLabelId_; + labelItems_ = other.labelItems_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionLabelIdToTextCalculatorOptions Clone() { + return new DetectionLabelIdToTextCalculatorOptions(this); + } + + /// Field number for the "label_map_path" field. + public const int LabelMapPathFieldNumber = 1; + private readonly static string LabelMapPathDefaultValue = ""; + + private string labelMapPath_; + /// + /// Path to a label map file for getting the actual name of detected classes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string LabelMapPath { + get { return labelMapPath_ ?? LabelMapPathDefaultValue; } + set { + labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label_map_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelMapPath { + get { return labelMapPath_ != null; } + } + /// Clears the value of the "label_map_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelMapPath() { + labelMapPath_ = null; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_label_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField label_ = new pbc::RepeatedField(); + /// + /// Alternative way to specify label map. + /// label: "label for id 0" + /// label: "label for id 1" + /// ... + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Label { + get { return label_; } + } + + /// Field number for the "keep_label_id" field. + public const int KeepLabelIdFieldNumber = 3; + private readonly static bool KeepLabelIdDefaultValue = false; + + private bool keepLabelId_; + /// + /// By default, the `label_id` field from the input is stripped if a text label + /// could be found. By setting this field to true, it is always copied to the + /// output detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool KeepLabelId { + get { if ((_hasBits0 & 1) != 0) { return keepLabelId_; } else { return KeepLabelIdDefaultValue; } } + set { + _hasBits0 |= 1; + keepLabelId_ = value; + } + } + /// Gets whether the "keep_label_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKeepLabelId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "keep_label_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKeepLabelId() { + _hasBits0 &= ~1; + } + + /// Field number for the "label_items" field. + public const int LabelItemsFieldNumber = 4; + private static readonly pbc::MapField.Codec _map_labelItems_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForMessage(18, global::Mediapipe.LabelMapItem.Parser), 34); + private readonly pbc::MapField labelItems_ = new pbc::MapField(); + /// + /// Identifying information for each classification label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField LabelItems { + get { return labelItems_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DetectionLabelIdToTextCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DetectionLabelIdToTextCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LabelMapPath != other.LabelMapPath) return false; + if(!label_.Equals(other.label_)) return false; + if (KeepLabelId != other.KeepLabelId) return false; + if (!LabelItems.Equals(other.LabelItems)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLabelMapPath) hash ^= LabelMapPath.GetHashCode(); + hash ^= label_.GetHashCode(); + if (HasKeepLabelId) hash ^= KeepLabelId.GetHashCode(); + hash ^= LabelItems.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLabelMapPath) { + output.WriteRawTag(10); + output.WriteString(LabelMapPath); + } + label_.WriteTo(output, _repeated_label_codec); + if (HasKeepLabelId) { + output.WriteRawTag(24); + output.WriteBool(KeepLabelId); + } + labelItems_.WriteTo(output, _map_labelItems_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLabelMapPath) { + output.WriteRawTag(10); + output.WriteString(LabelMapPath); + } + label_.WriteTo(ref output, _repeated_label_codec); + if (HasKeepLabelId) { + output.WriteRawTag(24); + output.WriteBool(KeepLabelId); + } + labelItems_.WriteTo(ref output, _map_labelItems_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLabelMapPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath); + } + size += label_.CalculateSize(_repeated_label_codec); + if (HasKeepLabelId) { + size += 1 + 1; + } + size += labelItems_.CalculateSize(_map_labelItems_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DetectionLabelIdToTextCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasLabelMapPath) { + LabelMapPath = other.LabelMapPath; + } + label_.Add(other.label_); + if (other.HasKeepLabelId) { + KeepLabelId = other.KeepLabelId; + } + labelItems_.Add(other.labelItems_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + LabelMapPath = input.ReadString(); + break; + } + case 18: { + label_.AddEntriesFrom(input, _repeated_label_codec); + break; + } + case 24: { + KeepLabelId = input.ReadBool(); + break; + } + case 34: { + labelItems_.AddEntriesFrom(input, _map_labelItems_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + LabelMapPath = input.ReadString(); + break; + } + case 18: { + label_.AddEntriesFrom(ref input, _repeated_label_codec); + break; + } + case 24: { + KeepLabelId = input.ReadBool(); + break; + } + case 34: { + labelItems_.AddEntriesFrom(ref input, _map_labelItems_codec); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the DetectionLabelIdToTextCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(251889072, pb::FieldCodec.ForMessage(2015112578, global::Mediapipe.DetectionLabelIdToTextCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs.meta new file mode 100644 index 0000000..0b134b7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionLabelIdToTextCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1983f602ecc94a58bb02c918202acbf3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs new file mode 100644 index 0000000..dedb89e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs @@ -0,0 +1,561 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/detections_to_rects_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/detections_to_rects_calculator.proto + public static partial class DetectionsToRectsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/detections_to_rects_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DetectionsToRectsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9kZXRlY3Rpb25zX3RvX3Jl", + "Y3RzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIv0DCiJEZXRlY3Rpb25zVG9SZWN0", + "c0NhbGN1bGF0b3JPcHRpb25zEiwKJHJvdGF0aW9uX3ZlY3Rvcl9zdGFydF9r", + "ZXlwb2ludF9pbmRleBgBIAEoBRIqCiJyb3RhdGlvbl92ZWN0b3JfZW5kX2tl", + "eXBvaW50X2luZGV4GAIgASgFEiQKHHJvdGF0aW9uX3ZlY3Rvcl90YXJnZXRf", + "YW5nbGUYAyABKAISLAokcm90YXRpb25fdmVjdG9yX3RhcmdldF9hbmdsZV9k", + "ZWdyZWVzGAQgASgCEi0KJW91dHB1dF96ZXJvX3JlY3RfZm9yX2VtcHR5X2Rl", + "dGVjdGlvbnMYBSABKAgSVQoPY29udmVyc2lvbl9tb2RlGAYgASgOMjwubWVk", + "aWFwaXBlLkRldGVjdGlvbnNUb1JlY3RzQ2FsY3VsYXRvck9wdGlvbnMuQ29u", + "dmVyc2lvbk1vZGUiRgoOQ29udmVyc2lvbk1vZGUSCwoHREVGQVVMVBAAEhQK", + "EFVTRV9CT1VORElOR19CT1gQARIRCg1VU0VfS0VZUE9JTlRTEAIyWwoDZXh0", + "EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGN+3oX0gASgLMi0ubWVk", + "aWFwaXBlLkRldGVjdGlvbnNUb1JlY3RzQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.DetectionsToRectsCalculatorOptions), global::Mediapipe.DetectionsToRectsCalculatorOptions.Parser, new[]{ "RotationVectorStartKeypointIndex", "RotationVectorEndKeypointIndex", "RotationVectorTargetAngle", "RotationVectorTargetAngleDegrees", "OutputZeroRectForEmptyDetections", "ConversionMode" }, null, new[]{ typeof(global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode) }, new pb::Extension[] { global::Mediapipe.DetectionsToRectsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DetectionsToRectsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DetectionsToRectsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DetectionsToRectsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRectsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRectsCalculatorOptions(DetectionsToRectsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + rotationVectorStartKeypointIndex_ = other.rotationVectorStartKeypointIndex_; + rotationVectorEndKeypointIndex_ = other.rotationVectorEndKeypointIndex_; + rotationVectorTargetAngle_ = other.rotationVectorTargetAngle_; + rotationVectorTargetAngleDegrees_ = other.rotationVectorTargetAngleDegrees_; + outputZeroRectForEmptyDetections_ = other.outputZeroRectForEmptyDetections_; + conversionMode_ = other.conversionMode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRectsCalculatorOptions Clone() { + return new DetectionsToRectsCalculatorOptions(this); + } + + /// Field number for the "rotation_vector_start_keypoint_index" field. + public const int RotationVectorStartKeypointIndexFieldNumber = 1; + private readonly static int RotationVectorStartKeypointIndexDefaultValue = 0; + + private int rotationVectorStartKeypointIndex_; + /// + /// Specify the rotation angle of the output rect with a vector formed by + /// connecting two keypoints in the detection, together with the target angle + /// (can be in radians or in degrees) of that vector after rotation. The target + /// angle is counter-clockwise starting from the positive x-axis. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RotationVectorStartKeypointIndex { + get { if ((_hasBits0 & 1) != 0) { return rotationVectorStartKeypointIndex_; } else { return RotationVectorStartKeypointIndexDefaultValue; } } + set { + _hasBits0 |= 1; + rotationVectorStartKeypointIndex_ = value; + } + } + /// Gets whether the "rotation_vector_start_keypoint_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationVectorStartKeypointIndex { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "rotation_vector_start_keypoint_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationVectorStartKeypointIndex() { + _hasBits0 &= ~1; + } + + /// Field number for the "rotation_vector_end_keypoint_index" field. + public const int RotationVectorEndKeypointIndexFieldNumber = 2; + private readonly static int RotationVectorEndKeypointIndexDefaultValue = 0; + + private int rotationVectorEndKeypointIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RotationVectorEndKeypointIndex { + get { if ((_hasBits0 & 2) != 0) { return rotationVectorEndKeypointIndex_; } else { return RotationVectorEndKeypointIndexDefaultValue; } } + set { + _hasBits0 |= 2; + rotationVectorEndKeypointIndex_ = value; + } + } + /// Gets whether the "rotation_vector_end_keypoint_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationVectorEndKeypointIndex { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "rotation_vector_end_keypoint_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationVectorEndKeypointIndex() { + _hasBits0 &= ~2; + } + + /// Field number for the "rotation_vector_target_angle" field. + public const int RotationVectorTargetAngleFieldNumber = 3; + private readonly static float RotationVectorTargetAngleDefaultValue = 0F; + + private float rotationVectorTargetAngle_; + /// + /// In radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RotationVectorTargetAngle { + get { if ((_hasBits0 & 4) != 0) { return rotationVectorTargetAngle_; } else { return RotationVectorTargetAngleDefaultValue; } } + set { + _hasBits0 |= 4; + rotationVectorTargetAngle_ = value; + } + } + /// Gets whether the "rotation_vector_target_angle" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationVectorTargetAngle { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "rotation_vector_target_angle" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationVectorTargetAngle() { + _hasBits0 &= ~4; + } + + /// Field number for the "rotation_vector_target_angle_degrees" field. + public const int RotationVectorTargetAngleDegreesFieldNumber = 4; + private readonly static float RotationVectorTargetAngleDegreesDefaultValue = 0F; + + private float rotationVectorTargetAngleDegrees_; + /// + /// In degrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RotationVectorTargetAngleDegrees { + get { if ((_hasBits0 & 8) != 0) { return rotationVectorTargetAngleDegrees_; } else { return RotationVectorTargetAngleDegreesDefaultValue; } } + set { + _hasBits0 |= 8; + rotationVectorTargetAngleDegrees_ = value; + } + } + /// Gets whether the "rotation_vector_target_angle_degrees" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationVectorTargetAngleDegrees { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "rotation_vector_target_angle_degrees" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationVectorTargetAngleDegrees() { + _hasBits0 &= ~8; + } + + /// Field number for the "output_zero_rect_for_empty_detections" field. + public const int OutputZeroRectForEmptyDetectionsFieldNumber = 5; + private readonly static bool OutputZeroRectForEmptyDetectionsDefaultValue = false; + + private bool outputZeroRectForEmptyDetections_; + /// + /// Whether to output a zero-rect (with origin and size both zero) when the + /// input detection vector is empty. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputZeroRectForEmptyDetections { + get { if ((_hasBits0 & 16) != 0) { return outputZeroRectForEmptyDetections_; } else { return OutputZeroRectForEmptyDetectionsDefaultValue; } } + set { + _hasBits0 |= 16; + outputZeroRectForEmptyDetections_ = value; + } + } + /// Gets whether the "output_zero_rect_for_empty_detections" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputZeroRectForEmptyDetections { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "output_zero_rect_for_empty_detections" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputZeroRectForEmptyDetections() { + _hasBits0 &= ~16; + } + + /// Field number for the "conversion_mode" field. + public const int ConversionModeFieldNumber = 6; + private readonly static global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode ConversionModeDefaultValue = global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode.Default; + + private global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode conversionMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode ConversionMode { + get { if ((_hasBits0 & 32) != 0) { return conversionMode_; } else { return ConversionModeDefaultValue; } } + set { + _hasBits0 |= 32; + conversionMode_ = value; + } + } + /// Gets whether the "conversion_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasConversionMode { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "conversion_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearConversionMode() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DetectionsToRectsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DetectionsToRectsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RotationVectorStartKeypointIndex != other.RotationVectorStartKeypointIndex) return false; + if (RotationVectorEndKeypointIndex != other.RotationVectorEndKeypointIndex) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RotationVectorTargetAngle, other.RotationVectorTargetAngle)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RotationVectorTargetAngleDegrees, other.RotationVectorTargetAngleDegrees)) return false; + if (OutputZeroRectForEmptyDetections != other.OutputZeroRectForEmptyDetections) return false; + if (ConversionMode != other.ConversionMode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRotationVectorStartKeypointIndex) hash ^= RotationVectorStartKeypointIndex.GetHashCode(); + if (HasRotationVectorEndKeypointIndex) hash ^= RotationVectorEndKeypointIndex.GetHashCode(); + if (HasRotationVectorTargetAngle) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RotationVectorTargetAngle); + if (HasRotationVectorTargetAngleDegrees) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RotationVectorTargetAngleDegrees); + if (HasOutputZeroRectForEmptyDetections) hash ^= OutputZeroRectForEmptyDetections.GetHashCode(); + if (HasConversionMode) hash ^= ConversionMode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRotationVectorStartKeypointIndex) { + output.WriteRawTag(8); + output.WriteInt32(RotationVectorStartKeypointIndex); + } + if (HasRotationVectorEndKeypointIndex) { + output.WriteRawTag(16); + output.WriteInt32(RotationVectorEndKeypointIndex); + } + if (HasRotationVectorTargetAngle) { + output.WriteRawTag(29); + output.WriteFloat(RotationVectorTargetAngle); + } + if (HasRotationVectorTargetAngleDegrees) { + output.WriteRawTag(37); + output.WriteFloat(RotationVectorTargetAngleDegrees); + } + if (HasOutputZeroRectForEmptyDetections) { + output.WriteRawTag(40); + output.WriteBool(OutputZeroRectForEmptyDetections); + } + if (HasConversionMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ConversionMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRotationVectorStartKeypointIndex) { + output.WriteRawTag(8); + output.WriteInt32(RotationVectorStartKeypointIndex); + } + if (HasRotationVectorEndKeypointIndex) { + output.WriteRawTag(16); + output.WriteInt32(RotationVectorEndKeypointIndex); + } + if (HasRotationVectorTargetAngle) { + output.WriteRawTag(29); + output.WriteFloat(RotationVectorTargetAngle); + } + if (HasRotationVectorTargetAngleDegrees) { + output.WriteRawTag(37); + output.WriteFloat(RotationVectorTargetAngleDegrees); + } + if (HasOutputZeroRectForEmptyDetections) { + output.WriteRawTag(40); + output.WriteBool(OutputZeroRectForEmptyDetections); + } + if (HasConversionMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ConversionMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRotationVectorStartKeypointIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RotationVectorStartKeypointIndex); + } + if (HasRotationVectorEndKeypointIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RotationVectorEndKeypointIndex); + } + if (HasRotationVectorTargetAngle) { + size += 1 + 4; + } + if (HasRotationVectorTargetAngleDegrees) { + size += 1 + 4; + } + if (HasOutputZeroRectForEmptyDetections) { + size += 1 + 1; + } + if (HasConversionMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ConversionMode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DetectionsToRectsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasRotationVectorStartKeypointIndex) { + RotationVectorStartKeypointIndex = other.RotationVectorStartKeypointIndex; + } + if (other.HasRotationVectorEndKeypointIndex) { + RotationVectorEndKeypointIndex = other.RotationVectorEndKeypointIndex; + } + if (other.HasRotationVectorTargetAngle) { + RotationVectorTargetAngle = other.RotationVectorTargetAngle; + } + if (other.HasRotationVectorTargetAngleDegrees) { + RotationVectorTargetAngleDegrees = other.RotationVectorTargetAngleDegrees; + } + if (other.HasOutputZeroRectForEmptyDetections) { + OutputZeroRectForEmptyDetections = other.OutputZeroRectForEmptyDetections; + } + if (other.HasConversionMode) { + ConversionMode = other.ConversionMode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RotationVectorStartKeypointIndex = input.ReadInt32(); + break; + } + case 16: { + RotationVectorEndKeypointIndex = input.ReadInt32(); + break; + } + case 29: { + RotationVectorTargetAngle = input.ReadFloat(); + break; + } + case 37: { + RotationVectorTargetAngleDegrees = input.ReadFloat(); + break; + } + case 40: { + OutputZeroRectForEmptyDetections = input.ReadBool(); + break; + } + case 48: { + ConversionMode = (global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RotationVectorStartKeypointIndex = input.ReadInt32(); + break; + } + case 16: { + RotationVectorEndKeypointIndex = input.ReadInt32(); + break; + } + case 29: { + RotationVectorTargetAngle = input.ReadFloat(); + break; + } + case 37: { + RotationVectorTargetAngleDegrees = input.ReadFloat(); + break; + } + case 40: { + OutputZeroRectForEmptyDetections = input.ReadBool(); + break; + } + case 48: { + ConversionMode = (global::Mediapipe.DetectionsToRectsCalculatorOptions.Types.ConversionMode) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the DetectionsToRectsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum ConversionMode { + [pbr::OriginalName("DEFAULT")] Default = 0, + [pbr::OriginalName("USE_BOUNDING_BOX")] UseBoundingBox = 1, + [pbr::OriginalName("USE_KEYPOINTS")] UseKeypoints = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the DetectionsToRectsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(262691807, pb::FieldCodec.ForMessage(2101534458, global::Mediapipe.DetectionsToRectsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs.meta new file mode 100644 index 0000000..aca745c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRectsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4debe466f3c1da7c9836257a319642d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs new file mode 100644 index 0000000..ba029c5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs @@ -0,0 +1,653 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/detections_to_render_data_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/detections_to_render_data_calculator.proto + public static partial class DetectionsToRenderDataCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/detections_to_render_data_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DetectionsToRenderDataCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkVtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9kZXRlY3Rpb25zX3RvX3Jl", + "bmRlcl9kYXRhX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFw", + "aXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvGhptZWRpYXBpcGUvdXRp", + "bC9jb2xvci5wcm90bxogbWVkaWFwaXBlL3V0aWwvcmVuZGVyX2RhdGEucHJv", + "dG8imAMKJ0RldGVjdGlvbnNUb1JlbmRlckRhdGFDYWxjdWxhdG9yT3B0aW9u", + "cxIiChRwcm9kdWNlX2VtcHR5X3BhY2tldBgBIAEoCDoEdHJ1ZRIZCg50ZXh0", + "X2RlbGltaXRlchgCIAEoCToBLBIhChJvbmVfbGFiZWxfcGVyX2xpbmUYAyAB", + "KAg6BWZhbHNlEi4KBHRleHQYBCABKAsyIC5tZWRpYXBpcGUuUmVuZGVyQW5u", + "b3RhdGlvbi5UZXh0EhQKCXRoaWNrbmVzcxgFIAEoAToBMRIfCgVjb2xvchgG", + "IAEoCzIQLm1lZGlhcGlwZS5Db2xvchIeCgtzY2VuZV9jbGFzcxgHIAEoCToJ", + "REVURUNUSU9OEiIKE3JlbmRlcl9kZXRlY3Rpb25faWQYCCABKAg6BWZhbHNl", + "MmAKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjm3rZ2IAEo", + "CzIyLm1lZGlhcGlwZS5EZXRlY3Rpb25zVG9SZW5kZXJEYXRhQ2FsY3VsYXRv", + "ck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, global::Mediapipe.RenderDataReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.DetectionsToRenderDataCalculatorOptions), global::Mediapipe.DetectionsToRenderDataCalculatorOptions.Parser, new[]{ "ProduceEmptyPacket", "TextDelimiter", "OneLabelPerLine", "Text", "Thickness", "Color", "SceneClass", "RenderDetectionId" }, null, null, new pb::Extension[] { global::Mediapipe.DetectionsToRenderDataCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DetectionsToRenderDataCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DetectionsToRenderDataCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DetectionsToRenderDataCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRenderDataCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRenderDataCalculatorOptions(DetectionsToRenderDataCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + produceEmptyPacket_ = other.produceEmptyPacket_; + textDelimiter_ = other.textDelimiter_; + oneLabelPerLine_ = other.oneLabelPerLine_; + text_ = other.text_ != null ? other.text_.Clone() : null; + thickness_ = other.thickness_; + color_ = other.color_ != null ? other.color_.Clone() : null; + sceneClass_ = other.sceneClass_; + renderDetectionId_ = other.renderDetectionId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionsToRenderDataCalculatorOptions Clone() { + return new DetectionsToRenderDataCalculatorOptions(this); + } + + /// Field number for the "produce_empty_packet" field. + public const int ProduceEmptyPacketFieldNumber = 1; + private readonly static bool ProduceEmptyPacketDefaultValue = true; + + private bool produceEmptyPacket_; + /// + /// If true, produces a RenderData packet with no annotation when the input + /// packet has no detection. Otherwise, it won't produce any packet. + /// Please note, regardless of this flag nothing will be produce if there is + /// no input packet for a timestamp. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ProduceEmptyPacket { + get { if ((_hasBits0 & 1) != 0) { return produceEmptyPacket_; } else { return ProduceEmptyPacketDefaultValue; } } + set { + _hasBits0 |= 1; + produceEmptyPacket_ = value; + } + } + /// Gets whether the "produce_empty_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProduceEmptyPacket { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "produce_empty_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProduceEmptyPacket() { + _hasBits0 &= ~1; + } + + /// Field number for the "text_delimiter" field. + public const int TextDelimiterFieldNumber = 2; + private readonly static string TextDelimiterDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("LA=="), 0, 1); + + private string textDelimiter_; + /// + /// The delimiter to separate label(_id) and score. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TextDelimiter { + get { return textDelimiter_ ?? TextDelimiterDefaultValue; } + set { + textDelimiter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "text_delimiter" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTextDelimiter { + get { return textDelimiter_ != null; } + } + /// Clears the value of the "text_delimiter" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTextDelimiter() { + textDelimiter_ = null; + } + + /// Field number for the "one_label_per_line" field. + public const int OneLabelPerLineFieldNumber = 3; + private readonly static bool OneLabelPerLineDefaultValue = false; + + private bool oneLabelPerLine_; + /// + /// If true, each "label(_id),score" will be on a separate line. + /// Otherwise, all "label(_id),score" will be concatenated when the detection + /// has more than one label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OneLabelPerLine { + get { if ((_hasBits0 & 2) != 0) { return oneLabelPerLine_; } else { return OneLabelPerLineDefaultValue; } } + set { + _hasBits0 |= 2; + oneLabelPerLine_ = value; + } + } + /// Gets whether the "one_label_per_line" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOneLabelPerLine { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "one_label_per_line" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOneLabelPerLine() { + _hasBits0 &= ~2; + } + + /// Field number for the "text" field. + public const int TextFieldNumber = 4; + private global::Mediapipe.RenderAnnotation.Types.Text text_; + /// + /// Rendering options for the label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Text Text { + get { return text_; } + set { + text_ = value; + } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 5; + private readonly static double ThicknessDefaultValue = 1D; + + private double thickness_; + /// + /// Thickness for drawing the label(s) and the location_data(box). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 4) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 4; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~4; + } + + /// Field number for the "color" field. + public const int ColorFieldNumber = 6; + private global::Mediapipe.Color color_; + /// + /// Color for drawing the label(s), feature_tag, and the location_data(box). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color { + get { return color_; } + set { + color_ = value; + } + } + + /// Field number for the "scene_class" field. + public const int SceneClassFieldNumber = 7; + private readonly static string SceneClassDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("REVURUNUSU9O"), 0, 9); + + private string sceneClass_; + /// + /// An optional string that identifies this class of annotations + /// for the render data output this calculator produces. If multiple + /// instances of this calculator are present in the graph, this value + /// should be unique among them. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SceneClass { + get { return sceneClass_ ?? SceneClassDefaultValue; } + set { + sceneClass_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "scene_class" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSceneClass { + get { return sceneClass_ != null; } + } + /// Clears the value of the "scene_class" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSceneClass() { + sceneClass_ = null; + } + + /// Field number for the "render_detection_id" field. + public const int RenderDetectionIdFieldNumber = 8; + private readonly static bool RenderDetectionIdDefaultValue = false; + + private bool renderDetectionId_; + /// + /// If true, renders the detection id in the first line before the labels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RenderDetectionId { + get { if ((_hasBits0 & 8) != 0) { return renderDetectionId_; } else { return RenderDetectionIdDefaultValue; } } + set { + _hasBits0 |= 8; + renderDetectionId_ = value; + } + } + /// Gets whether the "render_detection_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRenderDetectionId { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "render_detection_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRenderDetectionId() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DetectionsToRenderDataCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DetectionsToRenderDataCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ProduceEmptyPacket != other.ProduceEmptyPacket) return false; + if (TextDelimiter != other.TextDelimiter) return false; + if (OneLabelPerLine != other.OneLabelPerLine) return false; + if (!object.Equals(Text, other.Text)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + if (!object.Equals(Color, other.Color)) return false; + if (SceneClass != other.SceneClass) return false; + if (RenderDetectionId != other.RenderDetectionId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasProduceEmptyPacket) hash ^= ProduceEmptyPacket.GetHashCode(); + if (HasTextDelimiter) hash ^= TextDelimiter.GetHashCode(); + if (HasOneLabelPerLine) hash ^= OneLabelPerLine.GetHashCode(); + if (text_ != null) hash ^= Text.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + if (color_ != null) hash ^= Color.GetHashCode(); + if (HasSceneClass) hash ^= SceneClass.GetHashCode(); + if (HasRenderDetectionId) hash ^= RenderDetectionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasProduceEmptyPacket) { + output.WriteRawTag(8); + output.WriteBool(ProduceEmptyPacket); + } + if (HasTextDelimiter) { + output.WriteRawTag(18); + output.WriteString(TextDelimiter); + } + if (HasOneLabelPerLine) { + output.WriteRawTag(24); + output.WriteBool(OneLabelPerLine); + } + if (text_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Text); + } + if (HasThickness) { + output.WriteRawTag(41); + output.WriteDouble(Thickness); + } + if (color_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Color); + } + if (HasSceneClass) { + output.WriteRawTag(58); + output.WriteString(SceneClass); + } + if (HasRenderDetectionId) { + output.WriteRawTag(64); + output.WriteBool(RenderDetectionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasProduceEmptyPacket) { + output.WriteRawTag(8); + output.WriteBool(ProduceEmptyPacket); + } + if (HasTextDelimiter) { + output.WriteRawTag(18); + output.WriteString(TextDelimiter); + } + if (HasOneLabelPerLine) { + output.WriteRawTag(24); + output.WriteBool(OneLabelPerLine); + } + if (text_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Text); + } + if (HasThickness) { + output.WriteRawTag(41); + output.WriteDouble(Thickness); + } + if (color_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Color); + } + if (HasSceneClass) { + output.WriteRawTag(58); + output.WriteString(SceneClass); + } + if (HasRenderDetectionId) { + output.WriteRawTag(64); + output.WriteBool(RenderDetectionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasProduceEmptyPacket) { + size += 1 + 1; + } + if (HasTextDelimiter) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TextDelimiter); + } + if (HasOneLabelPerLine) { + size += 1 + 1; + } + if (text_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Text); + } + if (HasThickness) { + size += 1 + 8; + } + if (color_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color); + } + if (HasSceneClass) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SceneClass); + } + if (HasRenderDetectionId) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DetectionsToRenderDataCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasProduceEmptyPacket) { + ProduceEmptyPacket = other.ProduceEmptyPacket; + } + if (other.HasTextDelimiter) { + TextDelimiter = other.TextDelimiter; + } + if (other.HasOneLabelPerLine) { + OneLabelPerLine = other.OneLabelPerLine; + } + if (other.text_ != null) { + if (text_ == null) { + Text = new global::Mediapipe.RenderAnnotation.Types.Text(); + } + Text.MergeFrom(other.Text); + } + if (other.HasThickness) { + Thickness = other.Thickness; + } + if (other.color_ != null) { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + Color.MergeFrom(other.Color); + } + if (other.HasSceneClass) { + SceneClass = other.SceneClass; + } + if (other.HasRenderDetectionId) { + RenderDetectionId = other.RenderDetectionId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ProduceEmptyPacket = input.ReadBool(); + break; + } + case 18: { + TextDelimiter = input.ReadString(); + break; + } + case 24: { + OneLabelPerLine = input.ReadBool(); + break; + } + case 34: { + if (text_ == null) { + Text = new global::Mediapipe.RenderAnnotation.Types.Text(); + } + input.ReadMessage(Text); + break; + } + case 41: { + Thickness = input.ReadDouble(); + break; + } + case 50: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 58: { + SceneClass = input.ReadString(); + break; + } + case 64: { + RenderDetectionId = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ProduceEmptyPacket = input.ReadBool(); + break; + } + case 18: { + TextDelimiter = input.ReadString(); + break; + } + case 24: { + OneLabelPerLine = input.ReadBool(); + break; + } + case 34: { + if (text_ == null) { + Text = new global::Mediapipe.RenderAnnotation.Types.Text(); + } + input.ReadMessage(Text); + break; + } + case 41: { + Thickness = input.ReadDouble(); + break; + } + case 50: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 58: { + SceneClass = input.ReadString(); + break; + } + case 64: { + RenderDetectionId = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the DetectionsToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(248360806, pb::FieldCodec.ForMessage(1986886450, global::Mediapipe.DetectionsToRenderDataCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs.meta new file mode 100644 index 0000000..e6b5a49 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/DetectionsToRenderDataCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d70cf8e67756c61c8be1015f87d922ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs new file mode 100644 index 0000000..d0401c4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs @@ -0,0 +1,266 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/filter_detections_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/filter_detections_calculator.proto + public static partial class FilterDetectionsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/filter_detections_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FilterDetectionsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9maWx0ZXJfZGV0ZWN0aW9u", + "c19jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvY2FsY3VsYXRvci5wcm90byKTAQohRmlsdGVyRGV0ZWN0aW9uc0Nh", + "bGN1bGF0b3JPcHRpb25zEhEKCW1pbl9zY29yZRgBIAEoAjJbCgNleHQSHC5t", + "ZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY9IjKvAEgASgLMiwubWVkaWFw", + "aXBlLkZpbHRlckRldGVjdGlvbnNDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FilterDetectionsCalculatorOptions), global::Mediapipe.FilterDetectionsCalculatorOptions.Parser, new[]{ "MinScore" }, null, null, new pb::Extension[] { global::Mediapipe.FilterDetectionsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FilterDetectionsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilterDetectionsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FilterDetectionsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionsCalculatorOptions(FilterDetectionsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minScore_ = other.minScore_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionsCalculatorOptions Clone() { + return new FilterDetectionsCalculatorOptions(this); + } + + /// Field number for the "min_score" field. + public const int MinScoreFieldNumber = 1; + private readonly static float MinScoreDefaultValue = 0F; + + private float minScore_; + /// + /// Detections lower than this score get filtered out. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScore { + get { if ((_hasBits0 & 1) != 0) { return minScore_; } else { return MinScoreDefaultValue; } } + set { + _hasBits0 |= 1; + minScore_ = value; + } + } + /// Gets whether the "min_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScore { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScore() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FilterDetectionsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FilterDetectionsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScore, other.MinScore)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScore); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinScore) { + output.WriteRawTag(13); + output.WriteFloat(MinScore); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinScore) { + output.WriteRawTag(13); + output.WriteFloat(MinScore); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinScore) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FilterDetectionsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinScore) { + MinScore = other.MinScore; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinScore = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinScore = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FilterDetectionsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(395478132, pb::FieldCodec.ForMessage(3163825058, global::Mediapipe.FilterDetectionsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs.meta new file mode 100644 index 0000000..3c70f73 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/FilterDetectionsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94c2ebbb491ab59199d9fcc65e409b3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs new file mode 100644 index 0000000..1a4743e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs @@ -0,0 +1,853 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/labels_to_render_data_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/labels_to_render_data_calculator.proto + public static partial class LabelsToRenderDataCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/labels_to_render_data_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LabelsToRenderDataCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYWJlbHNfdG9fcmVuZGVy", + "X2RhdGFfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8aGm1lZGlhcGlwZS91dGlsL2Nv", + "bG9yLnByb3RvItoECiNMYWJlbHNUb1JlbmRlckRhdGFDYWxjdWxhdG9yT3B0", + "aW9ucxIfCgVjb2xvchgBIAMoCzIQLm1lZGlhcGlwZS5Db2xvchIUCgl0aGlj", + "a25lc3MYAiABKAE6ATISJwoNb3V0bGluZV9jb2xvchgMIAMoCzIQLm1lZGlh", + "cGlwZS5Db2xvchIZChFvdXRsaW5lX3RoaWNrbmVzcxgLIAEoARIaCg5mb250", + "X2hlaWdodF9weBgDIAEoBToCNTASHwoUaG9yaXpvbnRhbF9vZmZzZXRfcHgY", + "ByABKAU6ATASHQoSdmVydGljYWxfb2Zmc2V0X3B4GAggASgFOgEwEhkKDm1h", + "eF9udW1fbGFiZWxzGAQgASgFOgExEhQKCWZvbnRfZmFjZRgFIAEoBToBMBJT", + "Cghsb2NhdGlvbhgGIAEoDjI3Lm1lZGlhcGlwZS5MYWJlbHNUb1JlbmRlckRh", + "dGFDYWxjdWxhdG9yT3B0aW9ucy5Mb2NhdGlvbjoIVE9QX0xFRlQSHwoQdXNl", + "X2Rpc3BsYXlfbmFtZRgJIAEoCDoFZmFsc2USKwocZGlzcGxheV9jbGFzc2lm", + "aWNhdGlvbl9zY29yZRgKIAEoCDoFZmFsc2UiKQoITG9jYXRpb24SDAoIVE9Q", + "X0xFRlQQABIPCgtCT1RUT01fTEVGVBABMl0KA2V4dBIcLm1lZGlhcGlwZS5D", + "YWxjdWxhdG9yT3B0aW9ucxjM6sSBASABKAsyLi5tZWRpYXBpcGUuTGFiZWxz", + "VG9SZW5kZXJEYXRhQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LabelsToRenderDataCalculatorOptions), global::Mediapipe.LabelsToRenderDataCalculatorOptions.Parser, new[]{ "Color", "Thickness", "OutlineColor", "OutlineThickness", "FontHeightPx", "HorizontalOffsetPx", "VerticalOffsetPx", "MaxNumLabels", "FontFace", "Location", "UseDisplayName", "DisplayClassificationScore" }, null, new[]{ typeof(global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location) }, new pb::Extension[] { global::Mediapipe.LabelsToRenderDataCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LabelsToRenderDataCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LabelsToRenderDataCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LabelsToRenderDataCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelsToRenderDataCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelsToRenderDataCalculatorOptions(LabelsToRenderDataCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + color_ = other.color_.Clone(); + thickness_ = other.thickness_; + outlineColor_ = other.outlineColor_.Clone(); + outlineThickness_ = other.outlineThickness_; + fontHeightPx_ = other.fontHeightPx_; + horizontalOffsetPx_ = other.horizontalOffsetPx_; + verticalOffsetPx_ = other.verticalOffsetPx_; + maxNumLabels_ = other.maxNumLabels_; + fontFace_ = other.fontFace_; + location_ = other.location_; + useDisplayName_ = other.useDisplayName_; + displayClassificationScore_ = other.displayClassificationScore_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelsToRenderDataCalculatorOptions Clone() { + return new LabelsToRenderDataCalculatorOptions(this); + } + + /// Field number for the "color" field. + public const int ColorFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_color_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Color.Parser); + private readonly pbc::RepeatedField color_ = new pbc::RepeatedField(); + /// + /// Colors for drawing the label(s). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Color { + get { return color_; } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 2; + private readonly static double ThicknessDefaultValue = 2D; + + private double thickness_; + /// + /// Thickness for drawing the label(s). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 1) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 1; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~1; + } + + /// Field number for the "outline_color" field. + public const int OutlineColorFieldNumber = 12; + private static readonly pb::FieldCodec _repeated_outlineColor_codec + = pb::FieldCodec.ForMessage(98, global::Mediapipe.Color.Parser); + private readonly pbc::RepeatedField outlineColor_ = new pbc::RepeatedField(); + /// + /// Color of outline around each character, if any. One per label, as with + /// color attribute. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutlineColor { + get { return outlineColor_; } + } + + /// Field number for the "outline_thickness" field. + public const int OutlineThicknessFieldNumber = 11; + private readonly static double OutlineThicknessDefaultValue = 0D; + + private double outlineThickness_; + /// + /// Thickness of outline around each character. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double OutlineThickness { + get { if ((_hasBits0 & 512) != 0) { return outlineThickness_; } else { return OutlineThicknessDefaultValue; } } + set { + _hasBits0 |= 512; + outlineThickness_ = value; + } + } + /// Gets whether the "outline_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutlineThickness { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "outline_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutlineThickness() { + _hasBits0 &= ~512; + } + + /// Field number for the "font_height_px" field. + public const int FontHeightPxFieldNumber = 3; + private readonly static int FontHeightPxDefaultValue = 50; + + private int fontHeightPx_; + /// + /// The font height in absolute pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FontHeightPx { + get { if ((_hasBits0 & 2) != 0) { return fontHeightPx_; } else { return FontHeightPxDefaultValue; } } + set { + _hasBits0 |= 2; + fontHeightPx_ = value; + } + } + /// Gets whether the "font_height_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFontHeightPx { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "font_height_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFontHeightPx() { + _hasBits0 &= ~2; + } + + /// Field number for the "horizontal_offset_px" field. + public const int HorizontalOffsetPxFieldNumber = 7; + private readonly static int HorizontalOffsetPxDefaultValue = 0; + + private int horizontalOffsetPx_; + /// + /// The offset of the starting text in horizontal direction in absolute pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int HorizontalOffsetPx { + get { if ((_hasBits0 & 32) != 0) { return horizontalOffsetPx_; } else { return HorizontalOffsetPxDefaultValue; } } + set { + _hasBits0 |= 32; + horizontalOffsetPx_ = value; + } + } + /// Gets whether the "horizontal_offset_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHorizontalOffsetPx { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "horizontal_offset_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHorizontalOffsetPx() { + _hasBits0 &= ~32; + } + + /// Field number for the "vertical_offset_px" field. + public const int VerticalOffsetPxFieldNumber = 8; + private readonly static int VerticalOffsetPxDefaultValue = 0; + + private int verticalOffsetPx_; + /// + /// The offset of the starting text in vertical direction in absolute pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int VerticalOffsetPx { + get { if ((_hasBits0 & 64) != 0) { return verticalOffsetPx_; } else { return VerticalOffsetPxDefaultValue; } } + set { + _hasBits0 |= 64; + verticalOffsetPx_ = value; + } + } + /// Gets whether the "vertical_offset_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerticalOffsetPx { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "vertical_offset_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerticalOffsetPx() { + _hasBits0 &= ~64; + } + + /// Field number for the "max_num_labels" field. + public const int MaxNumLabelsFieldNumber = 4; + private readonly static int MaxNumLabelsDefaultValue = 1; + + private int maxNumLabels_; + /// + /// The maximum number of labels to display. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxNumLabels { + get { if ((_hasBits0 & 4) != 0) { return maxNumLabels_; } else { return MaxNumLabelsDefaultValue; } } + set { + _hasBits0 |= 4; + maxNumLabels_ = value; + } + } + /// Gets whether the "max_num_labels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxNumLabels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_num_labels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxNumLabels() { + _hasBits0 &= ~4; + } + + /// Field number for the "font_face" field. + public const int FontFaceFieldNumber = 5; + private readonly static int FontFaceDefaultValue = 0; + + private int fontFace_; + /// + /// Specifies the font for the text. Font must be one of the following from + /// OpenCV: + /// cv::FONT_HERSHEY_SIMPLEX (0) + /// cv::FONT_HERSHEY_PLAIN (1) + /// cv::FONT_HERSHEY_DUPLEX (2) + /// cv::FONT_HERSHEY_COMPLEX (3) + /// cv::FONT_HERSHEY_TRIPLEX (4) + /// cv::FONT_HERSHEY_COMPLEX_SMALL (5) + /// cv::FONT_HERSHEY_SCRIPT_SIMPLEX (6) + /// cv::FONT_HERSHEY_SCRIPT_COMPLEX (7) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FontFace { + get { if ((_hasBits0 & 8) != 0) { return fontFace_; } else { return FontFaceDefaultValue; } } + set { + _hasBits0 |= 8; + fontFace_ = value; + } + } + /// Gets whether the "font_face" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFontFace { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "font_face" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFontFace() { + _hasBits0 &= ~8; + } + + /// Field number for the "location" field. + public const int LocationFieldNumber = 6; + private readonly static global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location LocationDefaultValue = global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location.TopLeft; + + private global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location location_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location Location { + get { if ((_hasBits0 & 16) != 0) { return location_; } else { return LocationDefaultValue; } } + set { + _hasBits0 |= 16; + location_ = value; + } + } + /// Gets whether the "location" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLocation { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "location" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLocation() { + _hasBits0 &= ~16; + } + + /// Field number for the "use_display_name" field. + public const int UseDisplayNameFieldNumber = 9; + private readonly static bool UseDisplayNameDefaultValue = false; + + private bool useDisplayName_; + /// + /// Uses Classification.display_name field instead of Classification.label. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseDisplayName { + get { if ((_hasBits0 & 128) != 0) { return useDisplayName_; } else { return UseDisplayNameDefaultValue; } } + set { + _hasBits0 |= 128; + useDisplayName_ = value; + } + } + /// Gets whether the "use_display_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseDisplayName { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "use_display_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseDisplayName() { + _hasBits0 &= ~128; + } + + /// Field number for the "display_classification_score" field. + public const int DisplayClassificationScoreFieldNumber = 10; + private readonly static bool DisplayClassificationScoreDefaultValue = false; + + private bool displayClassificationScore_; + /// + /// Displays Classification score if enabled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DisplayClassificationScore { + get { if ((_hasBits0 & 256) != 0) { return displayClassificationScore_; } else { return DisplayClassificationScoreDefaultValue; } } + set { + _hasBits0 |= 256; + displayClassificationScore_ = value; + } + } + /// Gets whether the "display_classification_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisplayClassificationScore { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "display_classification_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisplayClassificationScore() { + _hasBits0 &= ~256; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LabelsToRenderDataCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LabelsToRenderDataCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!color_.Equals(other.color_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + if(!outlineColor_.Equals(other.outlineColor_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OutlineThickness, other.OutlineThickness)) return false; + if (FontHeightPx != other.FontHeightPx) return false; + if (HorizontalOffsetPx != other.HorizontalOffsetPx) return false; + if (VerticalOffsetPx != other.VerticalOffsetPx) return false; + if (MaxNumLabels != other.MaxNumLabels) return false; + if (FontFace != other.FontFace) return false; + if (Location != other.Location) return false; + if (UseDisplayName != other.UseDisplayName) return false; + if (DisplayClassificationScore != other.DisplayClassificationScore) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= color_.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + hash ^= outlineColor_.GetHashCode(); + if (HasOutlineThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OutlineThickness); + if (HasFontHeightPx) hash ^= FontHeightPx.GetHashCode(); + if (HasHorizontalOffsetPx) hash ^= HorizontalOffsetPx.GetHashCode(); + if (HasVerticalOffsetPx) hash ^= VerticalOffsetPx.GetHashCode(); + if (HasMaxNumLabels) hash ^= MaxNumLabels.GetHashCode(); + if (HasFontFace) hash ^= FontFace.GetHashCode(); + if (HasLocation) hash ^= Location.GetHashCode(); + if (HasUseDisplayName) hash ^= UseDisplayName.GetHashCode(); + if (HasDisplayClassificationScore) hash ^= DisplayClassificationScore.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + color_.WriteTo(output, _repeated_color_codec); + if (HasThickness) { + output.WriteRawTag(17); + output.WriteDouble(Thickness); + } + if (HasFontHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(FontHeightPx); + } + if (HasMaxNumLabels) { + output.WriteRawTag(32); + output.WriteInt32(MaxNumLabels); + } + if (HasFontFace) { + output.WriteRawTag(40); + output.WriteInt32(FontFace); + } + if (HasLocation) { + output.WriteRawTag(48); + output.WriteEnum((int) Location); + } + if (HasHorizontalOffsetPx) { + output.WriteRawTag(56); + output.WriteInt32(HorizontalOffsetPx); + } + if (HasVerticalOffsetPx) { + output.WriteRawTag(64); + output.WriteInt32(VerticalOffsetPx); + } + if (HasUseDisplayName) { + output.WriteRawTag(72); + output.WriteBool(UseDisplayName); + } + if (HasDisplayClassificationScore) { + output.WriteRawTag(80); + output.WriteBool(DisplayClassificationScore); + } + if (HasOutlineThickness) { + output.WriteRawTag(89); + output.WriteDouble(OutlineThickness); + } + outlineColor_.WriteTo(output, _repeated_outlineColor_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + color_.WriteTo(ref output, _repeated_color_codec); + if (HasThickness) { + output.WriteRawTag(17); + output.WriteDouble(Thickness); + } + if (HasFontHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(FontHeightPx); + } + if (HasMaxNumLabels) { + output.WriteRawTag(32); + output.WriteInt32(MaxNumLabels); + } + if (HasFontFace) { + output.WriteRawTag(40); + output.WriteInt32(FontFace); + } + if (HasLocation) { + output.WriteRawTag(48); + output.WriteEnum((int) Location); + } + if (HasHorizontalOffsetPx) { + output.WriteRawTag(56); + output.WriteInt32(HorizontalOffsetPx); + } + if (HasVerticalOffsetPx) { + output.WriteRawTag(64); + output.WriteInt32(VerticalOffsetPx); + } + if (HasUseDisplayName) { + output.WriteRawTag(72); + output.WriteBool(UseDisplayName); + } + if (HasDisplayClassificationScore) { + output.WriteRawTag(80); + output.WriteBool(DisplayClassificationScore); + } + if (HasOutlineThickness) { + output.WriteRawTag(89); + output.WriteDouble(OutlineThickness); + } + outlineColor_.WriteTo(ref output, _repeated_outlineColor_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += color_.CalculateSize(_repeated_color_codec); + if (HasThickness) { + size += 1 + 8; + } + size += outlineColor_.CalculateSize(_repeated_outlineColor_codec); + if (HasOutlineThickness) { + size += 1 + 8; + } + if (HasFontHeightPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FontHeightPx); + } + if (HasHorizontalOffsetPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HorizontalOffsetPx); + } + if (HasVerticalOffsetPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VerticalOffsetPx); + } + if (HasMaxNumLabels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumLabels); + } + if (HasFontFace) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FontFace); + } + if (HasLocation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Location); + } + if (HasUseDisplayName) { + size += 1 + 1; + } + if (HasDisplayClassificationScore) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LabelsToRenderDataCalculatorOptions other) { + if (other == null) { + return; + } + color_.Add(other.color_); + if (other.HasThickness) { + Thickness = other.Thickness; + } + outlineColor_.Add(other.outlineColor_); + if (other.HasOutlineThickness) { + OutlineThickness = other.OutlineThickness; + } + if (other.HasFontHeightPx) { + FontHeightPx = other.FontHeightPx; + } + if (other.HasHorizontalOffsetPx) { + HorizontalOffsetPx = other.HorizontalOffsetPx; + } + if (other.HasVerticalOffsetPx) { + VerticalOffsetPx = other.VerticalOffsetPx; + } + if (other.HasMaxNumLabels) { + MaxNumLabels = other.MaxNumLabels; + } + if (other.HasFontFace) { + FontFace = other.FontFace; + } + if (other.HasLocation) { + Location = other.Location; + } + if (other.HasUseDisplayName) { + UseDisplayName = other.UseDisplayName; + } + if (other.HasDisplayClassificationScore) { + DisplayClassificationScore = other.DisplayClassificationScore; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + color_.AddEntriesFrom(input, _repeated_color_codec); + break; + } + case 17: { + Thickness = input.ReadDouble(); + break; + } + case 24: { + FontHeightPx = input.ReadInt32(); + break; + } + case 32: { + MaxNumLabels = input.ReadInt32(); + break; + } + case 40: { + FontFace = input.ReadInt32(); + break; + } + case 48: { + Location = (global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location) input.ReadEnum(); + break; + } + case 56: { + HorizontalOffsetPx = input.ReadInt32(); + break; + } + case 64: { + VerticalOffsetPx = input.ReadInt32(); + break; + } + case 72: { + UseDisplayName = input.ReadBool(); + break; + } + case 80: { + DisplayClassificationScore = input.ReadBool(); + break; + } + case 89: { + OutlineThickness = input.ReadDouble(); + break; + } + case 98: { + outlineColor_.AddEntriesFrom(input, _repeated_outlineColor_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + color_.AddEntriesFrom(ref input, _repeated_color_codec); + break; + } + case 17: { + Thickness = input.ReadDouble(); + break; + } + case 24: { + FontHeightPx = input.ReadInt32(); + break; + } + case 32: { + MaxNumLabels = input.ReadInt32(); + break; + } + case 40: { + FontFace = input.ReadInt32(); + break; + } + case 48: { + Location = (global::Mediapipe.LabelsToRenderDataCalculatorOptions.Types.Location) input.ReadEnum(); + break; + } + case 56: { + HorizontalOffsetPx = input.ReadInt32(); + break; + } + case 64: { + VerticalOffsetPx = input.ReadInt32(); + break; + } + case 72: { + UseDisplayName = input.ReadBool(); + break; + } + case 80: { + DisplayClassificationScore = input.ReadBool(); + break; + } + case 89: { + OutlineThickness = input.ReadDouble(); + break; + } + case 98: { + outlineColor_.AddEntriesFrom(ref input, _repeated_outlineColor_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LabelsToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Label location. + /// + public enum Location { + [pbr::OriginalName("TOP_LEFT")] TopLeft = 0, + [pbr::OriginalName("BOTTOM_LEFT")] BottomLeft = 1, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the LabelsToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(271660364, pb::FieldCodec.ForMessage(2173282914, global::Mediapipe.LabelsToRenderDataCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs.meta new file mode 100644 index 0000000..5b93eb3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LabelsToRenderDataCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb6af299f03ecbd54b8998d4cc32c065 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs new file mode 100644 index 0000000..61a3b90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs @@ -0,0 +1,267 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/landmark_projection_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/landmark_projection_calculator.proto + public static partial class LandmarkProjectionCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/landmark_projection_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarkProjectionCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYW5kbWFya19wcm9qZWN0", + "aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIqMBCiNMYW5kbWFya1Byb2plY3Rp", + "b25DYWxjdWxhdG9yT3B0aW9ucxIeCg9pZ25vcmVfcm90YXRpb24YASABKAg6", + "BWZhbHNlMlwKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxj0", + "+Mp9IAEoCzIuLm1lZGlhcGlwZS5MYW5kbWFya1Byb2plY3Rpb25DYWxjdWxh", + "dG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarkProjectionCalculatorOptions), global::Mediapipe.LandmarkProjectionCalculatorOptions.Parser, new[]{ "IgnoreRotation" }, null, null, new pb::Extension[] { global::Mediapipe.LandmarkProjectionCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarkProjectionCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarkProjectionCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkProjectionCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkProjectionCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkProjectionCalculatorOptions(LandmarkProjectionCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + ignoreRotation_ = other.ignoreRotation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkProjectionCalculatorOptions Clone() { + return new LandmarkProjectionCalculatorOptions(this); + } + + /// Field number for the "ignore_rotation" field. + public const int IgnoreRotationFieldNumber = 1; + private readonly static bool IgnoreRotationDefaultValue = false; + + private bool ignoreRotation_; + /// + /// Ignore the rotation field of rect proto for projection. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IgnoreRotation { + get { if ((_hasBits0 & 1) != 0) { return ignoreRotation_; } else { return IgnoreRotationDefaultValue; } } + set { + _hasBits0 |= 1; + ignoreRotation_ = value; + } + } + /// Gets whether the "ignore_rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIgnoreRotation { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "ignore_rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIgnoreRotation() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarkProjectionCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarkProjectionCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IgnoreRotation != other.IgnoreRotation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIgnoreRotation) hash ^= IgnoreRotation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIgnoreRotation) { + output.WriteRawTag(8); + output.WriteBool(IgnoreRotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIgnoreRotation) { + output.WriteRawTag(8); + output.WriteBool(IgnoreRotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIgnoreRotation) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarkProjectionCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasIgnoreRotation) { + IgnoreRotation = other.IgnoreRotation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IgnoreRotation = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IgnoreRotation = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the LandmarkProjectionCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(263371892, pb::FieldCodec.ForMessage(2106975138, global::Mediapipe.LandmarkProjectionCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs.meta new file mode 100644 index 0000000..9e2b60d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarkProjectionCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ced62f2b6244ce807b131a90c01648e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs new file mode 100644 index 0000000..4d0c50b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs @@ -0,0 +1,1454 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/landmarks_smoothing_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/landmarks_smoothing_calculator.proto + public static partial class LandmarksSmoothingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/landmarks_smoothing_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarksSmoothingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYW5kbWFya3Nfc21vb3Ro", + "aW5nX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRosbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yX29wdGlvbnMucHJvdG8i9QUKI0xhbmRtYXJr", + "c1Ntb290aGluZ0NhbGN1bGF0b3JPcHRpb25zEkwKCW5vX2ZpbHRlchgBIAEo", + "CzI3Lm1lZGlhcGlwZS5MYW5kbWFya3NTbW9vdGhpbmdDYWxjdWxhdG9yT3B0", + "aW9ucy5Ob0ZpbHRlckgAElgKD3ZlbG9jaXR5X2ZpbHRlchgCIAEoCzI9Lm1l", + "ZGlhcGlwZS5MYW5kbWFya3NTbW9vdGhpbmdDYWxjdWxhdG9yT3B0aW9ucy5W", + "ZWxvY2l0eUZpbHRlckgAElcKD29uZV9ldXJvX2ZpbHRlchgDIAEoCzI8Lm1l", + "ZGlhcGlwZS5MYW5kbWFya3NTbW9vdGhpbmdDYWxjdWxhdG9yT3B0aW9ucy5P", + "bmVFdXJvRmlsdGVySAAaCgoITm9GaWx0ZXIakwEKDlZlbG9jaXR5RmlsdGVy", + "EhYKC3dpbmRvd19zaXplGAEgASgFOgE1EhoKDnZlbG9jaXR5X3NjYWxlGAIg", + "ASgCOgIxMBInChhtaW5fYWxsb3dlZF9vYmplY3Rfc2NhbGUYAyABKAI6BTFl", + "LTA2EiQKFWRpc2FibGVfdmFsdWVfc2NhbGluZxgEIAEoCDoFZmFsc2UauQEK", + "DU9uZUV1cm9GaWx0ZXISFQoJZnJlcXVlbmN5GAEgASgCOgIzMBIVCgptaW5f", + "Y3V0b2ZmGAIgASgCOgExEg8KBGJldGEYAyABKAI6ATASGgoPZGVyaXZhdGVf", + "Y3V0b2ZmGAQgASgCOgExEicKGG1pbl9hbGxvd2VkX29iamVjdF9zY2FsZRgF", + "IAEoAjoFMWUtMDYSJAoVZGlzYWJsZV92YWx1ZV9zY2FsaW5nGAYgASgIOgVm", + "YWxzZTJdCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYhbSl", + "mwEgASgLMi4ubWVkaWFwaXBlLkxhbmRtYXJrc1Ntb290aGluZ0NhbGN1bGF0", + "b3JPcHRpb25zQhAKDmZpbHRlcl9vcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksSmoothingCalculatorOptions), global::Mediapipe.LandmarksSmoothingCalculatorOptions.Parser, new[]{ "NoFilter", "VelocityFilter", "OneEuroFilter" }, new[]{ "FilterOptions" }, null, new pb::Extension[] { global::Mediapipe.LandmarksSmoothingCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter), global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter), global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter.Parser, new[]{ "WindowSize", "VelocityScale", "MinAllowedObjectScale", "DisableValueScaling" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter), global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter.Parser, new[]{ "Frequency", "MinCutoff", "Beta", "DerivateCutoff", "MinAllowedObjectScale", "DisableValueScaling" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarksSmoothingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksSmoothingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksSmoothingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksSmoothingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksSmoothingCalculatorOptions(LandmarksSmoothingCalculatorOptions other) : this() { + switch (other.FilterOptionsCase) { + case FilterOptionsOneofCase.NoFilter: + NoFilter = other.NoFilter.Clone(); + break; + case FilterOptionsOneofCase.VelocityFilter: + VelocityFilter = other.VelocityFilter.Clone(); + break; + case FilterOptionsOneofCase.OneEuroFilter: + OneEuroFilter = other.OneEuroFilter.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksSmoothingCalculatorOptions Clone() { + return new LandmarksSmoothingCalculatorOptions(this); + } + + /// Field number for the "no_filter" field. + public const int NoFilterFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter NoFilter { + get { return filterOptionsCase_ == FilterOptionsOneofCase.NoFilter ? (global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter) filterOptions_ : null; } + set { + filterOptions_ = value; + filterOptionsCase_ = value == null ? FilterOptionsOneofCase.None : FilterOptionsOneofCase.NoFilter; + } + } + + /// Field number for the "velocity_filter" field. + public const int VelocityFilterFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter VelocityFilter { + get { return filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter ? (global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter) filterOptions_ : null; } + set { + filterOptions_ = value; + filterOptionsCase_ = value == null ? FilterOptionsOneofCase.None : FilterOptionsOneofCase.VelocityFilter; + } + } + + /// Field number for the "one_euro_filter" field. + public const int OneEuroFilterFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter OneEuroFilter { + get { return filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter ? (global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter) filterOptions_ : null; } + set { + filterOptions_ = value; + filterOptionsCase_ = value == null ? FilterOptionsOneofCase.None : FilterOptionsOneofCase.OneEuroFilter; + } + } + + private object filterOptions_; + /// Enum of possible cases for the "filter_options" oneof. + public enum FilterOptionsOneofCase { + None = 0, + NoFilter = 1, + VelocityFilter = 2, + OneEuroFilter = 3, + } + private FilterOptionsOneofCase filterOptionsCase_ = FilterOptionsOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterOptionsOneofCase FilterOptionsCase { + get { return filterOptionsCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilterOptions() { + filterOptionsCase_ = FilterOptionsOneofCase.None; + filterOptions_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksSmoothingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksSmoothingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(NoFilter, other.NoFilter)) return false; + if (!object.Equals(VelocityFilter, other.VelocityFilter)) return false; + if (!object.Equals(OneEuroFilter, other.OneEuroFilter)) return false; + if (FilterOptionsCase != other.FilterOptionsCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) hash ^= NoFilter.GetHashCode(); + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) hash ^= VelocityFilter.GetHashCode(); + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) hash ^= OneEuroFilter.GetHashCode(); + hash ^= (int) filterOptionsCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + output.WriteRawTag(10); + output.WriteMessage(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) { + output.WriteRawTag(18); + output.WriteMessage(VelocityFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) { + output.WriteRawTag(26); + output.WriteMessage(OneEuroFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + output.WriteRawTag(10); + output.WriteMessage(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) { + output.WriteRawTag(18); + output.WriteMessage(VelocityFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) { + output.WriteRawTag(26); + output.WriteMessage(OneEuroFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VelocityFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OneEuroFilter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksSmoothingCalculatorOptions other) { + if (other == null) { + return; + } + switch (other.FilterOptionsCase) { + case FilterOptionsOneofCase.NoFilter: + if (NoFilter == null) { + NoFilter = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter(); + } + NoFilter.MergeFrom(other.NoFilter); + break; + case FilterOptionsOneofCase.VelocityFilter: + if (VelocityFilter == null) { + VelocityFilter = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter(); + } + VelocityFilter.MergeFrom(other.VelocityFilter); + break; + case FilterOptionsOneofCase.OneEuroFilter: + if (OneEuroFilter == null) { + OneEuroFilter = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter(); + } + OneEuroFilter.MergeFrom(other.OneEuroFilter); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + subBuilder.MergeFrom(NoFilter); + } + input.ReadMessage(subBuilder); + NoFilter = subBuilder; + break; + } + case 18: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) { + subBuilder.MergeFrom(VelocityFilter); + } + input.ReadMessage(subBuilder); + VelocityFilter = subBuilder; + break; + } + case 26: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) { + subBuilder.MergeFrom(OneEuroFilter); + } + input.ReadMessage(subBuilder); + OneEuroFilter = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.NoFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + subBuilder.MergeFrom(NoFilter); + } + input.ReadMessage(subBuilder); + NoFilter = subBuilder; + break; + } + case 18: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.VelocityFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.VelocityFilter) { + subBuilder.MergeFrom(VelocityFilter); + } + input.ReadMessage(subBuilder); + VelocityFilter = subBuilder; + break; + } + case 26: { + global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter subBuilder = new global::Mediapipe.LandmarksSmoothingCalculatorOptions.Types.OneEuroFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.OneEuroFilter) { + subBuilder.MergeFrom(OneEuroFilter); + } + input.ReadMessage(subBuilder); + OneEuroFilter = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LandmarksSmoothingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Default behaviour and fast way to disable smoothing. + /// + public sealed partial class NoFilter : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NoFilter()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksSmoothingCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter(NoFilter other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter Clone() { + return new NoFilter(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NoFilter); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NoFilter other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NoFilter other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class VelocityFilter : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VelocityFilter()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksSmoothingCalculatorOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VelocityFilter() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VelocityFilter(VelocityFilter other) : this() { + _hasBits0 = other._hasBits0; + windowSize_ = other.windowSize_; + velocityScale_ = other.velocityScale_; + minAllowedObjectScale_ = other.minAllowedObjectScale_; + disableValueScaling_ = other.disableValueScaling_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VelocityFilter Clone() { + return new VelocityFilter(this); + } + + /// Field number for the "window_size" field. + public const int WindowSizeFieldNumber = 1; + private readonly static int WindowSizeDefaultValue = 5; + + private int windowSize_; + /// + /// Number of value changes to keep over time. + /// Higher value adds to lag and to stability. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int WindowSize { + get { if ((_hasBits0 & 1) != 0) { return windowSize_; } else { return WindowSizeDefaultValue; } } + set { + _hasBits0 |= 1; + windowSize_ = value; + } + } + /// Gets whether the "window_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWindowSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "window_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWindowSize() { + _hasBits0 &= ~1; + } + + /// Field number for the "velocity_scale" field. + public const int VelocityScaleFieldNumber = 2; + private readonly static float VelocityScaleDefaultValue = 10F; + + private float velocityScale_; + /// + /// Scale to apply to the velocity calculated over the given window. With + /// higher velocity `low pass filter` weights new values higher. + /// Lower value adds to lag and to stability. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VelocityScale { + get { if ((_hasBits0 & 2) != 0) { return velocityScale_; } else { return VelocityScaleDefaultValue; } } + set { + _hasBits0 |= 2; + velocityScale_ = value; + } + } + /// Gets whether the "velocity_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVelocityScale { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "velocity_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVelocityScale() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_allowed_object_scale" field. + public const int MinAllowedObjectScaleFieldNumber = 3; + private readonly static float MinAllowedObjectScaleDefaultValue = 1e-06F; + + private float minAllowedObjectScale_; + /// + /// If calculated object scale is less than given value smoothing will be + /// disabled and landmarks will be returned as is. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinAllowedObjectScale { + get { if ((_hasBits0 & 4) != 0) { return minAllowedObjectScale_; } else { return MinAllowedObjectScaleDefaultValue; } } + set { + _hasBits0 |= 4; + minAllowedObjectScale_ = value; + } + } + /// Gets whether the "min_allowed_object_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinAllowedObjectScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_allowed_object_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinAllowedObjectScale() { + _hasBits0 &= ~4; + } + + /// Field number for the "disable_value_scaling" field. + public const int DisableValueScalingFieldNumber = 4; + private readonly static bool DisableValueScalingDefaultValue = false; + + private bool disableValueScaling_; + /// + /// Disable value scaling based on object size and use `1.0` instead. + /// If not disabled, value scale is calculated as inverse value of object + /// size. Object size is calculated as maximum side of rectangular bounding + /// box of the object in XY plane. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DisableValueScaling { + get { if ((_hasBits0 & 8) != 0) { return disableValueScaling_; } else { return DisableValueScalingDefaultValue; } } + set { + _hasBits0 |= 8; + disableValueScaling_ = value; + } + } + /// Gets whether the "disable_value_scaling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisableValueScaling { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "disable_value_scaling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisableValueScaling() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VelocityFilter); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VelocityFilter other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (WindowSize != other.WindowSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VelocityScale, other.VelocityScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAllowedObjectScale, other.MinAllowedObjectScale)) return false; + if (DisableValueScaling != other.DisableValueScaling) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasWindowSize) hash ^= WindowSize.GetHashCode(); + if (HasVelocityScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VelocityScale); + if (HasMinAllowedObjectScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAllowedObjectScale); + if (HasDisableValueScaling) hash ^= DisableValueScaling.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasWindowSize) { + output.WriteRawTag(8); + output.WriteInt32(WindowSize); + } + if (HasVelocityScale) { + output.WriteRawTag(21); + output.WriteFloat(VelocityScale); + } + if (HasMinAllowedObjectScale) { + output.WriteRawTag(29); + output.WriteFloat(MinAllowedObjectScale); + } + if (HasDisableValueScaling) { + output.WriteRawTag(32); + output.WriteBool(DisableValueScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasWindowSize) { + output.WriteRawTag(8); + output.WriteInt32(WindowSize); + } + if (HasVelocityScale) { + output.WriteRawTag(21); + output.WriteFloat(VelocityScale); + } + if (HasMinAllowedObjectScale) { + output.WriteRawTag(29); + output.WriteFloat(MinAllowedObjectScale); + } + if (HasDisableValueScaling) { + output.WriteRawTag(32); + output.WriteBool(DisableValueScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasWindowSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(WindowSize); + } + if (HasVelocityScale) { + size += 1 + 4; + } + if (HasMinAllowedObjectScale) { + size += 1 + 4; + } + if (HasDisableValueScaling) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VelocityFilter other) { + if (other == null) { + return; + } + if (other.HasWindowSize) { + WindowSize = other.WindowSize; + } + if (other.HasVelocityScale) { + VelocityScale = other.VelocityScale; + } + if (other.HasMinAllowedObjectScale) { + MinAllowedObjectScale = other.MinAllowedObjectScale; + } + if (other.HasDisableValueScaling) { + DisableValueScaling = other.DisableValueScaling; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + WindowSize = input.ReadInt32(); + break; + } + case 21: { + VelocityScale = input.ReadFloat(); + break; + } + case 29: { + MinAllowedObjectScale = input.ReadFloat(); + break; + } + case 32: { + DisableValueScaling = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + WindowSize = input.ReadInt32(); + break; + } + case 21: { + VelocityScale = input.ReadFloat(); + break; + } + case 29: { + MinAllowedObjectScale = input.ReadFloat(); + break; + } + case 32: { + DisableValueScaling = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// For the details of the filter implementation and the procedure of its + /// configuration please check http://cristal.univ-lille.fr/~casiez/1euro/ + /// + public sealed partial class OneEuroFilter : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneEuroFilter()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksSmoothingCalculatorOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OneEuroFilter() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OneEuroFilter(OneEuroFilter other) : this() { + _hasBits0 = other._hasBits0; + frequency_ = other.frequency_; + minCutoff_ = other.minCutoff_; + beta_ = other.beta_; + derivateCutoff_ = other.derivateCutoff_; + minAllowedObjectScale_ = other.minAllowedObjectScale_; + disableValueScaling_ = other.disableValueScaling_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OneEuroFilter Clone() { + return new OneEuroFilter(this); + } + + /// Field number for the "frequency" field. + public const int FrequencyFieldNumber = 1; + private readonly static float FrequencyDefaultValue = 30F; + + private float frequency_; + /// + /// Frequency of incomming frames defined in frames per seconds. Used only if + /// can't be calculated from provided events (e.g. on the very first frame). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Frequency { + get { if ((_hasBits0 & 1) != 0) { return frequency_; } else { return FrequencyDefaultValue; } } + set { + _hasBits0 |= 1; + frequency_ = value; + } + } + /// Gets whether the "frequency" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrequency { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frequency" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrequency() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_cutoff" field. + public const int MinCutoffFieldNumber = 2; + private readonly static float MinCutoffDefaultValue = 1F; + + private float minCutoff_; + /// + /// Minimum cutoff frequency. Start by tuning this parameter while keeping + /// `beta = 0` to reduce jittering to the desired level. 1Hz (the default + /// value) is a good starting point. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinCutoff { + get { if ((_hasBits0 & 2) != 0) { return minCutoff_; } else { return MinCutoffDefaultValue; } } + set { + _hasBits0 |= 2; + minCutoff_ = value; + } + } + /// Gets whether the "min_cutoff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinCutoff { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_cutoff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinCutoff() { + _hasBits0 &= ~2; + } + + /// Field number for the "beta" field. + public const int BetaFieldNumber = 3; + private readonly static float BetaDefaultValue = 0F; + + private float beta_; + /// + /// Cutoff slope. After `min_cutoff` is configured, start increasing `beta` + /// value to reduce the lag introduced by the `min_cutoff`. Find the desired + /// balance between jittering and lag. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Beta { + get { if ((_hasBits0 & 4) != 0) { return beta_; } else { return BetaDefaultValue; } } + set { + _hasBits0 |= 4; + beta_ = value; + } + } + /// Gets whether the "beta" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBeta { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "beta" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBeta() { + _hasBits0 &= ~4; + } + + /// Field number for the "derivate_cutoff" field. + public const int DerivateCutoffFieldNumber = 4; + private readonly static float DerivateCutoffDefaultValue = 1F; + + private float derivateCutoff_; + /// + /// Cutoff frequency for derivate. It is set to 1Hz in the original + /// algorithm, but can be tuned to further smooth the speed (i.e. derivate) + /// on the object. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DerivateCutoff { + get { if ((_hasBits0 & 8) != 0) { return derivateCutoff_; } else { return DerivateCutoffDefaultValue; } } + set { + _hasBits0 |= 8; + derivateCutoff_ = value; + } + } + /// Gets whether the "derivate_cutoff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDerivateCutoff { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "derivate_cutoff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDerivateCutoff() { + _hasBits0 &= ~8; + } + + /// Field number for the "min_allowed_object_scale" field. + public const int MinAllowedObjectScaleFieldNumber = 5; + private readonly static float MinAllowedObjectScaleDefaultValue = 1e-06F; + + private float minAllowedObjectScale_; + /// + /// If calculated object scale is less than given value smoothing will be + /// disabled and landmarks will be returned as is. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinAllowedObjectScale { + get { if ((_hasBits0 & 16) != 0) { return minAllowedObjectScale_; } else { return MinAllowedObjectScaleDefaultValue; } } + set { + _hasBits0 |= 16; + minAllowedObjectScale_ = value; + } + } + /// Gets whether the "min_allowed_object_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinAllowedObjectScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "min_allowed_object_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinAllowedObjectScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "disable_value_scaling" field. + public const int DisableValueScalingFieldNumber = 6; + private readonly static bool DisableValueScalingDefaultValue = false; + + private bool disableValueScaling_; + /// + /// Disable value scaling based on object size and use `1.0` instead. + /// If not disabled, value scale is calculated as inverse value of object + /// size. Object size is calculated as maximum side of rectangular bounding + /// box of the object in XY plane. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DisableValueScaling { + get { if ((_hasBits0 & 32) != 0) { return disableValueScaling_; } else { return DisableValueScalingDefaultValue; } } + set { + _hasBits0 |= 32; + disableValueScaling_ = value; + } + } + /// Gets whether the "disable_value_scaling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisableValueScaling { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "disable_value_scaling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisableValueScaling() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OneEuroFilter); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OneEuroFilter other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Frequency, other.Frequency)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinCutoff, other.MinCutoff)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Beta, other.Beta)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DerivateCutoff, other.DerivateCutoff)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAllowedObjectScale, other.MinAllowedObjectScale)) return false; + if (DisableValueScaling != other.DisableValueScaling) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrequency) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Frequency); + if (HasMinCutoff) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinCutoff); + if (HasBeta) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Beta); + if (HasDerivateCutoff) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DerivateCutoff); + if (HasMinAllowedObjectScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAllowedObjectScale); + if (HasDisableValueScaling) hash ^= DisableValueScaling.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrequency) { + output.WriteRawTag(13); + output.WriteFloat(Frequency); + } + if (HasMinCutoff) { + output.WriteRawTag(21); + output.WriteFloat(MinCutoff); + } + if (HasBeta) { + output.WriteRawTag(29); + output.WriteFloat(Beta); + } + if (HasDerivateCutoff) { + output.WriteRawTag(37); + output.WriteFloat(DerivateCutoff); + } + if (HasMinAllowedObjectScale) { + output.WriteRawTag(45); + output.WriteFloat(MinAllowedObjectScale); + } + if (HasDisableValueScaling) { + output.WriteRawTag(48); + output.WriteBool(DisableValueScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrequency) { + output.WriteRawTag(13); + output.WriteFloat(Frequency); + } + if (HasMinCutoff) { + output.WriteRawTag(21); + output.WriteFloat(MinCutoff); + } + if (HasBeta) { + output.WriteRawTag(29); + output.WriteFloat(Beta); + } + if (HasDerivateCutoff) { + output.WriteRawTag(37); + output.WriteFloat(DerivateCutoff); + } + if (HasMinAllowedObjectScale) { + output.WriteRawTag(45); + output.WriteFloat(MinAllowedObjectScale); + } + if (HasDisableValueScaling) { + output.WriteRawTag(48); + output.WriteBool(DisableValueScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrequency) { + size += 1 + 4; + } + if (HasMinCutoff) { + size += 1 + 4; + } + if (HasBeta) { + size += 1 + 4; + } + if (HasDerivateCutoff) { + size += 1 + 4; + } + if (HasMinAllowedObjectScale) { + size += 1 + 4; + } + if (HasDisableValueScaling) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OneEuroFilter other) { + if (other == null) { + return; + } + if (other.HasFrequency) { + Frequency = other.Frequency; + } + if (other.HasMinCutoff) { + MinCutoff = other.MinCutoff; + } + if (other.HasBeta) { + Beta = other.Beta; + } + if (other.HasDerivateCutoff) { + DerivateCutoff = other.DerivateCutoff; + } + if (other.HasMinAllowedObjectScale) { + MinAllowedObjectScale = other.MinAllowedObjectScale; + } + if (other.HasDisableValueScaling) { + DisableValueScaling = other.DisableValueScaling; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Frequency = input.ReadFloat(); + break; + } + case 21: { + MinCutoff = input.ReadFloat(); + break; + } + case 29: { + Beta = input.ReadFloat(); + break; + } + case 37: { + DerivateCutoff = input.ReadFloat(); + break; + } + case 45: { + MinAllowedObjectScale = input.ReadFloat(); + break; + } + case 48: { + DisableValueScaling = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Frequency = input.ReadFloat(); + break; + } + case 21: { + MinCutoff = input.ReadFloat(); + break; + } + case 29: { + Beta = input.ReadFloat(); + break; + } + case 37: { + DerivateCutoff = input.ReadFloat(); + break; + } + case 45: { + MinAllowedObjectScale = input.ReadFloat(); + break; + } + case 48: { + DisableValueScaling = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the LandmarksSmoothingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(325671429, pb::FieldCodec.ForMessage(2605371434, global::Mediapipe.LandmarksSmoothingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs.meta new file mode 100644 index 0000000..e4a34ea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksSmoothingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99ef370b31f170f39bc5665dfb5da1ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs new file mode 100644 index 0000000..159a9bc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs @@ -0,0 +1,241 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/landmarks_to_detection_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/landmarks_to_detection_calculator.proto + public static partial class LandmarksToDetectionCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/landmarks_to_detection_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarksToDetectionCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkJtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYW5kbWFya3NfdG9fZGV0", + "ZWN0aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBl", + "L2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIqoBCiVMYW5kbWFya3NUb0Rl", + "dGVjdGlvbkNhbGN1bGF0b3JPcHRpb25zEiEKGXNlbGVjdGVkX2xhbmRtYXJr", + "X2luZGljZXMYASADKAUyXgoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JP", + "cHRpb25zGPWpiXwgASgLMjAubWVkaWFwaXBlLkxhbmRtYXJrc1RvRGV0ZWN0", + "aW9uQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksToDetectionCalculatorOptions), global::Mediapipe.LandmarksToDetectionCalculatorOptions.Parser, new[]{ "SelectedLandmarkIndices" }, null, null, new pb::Extension[] { global::Mediapipe.LandmarksToDetectionCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarksToDetectionCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksToDetectionCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksToDetectionCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToDetectionCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToDetectionCalculatorOptions(LandmarksToDetectionCalculatorOptions other) : this() { + selectedLandmarkIndices_ = other.selectedLandmarkIndices_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToDetectionCalculatorOptions Clone() { + return new LandmarksToDetectionCalculatorOptions(this); + } + + /// Field number for the "selected_landmark_indices" field. + public const int SelectedLandmarkIndicesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_selectedLandmarkIndices_codec + = pb::FieldCodec.ForInt32(8); + private readonly pbc::RepeatedField selectedLandmarkIndices_ = new pbc::RepeatedField(); + /// + /// A subset of indices to be included when creating the detection. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SelectedLandmarkIndices { + get { return selectedLandmarkIndices_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksToDetectionCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksToDetectionCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!selectedLandmarkIndices_.Equals(other.selectedLandmarkIndices_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= selectedLandmarkIndices_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + selectedLandmarkIndices_.WriteTo(output, _repeated_selectedLandmarkIndices_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + selectedLandmarkIndices_.WriteTo(ref output, _repeated_selectedLandmarkIndices_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += selectedLandmarkIndices_.CalculateSize(_repeated_selectedLandmarkIndices_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksToDetectionCalculatorOptions other) { + if (other == null) { + return; + } + selectedLandmarkIndices_.Add(other.selectedLandmarkIndices_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + selectedLandmarkIndices_.AddEntriesFrom(input, _repeated_selectedLandmarkIndices_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + selectedLandmarkIndices_.AddEntriesFrom(ref input, _repeated_selectedLandmarkIndices_codec); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the LandmarksToDetectionCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(260199669, pb::FieldCodec.ForMessage(2081597354, global::Mediapipe.LandmarksToDetectionCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs.meta new file mode 100644 index 0000000..2c79e3e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToDetectionCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d172b181791a46859a1a2162ac85e91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs new file mode 100644 index 0000000..3d19f7f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs @@ -0,0 +1,267 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/landmarks_to_floats_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/landmarks_to_floats_calculator.proto + public static partial class LandmarksToFloatsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/landmarks_to_floats_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarksToFloatsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYW5kbWFya3NfdG9fZmxv", + "YXRzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIp0BCiJMYW5kbWFya3NUb0Zsb2F0", + "c0NhbGN1bGF0b3JPcHRpb25zEhkKDm51bV9kaW1lbnNpb25zGAEgASgFOgEy", + "MlwKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxjM59WCASAB", + "KAsyLS5tZWRpYXBpcGUuTGFuZG1hcmtzVG9GbG9hdHNDYWxjdWxhdG9yT3B0", + "aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksToFloatsCalculatorOptions), global::Mediapipe.LandmarksToFloatsCalculatorOptions.Parser, new[]{ "NumDimensions" }, null, null, new pb::Extension[] { global::Mediapipe.LandmarksToFloatsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarksToFloatsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksToFloatsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksToFloatsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToFloatsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToFloatsCalculatorOptions(LandmarksToFloatsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numDimensions_ = other.numDimensions_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToFloatsCalculatorOptions Clone() { + return new LandmarksToFloatsCalculatorOptions(this); + } + + /// Field number for the "num_dimensions" field. + public const int NumDimensionsFieldNumber = 1; + private readonly static int NumDimensionsDefaultValue = 2; + + private int numDimensions_; + /// + /// Number of dimensions to convert. Must within [1, 3]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumDimensions { + get { if ((_hasBits0 & 1) != 0) { return numDimensions_; } else { return NumDimensionsDefaultValue; } } + set { + _hasBits0 |= 1; + numDimensions_ = value; + } + } + /// Gets whether the "num_dimensions" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumDimensions { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_dimensions" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumDimensions() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksToFloatsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksToFloatsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumDimensions != other.NumDimensions) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumDimensions) hash ^= NumDimensions.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumDimensions) { + output.WriteRawTag(8); + output.WriteInt32(NumDimensions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumDimensions) { + output.WriteRawTag(8); + output.WriteInt32(NumDimensions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumDimensions) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumDimensions); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksToFloatsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumDimensions) { + NumDimensions = other.NumDimensions; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumDimensions = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumDimensions = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the LandmarksToFloatsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(274035660, pb::FieldCodec.ForMessage(2192285282, global::Mediapipe.LandmarksToFloatsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs.meta new file mode 100644 index 0000000..166e933 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToFloatsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4aa5bcb0d3b4c9dd9a8175ced9912e9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs new file mode 100644 index 0000000..d42cb15 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs @@ -0,0 +1,899 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/landmarks_to_render_data_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/landmarks_to_render_data_calculator.proto + public static partial class LandmarksToRenderDataCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/landmarks_to_render_data_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarksToRenderDataCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkRtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYW5kbWFya3NfdG9fcmVu", + "ZGVyX2RhdGFfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBp", + "cGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8aGm1lZGlhcGlwZS91dGls", + "L2NvbG9yLnByb3RvIu4ECiZMYW5kbWFya3NUb1JlbmRlckRhdGFDYWxjdWxh", + "dG9yT3B0aW9ucxIcChRsYW5kbWFya19jb25uZWN0aW9ucxgBIAMoBRIoCg5s", + "YW5kbWFya19jb2xvchgCIAEoCzIQLm1lZGlhcGlwZS5Db2xvchIqChBjb25u", + "ZWN0aW9uX2NvbG9yGAMgASgLMhAubWVkaWFwaXBlLkNvbG9yEhQKCXRoaWNr", + "bmVzcxgEIAEoAToBMRImChh2aXN1YWxpemVfbGFuZG1hcmtfZGVwdGgYBSAB", + "KAg6BHRydWUSIQoSdXRpbGl6ZV92aXNpYmlsaXR5GAYgASgIOgVmYWxzZRIf", + "ChR2aXNpYmlsaXR5X3RocmVzaG9sZBgHIAEoAToBMBIfChB1dGlsaXplX3By", + "ZXNlbmNlGAggASgIOgVmYWxzZRIdChJwcmVzZW5jZV90aHJlc2hvbGQYCSAB", + "KAE6ATASJQoabWluX2RlcHRoX2NpcmNsZV90aGlja25lc3MYCiABKAE6ATAS", + "JgoabWF4X2RlcHRoX2NpcmNsZV90aGlja25lc3MYCyABKAE6AjE4Ei4KFG1p", + "bl9kZXB0aF9saW5lX2NvbG9yGAwgASgLMhAubWVkaWFwaXBlLkNvbG9yEi4K", + "FG1heF9kZXB0aF9saW5lX2NvbG9yGA0gASgLMhAubWVkaWFwaXBlLkNvbG9y", + "Ml8KA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxi90p17IAEo", + "CzIxLm1lZGlhcGlwZS5MYW5kbWFya3NUb1JlbmRlckRhdGFDYWxjdWxhdG9y", + "T3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarksToRenderDataCalculatorOptions), global::Mediapipe.LandmarksToRenderDataCalculatorOptions.Parser, new[]{ "LandmarkConnections", "LandmarkColor", "ConnectionColor", "Thickness", "VisualizeLandmarkDepth", "UtilizeVisibility", "VisibilityThreshold", "UtilizePresence", "PresenceThreshold", "MinDepthCircleThickness", "MaxDepthCircleThickness", "MinDepthLineColor", "MaxDepthLineColor" }, null, null, new pb::Extension[] { global::Mediapipe.LandmarksToRenderDataCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LandmarksToRenderDataCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksToRenderDataCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarksToRenderDataCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToRenderDataCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToRenderDataCalculatorOptions(LandmarksToRenderDataCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + landmarkConnections_ = other.landmarkConnections_.Clone(); + landmarkColor_ = other.landmarkColor_ != null ? other.landmarkColor_.Clone() : null; + connectionColor_ = other.connectionColor_ != null ? other.connectionColor_.Clone() : null; + thickness_ = other.thickness_; + visualizeLandmarkDepth_ = other.visualizeLandmarkDepth_; + utilizeVisibility_ = other.utilizeVisibility_; + visibilityThreshold_ = other.visibilityThreshold_; + utilizePresence_ = other.utilizePresence_; + presenceThreshold_ = other.presenceThreshold_; + minDepthCircleThickness_ = other.minDepthCircleThickness_; + maxDepthCircleThickness_ = other.maxDepthCircleThickness_; + minDepthLineColor_ = other.minDepthLineColor_ != null ? other.minDepthLineColor_.Clone() : null; + maxDepthLineColor_ = other.maxDepthLineColor_ != null ? other.maxDepthLineColor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksToRenderDataCalculatorOptions Clone() { + return new LandmarksToRenderDataCalculatorOptions(this); + } + + /// Field number for the "landmark_connections" field. + public const int LandmarkConnectionsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_landmarkConnections_codec + = pb::FieldCodec.ForInt32(8); + private readonly pbc::RepeatedField landmarkConnections_ = new pbc::RepeatedField(); + /// + /// Specifies the landmarks to be connected in the drawing. For example, the + /// landmark_connections value of [0, 1, 1, 2] specifies two connections: one + /// that connects landmarks with index 0 and 1, and another that connects + /// landmarks with index 1 and 2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LandmarkConnections { + get { return landmarkConnections_; } + } + + /// Field number for the "landmark_color" field. + public const int LandmarkColorFieldNumber = 2; + private global::Mediapipe.Color landmarkColor_; + /// + /// Color of the landmarks. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color LandmarkColor { + get { return landmarkColor_; } + set { + landmarkColor_ = value; + } + } + + /// Field number for the "connection_color" field. + public const int ConnectionColorFieldNumber = 3; + private global::Mediapipe.Color connectionColor_; + /// + /// Color of the connections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color ConnectionColor { + get { return connectionColor_; } + set { + connectionColor_ = value; + } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 4; + private readonly static double ThicknessDefaultValue = 1D; + + private double thickness_; + /// + /// Thickness of the drawing of landmarks and connections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 1) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 1; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~1; + } + + /// Field number for the "visualize_landmark_depth" field. + public const int VisualizeLandmarkDepthFieldNumber = 5; + private readonly static bool VisualizeLandmarkDepthDefaultValue = true; + + private bool visualizeLandmarkDepth_; + /// + /// Change color and size of rendered landmarks based on its z value. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeLandmarkDepth { + get { if ((_hasBits0 & 2) != 0) { return visualizeLandmarkDepth_; } else { return VisualizeLandmarkDepthDefaultValue; } } + set { + _hasBits0 |= 2; + visualizeLandmarkDepth_ = value; + } + } + /// Gets whether the "visualize_landmark_depth" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeLandmarkDepth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "visualize_landmark_depth" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeLandmarkDepth() { + _hasBits0 &= ~2; + } + + /// Field number for the "utilize_visibility" field. + public const int UtilizeVisibilityFieldNumber = 6; + private readonly static bool UtilizeVisibilityDefaultValue = false; + + private bool utilizeVisibility_; + /// + /// Use landmarks visibility while rendering landmarks and connections. If + /// landmark is not visible, neither it nor adjacent connections will be + /// rendered. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UtilizeVisibility { + get { if ((_hasBits0 & 4) != 0) { return utilizeVisibility_; } else { return UtilizeVisibilityDefaultValue; } } + set { + _hasBits0 |= 4; + utilizeVisibility_ = value; + } + } + /// Gets whether the "utilize_visibility" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUtilizeVisibility { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "utilize_visibility" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUtilizeVisibility() { + _hasBits0 &= ~4; + } + + /// Field number for the "visibility_threshold" field. + public const int VisibilityThresholdFieldNumber = 7; + private readonly static double VisibilityThresholdDefaultValue = 0D; + + private double visibilityThreshold_; + /// + /// Threshold to determine visibility of the landmark. Landmark with visibility + /// greater or equal than threshold is considered visible. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double VisibilityThreshold { + get { if ((_hasBits0 & 8) != 0) { return visibilityThreshold_; } else { return VisibilityThresholdDefaultValue; } } + set { + _hasBits0 |= 8; + visibilityThreshold_ = value; + } + } + /// Gets whether the "visibility_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisibilityThreshold { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "visibility_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisibilityThreshold() { + _hasBits0 &= ~8; + } + + /// Field number for the "utilize_presence" field. + public const int UtilizePresenceFieldNumber = 8; + private readonly static bool UtilizePresenceDefaultValue = false; + + private bool utilizePresence_; + /// + /// Use landmarks presence while rendering landmarks and connections. If + /// landmark is not present, neither it nor adjacent connections will be + /// rendered. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UtilizePresence { + get { if ((_hasBits0 & 16) != 0) { return utilizePresence_; } else { return UtilizePresenceDefaultValue; } } + set { + _hasBits0 |= 16; + utilizePresence_ = value; + } + } + /// Gets whether the "utilize_presence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUtilizePresence { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "utilize_presence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUtilizePresence() { + _hasBits0 &= ~16; + } + + /// Field number for the "presence_threshold" field. + public const int PresenceThresholdFieldNumber = 9; + private readonly static double PresenceThresholdDefaultValue = 0D; + + private double presenceThreshold_; + /// + /// Threshold to determine presence of the landmark. Landmark with presence + /// greater or equal than threshold is considered present. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double PresenceThreshold { + get { if ((_hasBits0 & 32) != 0) { return presenceThreshold_; } else { return PresenceThresholdDefaultValue; } } + set { + _hasBits0 |= 32; + presenceThreshold_ = value; + } + } + /// Gets whether the "presence_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPresenceThreshold { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "presence_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPresenceThreshold() { + _hasBits0 &= ~32; + } + + /// Field number for the "min_depth_circle_thickness" field. + public const int MinDepthCircleThicknessFieldNumber = 10; + private readonly static double MinDepthCircleThicknessDefaultValue = 0D; + + private double minDepthCircleThickness_; + /// + /// Min thickness of the drawing for landmark circle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double MinDepthCircleThickness { + get { if ((_hasBits0 & 64) != 0) { return minDepthCircleThickness_; } else { return MinDepthCircleThicknessDefaultValue; } } + set { + _hasBits0 |= 64; + minDepthCircleThickness_ = value; + } + } + /// Gets whether the "min_depth_circle_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinDepthCircleThickness { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "min_depth_circle_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinDepthCircleThickness() { + _hasBits0 &= ~64; + } + + /// Field number for the "max_depth_circle_thickness" field. + public const int MaxDepthCircleThicknessFieldNumber = 11; + private readonly static double MaxDepthCircleThicknessDefaultValue = 18D; + + private double maxDepthCircleThickness_; + /// + /// Max thickness of the drawing for landmark circle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double MaxDepthCircleThickness { + get { if ((_hasBits0 & 128) != 0) { return maxDepthCircleThickness_; } else { return MaxDepthCircleThicknessDefaultValue; } } + set { + _hasBits0 |= 128; + maxDepthCircleThickness_ = value; + } + } + /// Gets whether the "max_depth_circle_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxDepthCircleThickness { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "max_depth_circle_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxDepthCircleThickness() { + _hasBits0 &= ~128; + } + + /// Field number for the "min_depth_line_color" field. + public const int MinDepthLineColorFieldNumber = 12; + private global::Mediapipe.Color minDepthLineColor_; + /// + /// Gradient color for the lines connecting landmarks at the minimum depth. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color MinDepthLineColor { + get { return minDepthLineColor_; } + set { + minDepthLineColor_ = value; + } + } + + /// Field number for the "max_depth_line_color" field. + public const int MaxDepthLineColorFieldNumber = 13; + private global::Mediapipe.Color maxDepthLineColor_; + /// + /// Gradient color for the lines connecting landmarks at the maximum depth. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color MaxDepthLineColor { + get { return maxDepthLineColor_; } + set { + maxDepthLineColor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksToRenderDataCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksToRenderDataCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!landmarkConnections_.Equals(other.landmarkConnections_)) return false; + if (!object.Equals(LandmarkColor, other.LandmarkColor)) return false; + if (!object.Equals(ConnectionColor, other.ConnectionColor)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + if (VisualizeLandmarkDepth != other.VisualizeLandmarkDepth) return false; + if (UtilizeVisibility != other.UtilizeVisibility) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(VisibilityThreshold, other.VisibilityThreshold)) return false; + if (UtilizePresence != other.UtilizePresence) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(PresenceThreshold, other.PresenceThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(MinDepthCircleThickness, other.MinDepthCircleThickness)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(MaxDepthCircleThickness, other.MaxDepthCircleThickness)) return false; + if (!object.Equals(MinDepthLineColor, other.MinDepthLineColor)) return false; + if (!object.Equals(MaxDepthLineColor, other.MaxDepthLineColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= landmarkConnections_.GetHashCode(); + if (landmarkColor_ != null) hash ^= LandmarkColor.GetHashCode(); + if (connectionColor_ != null) hash ^= ConnectionColor.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + if (HasVisualizeLandmarkDepth) hash ^= VisualizeLandmarkDepth.GetHashCode(); + if (HasUtilizeVisibility) hash ^= UtilizeVisibility.GetHashCode(); + if (HasVisibilityThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(VisibilityThreshold); + if (HasUtilizePresence) hash ^= UtilizePresence.GetHashCode(); + if (HasPresenceThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PresenceThreshold); + if (HasMinDepthCircleThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MinDepthCircleThickness); + if (HasMaxDepthCircleThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MaxDepthCircleThickness); + if (minDepthLineColor_ != null) hash ^= MinDepthLineColor.GetHashCode(); + if (maxDepthLineColor_ != null) hash ^= MaxDepthLineColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + landmarkConnections_.WriteTo(output, _repeated_landmarkConnections_codec); + if (landmarkColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LandmarkColor); + } + if (connectionColor_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ConnectionColor); + } + if (HasThickness) { + output.WriteRawTag(33); + output.WriteDouble(Thickness); + } + if (HasVisualizeLandmarkDepth) { + output.WriteRawTag(40); + output.WriteBool(VisualizeLandmarkDepth); + } + if (HasUtilizeVisibility) { + output.WriteRawTag(48); + output.WriteBool(UtilizeVisibility); + } + if (HasVisibilityThreshold) { + output.WriteRawTag(57); + output.WriteDouble(VisibilityThreshold); + } + if (HasUtilizePresence) { + output.WriteRawTag(64); + output.WriteBool(UtilizePresence); + } + if (HasPresenceThreshold) { + output.WriteRawTag(73); + output.WriteDouble(PresenceThreshold); + } + if (HasMinDepthCircleThickness) { + output.WriteRawTag(81); + output.WriteDouble(MinDepthCircleThickness); + } + if (HasMaxDepthCircleThickness) { + output.WriteRawTag(89); + output.WriteDouble(MaxDepthCircleThickness); + } + if (minDepthLineColor_ != null) { + output.WriteRawTag(98); + output.WriteMessage(MinDepthLineColor); + } + if (maxDepthLineColor_ != null) { + output.WriteRawTag(106); + output.WriteMessage(MaxDepthLineColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + landmarkConnections_.WriteTo(ref output, _repeated_landmarkConnections_codec); + if (landmarkColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(LandmarkColor); + } + if (connectionColor_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ConnectionColor); + } + if (HasThickness) { + output.WriteRawTag(33); + output.WriteDouble(Thickness); + } + if (HasVisualizeLandmarkDepth) { + output.WriteRawTag(40); + output.WriteBool(VisualizeLandmarkDepth); + } + if (HasUtilizeVisibility) { + output.WriteRawTag(48); + output.WriteBool(UtilizeVisibility); + } + if (HasVisibilityThreshold) { + output.WriteRawTag(57); + output.WriteDouble(VisibilityThreshold); + } + if (HasUtilizePresence) { + output.WriteRawTag(64); + output.WriteBool(UtilizePresence); + } + if (HasPresenceThreshold) { + output.WriteRawTag(73); + output.WriteDouble(PresenceThreshold); + } + if (HasMinDepthCircleThickness) { + output.WriteRawTag(81); + output.WriteDouble(MinDepthCircleThickness); + } + if (HasMaxDepthCircleThickness) { + output.WriteRawTag(89); + output.WriteDouble(MaxDepthCircleThickness); + } + if (minDepthLineColor_ != null) { + output.WriteRawTag(98); + output.WriteMessage(MinDepthLineColor); + } + if (maxDepthLineColor_ != null) { + output.WriteRawTag(106); + output.WriteMessage(MaxDepthLineColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += landmarkConnections_.CalculateSize(_repeated_landmarkConnections_codec); + if (landmarkColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LandmarkColor); + } + if (connectionColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionColor); + } + if (HasThickness) { + size += 1 + 8; + } + if (HasVisualizeLandmarkDepth) { + size += 1 + 1; + } + if (HasUtilizeVisibility) { + size += 1 + 1; + } + if (HasVisibilityThreshold) { + size += 1 + 8; + } + if (HasUtilizePresence) { + size += 1 + 1; + } + if (HasPresenceThreshold) { + size += 1 + 8; + } + if (HasMinDepthCircleThickness) { + size += 1 + 8; + } + if (HasMaxDepthCircleThickness) { + size += 1 + 8; + } + if (minDepthLineColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MinDepthLineColor); + } + if (maxDepthLineColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MaxDepthLineColor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksToRenderDataCalculatorOptions other) { + if (other == null) { + return; + } + landmarkConnections_.Add(other.landmarkConnections_); + if (other.landmarkColor_ != null) { + if (landmarkColor_ == null) { + LandmarkColor = new global::Mediapipe.Color(); + } + LandmarkColor.MergeFrom(other.LandmarkColor); + } + if (other.connectionColor_ != null) { + if (connectionColor_ == null) { + ConnectionColor = new global::Mediapipe.Color(); + } + ConnectionColor.MergeFrom(other.ConnectionColor); + } + if (other.HasThickness) { + Thickness = other.Thickness; + } + if (other.HasVisualizeLandmarkDepth) { + VisualizeLandmarkDepth = other.VisualizeLandmarkDepth; + } + if (other.HasUtilizeVisibility) { + UtilizeVisibility = other.UtilizeVisibility; + } + if (other.HasVisibilityThreshold) { + VisibilityThreshold = other.VisibilityThreshold; + } + if (other.HasUtilizePresence) { + UtilizePresence = other.UtilizePresence; + } + if (other.HasPresenceThreshold) { + PresenceThreshold = other.PresenceThreshold; + } + if (other.HasMinDepthCircleThickness) { + MinDepthCircleThickness = other.MinDepthCircleThickness; + } + if (other.HasMaxDepthCircleThickness) { + MaxDepthCircleThickness = other.MaxDepthCircleThickness; + } + if (other.minDepthLineColor_ != null) { + if (minDepthLineColor_ == null) { + MinDepthLineColor = new global::Mediapipe.Color(); + } + MinDepthLineColor.MergeFrom(other.MinDepthLineColor); + } + if (other.maxDepthLineColor_ != null) { + if (maxDepthLineColor_ == null) { + MaxDepthLineColor = new global::Mediapipe.Color(); + } + MaxDepthLineColor.MergeFrom(other.MaxDepthLineColor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + landmarkConnections_.AddEntriesFrom(input, _repeated_landmarkConnections_codec); + break; + } + case 18: { + if (landmarkColor_ == null) { + LandmarkColor = new global::Mediapipe.Color(); + } + input.ReadMessage(LandmarkColor); + break; + } + case 26: { + if (connectionColor_ == null) { + ConnectionColor = new global::Mediapipe.Color(); + } + input.ReadMessage(ConnectionColor); + break; + } + case 33: { + Thickness = input.ReadDouble(); + break; + } + case 40: { + VisualizeLandmarkDepth = input.ReadBool(); + break; + } + case 48: { + UtilizeVisibility = input.ReadBool(); + break; + } + case 57: { + VisibilityThreshold = input.ReadDouble(); + break; + } + case 64: { + UtilizePresence = input.ReadBool(); + break; + } + case 73: { + PresenceThreshold = input.ReadDouble(); + break; + } + case 81: { + MinDepthCircleThickness = input.ReadDouble(); + break; + } + case 89: { + MaxDepthCircleThickness = input.ReadDouble(); + break; + } + case 98: { + if (minDepthLineColor_ == null) { + MinDepthLineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(MinDepthLineColor); + break; + } + case 106: { + if (maxDepthLineColor_ == null) { + MaxDepthLineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(MaxDepthLineColor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + landmarkConnections_.AddEntriesFrom(ref input, _repeated_landmarkConnections_codec); + break; + } + case 18: { + if (landmarkColor_ == null) { + LandmarkColor = new global::Mediapipe.Color(); + } + input.ReadMessage(LandmarkColor); + break; + } + case 26: { + if (connectionColor_ == null) { + ConnectionColor = new global::Mediapipe.Color(); + } + input.ReadMessage(ConnectionColor); + break; + } + case 33: { + Thickness = input.ReadDouble(); + break; + } + case 40: { + VisualizeLandmarkDepth = input.ReadBool(); + break; + } + case 48: { + UtilizeVisibility = input.ReadBool(); + break; + } + case 57: { + VisibilityThreshold = input.ReadDouble(); + break; + } + case 64: { + UtilizePresence = input.ReadBool(); + break; + } + case 73: { + PresenceThreshold = input.ReadDouble(); + break; + } + case 81: { + MinDepthCircleThickness = input.ReadDouble(); + break; + } + case 89: { + MaxDepthCircleThickness = input.ReadDouble(); + break; + } + case 98: { + if (minDepthLineColor_ == null) { + MinDepthLineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(MinDepthLineColor); + break; + } + case 106: { + if (maxDepthLineColor_ == null) { + MaxDepthLineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(MaxDepthLineColor); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the LandmarksToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(258435389, pb::FieldCodec.ForMessage(2067483114, global::Mediapipe.LandmarksToRenderDataCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs.meta new file mode 100644 index 0000000..b40d505 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LandmarksToRenderDataCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f766da884f11757b7a1c593e972027a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs new file mode 100644 index 0000000..9d221ff --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs @@ -0,0 +1,573 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/latency.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/latency.proto + public static partial class LatencyReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/latency.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LatencyReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CihtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sYXRlbmN5LnByb3RvEglt", + "ZWRpYXBpcGUiygEKDVBhY2tldExhdGVuY3kSHAoUY3VycmVudF9sYXRlbmN5", + "X3VzZWMYCCABKAMSDgoGY291bnRzGAkgAygDEhkKDW51bV9pbnRlcnZhbHMY", + "CiABKAM6AjEwEiEKEmludGVydmFsX3NpemVfdXNlYxgLIAEoAzoFMTAwMDAS", + "GAoQYXZnX2xhdGVuY3lfdXNlYxgCIAEoAxINCgVsYWJlbBgHIAEoCRIYChBz", + "dW1fbGF0ZW5jeV91c2VjGAwgASgDSgQIARACSgQIAxAH")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketLatency), global::Mediapipe.PacketLatency.Parser, new[]{ "CurrentLatencyUsec", "Counts", "NumIntervals", "IntervalSizeUsec", "AvgLatencyUsec", "Label", "SumLatencyUsec" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Contains the latency information for a packet stream in mediapipe. The + /// following are provided + /// 1. current latency + /// 2. running average + /// 3. histogram of latencies observed + /// 4. cumulative sum of latencies observed + /// NextId: 13 + /// + public sealed partial class PacketLatency : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketLatency()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LatencyReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatency() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatency(PacketLatency other) : this() { + _hasBits0 = other._hasBits0; + currentLatencyUsec_ = other.currentLatencyUsec_; + counts_ = other.counts_.Clone(); + numIntervals_ = other.numIntervals_; + intervalSizeUsec_ = other.intervalSizeUsec_; + avgLatencyUsec_ = other.avgLatencyUsec_; + label_ = other.label_; + sumLatencyUsec_ = other.sumLatencyUsec_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatency Clone() { + return new PacketLatency(this); + } + + /// Field number for the "current_latency_usec" field. + public const int CurrentLatencyUsecFieldNumber = 8; + private readonly static long CurrentLatencyUsecDefaultValue = 0L; + + private long currentLatencyUsec_; + /// + /// Current latency (delay in microseconds wrt a reference packet). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long CurrentLatencyUsec { + get { if ((_hasBits0 & 2) != 0) { return currentLatencyUsec_; } else { return CurrentLatencyUsecDefaultValue; } } + set { + _hasBits0 |= 2; + currentLatencyUsec_ = value; + } + } + /// Gets whether the "current_latency_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCurrentLatencyUsec { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "current_latency_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCurrentLatencyUsec() { + _hasBits0 &= ~2; + } + + /// Field number for the "counts" field. + public const int CountsFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_counts_codec + = pb::FieldCodec.ForInt64(72); + private readonly pbc::RepeatedField counts_ = new pbc::RepeatedField(); + /// + /// The latency histogram which stores the count recorded for each specified + /// interval. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Counts { + get { return counts_; } + } + + /// Field number for the "num_intervals" field. + public const int NumIntervalsFieldNumber = 10; + private readonly static long NumIntervalsDefaultValue = 10L; + + private long numIntervals_; + /// + /// Number of intervals for the latency histogram output. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long NumIntervals { + get { if ((_hasBits0 & 4) != 0) { return numIntervals_; } else { return NumIntervalsDefaultValue; } } + set { + _hasBits0 |= 4; + numIntervals_ = value; + } + } + /// Gets whether the "num_intervals" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumIntervals { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_intervals" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumIntervals() { + _hasBits0 &= ~4; + } + + /// Field number for the "interval_size_usec" field. + public const int IntervalSizeUsecFieldNumber = 11; + private readonly static long IntervalSizeUsecDefaultValue = 10000L; + + private long intervalSizeUsec_; + /// + /// Size of the histogram intervals (in microseconds). The first interval is + /// [0, interval_size_usec). The last interval extends to +inf. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long IntervalSizeUsec { + get { if ((_hasBits0 & 8) != 0) { return intervalSizeUsec_; } else { return IntervalSizeUsecDefaultValue; } } + set { + _hasBits0 |= 8; + intervalSizeUsec_ = value; + } + } + /// Gets whether the "interval_size_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntervalSizeUsec { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "interval_size_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntervalSizeUsec() { + _hasBits0 &= ~8; + } + + /// Field number for the "avg_latency_usec" field. + public const int AvgLatencyUsecFieldNumber = 2; + private readonly static long AvgLatencyUsecDefaultValue = 0L; + + private long avgLatencyUsec_; + /// + /// Running average of latencies observed so far. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long AvgLatencyUsec { + get { if ((_hasBits0 & 1) != 0) { return avgLatencyUsec_; } else { return AvgLatencyUsecDefaultValue; } } + set { + _hasBits0 |= 1; + avgLatencyUsec_ = value; + } + } + /// Gets whether the "avg_latency_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAvgLatencyUsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "avg_latency_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAvgLatencyUsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 7; + private readonly static string LabelDefaultValue = ""; + + private string label_; + /// + /// An identifier label for the packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + /// Field number for the "sum_latency_usec" field. + public const int SumLatencyUsecFieldNumber = 12; + private readonly static long SumLatencyUsecDefaultValue = 0L; + + private long sumLatencyUsec_; + /// + /// Cumulative sum of individual packet latencies of all the packets output so + /// far. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long SumLatencyUsec { + get { if ((_hasBits0 & 16) != 0) { return sumLatencyUsec_; } else { return SumLatencyUsecDefaultValue; } } + set { + _hasBits0 |= 16; + sumLatencyUsec_ = value; + } + } + /// Gets whether the "sum_latency_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSumLatencyUsec { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "sum_latency_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSumLatencyUsec() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketLatency); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketLatency other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CurrentLatencyUsec != other.CurrentLatencyUsec) return false; + if(!counts_.Equals(other.counts_)) return false; + if (NumIntervals != other.NumIntervals) return false; + if (IntervalSizeUsec != other.IntervalSizeUsec) return false; + if (AvgLatencyUsec != other.AvgLatencyUsec) return false; + if (Label != other.Label) return false; + if (SumLatencyUsec != other.SumLatencyUsec) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCurrentLatencyUsec) hash ^= CurrentLatencyUsec.GetHashCode(); + hash ^= counts_.GetHashCode(); + if (HasNumIntervals) hash ^= NumIntervals.GetHashCode(); + if (HasIntervalSizeUsec) hash ^= IntervalSizeUsec.GetHashCode(); + if (HasAvgLatencyUsec) hash ^= AvgLatencyUsec.GetHashCode(); + if (HasLabel) hash ^= Label.GetHashCode(); + if (HasSumLatencyUsec) hash ^= SumLatencyUsec.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasAvgLatencyUsec) { + output.WriteRawTag(16); + output.WriteInt64(AvgLatencyUsec); + } + if (HasLabel) { + output.WriteRawTag(58); + output.WriteString(Label); + } + if (HasCurrentLatencyUsec) { + output.WriteRawTag(64); + output.WriteInt64(CurrentLatencyUsec); + } + counts_.WriteTo(output, _repeated_counts_codec); + if (HasNumIntervals) { + output.WriteRawTag(80); + output.WriteInt64(NumIntervals); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(88); + output.WriteInt64(IntervalSizeUsec); + } + if (HasSumLatencyUsec) { + output.WriteRawTag(96); + output.WriteInt64(SumLatencyUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAvgLatencyUsec) { + output.WriteRawTag(16); + output.WriteInt64(AvgLatencyUsec); + } + if (HasLabel) { + output.WriteRawTag(58); + output.WriteString(Label); + } + if (HasCurrentLatencyUsec) { + output.WriteRawTag(64); + output.WriteInt64(CurrentLatencyUsec); + } + counts_.WriteTo(ref output, _repeated_counts_codec); + if (HasNumIntervals) { + output.WriteRawTag(80); + output.WriteInt64(NumIntervals); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(88); + output.WriteInt64(IntervalSizeUsec); + } + if (HasSumLatencyUsec) { + output.WriteRawTag(96); + output.WriteInt64(SumLatencyUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCurrentLatencyUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CurrentLatencyUsec); + } + size += counts_.CalculateSize(_repeated_counts_codec); + if (HasNumIntervals) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumIntervals); + } + if (HasIntervalSizeUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IntervalSizeUsec); + } + if (HasAvgLatencyUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AvgLatencyUsec); + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (HasSumLatencyUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(SumLatencyUsec); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketLatency other) { + if (other == null) { + return; + } + if (other.HasCurrentLatencyUsec) { + CurrentLatencyUsec = other.CurrentLatencyUsec; + } + counts_.Add(other.counts_); + if (other.HasNumIntervals) { + NumIntervals = other.NumIntervals; + } + if (other.HasIntervalSizeUsec) { + IntervalSizeUsec = other.IntervalSizeUsec; + } + if (other.HasAvgLatencyUsec) { + AvgLatencyUsec = other.AvgLatencyUsec; + } + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasSumLatencyUsec) { + SumLatencyUsec = other.SumLatencyUsec; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + AvgLatencyUsec = input.ReadInt64(); + break; + } + case 58: { + Label = input.ReadString(); + break; + } + case 64: { + CurrentLatencyUsec = input.ReadInt64(); + break; + } + case 74: + case 72: { + counts_.AddEntriesFrom(input, _repeated_counts_codec); + break; + } + case 80: { + NumIntervals = input.ReadInt64(); + break; + } + case 88: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 96: { + SumLatencyUsec = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16: { + AvgLatencyUsec = input.ReadInt64(); + break; + } + case 58: { + Label = input.ReadString(); + break; + } + case 64: { + CurrentLatencyUsec = input.ReadInt64(); + break; + } + case 74: + case 72: { + counts_.AddEntriesFrom(ref input, _repeated_counts_codec); + break; + } + case 80: { + NumIntervals = input.ReadInt64(); + break; + } + case 88: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 96: { + SumLatencyUsec = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs.meta new file mode 100644 index 0000000..30eb5ff --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/Latency.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d70f09c2b778d6c7b80b0b8522b0d13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs new file mode 100644 index 0000000..3f56e09 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs @@ -0,0 +1,266 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/local_file_contents_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/local_file_contents_calculator.proto + public static partial class LocalFileContentsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/local_file_contents_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LocalFileContentsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sb2NhbF9maWxlX2NvbnRl", + "bnRzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIpUBCiJMb2NhbEZpbGVDb250ZW50", + "c0NhbGN1bGF0b3JPcHRpb25zEhEKCXRleHRfbW9kZRgBIAEoCDJcCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYvICypQEgASgLMi0ubWVk", + "aWFwaXBlLkxvY2FsRmlsZUNvbnRlbnRzQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocalFileContentsCalculatorOptions), global::Mediapipe.LocalFileContentsCalculatorOptions.Parser, new[]{ "TextMode" }, null, null, new pb::Extension[] { global::Mediapipe.LocalFileContentsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LocalFileContentsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LocalFileContentsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocalFileContentsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocalFileContentsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocalFileContentsCalculatorOptions(LocalFileContentsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + textMode_ = other.textMode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocalFileContentsCalculatorOptions Clone() { + return new LocalFileContentsCalculatorOptions(this); + } + + /// Field number for the "text_mode" field. + public const int TextModeFieldNumber = 1; + private readonly static bool TextModeDefaultValue = false; + + private bool textMode_; + /// + /// By default, set the file open mode to 'rb'. Otherwise, set the mode to 'r'. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TextMode { + get { if ((_hasBits0 & 1) != 0) { return textMode_; } else { return TextModeDefaultValue; } } + set { + _hasBits0 |= 1; + textMode_ = value; + } + } + /// Gets whether the "text_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTextMode { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "text_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTextMode() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LocalFileContentsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LocalFileContentsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TextMode != other.TextMode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTextMode) hash ^= TextMode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTextMode) { + output.WriteRawTag(8); + output.WriteBool(TextMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTextMode) { + output.WriteRawTag(8); + output.WriteBool(TextMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTextMode) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LocalFileContentsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTextMode) { + TextMode = other.TextMode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TextMode = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TextMode = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the LocalFileContentsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(346849340, pb::FieldCodec.ForMessage(2774794722, global::Mediapipe.LocalFileContentsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs.meta new file mode 100644 index 0000000..e86f102 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LocalFileContentsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7230508120a035808c4fa65aad9a52e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs new file mode 100644 index 0000000..ac40b6f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs @@ -0,0 +1,368 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/logic_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/logic_calculator.proto + public static partial class LogicCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/logic_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LogicCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9sb2dpY19jYWxjdWxhdG9y", + "LnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3Vs", + "YXRvci5wcm90byLvAQoWTG9naWNDYWxjdWxhdG9yT3B0aW9ucxI3CgJvcBgB", + "IAEoDjIrLm1lZGlhcGlwZS5Mb2dpY0NhbGN1bGF0b3JPcHRpb25zLk9wZXJh", + "dGlvbhIOCgZuZWdhdGUYAiABKAgSEwoLaW5wdXRfdmFsdWUYAyADKAgiJQoJ", + "T3BlcmF0aW9uEgcKA0FORBAAEgYKAk9SEAESBwoDWE9SEAIyUAoDZXh0Ehwu", + "bWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGO7BwqEBIAEoCzIhLm1lZGlh", + "cGlwZS5Mb2dpY0NhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LogicCalculatorOptions), global::Mediapipe.LogicCalculatorOptions.Parser, new[]{ "Op", "Negate", "InputValue" }, null, new[]{ typeof(global::Mediapipe.LogicCalculatorOptions.Types.Operation) }, new pb::Extension[] { global::Mediapipe.LogicCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class LogicCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LogicCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LogicCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LogicCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LogicCalculatorOptions(LogicCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + op_ = other.op_; + negate_ = other.negate_; + inputValue_ = other.inputValue_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LogicCalculatorOptions Clone() { + return new LogicCalculatorOptions(this); + } + + /// Field number for the "op" field. + public const int OpFieldNumber = 1; + private readonly static global::Mediapipe.LogicCalculatorOptions.Types.Operation OpDefaultValue = global::Mediapipe.LogicCalculatorOptions.Types.Operation.And; + + private global::Mediapipe.LogicCalculatorOptions.Types.Operation op_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LogicCalculatorOptions.Types.Operation Op { + get { if ((_hasBits0 & 1) != 0) { return op_; } else { return OpDefaultValue; } } + set { + _hasBits0 |= 1; + op_ = value; + } + } + /// Gets whether the "op" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOp { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "op" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOp() { + _hasBits0 &= ~1; + } + + /// Field number for the "negate" field. + public const int NegateFieldNumber = 2; + private readonly static bool NegateDefaultValue = false; + + private bool negate_; + /// + /// Whether to negate the result. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Negate { + get { if ((_hasBits0 & 2) != 0) { return negate_; } else { return NegateDefaultValue; } } + set { + _hasBits0 |= 2; + negate_ = value; + } + } + /// Gets whether the "negate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNegate { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "negate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNegate() { + _hasBits0 &= ~2; + } + + /// Field number for the "input_value" field. + public const int InputValueFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_inputValue_codec + = pb::FieldCodec.ForBool(24); + private readonly pbc::RepeatedField inputValue_ = new pbc::RepeatedField(); + /// + /// Optional bool input values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputValue { + get { return inputValue_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LogicCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LogicCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Op != other.Op) return false; + if (Negate != other.Negate) return false; + if(!inputValue_.Equals(other.inputValue_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOp) hash ^= Op.GetHashCode(); + if (HasNegate) hash ^= Negate.GetHashCode(); + hash ^= inputValue_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOp) { + output.WriteRawTag(8); + output.WriteEnum((int) Op); + } + if (HasNegate) { + output.WriteRawTag(16); + output.WriteBool(Negate); + } + inputValue_.WriteTo(output, _repeated_inputValue_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOp) { + output.WriteRawTag(8); + output.WriteEnum((int) Op); + } + if (HasNegate) { + output.WriteRawTag(16); + output.WriteBool(Negate); + } + inputValue_.WriteTo(ref output, _repeated_inputValue_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOp) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Op); + } + if (HasNegate) { + size += 1 + 1; + } + size += inputValue_.CalculateSize(_repeated_inputValue_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LogicCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOp) { + Op = other.Op; + } + if (other.HasNegate) { + Negate = other.Negate; + } + inputValue_.Add(other.inputValue_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Op = (global::Mediapipe.LogicCalculatorOptions.Types.Operation) input.ReadEnum(); + break; + } + case 16: { + Negate = input.ReadBool(); + break; + } + case 26: + case 24: { + inputValue_.AddEntriesFrom(input, _repeated_inputValue_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Op = (global::Mediapipe.LogicCalculatorOptions.Types.Operation) input.ReadEnum(); + break; + } + case 16: { + Negate = input.ReadBool(); + break; + } + case 26: + case 24: { + inputValue_.AddEntriesFrom(ref input, _repeated_inputValue_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LogicCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The logical operation to apply. + /// + public enum Operation { + [pbr::OriginalName("AND")] And = 0, + [pbr::OriginalName("OR")] Or = 1, + [pbr::OriginalName("XOR")] Xor = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the LogicCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(338731246, pb::FieldCodec.ForMessage(2709849970, global::Mediapipe.LogicCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs.meta new file mode 100644 index 0000000..abe3153 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/LogicCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d508893e7a509a3ee9c9c4fc0dffdc9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs new file mode 100644 index 0000000..63871e6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs @@ -0,0 +1,643 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/non_max_suppression_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/non_max_suppression_calculator.proto + public static partial class NonMaxSuppressionCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/non_max_suppression_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static NonMaxSuppressionCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9ub25fbWF4X3N1cHByZXNz", + "aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIvUECiJOb25NYXhTdXBwcmVzc2lv", + "bkNhbGN1bGF0b3JPcHRpb25zEiAKFW51bV9kZXRlY3Rpb25fc3RyZWFtcxgB", + "IAEoBToBMRIeChJtYXhfbnVtX2RldGVjdGlvbnMYAiABKAU6Ai0xEh8KE21p", + "bl9zY29yZV90aHJlc2hvbGQYBiABKAI6Ai0xEiQKGW1pbl9zdXBwcmVzc2lv", + "bl90aHJlc2hvbGQYAyABKAI6ATESWAoMb3ZlcmxhcF90eXBlGAQgASgOMjku", + "bWVkaWFwaXBlLk5vbk1heFN1cHByZXNzaW9uQ2FsY3VsYXRvck9wdGlvbnMu", + "T3ZlcmxhcFR5cGU6B0pBQ0NBUkQSHwoXcmV0dXJuX2VtcHR5X2RldGVjdGlv", + "bnMYBSABKAgSVgoJYWxnb3JpdGhtGAcgASgOMjoubWVkaWFwaXBlLk5vbk1h", + "eFN1cHByZXNzaW9uQ2FsY3VsYXRvck9wdGlvbnMuTm1zQWxnb3JpdGhtOgdE", + "RUZBVUxUImsKC092ZXJsYXBUeXBlEhwKGFVOU1BFQ0lGSUVEX09WRVJMQVBf", + "VFlQRRAAEgsKB0pBQ0NBUkQQARIUChBNT0RJRklFRF9KQUNDQVJEEAISGwoX", + "SU5URVJTRUNUSU9OX09WRVJfVU5JT04QAyIpCgxObXNBbGdvcml0aG0SCwoH", + "REVGQVVMVBAAEgwKCFdFSUdIVEVEEAEyWwoDZXh0EhwubWVkaWFwaXBlLkNh", + "bGN1bGF0b3JPcHRpb25zGLyotBogASgLMi0ubWVkaWFwaXBlLk5vbk1heFN1", + "cHByZXNzaW9uQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NonMaxSuppressionCalculatorOptions), global::Mediapipe.NonMaxSuppressionCalculatorOptions.Parser, new[]{ "NumDetectionStreams", "MaxNumDetections", "MinScoreThreshold", "MinSuppressionThreshold", "OverlapType", "ReturnEmptyDetections", "Algorithm" }, null, new[]{ typeof(global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType), typeof(global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm) }, new pb::Extension[] { global::Mediapipe.NonMaxSuppressionCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options to NonMaxSuppression calculator, which performs non-maximum + /// suppression on a set of detections. + /// + public sealed partial class NonMaxSuppressionCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NonMaxSuppressionCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.NonMaxSuppressionCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NonMaxSuppressionCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NonMaxSuppressionCalculatorOptions(NonMaxSuppressionCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numDetectionStreams_ = other.numDetectionStreams_; + maxNumDetections_ = other.maxNumDetections_; + minScoreThreshold_ = other.minScoreThreshold_; + minSuppressionThreshold_ = other.minSuppressionThreshold_; + overlapType_ = other.overlapType_; + returnEmptyDetections_ = other.returnEmptyDetections_; + algorithm_ = other.algorithm_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NonMaxSuppressionCalculatorOptions Clone() { + return new NonMaxSuppressionCalculatorOptions(this); + } + + /// Field number for the "num_detection_streams" field. + public const int NumDetectionStreamsFieldNumber = 1; + private readonly static int NumDetectionStreamsDefaultValue = 1; + + private int numDetectionStreams_; + /// + /// Number of input streams. Each input stream should contain a vector of + /// detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumDetectionStreams { + get { if ((_hasBits0 & 1) != 0) { return numDetectionStreams_; } else { return NumDetectionStreamsDefaultValue; } } + set { + _hasBits0 |= 1; + numDetectionStreams_ = value; + } + } + /// Gets whether the "num_detection_streams" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumDetectionStreams { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_detection_streams" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumDetectionStreams() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_num_detections" field. + public const int MaxNumDetectionsFieldNumber = 2; + private readonly static int MaxNumDetectionsDefaultValue = -1; + + private int maxNumDetections_; + /// + /// Maximum number of detections to be returned. If -1, then all detections are + /// returned. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxNumDetections { + get { if ((_hasBits0 & 2) != 0) { return maxNumDetections_; } else { return MaxNumDetectionsDefaultValue; } } + set { + _hasBits0 |= 2; + maxNumDetections_ = value; + } + } + /// Gets whether the "max_num_detections" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxNumDetections { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_num_detections" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxNumDetections() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_score_threshold" field. + public const int MinScoreThresholdFieldNumber = 6; + private readonly static float MinScoreThresholdDefaultValue = -1F; + + private float minScoreThreshold_; + /// + /// Minimum score of detections to be returned. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThreshold { + get { if ((_hasBits0 & 32) != 0) { return minScoreThreshold_; } else { return MinScoreThresholdDefaultValue; } } + set { + _hasBits0 |= 32; + minScoreThreshold_ = value; + } + } + /// Gets whether the "min_score_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThreshold { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "min_score_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThreshold() { + _hasBits0 &= ~32; + } + + /// Field number for the "min_suppression_threshold" field. + public const int MinSuppressionThresholdFieldNumber = 3; + private readonly static float MinSuppressionThresholdDefaultValue = 1F; + + private float minSuppressionThreshold_; + /// + /// Jaccard similarity threshold for suppression -- a detection would suppress + /// all other detections whose scores are lower and overlap by at least the + /// specified threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinSuppressionThreshold { + get { if ((_hasBits0 & 4) != 0) { return minSuppressionThreshold_; } else { return MinSuppressionThresholdDefaultValue; } } + set { + _hasBits0 |= 4; + minSuppressionThreshold_ = value; + } + } + /// Gets whether the "min_suppression_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinSuppressionThreshold { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_suppression_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinSuppressionThreshold() { + _hasBits0 &= ~4; + } + + /// Field number for the "overlap_type" field. + public const int OverlapTypeFieldNumber = 4; + private readonly static global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType OverlapTypeDefaultValue = global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType.Jaccard; + + private global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType overlapType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType OverlapType { + get { if ((_hasBits0 & 8) != 0) { return overlapType_; } else { return OverlapTypeDefaultValue; } } + set { + _hasBits0 |= 8; + overlapType_ = value; + } + } + /// Gets whether the "overlap_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlapType { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "overlap_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlapType() { + _hasBits0 &= ~8; + } + + /// Field number for the "return_empty_detections" field. + public const int ReturnEmptyDetectionsFieldNumber = 5; + private readonly static bool ReturnEmptyDetectionsDefaultValue = false; + + private bool returnEmptyDetections_; + /// + /// Whether to put empty detection vector in output stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReturnEmptyDetections { + get { if ((_hasBits0 & 16) != 0) { return returnEmptyDetections_; } else { return ReturnEmptyDetectionsDefaultValue; } } + set { + _hasBits0 |= 16; + returnEmptyDetections_ = value; + } + } + /// Gets whether the "return_empty_detections" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReturnEmptyDetections { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "return_empty_detections" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReturnEmptyDetections() { + _hasBits0 &= ~16; + } + + /// Field number for the "algorithm" field. + public const int AlgorithmFieldNumber = 7; + private readonly static global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm AlgorithmDefaultValue = global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm.Default; + + private global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm algorithm_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm Algorithm { + get { if ((_hasBits0 & 64) != 0) { return algorithm_; } else { return AlgorithmDefaultValue; } } + set { + _hasBits0 |= 64; + algorithm_ = value; + } + } + /// Gets whether the "algorithm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlgorithm { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "algorithm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlgorithm() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NonMaxSuppressionCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NonMaxSuppressionCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumDetectionStreams != other.NumDetectionStreams) return false; + if (MaxNumDetections != other.MaxNumDetections) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThreshold, other.MinScoreThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinSuppressionThreshold, other.MinSuppressionThreshold)) return false; + if (OverlapType != other.OverlapType) return false; + if (ReturnEmptyDetections != other.ReturnEmptyDetections) return false; + if (Algorithm != other.Algorithm) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumDetectionStreams) hash ^= NumDetectionStreams.GetHashCode(); + if (HasMaxNumDetections) hash ^= MaxNumDetections.GetHashCode(); + if (HasMinScoreThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThreshold); + if (HasMinSuppressionThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinSuppressionThreshold); + if (HasOverlapType) hash ^= OverlapType.GetHashCode(); + if (HasReturnEmptyDetections) hash ^= ReturnEmptyDetections.GetHashCode(); + if (HasAlgorithm) hash ^= Algorithm.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumDetectionStreams) { + output.WriteRawTag(8); + output.WriteInt32(NumDetectionStreams); + } + if (HasMaxNumDetections) { + output.WriteRawTag(16); + output.WriteInt32(MaxNumDetections); + } + if (HasMinSuppressionThreshold) { + output.WriteRawTag(29); + output.WriteFloat(MinSuppressionThreshold); + } + if (HasOverlapType) { + output.WriteRawTag(32); + output.WriteEnum((int) OverlapType); + } + if (HasReturnEmptyDetections) { + output.WriteRawTag(40); + output.WriteBool(ReturnEmptyDetections); + } + if (HasMinScoreThreshold) { + output.WriteRawTag(53); + output.WriteFloat(MinScoreThreshold); + } + if (HasAlgorithm) { + output.WriteRawTag(56); + output.WriteEnum((int) Algorithm); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumDetectionStreams) { + output.WriteRawTag(8); + output.WriteInt32(NumDetectionStreams); + } + if (HasMaxNumDetections) { + output.WriteRawTag(16); + output.WriteInt32(MaxNumDetections); + } + if (HasMinSuppressionThreshold) { + output.WriteRawTag(29); + output.WriteFloat(MinSuppressionThreshold); + } + if (HasOverlapType) { + output.WriteRawTag(32); + output.WriteEnum((int) OverlapType); + } + if (HasReturnEmptyDetections) { + output.WriteRawTag(40); + output.WriteBool(ReturnEmptyDetections); + } + if (HasMinScoreThreshold) { + output.WriteRawTag(53); + output.WriteFloat(MinScoreThreshold); + } + if (HasAlgorithm) { + output.WriteRawTag(56); + output.WriteEnum((int) Algorithm); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumDetectionStreams) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumDetectionStreams); + } + if (HasMaxNumDetections) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumDetections); + } + if (HasMinScoreThreshold) { + size += 1 + 4; + } + if (HasMinSuppressionThreshold) { + size += 1 + 4; + } + if (HasOverlapType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OverlapType); + } + if (HasReturnEmptyDetections) { + size += 1 + 1; + } + if (HasAlgorithm) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Algorithm); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NonMaxSuppressionCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumDetectionStreams) { + NumDetectionStreams = other.NumDetectionStreams; + } + if (other.HasMaxNumDetections) { + MaxNumDetections = other.MaxNumDetections; + } + if (other.HasMinScoreThreshold) { + MinScoreThreshold = other.MinScoreThreshold; + } + if (other.HasMinSuppressionThreshold) { + MinSuppressionThreshold = other.MinSuppressionThreshold; + } + if (other.HasOverlapType) { + OverlapType = other.OverlapType; + } + if (other.HasReturnEmptyDetections) { + ReturnEmptyDetections = other.ReturnEmptyDetections; + } + if (other.HasAlgorithm) { + Algorithm = other.Algorithm; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumDetectionStreams = input.ReadInt32(); + break; + } + case 16: { + MaxNumDetections = input.ReadInt32(); + break; + } + case 29: { + MinSuppressionThreshold = input.ReadFloat(); + break; + } + case 32: { + OverlapType = (global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType) input.ReadEnum(); + break; + } + case 40: { + ReturnEmptyDetections = input.ReadBool(); + break; + } + case 53: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 56: { + Algorithm = (global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumDetectionStreams = input.ReadInt32(); + break; + } + case 16: { + MaxNumDetections = input.ReadInt32(); + break; + } + case 29: { + MinSuppressionThreshold = input.ReadFloat(); + break; + } + case 32: { + OverlapType = (global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.OverlapType) input.ReadEnum(); + break; + } + case 40: { + ReturnEmptyDetections = input.ReadBool(); + break; + } + case 53: { + MinScoreThreshold = input.ReadFloat(); + break; + } + case 56: { + Algorithm = (global::Mediapipe.NonMaxSuppressionCalculatorOptions.Types.NmsAlgorithm) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the NonMaxSuppressionCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// During the overlap computation, which is used to determine whether a + /// rectangle suppresses another rectangle, one can use the Jaccard similarity, + /// defined as the ration of the intersection over union of the two rectangles. + /// Alternatively a modified version of Jaccard can be used, where the + /// normalization is done by the area of the rectangle being checked for + /// suppression. + /// + public enum OverlapType { + [pbr::OriginalName("UNSPECIFIED_OVERLAP_TYPE")] UnspecifiedOverlapType = 0, + [pbr::OriginalName("JACCARD")] Jaccard = 1, + [pbr::OriginalName("MODIFIED_JACCARD")] ModifiedJaccard = 2, + [pbr::OriginalName("INTERSECTION_OVER_UNION")] IntersectionOverUnion = 3, + } + + /// + /// Algorithms that can be used to apply non-maximum suppression. + /// + public enum NmsAlgorithm { + [pbr::OriginalName("DEFAULT")] Default = 0, + /// + /// Only supports relative bounding box for weighted NMS. + /// + [pbr::OriginalName("WEIGHTED")] Weighted = 1, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the NonMaxSuppressionCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(55383100, pb::FieldCodec.ForMessage(443064802, global::Mediapipe.NonMaxSuppressionCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs.meta new file mode 100644 index 0000000..18b79c4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/NonMaxSuppressionCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd2107ed880bf55719c7a5ed57b2ff84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs new file mode 100644 index 0000000..4f8bc35 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs @@ -0,0 +1,311 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/packet_frequency.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/packet_frequency.proto + public static partial class PacketFrequencyReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/packet_frequency.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketFrequencyReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9wYWNrZXRfZnJlcXVlbmN5", + "LnByb3RvEgltZWRpYXBpcGUiPQoPUGFja2V0RnJlcXVlbmN5EhsKE3BhY2tl", + "dF9mcmVxdWVuY3lfaHoYASABKAESDQoFbGFiZWwYAiABKAk=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketFrequency), global::Mediapipe.PacketFrequency.Parser, new[]{ "PacketFrequencyHz", "Label" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Contains the packet frequency information. + /// + public sealed partial class PacketFrequency : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketFrequency()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketFrequencyReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequency() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequency(PacketFrequency other) : this() { + _hasBits0 = other._hasBits0; + packetFrequencyHz_ = other.packetFrequencyHz_; + label_ = other.label_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequency Clone() { + return new PacketFrequency(this); + } + + /// Field number for the "packet_frequency_hz" field. + public const int PacketFrequencyHzFieldNumber = 1; + private readonly static double PacketFrequencyHzDefaultValue = 0D; + + private double packetFrequencyHz_; + /// + /// Packet frequency (packets per second). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double PacketFrequencyHz { + get { if ((_hasBits0 & 1) != 0) { return packetFrequencyHz_; } else { return PacketFrequencyHzDefaultValue; } } + set { + _hasBits0 |= 1; + packetFrequencyHz_ = value; + } + } + /// Gets whether the "packet_frequency_hz" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketFrequencyHz { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "packet_frequency_hz" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketFrequencyHz() { + _hasBits0 &= ~1; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 2; + private readonly static string LabelDefaultValue = ""; + + private string label_; + /// + /// A label that identifies what this packet frequency is for. Eg. "Gaze", + /// "Gesture", etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketFrequency); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketFrequency other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(PacketFrequencyHz, other.PacketFrequencyHz)) return false; + if (Label != other.Label) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPacketFrequencyHz) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PacketFrequencyHz); + if (HasLabel) hash ^= Label.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPacketFrequencyHz) { + output.WriteRawTag(9); + output.WriteDouble(PacketFrequencyHz); + } + if (HasLabel) { + output.WriteRawTag(18); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPacketFrequencyHz) { + output.WriteRawTag(9); + output.WriteDouble(PacketFrequencyHz); + } + if (HasLabel) { + output.WriteRawTag(18); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPacketFrequencyHz) { + size += 1 + 8; + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketFrequency other) { + if (other == null) { + return; + } + if (other.HasPacketFrequencyHz) { + PacketFrequencyHz = other.PacketFrequencyHz; + } + if (other.HasLabel) { + Label = other.Label; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + PacketFrequencyHz = input.ReadDouble(); + break; + } + case 18: { + Label = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + PacketFrequencyHz = input.ReadDouble(); + break; + } + case 18: { + Label = input.ReadString(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs.meta new file mode 100644 index 0000000..0aa0d5c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequency.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 446374614ff141e939243a3915776b22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs new file mode 100644 index 0000000..1f69175 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs @@ -0,0 +1,301 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/packet_frequency_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/packet_frequency_calculator.proto + public static partial class PacketFrequencyCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/packet_frequency_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketFrequencyCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjxtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9wYWNrZXRfZnJlcXVlbmN5", + "X2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1l", + "d29yay9jYWxjdWxhdG9yLnByb3RvIqgBCiBQYWNrZXRGcmVxdWVuY3lDYWxj", + "dWxhdG9yT3B0aW9ucxIaCg90aW1lX3dpbmRvd19zZWMYASABKAE6ATMSDQoF", + "bGFiZWwYAiADKAkyWQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRp", + "b25zGLbDqlAgASgLMisubWVkaWFwaXBlLlBhY2tldEZyZXF1ZW5jeUNhbGN1", + "bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketFrequencyCalculatorOptions), global::Mediapipe.PacketFrequencyCalculatorOptions.Parser, new[]{ "TimeWindowSec", "Label" }, null, null, new pb::Extension[] { global::Mediapipe.PacketFrequencyCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options for PacketFrequencyCalculator. + /// + public sealed partial class PacketFrequencyCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketFrequencyCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketFrequencyCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequencyCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequencyCalculatorOptions(PacketFrequencyCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + timeWindowSec_ = other.timeWindowSec_; + label_ = other.label_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFrequencyCalculatorOptions Clone() { + return new PacketFrequencyCalculatorOptions(this); + } + + /// Field number for the "time_window_sec" field. + public const int TimeWindowSecFieldNumber = 1; + private readonly static double TimeWindowSecDefaultValue = 3D; + + private double timeWindowSec_; + /// + /// Time window (in seconds) over which the packet frequency is computed. Must + /// be greater than 0 and less than 100 seconds (in order to limit memory + /// usage). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double TimeWindowSec { + get { if ((_hasBits0 & 1) != 0) { return timeWindowSec_; } else { return TimeWindowSecDefaultValue; } } + set { + _hasBits0 |= 1; + timeWindowSec_ = value; + } + } + /// Gets whether the "time_window_sec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimeWindowSec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "time_window_sec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimeWindowSec() { + _hasBits0 &= ~1; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_label_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField label_ = new pbc::RepeatedField(); + /// + /// Text identifiers for the input streams. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Label { + get { return label_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketFrequencyCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketFrequencyCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeWindowSec, other.TimeWindowSec)) return false; + if(!label_.Equals(other.label_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTimeWindowSec) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeWindowSec); + hash ^= label_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTimeWindowSec) { + output.WriteRawTag(9); + output.WriteDouble(TimeWindowSec); + } + label_.WriteTo(output, _repeated_label_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTimeWindowSec) { + output.WriteRawTag(9); + output.WriteDouble(TimeWindowSec); + } + label_.WriteTo(ref output, _repeated_label_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTimeWindowSec) { + size += 1 + 8; + } + size += label_.CalculateSize(_repeated_label_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketFrequencyCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTimeWindowSec) { + TimeWindowSec = other.TimeWindowSec; + } + label_.Add(other.label_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + TimeWindowSec = input.ReadDouble(); + break; + } + case 18: { + label_.AddEntriesFrom(input, _repeated_label_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + TimeWindowSec = input.ReadDouble(); + break; + } + case 18: { + label_.AddEntriesFrom(ref input, _repeated_label_codec); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the PacketFrequencyCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(168468918, pb::FieldCodec.ForMessage(1347751346, global::Mediapipe.PacketFrequencyCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs.meta new file mode 100644 index 0000000..551b944 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketFrequencyCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5509c6d03b5c9b33d8ca58ab338481b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs new file mode 100644 index 0000000..6144531 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs @@ -0,0 +1,411 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/packet_latency_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/packet_latency_calculator.proto + public static partial class PacketLatencyCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/packet_latency_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketLatencyCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9wYWNrZXRfbGF0ZW5jeV9j", + "YWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdv", + "cmsvY2FsY3VsYXRvci5wcm90byLvAQoeUGFja2V0TGF0ZW5jeUNhbGN1bGF0", + "b3JPcHRpb25zEhkKDW51bV9pbnRlcnZhbHMYASABKAM6AjEwEiEKEmludGVy", + "dmFsX3NpemVfdXNlYxgCIAEoAzoFMTAwMDASHwoTcmVzZXRfZHVyYXRpb25f", + "dXNlYxgDIAEoAzoCLTESFQoNcGFja2V0X2xhYmVscxgEIAMoCTJXCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYzdGrUiABKAsyKS5tZWRp", + "YXBpcGUuUGFja2V0TGF0ZW5jeUNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketLatencyCalculatorOptions), global::Mediapipe.PacketLatencyCalculatorOptions.Parser, new[]{ "NumIntervals", "IntervalSizeUsec", "ResetDurationUsec", "PacketLabels" }, null, null, new pb::Extension[] { global::Mediapipe.PacketLatencyCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class PacketLatencyCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketLatencyCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketLatencyCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatencyCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatencyCalculatorOptions(PacketLatencyCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numIntervals_ = other.numIntervals_; + intervalSizeUsec_ = other.intervalSizeUsec_; + resetDurationUsec_ = other.resetDurationUsec_; + packetLabels_ = other.packetLabels_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketLatencyCalculatorOptions Clone() { + return new PacketLatencyCalculatorOptions(this); + } + + /// Field number for the "num_intervals" field. + public const int NumIntervalsFieldNumber = 1; + private readonly static long NumIntervalsDefaultValue = 10L; + + private long numIntervals_; + /// + /// Number of intervals for the latency histogram output. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long NumIntervals { + get { if ((_hasBits0 & 1) != 0) { return numIntervals_; } else { return NumIntervalsDefaultValue; } } + set { + _hasBits0 |= 1; + numIntervals_ = value; + } + } + /// Gets whether the "num_intervals" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumIntervals { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_intervals" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumIntervals() { + _hasBits0 &= ~1; + } + + /// Field number for the "interval_size_usec" field. + public const int IntervalSizeUsecFieldNumber = 2; + private readonly static long IntervalSizeUsecDefaultValue = 10000L; + + private long intervalSizeUsec_; + /// + /// Interval size (in microseconds) for the histogram. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long IntervalSizeUsec { + get { if ((_hasBits0 & 2) != 0) { return intervalSizeUsec_; } else { return IntervalSizeUsecDefaultValue; } } + set { + _hasBits0 |= 2; + intervalSizeUsec_ = value; + } + } + /// Gets whether the "interval_size_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntervalSizeUsec { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "interval_size_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntervalSizeUsec() { + _hasBits0 &= ~2; + } + + /// Field number for the "reset_duration_usec" field. + public const int ResetDurationUsecFieldNumber = 3; + private readonly static long ResetDurationUsecDefaultValue = -1L; + + private long resetDurationUsec_; + /// + /// Reset time (in microseconds) for histogram and average. The histogram and + /// running average are initialized to zero periodically based on the specified + /// duration. Negative value implies never resetting the statistics. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ResetDurationUsec { + get { if ((_hasBits0 & 4) != 0) { return resetDurationUsec_; } else { return ResetDurationUsecDefaultValue; } } + set { + _hasBits0 |= 4; + resetDurationUsec_ = value; + } + } + /// Gets whether the "reset_duration_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasResetDurationUsec { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "reset_duration_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearResetDurationUsec() { + _hasBits0 &= ~4; + } + + /// Field number for the "packet_labels" field. + public const int PacketLabelsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_packetLabels_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField packetLabels_ = new pbc::RepeatedField(); + /// + /// Identifier labels for each input packet stream. The order of labels must + /// correspond 1:1 with the input streams order. The labels are copied to the + /// latency information output by the calculator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PacketLabels { + get { return packetLabels_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketLatencyCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketLatencyCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumIntervals != other.NumIntervals) return false; + if (IntervalSizeUsec != other.IntervalSizeUsec) return false; + if (ResetDurationUsec != other.ResetDurationUsec) return false; + if(!packetLabels_.Equals(other.packetLabels_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumIntervals) hash ^= NumIntervals.GetHashCode(); + if (HasIntervalSizeUsec) hash ^= IntervalSizeUsec.GetHashCode(); + if (HasResetDurationUsec) hash ^= ResetDurationUsec.GetHashCode(); + hash ^= packetLabels_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumIntervals) { + output.WriteRawTag(8); + output.WriteInt64(NumIntervals); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(16); + output.WriteInt64(IntervalSizeUsec); + } + if (HasResetDurationUsec) { + output.WriteRawTag(24); + output.WriteInt64(ResetDurationUsec); + } + packetLabels_.WriteTo(output, _repeated_packetLabels_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumIntervals) { + output.WriteRawTag(8); + output.WriteInt64(NumIntervals); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(16); + output.WriteInt64(IntervalSizeUsec); + } + if (HasResetDurationUsec) { + output.WriteRawTag(24); + output.WriteInt64(ResetDurationUsec); + } + packetLabels_.WriteTo(ref output, _repeated_packetLabels_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumIntervals) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumIntervals); + } + if (HasIntervalSizeUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IntervalSizeUsec); + } + if (HasResetDurationUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ResetDurationUsec); + } + size += packetLabels_.CalculateSize(_repeated_packetLabels_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketLatencyCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumIntervals) { + NumIntervals = other.NumIntervals; + } + if (other.HasIntervalSizeUsec) { + IntervalSizeUsec = other.IntervalSizeUsec; + } + if (other.HasResetDurationUsec) { + ResetDurationUsec = other.ResetDurationUsec; + } + packetLabels_.Add(other.packetLabels_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumIntervals = input.ReadInt64(); + break; + } + case 16: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 24: { + ResetDurationUsec = input.ReadInt64(); + break; + } + case 34: { + packetLabels_.AddEntriesFrom(input, _repeated_packetLabels_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumIntervals = input.ReadInt64(); + break; + } + case 16: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 24: { + ResetDurationUsec = input.ReadInt64(); + break; + } + case 34: { + packetLabels_.AddEntriesFrom(ref input, _repeated_packetLabels_codec); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the PacketLatencyCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(172681421, pb::FieldCodec.ForMessage(1381451370, global::Mediapipe.PacketLatencyCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs.meta new file mode 100644 index 0000000..60f3070 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/PacketLatencyCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3b9f92408a56ffb7ba62882486e231c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs new file mode 100644 index 0000000..108cb3f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs @@ -0,0 +1,484 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/rect_to_render_data_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/rect_to_render_data_calculator.proto + public static partial class RectToRenderDataCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/rect_to_render_data_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RectToRenderDataCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9yZWN0X3RvX3JlbmRlcl9k", + "YXRhX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvGhptZWRpYXBpcGUvdXRpbC9jb2xv", + "ci5wcm90byL3AQohUmVjdFRvUmVuZGVyRGF0YUNhbGN1bGF0b3JPcHRpb25z", + "Eg4KBmZpbGxlZBgBIAEoCBIfCgVjb2xvchgCIAEoCzIQLm1lZGlhcGlwZS5D", + "b2xvchIUCgl0aGlja25lc3MYAyABKAE6ATESEwoEb3ZhbBgEIAEoCDoFZmFs", + "c2USGgoSdG9wX2xlZnRfdGhpY2tuZXNzGAUgASgBMloKA2V4dBIcLm1lZGlh", + "cGlwZS5DYWxjdWxhdG9yT3B0aW9ucxis24d9IAEoCzIsLm1lZGlhcGlwZS5S", + "ZWN0VG9SZW5kZXJEYXRhQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RectToRenderDataCalculatorOptions), global::Mediapipe.RectToRenderDataCalculatorOptions.Parser, new[]{ "Filled", "Color", "Thickness", "Oval", "TopLeftThickness" }, null, null, new pb::Extension[] { global::Mediapipe.RectToRenderDataCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RectToRenderDataCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RectToRenderDataCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RectToRenderDataCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderDataCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderDataCalculatorOptions(RectToRenderDataCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + filled_ = other.filled_; + color_ = other.color_ != null ? other.color_.Clone() : null; + thickness_ = other.thickness_; + oval_ = other.oval_; + topLeftThickness_ = other.topLeftThickness_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderDataCalculatorOptions Clone() { + return new RectToRenderDataCalculatorOptions(this); + } + + /// Field number for the "filled" field. + public const int FilledFieldNumber = 1; + private readonly static bool FilledDefaultValue = false; + + private bool filled_; + /// + /// Whether the rendered rectangle should be filled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Filled { + get { if ((_hasBits0 & 1) != 0) { return filled_; } else { return FilledDefaultValue; } } + set { + _hasBits0 |= 1; + filled_ = value; + } + } + /// Gets whether the "filled" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilled { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "filled" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilled() { + _hasBits0 &= ~1; + } + + /// Field number for the "color" field. + public const int ColorFieldNumber = 2; + private global::Mediapipe.Color color_; + /// + /// Line color or filled color of the rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color { + get { return color_; } + set { + color_ = value; + } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 3; + private readonly static double ThicknessDefaultValue = 1D; + + private double thickness_; + /// + /// Thickness of the line (applicable when the rectangle is not filled). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 2) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 2; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~2; + } + + /// Field number for the "oval" field. + public const int OvalFieldNumber = 4; + private readonly static bool OvalDefaultValue = false; + + private bool oval_; + /// + /// Whether the rendered rectangle should be an oval. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Oval { + get { if ((_hasBits0 & 4) != 0) { return oval_; } else { return OvalDefaultValue; } } + set { + _hasBits0 |= 4; + oval_ = value; + } + } + /// Gets whether the "oval" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOval { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "oval" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOval() { + _hasBits0 &= ~4; + } + + /// Field number for the "top_left_thickness" field. + public const int TopLeftThicknessFieldNumber = 5; + private readonly static double TopLeftThicknessDefaultValue = 0D; + + private double topLeftThickness_; + /// + /// Radius of top left corner circle. Only supported for oval=false, + /// filled=false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double TopLeftThickness { + get { if ((_hasBits0 & 8) != 0) { return topLeftThickness_; } else { return TopLeftThicknessDefaultValue; } } + set { + _hasBits0 |= 8; + topLeftThickness_ = value; + } + } + /// Gets whether the "top_left_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopLeftThickness { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "top_left_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopLeftThickness() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RectToRenderDataCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RectToRenderDataCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Filled != other.Filled) return false; + if (!object.Equals(Color, other.Color)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + if (Oval != other.Oval) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TopLeftThickness, other.TopLeftThickness)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFilled) hash ^= Filled.GetHashCode(); + if (color_ != null) hash ^= Color.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + if (HasOval) hash ^= Oval.GetHashCode(); + if (HasTopLeftThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TopLeftThickness); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFilled) { + output.WriteRawTag(8); + output.WriteBool(Filled); + } + if (color_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Color); + } + if (HasThickness) { + output.WriteRawTag(25); + output.WriteDouble(Thickness); + } + if (HasOval) { + output.WriteRawTag(32); + output.WriteBool(Oval); + } + if (HasTopLeftThickness) { + output.WriteRawTag(41); + output.WriteDouble(TopLeftThickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFilled) { + output.WriteRawTag(8); + output.WriteBool(Filled); + } + if (color_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Color); + } + if (HasThickness) { + output.WriteRawTag(25); + output.WriteDouble(Thickness); + } + if (HasOval) { + output.WriteRawTag(32); + output.WriteBool(Oval); + } + if (HasTopLeftThickness) { + output.WriteRawTag(41); + output.WriteDouble(TopLeftThickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFilled) { + size += 1 + 1; + } + if (color_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color); + } + if (HasThickness) { + size += 1 + 8; + } + if (HasOval) { + size += 1 + 1; + } + if (HasTopLeftThickness) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RectToRenderDataCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasFilled) { + Filled = other.Filled; + } + if (other.color_ != null) { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + Color.MergeFrom(other.Color); + } + if (other.HasThickness) { + Thickness = other.Thickness; + } + if (other.HasOval) { + Oval = other.Oval; + } + if (other.HasTopLeftThickness) { + TopLeftThickness = other.TopLeftThickness; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Filled = input.ReadBool(); + break; + } + case 18: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 25: { + Thickness = input.ReadDouble(); + break; + } + case 32: { + Oval = input.ReadBool(); + break; + } + case 41: { + TopLeftThickness = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Filled = input.ReadBool(); + break; + } + case 18: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 25: { + Thickness = input.ReadDouble(); + break; + } + case 32: { + Oval = input.ReadBool(); + break; + } + case 41: { + TopLeftThickness = input.ReadDouble(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the RectToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(262270380, pb::FieldCodec.ForMessage(2098163042, global::Mediapipe.RectToRenderDataCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs.meta new file mode 100644 index 0000000..2856907 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderDataCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cebcacf7fccb5e276b1bf0945587f5f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs new file mode 100644 index 0000000..be12e35 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs @@ -0,0 +1,327 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/rect_to_render_scale_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/rect_to_render_scale_calculator.proto + public static partial class RectToRenderScaleCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/rect_to_render_scale_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RectToRenderScaleCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9yZWN0X3RvX3JlbmRlcl9z", + "Y2FsZV9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9m", + "cmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byLFAQoiUmVjdFRvUmVuZGVyU2Nh", + "bGVDYWxjdWxhdG9yT3B0aW9ucxIYCgptdWx0aXBsaWVyGAEgASgCOgQwLjAx", + "EicKGHByb2Nlc3NfdGltZXN0YW1wX2JvdW5kcxgCIAEoCDoFZmFsc2UyXAoD", + "ZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGPHl5Y4BIAEoCzIt", + "Lm1lZGlhcGlwZS5SZWN0VG9SZW5kZXJTY2FsZUNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RectToRenderScaleCalculatorOptions), global::Mediapipe.RectToRenderScaleCalculatorOptions.Parser, new[]{ "Multiplier", "ProcessTimestampBounds" }, null, null, new pb::Extension[] { global::Mediapipe.RectToRenderScaleCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RectToRenderScaleCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RectToRenderScaleCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RectToRenderScaleCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderScaleCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderScaleCalculatorOptions(RectToRenderScaleCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + multiplier_ = other.multiplier_; + processTimestampBounds_ = other.processTimestampBounds_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectToRenderScaleCalculatorOptions Clone() { + return new RectToRenderScaleCalculatorOptions(this); + } + + /// Field number for the "multiplier" field. + public const int MultiplierFieldNumber = 1; + private readonly static float MultiplierDefaultValue = 0.01F; + + private float multiplier_; + /// + /// Multiplier to apply to the rect size. + /// If one defined `thickness` for RenderData primitives for object (e.g. pose, + /// hand or face) of size `A` then multiplier should be `1/A`. It means that + /// when actual object size on the image will be `B`, than all RenderData + /// primitives will be scaled with factor `B/A`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Multiplier { + get { if ((_hasBits0 & 1) != 0) { return multiplier_; } else { return MultiplierDefaultValue; } } + set { + _hasBits0 |= 1; + multiplier_ = value; + } + } + /// Gets whether the "multiplier" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMultiplier { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "multiplier" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMultiplier() { + _hasBits0 &= ~1; + } + + /// Field number for the "process_timestamp_bounds" field. + public const int ProcessTimestampBoundsFieldNumber = 2; + private readonly static bool ProcessTimestampBoundsDefaultValue = false; + + private bool processTimestampBounds_; + /// + /// When true, Process is called for every new timestamp bound, with or without + /// new packets. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ProcessTimestampBounds { + get { if ((_hasBits0 & 2) != 0) { return processTimestampBounds_; } else { return ProcessTimestampBoundsDefaultValue; } } + set { + _hasBits0 |= 2; + processTimestampBounds_ = value; + } + } + /// Gets whether the "process_timestamp_bounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProcessTimestampBounds { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "process_timestamp_bounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProcessTimestampBounds() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RectToRenderScaleCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RectToRenderScaleCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Multiplier, other.Multiplier)) return false; + if (ProcessTimestampBounds != other.ProcessTimestampBounds) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMultiplier) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Multiplier); + if (HasProcessTimestampBounds) hash ^= ProcessTimestampBounds.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMultiplier) { + output.WriteRawTag(13); + output.WriteFloat(Multiplier); + } + if (HasProcessTimestampBounds) { + output.WriteRawTag(16); + output.WriteBool(ProcessTimestampBounds); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMultiplier) { + output.WriteRawTag(13); + output.WriteFloat(Multiplier); + } + if (HasProcessTimestampBounds) { + output.WriteRawTag(16); + output.WriteBool(ProcessTimestampBounds); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMultiplier) { + size += 1 + 4; + } + if (HasProcessTimestampBounds) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RectToRenderScaleCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMultiplier) { + Multiplier = other.Multiplier; + } + if (other.HasProcessTimestampBounds) { + ProcessTimestampBounds = other.ProcessTimestampBounds; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Multiplier = input.ReadFloat(); + break; + } + case 16: { + ProcessTimestampBounds = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Multiplier = input.ReadFloat(); + break; + } + case 16: { + ProcessTimestampBounds = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the RectToRenderScaleCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(299463409, pb::FieldCodec.ForMessage(2395707274, global::Mediapipe.RectToRenderScaleCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs.meta new file mode 100644 index 0000000..e573be4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectToRenderScaleCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f543e63e248fb96eae0d0d5a084479b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs new file mode 100644 index 0000000..235ce7d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs @@ -0,0 +1,651 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/rect_transformation_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/rect_transformation_calculator.proto + public static partial class RectTransformationCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/rect_transformation_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RectTransformationCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9yZWN0X3RyYW5zZm9ybWF0", + "aW9uX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2Zy", + "YW1ld29yay9jYWxjdWxhdG9yLnByb3RvIqQCCiNSZWN0VHJhbnNmb3JtYXRp", + "b25DYWxjdWxhdG9yT3B0aW9ucxISCgdzY2FsZV94GAEgASgCOgExEhIKB3Nj", + "YWxlX3kYAiABKAI6ATESEAoIcm90YXRpb24YAyABKAISGAoQcm90YXRpb25f", + "ZGVncmVlcxgEIAEoBRIPCgdzaGlmdF94GAUgASgCEg8KB3NoaWZ0X3kYBiAB", + "KAISEwoLc3F1YXJlX2xvbmcYByABKAgSFAoMc3F1YXJlX3Nob3J0GAggASgI", + "MlwKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiIg4V9IAEo", + "CzIuLm1lZGlhcGlwZS5SZWN0VHJhbnNmb3JtYXRpb25DYWxjdWxhdG9yT3B0", + "aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RectTransformationCalculatorOptions), global::Mediapipe.RectTransformationCalculatorOptions.Parser, new[]{ "ScaleX", "ScaleY", "Rotation", "RotationDegrees", "ShiftX", "ShiftY", "SquareLong", "SquareShort" }, null, null, new pb::Extension[] { global::Mediapipe.RectTransformationCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RectTransformationCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RectTransformationCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RectTransformationCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectTransformationCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectTransformationCalculatorOptions(RectTransformationCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + scaleX_ = other.scaleX_; + scaleY_ = other.scaleY_; + rotation_ = other.rotation_; + rotationDegrees_ = other.rotationDegrees_; + shiftX_ = other.shiftX_; + shiftY_ = other.shiftY_; + squareLong_ = other.squareLong_; + squareShort_ = other.squareShort_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectTransformationCalculatorOptions Clone() { + return new RectTransformationCalculatorOptions(this); + } + + /// Field number for the "scale_x" field. + public const int ScaleXFieldNumber = 1; + private readonly static float ScaleXDefaultValue = 1F; + + private float scaleX_; + /// + /// Scaling factor along the side of a rotated rect that was aligned with the + /// X and Y axis before rotation respectively. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ScaleX { + get { if ((_hasBits0 & 1) != 0) { return scaleX_; } else { return ScaleXDefaultValue; } } + set { + _hasBits0 |= 1; + scaleX_ = value; + } + } + /// Gets whether the "scale_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "scale_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleX() { + _hasBits0 &= ~1; + } + + /// Field number for the "scale_y" field. + public const int ScaleYFieldNumber = 2; + private readonly static float ScaleYDefaultValue = 1F; + + private float scaleY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ScaleY { + get { if ((_hasBits0 & 2) != 0) { return scaleY_; } else { return ScaleYDefaultValue; } } + set { + _hasBits0 |= 2; + scaleY_ = value; + } + } + /// Gets whether the "scale_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "scale_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleY() { + _hasBits0 &= ~2; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 3; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// Additional rotation (counter-clockwise) around the rect center either in + /// radians or in degrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 4) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 4; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~4; + } + + /// Field number for the "rotation_degrees" field. + public const int RotationDegreesFieldNumber = 4; + private readonly static int RotationDegreesDefaultValue = 0; + + private int rotationDegrees_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RotationDegrees { + get { if ((_hasBits0 & 8) != 0) { return rotationDegrees_; } else { return RotationDegreesDefaultValue; } } + set { + _hasBits0 |= 8; + rotationDegrees_ = value; + } + } + /// Gets whether the "rotation_degrees" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationDegrees { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "rotation_degrees" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationDegrees() { + _hasBits0 &= ~8; + } + + /// Field number for the "shift_x" field. + public const int ShiftXFieldNumber = 5; + private readonly static float ShiftXDefaultValue = 0F; + + private float shiftX_; + /// + /// Shift along the side of a rotated rect that was aligned with the X and Y + /// axis before rotation respectively. The shift is relative to the length of + /// corresponding side. For example, for a rect with size (0.4, 0.6), with + /// shift_x = 0.5 and shift_y = -0.5 the rect is shifted along the two sides + /// by 0.2 and -0.3 respectively. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ShiftX { + get { if ((_hasBits0 & 16) != 0) { return shiftX_; } else { return ShiftXDefaultValue; } } + set { + _hasBits0 |= 16; + shiftX_ = value; + } + } + /// Gets whether the "shift_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasShiftX { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "shift_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearShiftX() { + _hasBits0 &= ~16; + } + + /// Field number for the "shift_y" field. + public const int ShiftYFieldNumber = 6; + private readonly static float ShiftYDefaultValue = 0F; + + private float shiftY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ShiftY { + get { if ((_hasBits0 & 32) != 0) { return shiftY_; } else { return ShiftYDefaultValue; } } + set { + _hasBits0 |= 32; + shiftY_ = value; + } + } + /// Gets whether the "shift_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasShiftY { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "shift_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearShiftY() { + _hasBits0 &= ~32; + } + + /// Field number for the "square_long" field. + public const int SquareLongFieldNumber = 7; + private readonly static bool SquareLongDefaultValue = false; + + private bool squareLong_; + /// + /// Change the final transformed rect into a square that shares the same center + /// and rotation with the rect, and with the side of the square equal to either + /// the long or short side of the rect respectively. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SquareLong { + get { if ((_hasBits0 & 64) != 0) { return squareLong_; } else { return SquareLongDefaultValue; } } + set { + _hasBits0 |= 64; + squareLong_ = value; + } + } + /// Gets whether the "square_long" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSquareLong { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "square_long" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSquareLong() { + _hasBits0 &= ~64; + } + + /// Field number for the "square_short" field. + public const int SquareShortFieldNumber = 8; + private readonly static bool SquareShortDefaultValue = false; + + private bool squareShort_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SquareShort { + get { if ((_hasBits0 & 128) != 0) { return squareShort_; } else { return SquareShortDefaultValue; } } + set { + _hasBits0 |= 128; + squareShort_ = value; + } + } + /// Gets whether the "square_short" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSquareShort { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "square_short" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSquareShort() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RectTransformationCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RectTransformationCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScaleX, other.ScaleX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScaleY, other.ScaleY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (RotationDegrees != other.RotationDegrees) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ShiftX, other.ShiftX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ShiftY, other.ShiftY)) return false; + if (SquareLong != other.SquareLong) return false; + if (SquareShort != other.SquareShort) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasScaleX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScaleX); + if (HasScaleY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScaleY); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (HasRotationDegrees) hash ^= RotationDegrees.GetHashCode(); + if (HasShiftX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ShiftX); + if (HasShiftY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ShiftY); + if (HasSquareLong) hash ^= SquareLong.GetHashCode(); + if (HasSquareShort) hash ^= SquareShort.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasScaleX) { + output.WriteRawTag(13); + output.WriteFloat(ScaleX); + } + if (HasScaleY) { + output.WriteRawTag(21); + output.WriteFloat(ScaleY); + } + if (HasRotation) { + output.WriteRawTag(29); + output.WriteFloat(Rotation); + } + if (HasRotationDegrees) { + output.WriteRawTag(32); + output.WriteInt32(RotationDegrees); + } + if (HasShiftX) { + output.WriteRawTag(45); + output.WriteFloat(ShiftX); + } + if (HasShiftY) { + output.WriteRawTag(53); + output.WriteFloat(ShiftY); + } + if (HasSquareLong) { + output.WriteRawTag(56); + output.WriteBool(SquareLong); + } + if (HasSquareShort) { + output.WriteRawTag(64); + output.WriteBool(SquareShort); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasScaleX) { + output.WriteRawTag(13); + output.WriteFloat(ScaleX); + } + if (HasScaleY) { + output.WriteRawTag(21); + output.WriteFloat(ScaleY); + } + if (HasRotation) { + output.WriteRawTag(29); + output.WriteFloat(Rotation); + } + if (HasRotationDegrees) { + output.WriteRawTag(32); + output.WriteInt32(RotationDegrees); + } + if (HasShiftX) { + output.WriteRawTag(45); + output.WriteFloat(ShiftX); + } + if (HasShiftY) { + output.WriteRawTag(53); + output.WriteFloat(ShiftY); + } + if (HasSquareLong) { + output.WriteRawTag(56); + output.WriteBool(SquareLong); + } + if (HasSquareShort) { + output.WriteRawTag(64); + output.WriteBool(SquareShort); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasScaleX) { + size += 1 + 4; + } + if (HasScaleY) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + 4; + } + if (HasRotationDegrees) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RotationDegrees); + } + if (HasShiftX) { + size += 1 + 4; + } + if (HasShiftY) { + size += 1 + 4; + } + if (HasSquareLong) { + size += 1 + 1; + } + if (HasSquareShort) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RectTransformationCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasScaleX) { + ScaleX = other.ScaleX; + } + if (other.HasScaleY) { + ScaleY = other.ScaleY; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasRotationDegrees) { + RotationDegrees = other.RotationDegrees; + } + if (other.HasShiftX) { + ShiftX = other.ShiftX; + } + if (other.HasShiftY) { + ShiftY = other.ShiftY; + } + if (other.HasSquareLong) { + SquareLong = other.SquareLong; + } + if (other.HasSquareShort) { + SquareShort = other.SquareShort; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + ScaleX = input.ReadFloat(); + break; + } + case 21: { + ScaleY = input.ReadFloat(); + break; + } + case 29: { + Rotation = input.ReadFloat(); + break; + } + case 32: { + RotationDegrees = input.ReadInt32(); + break; + } + case 45: { + ShiftX = input.ReadFloat(); + break; + } + case 53: { + ShiftY = input.ReadFloat(); + break; + } + case 56: { + SquareLong = input.ReadBool(); + break; + } + case 64: { + SquareShort = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + ScaleX = input.ReadFloat(); + break; + } + case 21: { + ScaleY = input.ReadFloat(); + break; + } + case 29: { + Rotation = input.ReadFloat(); + break; + } + case 32: { + RotationDegrees = input.ReadInt32(); + break; + } + case 45: { + ShiftX = input.ReadFloat(); + break; + } + case 53: { + ShiftY = input.ReadFloat(); + break; + } + case 56: { + SquareLong = input.ReadBool(); + break; + } + case 64: { + SquareShort = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the RectTransformationCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(262226312, pb::FieldCodec.ForMessage(2097810498, global::Mediapipe.RectTransformationCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs.meta new file mode 100644 index 0000000..6fac547 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RectTransformationCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05e149598366f900bb466d533de49fe2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs new file mode 100644 index 0000000..0c819ea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs @@ -0,0 +1,422 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.proto + public static partial class RefineLandmarksFromHeatmapCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RefineLandmarksFromHeatmapCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkltZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC9yZWZpbmVfbGFuZG1hcmtz", + "X2Zyb21faGVhdG1hcF9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1l", + "ZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byKVAgorUmVmaW5l", + "TGFuZG1hcmtzRnJvbUhlYXRtYXBDYWxjdWxhdG9yT3B0aW9ucxIWCgtrZXJu", + "ZWxfc2l6ZRgBIAEoBToBORIlChhtaW5fY29uZmlkZW5jZV90b19yZWZpbmUY", + "AiABKAI6AzAuNRIeCg9yZWZpbmVfcHJlc2VuY2UYAyABKAg6BWZhbHNlEiAK", + "EXJlZmluZV92aXNpYmlsaXR5GAQgASgIOgVmYWxzZTJlCgNleHQSHC5tZWRp", + "YXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYtfXfrAEgASgLMjYubWVkaWFwaXBl", + "LlJlZmluZUxhbmRtYXJrc0Zyb21IZWF0bWFwQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RefineLandmarksFromHeatmapCalculatorOptions), global::Mediapipe.RefineLandmarksFromHeatmapCalculatorOptions.Parser, new[]{ "KernelSize", "MinConfidenceToRefine", "RefinePresence", "RefineVisibility" }, null, null, new pb::Extension[] { global::Mediapipe.RefineLandmarksFromHeatmapCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class RefineLandmarksFromHeatmapCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RefineLandmarksFromHeatmapCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RefineLandmarksFromHeatmapCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RefineLandmarksFromHeatmapCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RefineLandmarksFromHeatmapCalculatorOptions(RefineLandmarksFromHeatmapCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + kernelSize_ = other.kernelSize_; + minConfidenceToRefine_ = other.minConfidenceToRefine_; + refinePresence_ = other.refinePresence_; + refineVisibility_ = other.refineVisibility_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RefineLandmarksFromHeatmapCalculatorOptions Clone() { + return new RefineLandmarksFromHeatmapCalculatorOptions(this); + } + + /// Field number for the "kernel_size" field. + public const int KernelSizeFieldNumber = 1; + private readonly static int KernelSizeDefaultValue = 9; + + private int kernelSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int KernelSize { + get { if ((_hasBits0 & 1) != 0) { return kernelSize_; } else { return KernelSizeDefaultValue; } } + set { + _hasBits0 |= 1; + kernelSize_ = value; + } + } + /// Gets whether the "kernel_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKernelSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "kernel_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKernelSize() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_confidence_to_refine" field. + public const int MinConfidenceToRefineFieldNumber = 2; + private readonly static float MinConfidenceToRefineDefaultValue = 0.5F; + + private float minConfidenceToRefine_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinConfidenceToRefine { + get { if ((_hasBits0 & 2) != 0) { return minConfidenceToRefine_; } else { return MinConfidenceToRefineDefaultValue; } } + set { + _hasBits0 |= 2; + minConfidenceToRefine_ = value; + } + } + /// Gets whether the "min_confidence_to_refine" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinConfidenceToRefine { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_confidence_to_refine" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinConfidenceToRefine() { + _hasBits0 &= ~2; + } + + /// Field number for the "refine_presence" field. + public const int RefinePresenceFieldNumber = 3; + private readonly static bool RefinePresenceDefaultValue = false; + + private bool refinePresence_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RefinePresence { + get { if ((_hasBits0 & 4) != 0) { return refinePresence_; } else { return RefinePresenceDefaultValue; } } + set { + _hasBits0 |= 4; + refinePresence_ = value; + } + } + /// Gets whether the "refine_presence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRefinePresence { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "refine_presence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRefinePresence() { + _hasBits0 &= ~4; + } + + /// Field number for the "refine_visibility" field. + public const int RefineVisibilityFieldNumber = 4; + private readonly static bool RefineVisibilityDefaultValue = false; + + private bool refineVisibility_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RefineVisibility { + get { if ((_hasBits0 & 8) != 0) { return refineVisibility_; } else { return RefineVisibilityDefaultValue; } } + set { + _hasBits0 |= 8; + refineVisibility_ = value; + } + } + /// Gets whether the "refine_visibility" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRefineVisibility { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "refine_visibility" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRefineVisibility() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RefineLandmarksFromHeatmapCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RefineLandmarksFromHeatmapCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (KernelSize != other.KernelSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinConfidenceToRefine, other.MinConfidenceToRefine)) return false; + if (RefinePresence != other.RefinePresence) return false; + if (RefineVisibility != other.RefineVisibility) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasKernelSize) hash ^= KernelSize.GetHashCode(); + if (HasMinConfidenceToRefine) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinConfidenceToRefine); + if (HasRefinePresence) hash ^= RefinePresence.GetHashCode(); + if (HasRefineVisibility) hash ^= RefineVisibility.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasKernelSize) { + output.WriteRawTag(8); + output.WriteInt32(KernelSize); + } + if (HasMinConfidenceToRefine) { + output.WriteRawTag(21); + output.WriteFloat(MinConfidenceToRefine); + } + if (HasRefinePresence) { + output.WriteRawTag(24); + output.WriteBool(RefinePresence); + } + if (HasRefineVisibility) { + output.WriteRawTag(32); + output.WriteBool(RefineVisibility); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasKernelSize) { + output.WriteRawTag(8); + output.WriteInt32(KernelSize); + } + if (HasMinConfidenceToRefine) { + output.WriteRawTag(21); + output.WriteFloat(MinConfidenceToRefine); + } + if (HasRefinePresence) { + output.WriteRawTag(24); + output.WriteBool(RefinePresence); + } + if (HasRefineVisibility) { + output.WriteRawTag(32); + output.WriteBool(RefineVisibility); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasKernelSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(KernelSize); + } + if (HasMinConfidenceToRefine) { + size += 1 + 4; + } + if (HasRefinePresence) { + size += 1 + 1; + } + if (HasRefineVisibility) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RefineLandmarksFromHeatmapCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasKernelSize) { + KernelSize = other.KernelSize; + } + if (other.HasMinConfidenceToRefine) { + MinConfidenceToRefine = other.MinConfidenceToRefine; + } + if (other.HasRefinePresence) { + RefinePresence = other.RefinePresence; + } + if (other.HasRefineVisibility) { + RefineVisibility = other.RefineVisibility; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + KernelSize = input.ReadInt32(); + break; + } + case 21: { + MinConfidenceToRefine = input.ReadFloat(); + break; + } + case 24: { + RefinePresence = input.ReadBool(); + break; + } + case 32: { + RefineVisibility = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + KernelSize = input.ReadInt32(); + break; + } + case 21: { + MinConfidenceToRefine = input.ReadFloat(); + break; + } + case 24: { + RefinePresence = input.ReadBool(); + break; + } + case 32: { + RefineVisibility = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the RefineLandmarksFromHeatmapCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(362281653, pb::FieldCodec.ForMessage(2898253226, global::Mediapipe.RefineLandmarksFromHeatmapCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs.meta new file mode 100644 index 0000000..d44de49 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/RefineLandmarksFromHeatmapCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c3baab1928bff0e1bdec866528b7e28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs new file mode 100644 index 0000000..3dbaa88 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs @@ -0,0 +1,263 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/thresholding_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/thresholding_calculator.proto + public static partial class ThresholdingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/thresholding_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ThresholdingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC90aHJlc2hvbGRpbmdfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8iigEKHVRocmVzaG9sZGluZ0NhbGN1bGF0b3JP", + "cHRpb25zEhEKCXRocmVzaG9sZBgBIAEoATJWCgNleHQSHC5tZWRpYXBpcGUu", + "Q2FsY3VsYXRvck9wdGlvbnMY4sf8eyABKAsyKC5tZWRpYXBpcGUuVGhyZXNo", + "b2xkaW5nQ2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ThresholdingCalculatorOptions), global::Mediapipe.ThresholdingCalculatorOptions.Parser, new[]{ "Threshold" }, null, null, new pb::Extension[] { global::Mediapipe.ThresholdingCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ThresholdingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ThresholdingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ThresholdingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThresholdingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThresholdingCalculatorOptions(ThresholdingCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + threshold_ = other.threshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThresholdingCalculatorOptions Clone() { + return new ThresholdingCalculatorOptions(this); + } + + /// Field number for the "threshold" field. + public const int ThresholdFieldNumber = 1; + private readonly static double ThresholdDefaultValue = 0D; + + private double threshold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Threshold { + get { if ((_hasBits0 & 1) != 0) { return threshold_; } else { return ThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + threshold_ = value; + } + } + /// Gets whether the "threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThreshold() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ThresholdingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ThresholdingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Threshold, other.Threshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Threshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasThreshold) { + output.WriteRawTag(9); + output.WriteDouble(Threshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasThreshold) { + output.WriteRawTag(9); + output.WriteDouble(Threshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasThreshold) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ThresholdingCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasThreshold) { + Threshold = other.Threshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + Threshold = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Threshold = input.ReadDouble(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the ThresholdingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(259990498, pb::FieldCodec.ForMessage(2079923986, global::Mediapipe.ThresholdingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs.meta new file mode 100644 index 0000000..8ddfad1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/ThresholdingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81f3d9cc258eeb1d1b47c50df48d5cf6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs new file mode 100644 index 0000000..6aef227 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs @@ -0,0 +1,264 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/timed_box_list_id_to_label_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/timed_box_list_id_to_label_calculator.proto + public static partial class TimedBoxListIdToLabelCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/timed_box_list_id_to_label_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TimedBoxListIdToLabelCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkZtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC90aW1lZF9ib3hfbGlzdF9p", + "ZF90b19sYWJlbF9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlh", + "cGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byKiAQomVGltZWRCb3hM", + "aXN0SWRUb0xhYmVsQ2FsY3VsYXRvck9wdGlvbnMSFgoObGFiZWxfbWFwX3Bh", + "dGgYASABKAkyYAoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25z", + "GOah+o0BIAEoCzIxLm1lZGlhcGlwZS5UaW1lZEJveExpc3RJZFRvTGFiZWxD", + "YWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedBoxListIdToLabelCalculatorOptions), global::Mediapipe.TimedBoxListIdToLabelCalculatorOptions.Parser, new[]{ "LabelMapPath" }, null, null, new pb::Extension[] { global::Mediapipe.TimedBoxListIdToLabelCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TimedBoxListIdToLabelCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedBoxListIdToLabelCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TimedBoxListIdToLabelCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListIdToLabelCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListIdToLabelCalculatorOptions(TimedBoxListIdToLabelCalculatorOptions other) : this() { + labelMapPath_ = other.labelMapPath_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListIdToLabelCalculatorOptions Clone() { + return new TimedBoxListIdToLabelCalculatorOptions(this); + } + + /// Field number for the "label_map_path" field. + public const int LabelMapPathFieldNumber = 1; + private readonly static string LabelMapPathDefaultValue = ""; + + private string labelMapPath_; + /// + /// Path to a label map file for getting the actual name of detected classes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string LabelMapPath { + get { return labelMapPath_ ?? LabelMapPathDefaultValue; } + set { + labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label_map_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelMapPath { + get { return labelMapPath_ != null; } + } + /// Clears the value of the "label_map_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelMapPath() { + labelMapPath_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedBoxListIdToLabelCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedBoxListIdToLabelCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LabelMapPath != other.LabelMapPath) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLabelMapPath) hash ^= LabelMapPath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLabelMapPath) { + output.WriteRawTag(10); + output.WriteString(LabelMapPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLabelMapPath) { + output.WriteRawTag(10); + output.WriteString(LabelMapPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLabelMapPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedBoxListIdToLabelCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasLabelMapPath) { + LabelMapPath = other.LabelMapPath; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + LabelMapPath = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + LabelMapPath = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TimedBoxListIdToLabelCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(297701606, pb::FieldCodec.ForMessage(2381612850, global::Mediapipe.TimedBoxListIdToLabelCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs.meta new file mode 100644 index 0000000..332d703 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListIdToLabelCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05f458a4a22cf5c6ca8c79f51b461de1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs new file mode 100644 index 0000000..d85f4cd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs @@ -0,0 +1,317 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/timed_box_list_to_render_data_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/timed_box_list_to_render_data_calculator.proto + public static partial class TimedBoxListToRenderDataCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/timed_box_list_to_render_data_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TimedBoxListToRenderDataCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkltZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC90aW1lZF9ib3hfbGlzdF90", + "b19yZW5kZXJfZGF0YV9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1l", + "ZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90bxoabWVkaWFwaXBl", + "L3V0aWwvY29sb3IucHJvdG8iywEKKVRpbWVkQm94TGlzdFRvUmVuZGVyRGF0", + "YUNhbGN1bGF0b3JPcHRpb25zEiMKCWJveF9jb2xvchgBIAEoCzIQLm1lZGlh", + "cGlwZS5Db2xvchIUCgl0aGlja25lc3MYAiABKAE6ATEyYwoDZXh0EhwubWVk", + "aWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGM6KnooBIAEoCzI0Lm1lZGlhcGlw", + "ZS5UaW1lZEJveExpc3RUb1JlbmRlckRhdGFDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedBoxListToRenderDataCalculatorOptions), global::Mediapipe.TimedBoxListToRenderDataCalculatorOptions.Parser, new[]{ "BoxColor", "Thickness" }, null, null, new pb::Extension[] { global::Mediapipe.TimedBoxListToRenderDataCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TimedBoxListToRenderDataCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedBoxListToRenderDataCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TimedBoxListToRenderDataCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListToRenderDataCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListToRenderDataCalculatorOptions(TimedBoxListToRenderDataCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + boxColor_ = other.boxColor_ != null ? other.boxColor_.Clone() : null; + thickness_ = other.thickness_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxListToRenderDataCalculatorOptions Clone() { + return new TimedBoxListToRenderDataCalculatorOptions(this); + } + + /// Field number for the "box_color" field. + public const int BoxColorFieldNumber = 1; + private global::Mediapipe.Color boxColor_; + /// + /// Color of boxes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color BoxColor { + get { return boxColor_; } + set { + boxColor_ = value; + } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 2; + private readonly static double ThicknessDefaultValue = 1D; + + private double thickness_; + /// + /// Thickness of the drawing of boxes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 1) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 1; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedBoxListToRenderDataCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedBoxListToRenderDataCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(BoxColor, other.BoxColor)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (boxColor_ != null) hash ^= BoxColor.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (boxColor_ != null) { + output.WriteRawTag(10); + output.WriteMessage(BoxColor); + } + if (HasThickness) { + output.WriteRawTag(17); + output.WriteDouble(Thickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (boxColor_ != null) { + output.WriteRawTag(10); + output.WriteMessage(BoxColor); + } + if (HasThickness) { + output.WriteRawTag(17); + output.WriteDouble(Thickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (boxColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoxColor); + } + if (HasThickness) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedBoxListToRenderDataCalculatorOptions other) { + if (other == null) { + return; + } + if (other.boxColor_ != null) { + if (boxColor_ == null) { + BoxColor = new global::Mediapipe.Color(); + } + BoxColor.MergeFrom(other.BoxColor); + } + if (other.HasThickness) { + Thickness = other.Thickness; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (boxColor_ == null) { + BoxColor = new global::Mediapipe.Color(); + } + input.ReadMessage(BoxColor); + break; + } + case 17: { + Thickness = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (boxColor_ == null) { + BoxColor = new global::Mediapipe.Color(); + } + input.ReadMessage(BoxColor); + break; + } + case 17: { + Thickness = input.ReadDouble(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TimedBoxListToRenderDataCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(289899854, pb::FieldCodec.ForMessage(2319198834, global::Mediapipe.TimedBoxListToRenderDataCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs.meta new file mode 100644 index 0000000..979be0b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TimedBoxListToRenderDataCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f75e4e7584829ce393e1ad0afaf0c89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs new file mode 100644 index 0000000..7e2fdb2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs @@ -0,0 +1,376 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/top_k_scores_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/top_k_scores_calculator.proto + public static partial class TopKScoresCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/top_k_scores_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TopKScoresCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC90b3Bfa19zY29yZXNfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8irgEKG1RvcEtTY29yZXNDYWxjdWxhdG9yT3B0", + "aW9ucxINCgV0b3BfaxgBIAEoBRIRCgl0aHJlc2hvbGQYAiABKAISFgoObGFi", + "ZWxfbWFwX3BhdGgYAyABKAkyVQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0", + "b3JPcHRpb25zGIy6qYEBIAEoCzImLm1lZGlhcGlwZS5Ub3BLU2NvcmVzQ2Fs", + "Y3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TopKScoresCalculatorOptions), global::Mediapipe.TopKScoresCalculatorOptions.Parser, new[]{ "TopK", "Threshold", "LabelMapPath" }, null, null, new pb::Extension[] { global::Mediapipe.TopKScoresCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TopKScoresCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopKScoresCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TopKScoresCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TopKScoresCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TopKScoresCalculatorOptions(TopKScoresCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + topK_ = other.topK_; + threshold_ = other.threshold_; + labelMapPath_ = other.labelMapPath_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TopKScoresCalculatorOptions Clone() { + return new TopKScoresCalculatorOptions(this); + } + + /// Field number for the "top_k" field. + public const int TopKFieldNumber = 1; + private readonly static int TopKDefaultValue = 0; + + private int topK_; + /// + /// How many highest scoring packets to output. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TopK { + get { if ((_hasBits0 & 1) != 0) { return topK_; } else { return TopKDefaultValue; } } + set { + _hasBits0 |= 1; + topK_ = value; + } + } + /// Gets whether the "top_k" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopK { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "top_k" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopK() { + _hasBits0 &= ~1; + } + + /// Field number for the "threshold" field. + public const int ThresholdFieldNumber = 2; + private readonly static float ThresholdDefaultValue = 0F; + + private float threshold_; + /// + /// If set, only keep the scores that are greater than the threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Threshold { + get { if ((_hasBits0 & 2) != 0) { return threshold_; } else { return ThresholdDefaultValue; } } + set { + _hasBits0 |= 2; + threshold_ = value; + } + } + /// Gets whether the "threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThreshold { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThreshold() { + _hasBits0 &= ~2; + } + + /// Field number for the "label_map_path" field. + public const int LabelMapPathFieldNumber = 3; + private readonly static string LabelMapPathDefaultValue = ""; + + private string labelMapPath_; + /// + /// Path to a label map file for getting the actual name of classes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string LabelMapPath { + get { return labelMapPath_ ?? LabelMapPathDefaultValue; } + set { + labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label_map_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelMapPath { + get { return labelMapPath_ != null; } + } + /// Clears the value of the "label_map_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelMapPath() { + labelMapPath_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TopKScoresCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TopKScoresCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TopK != other.TopK) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Threshold, other.Threshold)) return false; + if (LabelMapPath != other.LabelMapPath) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTopK) hash ^= TopK.GetHashCode(); + if (HasThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Threshold); + if (HasLabelMapPath) hash ^= LabelMapPath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTopK) { + output.WriteRawTag(8); + output.WriteInt32(TopK); + } + if (HasThreshold) { + output.WriteRawTag(21); + output.WriteFloat(Threshold); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTopK) { + output.WriteRawTag(8); + output.WriteInt32(TopK); + } + if (HasThreshold) { + output.WriteRawTag(21); + output.WriteFloat(Threshold); + } + if (HasLabelMapPath) { + output.WriteRawTag(26); + output.WriteString(LabelMapPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTopK) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TopK); + } + if (HasThreshold) { + size += 1 + 4; + } + if (HasLabelMapPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TopKScoresCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasTopK) { + TopK = other.TopK; + } + if (other.HasThreshold) { + Threshold = other.Threshold; + } + if (other.HasLabelMapPath) { + LabelMapPath = other.LabelMapPath; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TopK = input.ReadInt32(); + break; + } + case 21: { + Threshold = input.ReadFloat(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TopK = input.ReadInt32(); + break; + } + case 21: { + Threshold = input.ReadFloat(); + break; + } + case 26: { + LabelMapPath = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TopKScoresCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(271211788, pb::FieldCodec.ForMessage(2169694306, global::Mediapipe.TopKScoresCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs.meta new file mode 100644 index 0000000..e953106 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/TopKScoresCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1efed349f47e3fce9b8384ee0a810c17 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs new file mode 100644 index 0000000..05670e1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs @@ -0,0 +1,316 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/visibility_copy_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/visibility_copy_calculator.proto + public static partial class VisibilityCopyCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/visibility_copy_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static VisibilityCopyCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjttZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC92aXNpYmlsaXR5X2NvcHlf", + "Y2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGixtZWRpYXBpcGUvZnJhbWV3", + "b3JrL2NhbGN1bGF0b3Jfb3B0aW9ucy5wcm90byK4AQofVmlzaWJpbGl0eUNv", + "cHlDYWxjdWxhdG9yT3B0aW9ucxIdCg9jb3B5X3Zpc2liaWxpdHkYASABKAg6", + "BHRydWUSGwoNY29weV9wcmVzZW5jZRgCIAEoCDoEdHJ1ZTJZCgNleHQSHC5t", + "ZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYpZy4rQEgASgLMioubWVkaWFw", + "aXBlLlZpc2liaWxpdHlDb3B5Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VisibilityCopyCalculatorOptions), global::Mediapipe.VisibilityCopyCalculatorOptions.Parser, new[]{ "CopyVisibility", "CopyPresence" }, null, null, new pb::Extension[] { global::Mediapipe.VisibilityCopyCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class VisibilityCopyCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VisibilityCopyCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VisibilityCopyCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilityCopyCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilityCopyCalculatorOptions(VisibilityCopyCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + copyVisibility_ = other.copyVisibility_; + copyPresence_ = other.copyPresence_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilityCopyCalculatorOptions Clone() { + return new VisibilityCopyCalculatorOptions(this); + } + + /// Field number for the "copy_visibility" field. + public const int CopyVisibilityFieldNumber = 1; + private readonly static bool CopyVisibilityDefaultValue = true; + + private bool copyVisibility_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CopyVisibility { + get { if ((_hasBits0 & 1) != 0) { return copyVisibility_; } else { return CopyVisibilityDefaultValue; } } + set { + _hasBits0 |= 1; + copyVisibility_ = value; + } + } + /// Gets whether the "copy_visibility" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCopyVisibility { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "copy_visibility" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCopyVisibility() { + _hasBits0 &= ~1; + } + + /// Field number for the "copy_presence" field. + public const int CopyPresenceFieldNumber = 2; + private readonly static bool CopyPresenceDefaultValue = true; + + private bool copyPresence_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CopyPresence { + get { if ((_hasBits0 & 2) != 0) { return copyPresence_; } else { return CopyPresenceDefaultValue; } } + set { + _hasBits0 |= 2; + copyPresence_ = value; + } + } + /// Gets whether the "copy_presence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCopyPresence { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "copy_presence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCopyPresence() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VisibilityCopyCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VisibilityCopyCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CopyVisibility != other.CopyVisibility) return false; + if (CopyPresence != other.CopyPresence) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCopyVisibility) hash ^= CopyVisibility.GetHashCode(); + if (HasCopyPresence) hash ^= CopyPresence.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCopyVisibility) { + output.WriteRawTag(8); + output.WriteBool(CopyVisibility); + } + if (HasCopyPresence) { + output.WriteRawTag(16); + output.WriteBool(CopyPresence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCopyVisibility) { + output.WriteRawTag(8); + output.WriteBool(CopyVisibility); + } + if (HasCopyPresence) { + output.WriteRawTag(16); + output.WriteBool(CopyPresence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCopyVisibility) { + size += 1 + 1; + } + if (HasCopyPresence) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VisibilityCopyCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasCopyVisibility) { + CopyVisibility = other.CopyVisibility; + } + if (other.HasCopyPresence) { + CopyPresence = other.CopyPresence; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + CopyVisibility = input.ReadBool(); + break; + } + case 16: { + CopyPresence = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + CopyVisibility = input.ReadBool(); + break; + } + case 16: { + CopyPresence = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the VisibilityCopyCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(363728421, pb::FieldCodec.ForMessage(2909827370, global::Mediapipe.VisibilityCopyCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs.meta new file mode 100644 index 0000000..98a859b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilityCopyCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e93b9fa0114e34970b69166d4019517a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs new file mode 100644 index 0000000..51c0566 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs @@ -0,0 +1,723 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/util/visibility_smoothing_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/util/visibility_smoothing_calculator.proto + public static partial class VisibilitySmoothingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/util/visibility_smoothing_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static VisibilitySmoothingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdXRpbC92aXNpYmlsaXR5X3Ntb290", + "aGluZ19jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaLG1lZGlhcGlwZS9m", + "cmFtZXdvcmsvY2FsY3VsYXRvcl9vcHRpb25zLnByb3RvIvICCiRWaXNpYmls", + "aXR5U21vb3RoaW5nQ2FsY3VsYXRvck9wdGlvbnMSTQoJbm9fZmlsdGVyGAEg", + "ASgLMjgubWVkaWFwaXBlLlZpc2liaWxpdHlTbW9vdGhpbmdDYWxjdWxhdG9y", + "T3B0aW9ucy5Ob0ZpbHRlckgAElgKD2xvd19wYXNzX2ZpbHRlchgCIAEoCzI9", + "Lm1lZGlhcGlwZS5WaXNpYmlsaXR5U21vb3RoaW5nQ2FsY3VsYXRvck9wdGlv", + "bnMuTG93UGFzc0ZpbHRlckgAGgoKCE5vRmlsdGVyGiMKDUxvd1Bhc3NGaWx0", + "ZXISEgoFYWxwaGEYASABKAI6AzAuMTJeCgNleHQSHC5tZWRpYXBpcGUuQ2Fs", + "Y3VsYXRvck9wdGlvbnMY9qfhqwEgASgLMi8ubWVkaWFwaXBlLlZpc2liaWxp", + "dHlTbW9vdGhpbmdDYWxjdWxhdG9yT3B0aW9uc0IQCg5maWx0ZXJfb3B0aW9u", + "cw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VisibilitySmoothingCalculatorOptions), global::Mediapipe.VisibilitySmoothingCalculatorOptions.Parser, new[]{ "NoFilter", "LowPassFilter" }, new[]{ "FilterOptions" }, null, new pb::Extension[] { global::Mediapipe.VisibilitySmoothingCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter), global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter), global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter.Parser, new[]{ "Alpha" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class VisibilitySmoothingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VisibilitySmoothingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VisibilitySmoothingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilitySmoothingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilitySmoothingCalculatorOptions(VisibilitySmoothingCalculatorOptions other) : this() { + switch (other.FilterOptionsCase) { + case FilterOptionsOneofCase.NoFilter: + NoFilter = other.NoFilter.Clone(); + break; + case FilterOptionsOneofCase.LowPassFilter: + LowPassFilter = other.LowPassFilter.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisibilitySmoothingCalculatorOptions Clone() { + return new VisibilitySmoothingCalculatorOptions(this); + } + + /// Field number for the "no_filter" field. + public const int NoFilterFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter NoFilter { + get { return filterOptionsCase_ == FilterOptionsOneofCase.NoFilter ? (global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter) filterOptions_ : null; } + set { + filterOptions_ = value; + filterOptionsCase_ = value == null ? FilterOptionsOneofCase.None : FilterOptionsOneofCase.NoFilter; + } + } + + /// Field number for the "low_pass_filter" field. + public const int LowPassFilterFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter LowPassFilter { + get { return filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter ? (global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter) filterOptions_ : null; } + set { + filterOptions_ = value; + filterOptionsCase_ = value == null ? FilterOptionsOneofCase.None : FilterOptionsOneofCase.LowPassFilter; + } + } + + private object filterOptions_; + /// Enum of possible cases for the "filter_options" oneof. + public enum FilterOptionsOneofCase { + None = 0, + NoFilter = 1, + LowPassFilter = 2, + } + private FilterOptionsOneofCase filterOptionsCase_ = FilterOptionsOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterOptionsOneofCase FilterOptionsCase { + get { return filterOptionsCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilterOptions() { + filterOptionsCase_ = FilterOptionsOneofCase.None; + filterOptions_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VisibilitySmoothingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VisibilitySmoothingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(NoFilter, other.NoFilter)) return false; + if (!object.Equals(LowPassFilter, other.LowPassFilter)) return false; + if (FilterOptionsCase != other.FilterOptionsCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) hash ^= NoFilter.GetHashCode(); + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) hash ^= LowPassFilter.GetHashCode(); + hash ^= (int) filterOptionsCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + output.WriteRawTag(10); + output.WriteMessage(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) { + output.WriteRawTag(18); + output.WriteMessage(LowPassFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + output.WriteRawTag(10); + output.WriteMessage(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) { + output.WriteRawTag(18); + output.WriteMessage(LowPassFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NoFilter); + } + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LowPassFilter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VisibilitySmoothingCalculatorOptions other) { + if (other == null) { + return; + } + switch (other.FilterOptionsCase) { + case FilterOptionsOneofCase.NoFilter: + if (NoFilter == null) { + NoFilter = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter(); + } + NoFilter.MergeFrom(other.NoFilter); + break; + case FilterOptionsOneofCase.LowPassFilter: + if (LowPassFilter == null) { + LowPassFilter = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter(); + } + LowPassFilter.MergeFrom(other.LowPassFilter); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter subBuilder = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + subBuilder.MergeFrom(NoFilter); + } + input.ReadMessage(subBuilder); + NoFilter = subBuilder; + break; + } + case 18: { + global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter subBuilder = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) { + subBuilder.MergeFrom(LowPassFilter); + } + input.ReadMessage(subBuilder); + LowPassFilter = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter subBuilder = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.NoFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.NoFilter) { + subBuilder.MergeFrom(NoFilter); + } + input.ReadMessage(subBuilder); + NoFilter = subBuilder; + break; + } + case 18: { + global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter subBuilder = new global::Mediapipe.VisibilitySmoothingCalculatorOptions.Types.LowPassFilter(); + if (filterOptionsCase_ == FilterOptionsOneofCase.LowPassFilter) { + subBuilder.MergeFrom(LowPassFilter); + } + input.ReadMessage(subBuilder); + LowPassFilter = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the VisibilitySmoothingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Default behaviour and fast way to disable smoothing. + /// + public sealed partial class NoFilter : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NoFilter()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VisibilitySmoothingCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter(NoFilter other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NoFilter Clone() { + return new NoFilter(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NoFilter); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NoFilter other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NoFilter other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class LowPassFilter : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LowPassFilter()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VisibilitySmoothingCalculatorOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LowPassFilter() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LowPassFilter(LowPassFilter other) : this() { + _hasBits0 = other._hasBits0; + alpha_ = other.alpha_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LowPassFilter Clone() { + return new LowPassFilter(this); + } + + /// Field number for the "alpha" field. + public const int AlphaFieldNumber = 1; + private readonly static float AlphaDefaultValue = 0.1F; + + private float alpha_; + /// + /// Coefficient applied to a new value, whilte `1 - alpha` is applied to a + /// stored value. Should be in [0, 1] range. The smaller the value - the + /// smoother result and the bigger lag. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Alpha { + get { if ((_hasBits0 & 1) != 0) { return alpha_; } else { return AlphaDefaultValue; } } + set { + _hasBits0 |= 1; + alpha_ = value; + } + } + /// Gets whether the "alpha" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlpha { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "alpha" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlpha() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LowPassFilter); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LowPassFilter other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Alpha, other.Alpha)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasAlpha) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Alpha); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasAlpha) { + output.WriteRawTag(13); + output.WriteFloat(Alpha); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAlpha) { + output.WriteRawTag(13); + output.WriteFloat(Alpha); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasAlpha) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LowPassFilter other) { + if (other == null) { + return; + } + if (other.HasAlpha) { + Alpha = other.Alpha; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Alpha = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Alpha = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the VisibilitySmoothingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(360207350, pb::FieldCodec.ForMessage(2881658802, global::Mediapipe.VisibilitySmoothingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs.meta new file mode 100644 index 0000000..a556cc5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Util/VisibilitySmoothingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b33a7b06050a2b600a46abcd2c35c27d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video.meta new file mode 100644 index 0000000..eb9df06 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1cc34f5b2f24dbb4282d1f3152f932a2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs new file mode 100644 index 0000000..7bc659c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs @@ -0,0 +1,286 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/box_detector_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/box_detector_calculator.proto + public static partial class BoxDetectorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/box_detector_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BoxDetectorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vYm94X2RldGVjdG9yX2Nh", + "bGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29y", + "ay9jYWxjdWxhdG9yLnByb3RvGiptZWRpYXBpcGUvdXRpbC90cmFja2luZy9i", + "b3hfZGV0ZWN0b3IucHJvdG8izQEKHEJveERldGVjdG9yQ2FsY3VsYXRvck9w", + "dGlvbnMSNwoQZGV0ZWN0b3Jfb3B0aW9ucxgBIAEoCzIdLm1lZGlhcGlwZS5C", + "b3hEZXRlY3Rvck9wdGlvbnMSHAoUaW5kZXhfcHJvdG9fZmlsZW5hbWUYAiAD", + "KAkyVgoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGOLclIoB", + "IAEoCzInLm1lZGlhcGlwZS5Cb3hEZXRlY3RvckNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.BoxDetectorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorCalculatorOptions), global::Mediapipe.BoxDetectorCalculatorOptions.Parser, new[]{ "DetectorOptions", "IndexProtoFilename" }, null, null, new pb::Extension[] { global::Mediapipe.BoxDetectorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class BoxDetectorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxDetectorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorCalculatorOptions(BoxDetectorCalculatorOptions other) : this() { + detectorOptions_ = other.detectorOptions_ != null ? other.detectorOptions_.Clone() : null; + indexProtoFilename_ = other.indexProtoFilename_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorCalculatorOptions Clone() { + return new BoxDetectorCalculatorOptions(this); + } + + /// Field number for the "detector_options" field. + public const int DetectorOptionsFieldNumber = 1; + private global::Mediapipe.BoxDetectorOptions detectorOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BoxDetectorOptions DetectorOptions { + get { return detectorOptions_; } + set { + detectorOptions_ = value; + } + } + + /// Field number for the "index_proto_filename" field. + public const int IndexProtoFilenameFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_indexProtoFilename_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField indexProtoFilename_ = new pbc::RepeatedField(); + /// + /// File path to the template index files. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IndexProtoFilename { + get { return indexProtoFilename_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxDetectorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxDetectorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(DetectorOptions, other.DetectorOptions)) return false; + if(!indexProtoFilename_.Equals(other.indexProtoFilename_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (detectorOptions_ != null) hash ^= DetectorOptions.GetHashCode(); + hash ^= indexProtoFilename_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (detectorOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DetectorOptions); + } + indexProtoFilename_.WriteTo(output, _repeated_indexProtoFilename_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (detectorOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DetectorOptions); + } + indexProtoFilename_.WriteTo(ref output, _repeated_indexProtoFilename_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (detectorOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DetectorOptions); + } + size += indexProtoFilename_.CalculateSize(_repeated_indexProtoFilename_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxDetectorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.detectorOptions_ != null) { + if (detectorOptions_ == null) { + DetectorOptions = new global::Mediapipe.BoxDetectorOptions(); + } + DetectorOptions.MergeFrom(other.DetectorOptions); + } + indexProtoFilename_.Add(other.indexProtoFilename_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (detectorOptions_ == null) { + DetectorOptions = new global::Mediapipe.BoxDetectorOptions(); + } + input.ReadMessage(DetectorOptions); + break; + } + case 18: { + indexProtoFilename_.AddEntriesFrom(input, _repeated_indexProtoFilename_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (detectorOptions_ == null) { + DetectorOptions = new global::Mediapipe.BoxDetectorOptions(); + } + input.ReadMessage(DetectorOptions); + break; + } + case 18: { + indexProtoFilename_.AddEntriesFrom(ref input, _repeated_indexProtoFilename_codec); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the BoxDetectorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(289746530, pb::FieldCodec.ForMessage(2317972242, global::Mediapipe.BoxDetectorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs.meta new file mode 100644 index 0000000..59442af --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxDetectorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51813a5d019fccca1a26cfd496bfb562 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs new file mode 100644 index 0000000..871c4a6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs @@ -0,0 +1,597 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/box_tracker_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/box_tracker_calculator.proto + public static partial class BoxTrackerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/box_tracker_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BoxTrackerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vYm94X3RyYWNrZXJfY2Fs", + "Y3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3Jr", + "L2NhbGN1bGF0b3IucHJvdG8aKW1lZGlhcGlwZS91dGlsL3RyYWNraW5nL2Jv", + "eF90cmFja2VyLnByb3RvIqgDChtCb3hUcmFja2VyQ2FsY3VsYXRvck9wdGlv", + "bnMSNQoPdHJhY2tlcl9vcHRpb25zGAEgASgLMhwubWVkaWFwaXBlLkJveFRy", + "YWNrZXJPcHRpb25zEjYKEGluaXRpYWxfcG9zaXRpb24YAiABKAsyHC5tZWRp", + "YXBpcGUuVGltZWRCb3hQcm90b0xpc3QSJgoXdmlzdWFsaXplX3RyYWNraW5n", + "X2RhdGEYAyABKAg6BWZhbHNlEh4KD3Zpc3VhbGl6ZV9zdGF0ZRgEIAEoCDoF", + "ZmFsc2USJwoYdmlzdWFsaXplX2ludGVybmFsX3N0YXRlGAUgASgIOgVmYWxz", + "ZRIqCh9zdHJlYW1pbmdfdHJhY2tfZGF0YV9jYWNoZV9zaXplGAYgASgFOgEw", + "EiYKG3N0YXJ0X3Bvc190cmFuc2l0aW9uX2ZyYW1lcxgHIAEoBToBMDJVCgNl", + "eHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY9KSUgAEgASgLMiYu", + "bWVkaWFwaXBlLkJveFRyYWNrZXJDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.BoxTrackerReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxTrackerCalculatorOptions), global::Mediapipe.BoxTrackerCalculatorOptions.Parser, new[]{ "TrackerOptions", "InitialPosition", "VisualizeTrackingData", "VisualizeState", "VisualizeInternalState", "StreamingTrackDataCacheSize", "StartPosTransitionFrames" }, null, null, new pb::Extension[] { global::Mediapipe.BoxTrackerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class BoxTrackerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxTrackerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxTrackerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerCalculatorOptions(BoxTrackerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + trackerOptions_ = other.trackerOptions_ != null ? other.trackerOptions_.Clone() : null; + initialPosition_ = other.initialPosition_ != null ? other.initialPosition_.Clone() : null; + visualizeTrackingData_ = other.visualizeTrackingData_; + visualizeState_ = other.visualizeState_; + visualizeInternalState_ = other.visualizeInternalState_; + streamingTrackDataCacheSize_ = other.streamingTrackDataCacheSize_; + startPosTransitionFrames_ = other.startPosTransitionFrames_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerCalculatorOptions Clone() { + return new BoxTrackerCalculatorOptions(this); + } + + /// Field number for the "tracker_options" field. + public const int TrackerOptionsFieldNumber = 1; + private global::Mediapipe.BoxTrackerOptions trackerOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BoxTrackerOptions TrackerOptions { + get { return trackerOptions_; } + set { + trackerOptions_ = value; + } + } + + /// Field number for the "initial_position" field. + public const int InitialPositionFieldNumber = 2; + private global::Mediapipe.TimedBoxProtoList initialPosition_; + /// + /// Initial position to be tracked. Can also be supplied as side packet or + /// as input stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimedBoxProtoList InitialPosition { + get { return initialPosition_; } + set { + initialPosition_ = value; + } + } + + /// Field number for the "visualize_tracking_data" field. + public const int VisualizeTrackingDataFieldNumber = 3; + private readonly static bool VisualizeTrackingDataDefaultValue = false; + + private bool visualizeTrackingData_; + /// + /// If set and VIZ stream is present, renders tracking data into the + /// visualization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeTrackingData { + get { if ((_hasBits0 & 1) != 0) { return visualizeTrackingData_; } else { return VisualizeTrackingDataDefaultValue; } } + set { + _hasBits0 |= 1; + visualizeTrackingData_ = value; + } + } + /// Gets whether the "visualize_tracking_data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeTrackingData { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "visualize_tracking_data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeTrackingData() { + _hasBits0 &= ~1; + } + + /// Field number for the "visualize_state" field. + public const int VisualizeStateFieldNumber = 4; + private readonly static bool VisualizeStateDefaultValue = false; + + private bool visualizeState_; + /// + /// If set and VIZ stream is present, renders the box state + /// into the visualization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeState { + get { if ((_hasBits0 & 2) != 0) { return visualizeState_; } else { return VisualizeStateDefaultValue; } } + set { + _hasBits0 |= 2; + visualizeState_ = value; + } + } + /// Gets whether the "visualize_state" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeState { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "visualize_state" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeState() { + _hasBits0 &= ~2; + } + + /// Field number for the "visualize_internal_state" field. + public const int VisualizeInternalStateFieldNumber = 5; + private readonly static bool VisualizeInternalStateDefaultValue = false; + + private bool visualizeInternalState_; + /// + /// If set and VIZ stream is present, renders the internal box state + /// into the visualization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeInternalState { + get { if ((_hasBits0 & 4) != 0) { return visualizeInternalState_; } else { return VisualizeInternalStateDefaultValue; } } + set { + _hasBits0 |= 4; + visualizeInternalState_ = value; + } + } + /// Gets whether the "visualize_internal_state" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeInternalState { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "visualize_internal_state" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeInternalState() { + _hasBits0 &= ~4; + } + + /// Field number for the "streaming_track_data_cache_size" field. + public const int StreamingTrackDataCacheSizeFieldNumber = 6; + private readonly static int StreamingTrackDataCacheSizeDefaultValue = 0; + + private int streamingTrackDataCacheSize_; + /// + /// Size of the track data cache during streaming mode. This allows to buffer + /// track_data's for fast forward tracking, i.e. any TimedBox received + /// via input stream START_POS can be tracked towards the current track head + /// (i.e. last received TrackingData). Measured in number of frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StreamingTrackDataCacheSize { + get { if ((_hasBits0 & 8) != 0) { return streamingTrackDataCacheSize_; } else { return StreamingTrackDataCacheSizeDefaultValue; } } + set { + _hasBits0 |= 8; + streamingTrackDataCacheSize_ = value; + } + } + /// Gets whether the "streaming_track_data_cache_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStreamingTrackDataCacheSize { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "streaming_track_data_cache_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStreamingTrackDataCacheSize() { + _hasBits0 &= ~8; + } + + /// Field number for the "start_pos_transition_frames" field. + public const int StartPosTransitionFramesFieldNumber = 7; + private readonly static int StartPosTransitionFramesDefaultValue = 0; + + private int startPosTransitionFrames_; + /// + /// Add a transition period of N frames to smooth the jump from original + /// tracking to reset start pos with motion compensation. The transition will + /// be a linear decay of original tracking result. 0 means no transition. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StartPosTransitionFrames { + get { if ((_hasBits0 & 16) != 0) { return startPosTransitionFrames_; } else { return StartPosTransitionFramesDefaultValue; } } + set { + _hasBits0 |= 16; + startPosTransitionFrames_ = value; + } + } + /// Gets whether the "start_pos_transition_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartPosTransitionFrames { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "start_pos_transition_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartPosTransitionFrames() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxTrackerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxTrackerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TrackerOptions, other.TrackerOptions)) return false; + if (!object.Equals(InitialPosition, other.InitialPosition)) return false; + if (VisualizeTrackingData != other.VisualizeTrackingData) return false; + if (VisualizeState != other.VisualizeState) return false; + if (VisualizeInternalState != other.VisualizeInternalState) return false; + if (StreamingTrackDataCacheSize != other.StreamingTrackDataCacheSize) return false; + if (StartPosTransitionFrames != other.StartPosTransitionFrames) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (trackerOptions_ != null) hash ^= TrackerOptions.GetHashCode(); + if (initialPosition_ != null) hash ^= InitialPosition.GetHashCode(); + if (HasVisualizeTrackingData) hash ^= VisualizeTrackingData.GetHashCode(); + if (HasVisualizeState) hash ^= VisualizeState.GetHashCode(); + if (HasVisualizeInternalState) hash ^= VisualizeInternalState.GetHashCode(); + if (HasStreamingTrackDataCacheSize) hash ^= StreamingTrackDataCacheSize.GetHashCode(); + if (HasStartPosTransitionFrames) hash ^= StartPosTransitionFrames.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (trackerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackerOptions); + } + if (initialPosition_ != null) { + output.WriteRawTag(18); + output.WriteMessage(InitialPosition); + } + if (HasVisualizeTrackingData) { + output.WriteRawTag(24); + output.WriteBool(VisualizeTrackingData); + } + if (HasVisualizeState) { + output.WriteRawTag(32); + output.WriteBool(VisualizeState); + } + if (HasVisualizeInternalState) { + output.WriteRawTag(40); + output.WriteBool(VisualizeInternalState); + } + if (HasStreamingTrackDataCacheSize) { + output.WriteRawTag(48); + output.WriteInt32(StreamingTrackDataCacheSize); + } + if (HasStartPosTransitionFrames) { + output.WriteRawTag(56); + output.WriteInt32(StartPosTransitionFrames); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (trackerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackerOptions); + } + if (initialPosition_ != null) { + output.WriteRawTag(18); + output.WriteMessage(InitialPosition); + } + if (HasVisualizeTrackingData) { + output.WriteRawTag(24); + output.WriteBool(VisualizeTrackingData); + } + if (HasVisualizeState) { + output.WriteRawTag(32); + output.WriteBool(VisualizeState); + } + if (HasVisualizeInternalState) { + output.WriteRawTag(40); + output.WriteBool(VisualizeInternalState); + } + if (HasStreamingTrackDataCacheSize) { + output.WriteRawTag(48); + output.WriteInt32(StreamingTrackDataCacheSize); + } + if (HasStartPosTransitionFrames) { + output.WriteRawTag(56); + output.WriteInt32(StartPosTransitionFrames); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (trackerOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrackerOptions); + } + if (initialPosition_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(InitialPosition); + } + if (HasVisualizeTrackingData) { + size += 1 + 1; + } + if (HasVisualizeState) { + size += 1 + 1; + } + if (HasVisualizeInternalState) { + size += 1 + 1; + } + if (HasStreamingTrackDataCacheSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StreamingTrackDataCacheSize); + } + if (HasStartPosTransitionFrames) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StartPosTransitionFrames); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxTrackerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.trackerOptions_ != null) { + if (trackerOptions_ == null) { + TrackerOptions = new global::Mediapipe.BoxTrackerOptions(); + } + TrackerOptions.MergeFrom(other.TrackerOptions); + } + if (other.initialPosition_ != null) { + if (initialPosition_ == null) { + InitialPosition = new global::Mediapipe.TimedBoxProtoList(); + } + InitialPosition.MergeFrom(other.InitialPosition); + } + if (other.HasVisualizeTrackingData) { + VisualizeTrackingData = other.VisualizeTrackingData; + } + if (other.HasVisualizeState) { + VisualizeState = other.VisualizeState; + } + if (other.HasVisualizeInternalState) { + VisualizeInternalState = other.VisualizeInternalState; + } + if (other.HasStreamingTrackDataCacheSize) { + StreamingTrackDataCacheSize = other.StreamingTrackDataCacheSize; + } + if (other.HasStartPosTransitionFrames) { + StartPosTransitionFrames = other.StartPosTransitionFrames; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (trackerOptions_ == null) { + TrackerOptions = new global::Mediapipe.BoxTrackerOptions(); + } + input.ReadMessage(TrackerOptions); + break; + } + case 18: { + if (initialPosition_ == null) { + InitialPosition = new global::Mediapipe.TimedBoxProtoList(); + } + input.ReadMessage(InitialPosition); + break; + } + case 24: { + VisualizeTrackingData = input.ReadBool(); + break; + } + case 32: { + VisualizeState = input.ReadBool(); + break; + } + case 40: { + VisualizeInternalState = input.ReadBool(); + break; + } + case 48: { + StreamingTrackDataCacheSize = input.ReadInt32(); + break; + } + case 56: { + StartPosTransitionFrames = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (trackerOptions_ == null) { + TrackerOptions = new global::Mediapipe.BoxTrackerOptions(); + } + input.ReadMessage(TrackerOptions); + break; + } + case 18: { + if (initialPosition_ == null) { + InitialPosition = new global::Mediapipe.TimedBoxProtoList(); + } + input.ReadMessage(InitialPosition); + break; + } + case 24: { + VisualizeTrackingData = input.ReadBool(); + break; + } + case 32: { + VisualizeState = input.ReadBool(); + break; + } + case 40: { + VisualizeInternalState = input.ReadBool(); + break; + } + case 48: { + StreamingTrackDataCacheSize = input.ReadInt32(); + break; + } + case 56: { + StartPosTransitionFrames = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the BoxTrackerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(268767860, pb::FieldCodec.ForMessage(2150142882, global::Mediapipe.BoxTrackerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs.meta new file mode 100644 index 0000000..8ad7f8c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/BoxTrackerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70c25fbe01c4a302c9fc97e894de0077 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs new file mode 100644 index 0000000..1d021e0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs @@ -0,0 +1,370 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/flow_packager_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/flow_packager_calculator.proto + public static partial class FlowPackagerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/flow_packager_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FlowPackagerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vZmxvd19wYWNrYWdlcl9j", + "YWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdv", + "cmsvY2FsY3VsYXRvci5wcm90bxorbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcv", + "Zmxvd19wYWNrYWdlci5wcm90byKFAgodRmxvd1BhY2thZ2VyQ2FsY3VsYXRv", + "ck9wdGlvbnMSPQoVZmxvd19wYWNrYWdlcl9vcHRpb25zGAEgASgLMh4ubWVk", + "aWFwaXBlLkZsb3dQYWNrYWdlck9wdGlvbnMSJQoXY2FjaGluZ19jaHVua19z", + "aXplX21zZWMYAiABKAU6BDI1MDASJQoRY2FjaGVfZmlsZV9mb3JtYXQYAyAB", + "KAk6CmNodW5rXyUwNGQyVwoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JP", + "cHRpb25zGLP4qoEBIAEoCzIoLm1lZGlhcGlwZS5GbG93UGFja2FnZXJDYWxj", + "dWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.FlowPackagerReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FlowPackagerCalculatorOptions), global::Mediapipe.FlowPackagerCalculatorOptions.Parser, new[]{ "FlowPackagerOptions", "CachingChunkSizeMsec", "CacheFileFormat" }, null, null, new pb::Extension[] { global::Mediapipe.FlowPackagerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FlowPackagerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FlowPackagerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerCalculatorOptions(FlowPackagerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + flowPackagerOptions_ = other.flowPackagerOptions_ != null ? other.flowPackagerOptions_.Clone() : null; + cachingChunkSizeMsec_ = other.cachingChunkSizeMsec_; + cacheFileFormat_ = other.cacheFileFormat_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerCalculatorOptions Clone() { + return new FlowPackagerCalculatorOptions(this); + } + + /// Field number for the "flow_packager_options" field. + public const int FlowPackagerOptionsFieldNumber = 1; + private global::Mediapipe.FlowPackagerOptions flowPackagerOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FlowPackagerOptions FlowPackagerOptions { + get { return flowPackagerOptions_; } + set { + flowPackagerOptions_ = value; + } + } + + /// Field number for the "caching_chunk_size_msec" field. + public const int CachingChunkSizeMsecFieldNumber = 2; + private readonly static int CachingChunkSizeMsecDefaultValue = 2500; + + private int cachingChunkSizeMsec_; + /// + /// Chunk size for caching files that are written to the externally specified + /// caching directory. Specified in msec. + /// Note that each chunk always contains at its end the first frame of the + /// next chunk (to enable forward tracking across chunk boundaries). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CachingChunkSizeMsec { + get { if ((_hasBits0 & 1) != 0) { return cachingChunkSizeMsec_; } else { return CachingChunkSizeMsecDefaultValue; } } + set { + _hasBits0 |= 1; + cachingChunkSizeMsec_ = value; + } + } + /// Gets whether the "caching_chunk_size_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCachingChunkSizeMsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "caching_chunk_size_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCachingChunkSizeMsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "cache_file_format" field. + public const int CacheFileFormatFieldNumber = 3; + private readonly static string CacheFileFormatDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Y2h1bmtfJTA0ZA=="), 0, 10); + + private string cacheFileFormat_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CacheFileFormat { + get { return cacheFileFormat_ ?? CacheFileFormatDefaultValue; } + set { + cacheFileFormat_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cache_file_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCacheFileFormat { + get { return cacheFileFormat_ != null; } + } + /// Clears the value of the "cache_file_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCacheFileFormat() { + cacheFileFormat_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FlowPackagerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FlowPackagerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(FlowPackagerOptions, other.FlowPackagerOptions)) return false; + if (CachingChunkSizeMsec != other.CachingChunkSizeMsec) return false; + if (CacheFileFormat != other.CacheFileFormat) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (flowPackagerOptions_ != null) hash ^= FlowPackagerOptions.GetHashCode(); + if (HasCachingChunkSizeMsec) hash ^= CachingChunkSizeMsec.GetHashCode(); + if (HasCacheFileFormat) hash ^= CacheFileFormat.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (flowPackagerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(FlowPackagerOptions); + } + if (HasCachingChunkSizeMsec) { + output.WriteRawTag(16); + output.WriteInt32(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + output.WriteRawTag(26); + output.WriteString(CacheFileFormat); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (flowPackagerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(FlowPackagerOptions); + } + if (HasCachingChunkSizeMsec) { + output.WriteRawTag(16); + output.WriteInt32(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + output.WriteRawTag(26); + output.WriteString(CacheFileFormat); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (flowPackagerOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FlowPackagerOptions); + } + if (HasCachingChunkSizeMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CacheFileFormat); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FlowPackagerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.flowPackagerOptions_ != null) { + if (flowPackagerOptions_ == null) { + FlowPackagerOptions = new global::Mediapipe.FlowPackagerOptions(); + } + FlowPackagerOptions.MergeFrom(other.FlowPackagerOptions); + } + if (other.HasCachingChunkSizeMsec) { + CachingChunkSizeMsec = other.CachingChunkSizeMsec; + } + if (other.HasCacheFileFormat) { + CacheFileFormat = other.CacheFileFormat; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (flowPackagerOptions_ == null) { + FlowPackagerOptions = new global::Mediapipe.FlowPackagerOptions(); + } + input.ReadMessage(FlowPackagerOptions); + break; + } + case 16: { + CachingChunkSizeMsec = input.ReadInt32(); + break; + } + case 26: { + CacheFileFormat = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (flowPackagerOptions_ == null) { + FlowPackagerOptions = new global::Mediapipe.FlowPackagerOptions(); + } + input.ReadMessage(FlowPackagerOptions); + break; + } + case 16: { + CachingChunkSizeMsec = input.ReadInt32(); + break; + } + case 26: { + CacheFileFormat = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FlowPackagerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(271236147, pb::FieldCodec.ForMessage(2169889178, global::Mediapipe.FlowPackagerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs.meta new file mode 100644 index 0000000..3a19a94 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowPackagerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab267d53cd2ff77c086cc378b491627f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs new file mode 100644 index 0000000..d997016 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs @@ -0,0 +1,320 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/flow_to_image_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/flow_to_image_calculator.proto + public static partial class FlowToImageCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/flow_to_image_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FlowToImageCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vZmxvd190b19pbWFnZV9j", + "YWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdv", + "cmsvY2FsY3VsYXRvci5wcm90byKkAQocRmxvd1RvSW1hZ2VDYWxjdWxhdG9y", + "T3B0aW9ucxIWCgltaW5fdmFsdWUYASABKAI6Ay00MBIVCgltYXhfdmFsdWUY", + "AiABKAI6AjQwMlUKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9u", + "cxjwu5IhIAEoCzInLm1lZGlhcGlwZS5GbG93VG9JbWFnZUNhbGN1bGF0b3JP", + "cHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FlowToImageCalculatorOptions), global::Mediapipe.FlowToImageCalculatorOptions.Parser, new[]{ "MinValue", "MaxValue" }, null, null, new pb::Extension[] { global::Mediapipe.FlowToImageCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Specifies the maximum and minimum value to truncate when normalize optical + /// flow fields. + /// + public sealed partial class FlowToImageCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FlowToImageCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowToImageCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowToImageCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowToImageCalculatorOptions(FlowToImageCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minValue_ = other.minValue_; + maxValue_ = other.maxValue_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowToImageCalculatorOptions Clone() { + return new FlowToImageCalculatorOptions(this); + } + + /// Field number for the "min_value" field. + public const int MinValueFieldNumber = 1; + private readonly static float MinValueDefaultValue = -40F; + + private float minValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinValue { + get { if ((_hasBits0 & 1) != 0) { return minValue_; } else { return MinValueDefaultValue; } } + set { + _hasBits0 |= 1; + minValue_ = value; + } + } + /// Gets whether the "min_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinValue { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinValue() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_value" field. + public const int MaxValueFieldNumber = 2; + private readonly static float MaxValueDefaultValue = 40F; + + private float maxValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxValue { + get { if ((_hasBits0 & 2) != 0) { return maxValue_; } else { return MaxValueDefaultValue; } } + set { + _hasBits0 |= 2; + maxValue_ = value; + } + } + /// Gets whether the "max_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxValue { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxValue() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FlowToImageCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FlowToImageCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinValue, other.MinValue)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxValue, other.MaxValue)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinValue); + if (HasMaxValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxValue); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinValue) { + output.WriteRawTag(13); + output.WriteFloat(MinValue); + } + if (HasMaxValue) { + output.WriteRawTag(21); + output.WriteFloat(MaxValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinValue) { + output.WriteRawTag(13); + output.WriteFloat(MinValue); + } + if (HasMaxValue) { + output.WriteRawTag(21); + output.WriteFloat(MaxValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinValue) { + size += 1 + 4; + } + if (HasMaxValue) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FlowToImageCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinValue) { + MinValue = other.MinValue; + } + if (other.HasMaxValue) { + MaxValue = other.MaxValue; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinValue = input.ReadFloat(); + break; + } + case 21: { + MaxValue = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinValue = input.ReadFloat(); + break; + } + case 21: { + MaxValue = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FlowToImageCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(69508592, pb::FieldCodec.ForMessage(556068738, global::Mediapipe.FlowToImageCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs.meta new file mode 100644 index 0000000..db5255a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/FlowToImageCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a77a6974438bb145b344d025eaeff7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs new file mode 100644 index 0000000..43507ff --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs @@ -0,0 +1,1001 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/motion_analysis_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/motion_analysis_calculator.proto + public static partial class MotionAnalysisCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/motion_analysis_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MotionAnalysisCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjxtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vbW90aW9uX2FuYWx5c2lz", + "X2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1l", + "d29yay9jYWxjdWxhdG9yLnByb3RvGi1tZWRpYXBpcGUvdXRpbC90cmFja2lu", + "Zy9tb3Rpb25fYW5hbHlzaXMucHJvdG8i5QUKH01vdGlvbkFuYWx5c2lzQ2Fs", + "Y3VsYXRvck9wdGlvbnMSOgoQYW5hbHlzaXNfb3B0aW9ucxgBIAEoCzIgLm1l", + "ZGlhcGlwZS5Nb3Rpb25BbmFseXNpc09wdGlvbnMSbAoSc2VsZWN0aW9uX2Fu", + "YWx5c2lzGAQgASgOMjwubWVkaWFwaXBlLk1vdGlvbkFuYWx5c2lzQ2FsY3Vs", + "YXRvck9wdGlvbnMuU2VsZWN0aW9uQW5hbHlzaXM6EkFOQUxZU0lTX1dJVEhf", + "U0VFRBImChdoeWJyaWRfc2VsZWN0aW9uX2NhbWVyYRgFIAEoCDoFZmFsc2US", + "ZgoNbWV0YV9hbmFseXNpcxgIIAEoDjI3Lm1lZGlhcGlwZS5Nb3Rpb25BbmFs", + "eXNpc0NhbGN1bGF0b3JPcHRpb25zLk1ldGFBbmFseXNpczoWTUVUQV9BTkFM", + "WVNJU19VU0VfTUVUQRIgChVtZXRhX21vZGVsc19wZXJfZnJhbWUYBiABKAU6", + "ATESKQoZbWV0YV9vdXRsaWVyX2RvbWFpbl9yYXRpbxgJIAEoAjoGMC4wMDE1", + "EhoKC2J5cGFzc19tb2RlGAcgASgIOgVmYWxzZSJ+ChFTZWxlY3Rpb25BbmFs", + "eXNpcxIWChJBTkFMWVNJU19SRUNPTVBVVEUQARIdChlOT19BTkFMWVNJU19V", + "U0VfU0VMRUNUSU9OEAISGgoWQU5BTFlTSVNfRlJPTV9GRUFUVVJFUxADEhYK", + "EkFOQUxZU0lTX1dJVEhfU0VFRBAEIkQKDE1ldGFBbmFseXNpcxIaChZNRVRB", + "X0FOQUxZU0lTX1VTRV9NRVRBEAESGAoUTUVUQV9BTkFMWVNJU19IWUJSSUQQ", + "AjJZCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYj46KgQEg", + "ASgLMioubWVkaWFwaXBlLk1vdGlvbkFuYWx5c2lzQ2FsY3VsYXRvck9wdGlv", + "bnMigQEKDkhvbW9ncmFwaHlEYXRhEiIKFm1vdGlvbl9ob21vZ3JhcGh5X2Rh", + "dGEYASADKAJCAhABEiAKFGhpc3RvZ3JhbV9jb3VudF9kYXRhGAIgAygNQgIQ", + "ARITCgtmcmFtZV93aWR0aBgDIAEoBRIUCgxmcmFtZV9oZWlnaHQYBCABKAU=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.MotionAnalysisReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionAnalysisCalculatorOptions), global::Mediapipe.MotionAnalysisCalculatorOptions.Parser, new[]{ "AnalysisOptions", "SelectionAnalysis", "HybridSelectionCamera", "MetaAnalysis", "MetaModelsPerFrame", "MetaOutlierDomainRatio", "BypassMode" }, null, new[]{ typeof(global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis), typeof(global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis) }, new pb::Extension[] { global::Mediapipe.MotionAnalysisCalculatorOptions.Extensions.Ext }, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.HomographyData), global::Mediapipe.HomographyData.Parser, new[]{ "MotionHomographyData", "HistogramCountData", "FrameWidth", "FrameHeight" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Next tag: 10 + /// + public sealed partial class MotionAnalysisCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionAnalysisCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionAnalysisCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisCalculatorOptions(MotionAnalysisCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + analysisOptions_ = other.analysisOptions_ != null ? other.analysisOptions_.Clone() : null; + selectionAnalysis_ = other.selectionAnalysis_; + hybridSelectionCamera_ = other.hybridSelectionCamera_; + metaAnalysis_ = other.metaAnalysis_; + metaModelsPerFrame_ = other.metaModelsPerFrame_; + metaOutlierDomainRatio_ = other.metaOutlierDomainRatio_; + bypassMode_ = other.bypassMode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisCalculatorOptions Clone() { + return new MotionAnalysisCalculatorOptions(this); + } + + /// Field number for the "analysis_options" field. + public const int AnalysisOptionsFieldNumber = 1; + private global::Mediapipe.MotionAnalysisOptions analysisOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisOptions AnalysisOptions { + get { return analysisOptions_; } + set { + analysisOptions_ = value; + } + } + + /// Field number for the "selection_analysis" field. + public const int SelectionAnalysisFieldNumber = 4; + private readonly static global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis SelectionAnalysisDefaultValue = global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis.AnalysisWithSeed; + + private global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis selectionAnalysis_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis SelectionAnalysis { + get { if ((_hasBits0 & 1) != 0) { return selectionAnalysis_; } else { return SelectionAnalysisDefaultValue; } } + set { + _hasBits0 |= 1; + selectionAnalysis_ = value; + } + } + /// Gets whether the "selection_analysis" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSelectionAnalysis { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "selection_analysis" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSelectionAnalysis() { + _hasBits0 &= ~1; + } + + /// Field number for the "hybrid_selection_camera" field. + public const int HybridSelectionCameraFieldNumber = 5; + private readonly static bool HybridSelectionCameraDefaultValue = false; + + private bool hybridSelectionCamera_; + /// + /// If activated when SELECTION input is activated, will replace the computed + /// camera motion (for any of the ANALYSIS_* case above) with the one supplied + /// by the frame selection, in case the frame selection one is more stable. + /// For example, if recomputed camera motion is unstable but the one from + /// the selection result is stable, will use the stable result instead. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HybridSelectionCamera { + get { if ((_hasBits0 & 2) != 0) { return hybridSelectionCamera_; } else { return HybridSelectionCameraDefaultValue; } } + set { + _hasBits0 |= 2; + hybridSelectionCamera_ = value; + } + } + /// Gets whether the "hybrid_selection_camera" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHybridSelectionCamera { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "hybrid_selection_camera" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHybridSelectionCamera() { + _hasBits0 &= ~2; + } + + /// Field number for the "meta_analysis" field. + public const int MetaAnalysisFieldNumber = 8; + private readonly static global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis MetaAnalysisDefaultValue = global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis.UseMeta; + + private global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis metaAnalysis_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis MetaAnalysis { + get { if ((_hasBits0 & 16) != 0) { return metaAnalysis_; } else { return MetaAnalysisDefaultValue; } } + set { + _hasBits0 |= 16; + metaAnalysis_ = value; + } + } + /// Gets whether the "meta_analysis" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMetaAnalysis { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "meta_analysis" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMetaAnalysis() { + _hasBits0 &= ~16; + } + + /// Field number for the "meta_models_per_frame" field. + public const int MetaModelsPerFrameFieldNumber = 6; + private readonly static int MetaModelsPerFrameDefaultValue = 1; + + private int metaModelsPerFrame_; + /// + /// Determines number of homography models per frame stored in the CSV file + /// or the homography metadata in META. + /// For values > 1, MixtureHomographies are created. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MetaModelsPerFrame { + get { if ((_hasBits0 & 4) != 0) { return metaModelsPerFrame_; } else { return MetaModelsPerFrameDefaultValue; } } + set { + _hasBits0 |= 4; + metaModelsPerFrame_ = value; + } + } + /// Gets whether the "meta_models_per_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMetaModelsPerFrame { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "meta_models_per_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMetaModelsPerFrame() { + _hasBits0 &= ~4; + } + + /// Field number for the "meta_outlier_domain_ratio" field. + public const int MetaOutlierDomainRatioFieldNumber = 9; + private readonly static float MetaOutlierDomainRatioDefaultValue = 0.0015F; + + private float metaOutlierDomainRatio_; + /// + /// Used for META_ANALYSIS_HYBRID. Rejects features which flow deviates + /// domain_ratio * image diagonal size from the ground truth metadata motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MetaOutlierDomainRatio { + get { if ((_hasBits0 & 32) != 0) { return metaOutlierDomainRatio_; } else { return MetaOutlierDomainRatioDefaultValue; } } + set { + _hasBits0 |= 32; + metaOutlierDomainRatio_ = value; + } + } + /// Gets whether the "meta_outlier_domain_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMetaOutlierDomainRatio { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "meta_outlier_domain_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMetaOutlierDomainRatio() { + _hasBits0 &= ~32; + } + + /// Field number for the "bypass_mode" field. + public const int BypassModeFieldNumber = 7; + private readonly static bool BypassModeDefaultValue = false; + + private bool bypassMode_; + /// + /// If true, the MotionAnalysisCalculator will skip all processing and emit no + /// packets on any output. This is useful for quickly creating different + /// versions of a MediaPipe graph without changing its structure, assuming that + /// downstream calculators can handle missing input packets. + /// TODO: Remove this hack. See b/36485206 for more details. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BypassMode { + get { if ((_hasBits0 & 8) != 0) { return bypassMode_; } else { return BypassModeDefaultValue; } } + set { + _hasBits0 |= 8; + bypassMode_ = value; + } + } + /// Gets whether the "bypass_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBypassMode { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "bypass_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBypassMode() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionAnalysisCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionAnalysisCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(AnalysisOptions, other.AnalysisOptions)) return false; + if (SelectionAnalysis != other.SelectionAnalysis) return false; + if (HybridSelectionCamera != other.HybridSelectionCamera) return false; + if (MetaAnalysis != other.MetaAnalysis) return false; + if (MetaModelsPerFrame != other.MetaModelsPerFrame) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MetaOutlierDomainRatio, other.MetaOutlierDomainRatio)) return false; + if (BypassMode != other.BypassMode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (analysisOptions_ != null) hash ^= AnalysisOptions.GetHashCode(); + if (HasSelectionAnalysis) hash ^= SelectionAnalysis.GetHashCode(); + if (HasHybridSelectionCamera) hash ^= HybridSelectionCamera.GetHashCode(); + if (HasMetaAnalysis) hash ^= MetaAnalysis.GetHashCode(); + if (HasMetaModelsPerFrame) hash ^= MetaModelsPerFrame.GetHashCode(); + if (HasMetaOutlierDomainRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MetaOutlierDomainRatio); + if (HasBypassMode) hash ^= BypassMode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (analysisOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AnalysisOptions); + } + if (HasSelectionAnalysis) { + output.WriteRawTag(32); + output.WriteEnum((int) SelectionAnalysis); + } + if (HasHybridSelectionCamera) { + output.WriteRawTag(40); + output.WriteBool(HybridSelectionCamera); + } + if (HasMetaModelsPerFrame) { + output.WriteRawTag(48); + output.WriteInt32(MetaModelsPerFrame); + } + if (HasBypassMode) { + output.WriteRawTag(56); + output.WriteBool(BypassMode); + } + if (HasMetaAnalysis) { + output.WriteRawTag(64); + output.WriteEnum((int) MetaAnalysis); + } + if (HasMetaOutlierDomainRatio) { + output.WriteRawTag(77); + output.WriteFloat(MetaOutlierDomainRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (analysisOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AnalysisOptions); + } + if (HasSelectionAnalysis) { + output.WriteRawTag(32); + output.WriteEnum((int) SelectionAnalysis); + } + if (HasHybridSelectionCamera) { + output.WriteRawTag(40); + output.WriteBool(HybridSelectionCamera); + } + if (HasMetaModelsPerFrame) { + output.WriteRawTag(48); + output.WriteInt32(MetaModelsPerFrame); + } + if (HasBypassMode) { + output.WriteRawTag(56); + output.WriteBool(BypassMode); + } + if (HasMetaAnalysis) { + output.WriteRawTag(64); + output.WriteEnum((int) MetaAnalysis); + } + if (HasMetaOutlierDomainRatio) { + output.WriteRawTag(77); + output.WriteFloat(MetaOutlierDomainRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (analysisOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AnalysisOptions); + } + if (HasSelectionAnalysis) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SelectionAnalysis); + } + if (HasHybridSelectionCamera) { + size += 1 + 1; + } + if (HasMetaAnalysis) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MetaAnalysis); + } + if (HasMetaModelsPerFrame) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MetaModelsPerFrame); + } + if (HasMetaOutlierDomainRatio) { + size += 1 + 4; + } + if (HasBypassMode) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionAnalysisCalculatorOptions other) { + if (other == null) { + return; + } + if (other.analysisOptions_ != null) { + if (analysisOptions_ == null) { + AnalysisOptions = new global::Mediapipe.MotionAnalysisOptions(); + } + AnalysisOptions.MergeFrom(other.AnalysisOptions); + } + if (other.HasSelectionAnalysis) { + SelectionAnalysis = other.SelectionAnalysis; + } + if (other.HasHybridSelectionCamera) { + HybridSelectionCamera = other.HybridSelectionCamera; + } + if (other.HasMetaAnalysis) { + MetaAnalysis = other.MetaAnalysis; + } + if (other.HasMetaModelsPerFrame) { + MetaModelsPerFrame = other.MetaModelsPerFrame; + } + if (other.HasMetaOutlierDomainRatio) { + MetaOutlierDomainRatio = other.MetaOutlierDomainRatio; + } + if (other.HasBypassMode) { + BypassMode = other.BypassMode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (analysisOptions_ == null) { + AnalysisOptions = new global::Mediapipe.MotionAnalysisOptions(); + } + input.ReadMessage(AnalysisOptions); + break; + } + case 32: { + SelectionAnalysis = (global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis) input.ReadEnum(); + break; + } + case 40: { + HybridSelectionCamera = input.ReadBool(); + break; + } + case 48: { + MetaModelsPerFrame = input.ReadInt32(); + break; + } + case 56: { + BypassMode = input.ReadBool(); + break; + } + case 64: { + MetaAnalysis = (global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis) input.ReadEnum(); + break; + } + case 77: { + MetaOutlierDomainRatio = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (analysisOptions_ == null) { + AnalysisOptions = new global::Mediapipe.MotionAnalysisOptions(); + } + input.ReadMessage(AnalysisOptions); + break; + } + case 32: { + SelectionAnalysis = (global::Mediapipe.MotionAnalysisCalculatorOptions.Types.SelectionAnalysis) input.ReadEnum(); + break; + } + case 40: { + HybridSelectionCamera = input.ReadBool(); + break; + } + case 48: { + MetaModelsPerFrame = input.ReadInt32(); + break; + } + case 56: { + BypassMode = input.ReadBool(); + break; + } + case 64: { + MetaAnalysis = (global::Mediapipe.MotionAnalysisCalculatorOptions.Types.MetaAnalysis) input.ReadEnum(); + break; + } + case 77: { + MetaOutlierDomainRatio = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MotionAnalysisCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Determines how optional input SELECTION (if present) is used to compute + /// the final camera motion. + /// + public enum SelectionAnalysis { + /// + /// Recompute camera motion for selected frame neighbors. + /// + [pbr::OriginalName("ANALYSIS_RECOMPUTE")] AnalysisRecompute = 1, + /// + /// Use composited camera motion and region flow from SELECTION input. No + /// tracking or re-computation is performed. + /// Note that in this case only CAMERA, FLOW and VIDEO_OUT tags are + /// supported as output. + /// + [pbr::OriginalName("NO_ANALYSIS_USE_SELECTION")] NoAnalysisUseSelection = 2, + /// + /// Recompute camera motion for selected frame neighbors using + /// features supplied by SELECTION input. No feature tracking is performed. + /// + [pbr::OriginalName("ANALYSIS_FROM_FEATURES")] AnalysisFromFeatures = 3, + /// + /// Recomputes camera motion for selected frame neighbors but seeds + /// initial transform with camera motion from SELECTION input. + /// + [pbr::OriginalName("ANALYSIS_WITH_SEED")] AnalysisWithSeed = 4, + } + + /// + /// Determines how optional input META is used to compute the final camera + /// motion. + /// + public enum MetaAnalysis { + /// + /// Uses metadata supplied motions as is. + /// + [pbr::OriginalName("META_ANALYSIS_USE_META")] UseMeta = 1, + /// + /// Seeds visual tracking from metadata motions - estimates visual residual + /// motion and combines with metadata. + /// + [pbr::OriginalName("META_ANALYSIS_HYBRID")] Hybrid = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the MotionAnalysisCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(270698255, pb::FieldCodec.ForMessage(2165586042, global::Mediapipe.MotionAnalysisCalculatorOptions.Parser)); + } + #endregion + + } + + /// + /// Taken from + /// java/com/google/android/libraries/microvideo/proto/microvideo.proto to + /// satisfy leakr requirements + /// TODO: Remove and use above proto. + /// + public sealed partial class HomographyData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HomographyData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionAnalysisCalculatorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyData(HomographyData other) : this() { + _hasBits0 = other._hasBits0; + motionHomographyData_ = other.motionHomographyData_.Clone(); + histogramCountData_ = other.histogramCountData_.Clone(); + frameWidth_ = other.frameWidth_; + frameHeight_ = other.frameHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyData Clone() { + return new HomographyData(this); + } + + /// Field number for the "motion_homography_data" field. + public const int MotionHomographyDataFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_motionHomographyData_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField motionHomographyData_ = new pbc::RepeatedField(); + /// + /// For each frame, there are 12 homography matrices stored. Each matrix is + /// 3x3 (9 elements). This field will contain 12 x 3 x 3 float values. The + /// first row of the first homography matrix will be followed by the second row + /// of the first homography matrix, followed by third row of first homography + /// matrix, followed by the first row of the second homography matrix, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField MotionHomographyData { + get { return motionHomographyData_; } + } + + /// Field number for the "histogram_count_data" field. + public const int HistogramCountDataFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_histogramCountData_codec + = pb::FieldCodec.ForUInt32(18); + private readonly pbc::RepeatedField histogramCountData_ = new pbc::RepeatedField(); + /// + /// Vector containing histogram counts for individual patches in the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField HistogramCountData { + get { return histogramCountData_; } + } + + /// Field number for the "frame_width" field. + public const int FrameWidthFieldNumber = 3; + private readonly static int FrameWidthDefaultValue = 0; + + private int frameWidth_; + /// + /// The width of the frame at the time metadata was sampled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameWidth { + get { if ((_hasBits0 & 1) != 0) { return frameWidth_; } else { return FrameWidthDefaultValue; } } + set { + _hasBits0 |= 1; + frameWidth_ = value; + } + } + /// Gets whether the "frame_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_height" field. + public const int FrameHeightFieldNumber = 4; + private readonly static int FrameHeightDefaultValue = 0; + + private int frameHeight_; + /// + /// The height of the frame at the time metadata was sampled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameHeight { + get { if ((_hasBits0 & 2) != 0) { return frameHeight_; } else { return FrameHeightDefaultValue; } } + set { + _hasBits0 |= 2; + frameHeight_ = value; + } + } + /// Gets whether the "frame_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameHeight() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as HomographyData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(HomographyData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!motionHomographyData_.Equals(other.motionHomographyData_)) return false; + if(!histogramCountData_.Equals(other.histogramCountData_)) return false; + if (FrameWidth != other.FrameWidth) return false; + if (FrameHeight != other.FrameHeight) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= motionHomographyData_.GetHashCode(); + hash ^= histogramCountData_.GetHashCode(); + if (HasFrameWidth) hash ^= FrameWidth.GetHashCode(); + if (HasFrameHeight) hash ^= FrameHeight.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + motionHomographyData_.WriteTo(output, _repeated_motionHomographyData_codec); + histogramCountData_.WriteTo(output, _repeated_histogramCountData_codec); + if (HasFrameWidth) { + output.WriteRawTag(24); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(32); + output.WriteInt32(FrameHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + motionHomographyData_.WriteTo(ref output, _repeated_motionHomographyData_codec); + histogramCountData_.WriteTo(ref output, _repeated_histogramCountData_codec); + if (HasFrameWidth) { + output.WriteRawTag(24); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(32); + output.WriteInt32(FrameHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += motionHomographyData_.CalculateSize(_repeated_motionHomographyData_codec); + size += histogramCountData_.CalculateSize(_repeated_histogramCountData_codec); + if (HasFrameWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameWidth); + } + if (HasFrameHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameHeight); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(HomographyData other) { + if (other == null) { + return; + } + motionHomographyData_.Add(other.motionHomographyData_); + histogramCountData_.Add(other.histogramCountData_); + if (other.HasFrameWidth) { + FrameWidth = other.FrameWidth; + } + if (other.HasFrameHeight) { + FrameHeight = other.FrameHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + motionHomographyData_.AddEntriesFrom(input, _repeated_motionHomographyData_codec); + break; + } + case 18: + case 16: { + histogramCountData_.AddEntriesFrom(input, _repeated_histogramCountData_codec); + break; + } + case 24: { + FrameWidth = input.ReadInt32(); + break; + } + case 32: { + FrameHeight = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + motionHomographyData_.AddEntriesFrom(ref input, _repeated_motionHomographyData_codec); + break; + } + case 18: + case 16: { + histogramCountData_.AddEntriesFrom(ref input, _repeated_histogramCountData_codec); + break; + } + case 24: { + FrameWidth = input.ReadInt32(); + break; + } + case 32: { + FrameHeight = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs.meta new file mode 100644 index 0000000..87cf419 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/MotionAnalysisCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2fe620dc5b57e305caf5772d5cf27cac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs new file mode 100644 index 0000000..98791ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs @@ -0,0 +1,483 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/opencv_video_encoder_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/opencv_video_encoder_calculator.proto + public static partial class OpencvVideoEncoderCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/opencv_video_encoder_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OpencvVideoEncoderCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkFtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vb3BlbmN2X3ZpZGVvX2Vu", + "Y29kZXJfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8i1AEKI09wZW5DdlZpZGVvRW5j", + "b2RlckNhbGN1bGF0b3JPcHRpb25zEg0KBWNvZGVjGAEgASgJEhQKDHZpZGVv", + "X2Zvcm1hdBgCIAEoCRILCgNmcHMYAyABKAESDQoFd2lkdGgYBCABKAUSDgoG", + "aGVpZ2h0GAUgASgFMlwKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0", + "aW9ucxj7uZNjIAEoCzIuLm1lZGlhcGlwZS5PcGVuQ3ZWaWRlb0VuY29kZXJD", + "YWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OpenCvVideoEncoderCalculatorOptions), global::Mediapipe.OpenCvVideoEncoderCalculatorOptions.Parser, new[]{ "Codec", "VideoFormat", "Fps", "Width", "Height" }, null, null, new pb::Extension[] { global::Mediapipe.OpenCvVideoEncoderCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OpenCvVideoEncoderCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OpenCvVideoEncoderCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.OpencvVideoEncoderCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvVideoEncoderCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvVideoEncoderCalculatorOptions(OpenCvVideoEncoderCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + codec_ = other.codec_; + videoFormat_ = other.videoFormat_; + fps_ = other.fps_; + width_ = other.width_; + height_ = other.height_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpenCvVideoEncoderCalculatorOptions Clone() { + return new OpenCvVideoEncoderCalculatorOptions(this); + } + + /// Field number for the "codec" field. + public const int CodecFieldNumber = 1; + private readonly static string CodecDefaultValue = ""; + + private string codec_; + /// + /// The 4-character code of the codec to encode the video. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Codec { + get { return codec_ ?? CodecDefaultValue; } + set { + codec_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "codec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCodec { + get { return codec_ != null; } + } + /// Clears the value of the "codec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCodec() { + codec_ = null; + } + + /// Field number for the "video_format" field. + public const int VideoFormatFieldNumber = 2; + private readonly static string VideoFormatDefaultValue = ""; + + private string videoFormat_; + /// + /// The video format of the output video file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string VideoFormat { + get { return videoFormat_ ?? VideoFormatDefaultValue; } + set { + videoFormat_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "video_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVideoFormat { + get { return videoFormat_ != null; } + } + /// Clears the value of the "video_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVideoFormat() { + videoFormat_ = null; + } + + /// Field number for the "fps" field. + public const int FpsFieldNumber = 3; + private readonly static double FpsDefaultValue = 0D; + + private double fps_; + /// + /// The frame rate in Hz at which the video frames are output. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Fps { + get { if ((_hasBits0 & 1) != 0) { return fps_; } else { return FpsDefaultValue; } } + set { + _hasBits0 |= 1; + fps_ = value; + } + } + /// Gets whether the "fps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFps { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "fps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFps() { + _hasBits0 &= ~1; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 4; + private readonly static int WidthDefaultValue = 0; + + private int width_; + /// + /// Dimensions of the video in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 2) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 2; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 5; + private readonly static int HeightDefaultValue = 0; + + private int height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 4) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 4; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OpenCvVideoEncoderCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OpenCvVideoEncoderCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Codec != other.Codec) return false; + if (VideoFormat != other.VideoFormat) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Fps, other.Fps)) return false; + if (Width != other.Width) return false; + if (Height != other.Height) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCodec) hash ^= Codec.GetHashCode(); + if (HasVideoFormat) hash ^= VideoFormat.GetHashCode(); + if (HasFps) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Fps); + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCodec) { + output.WriteRawTag(10); + output.WriteString(Codec); + } + if (HasVideoFormat) { + output.WriteRawTag(18); + output.WriteString(VideoFormat); + } + if (HasFps) { + output.WriteRawTag(25); + output.WriteDouble(Fps); + } + if (HasWidth) { + output.WriteRawTag(32); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(40); + output.WriteInt32(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCodec) { + output.WriteRawTag(10); + output.WriteString(Codec); + } + if (HasVideoFormat) { + output.WriteRawTag(18); + output.WriteString(VideoFormat); + } + if (HasFps) { + output.WriteRawTag(25); + output.WriteDouble(Fps); + } + if (HasWidth) { + output.WriteRawTag(32); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(40); + output.WriteInt32(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCodec) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Codec); + } + if (HasVideoFormat) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(VideoFormat); + } + if (HasFps) { + size += 1 + 8; + } + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OpenCvVideoEncoderCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasCodec) { + Codec = other.Codec; + } + if (other.HasVideoFormat) { + VideoFormat = other.VideoFormat; + } + if (other.HasFps) { + Fps = other.Fps; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Codec = input.ReadString(); + break; + } + case 18: { + VideoFormat = input.ReadString(); + break; + } + case 25: { + Fps = input.ReadDouble(); + break; + } + case 32: { + Width = input.ReadInt32(); + break; + } + case 40: { + Height = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Codec = input.ReadString(); + break; + } + case 18: { + VideoFormat = input.ReadString(); + break; + } + case 25: { + Fps = input.ReadDouble(); + break; + } + case 32: { + Width = input.ReadInt32(); + break; + } + case 40: { + Height = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the OpenCvVideoEncoderCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(207936763, pb::FieldCodec.ForMessage(1663494106, global::Mediapipe.OpenCvVideoEncoderCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs.meta new file mode 100644 index 0000000..2259587 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/OpencvVideoEncoderCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19dbc641471fc57bc825ebfd937f4fc2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs new file mode 100644 index 0000000..086913f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs @@ -0,0 +1,259 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/tracked_detection_manager_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/tracked_detection_manager_calculator.proto + public static partial class TrackedDetectionManagerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/tracked_detection_manager_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TrackedDetectionManagerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkZtZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vdHJhY2tlZF9kZXRlY3Rp", + "b25fbWFuYWdlcl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlh", + "cGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90bxo+bWVkaWFwaXBlL3V0", + "aWwvdHJhY2tpbmcvdHJhY2tlZF9kZXRlY3Rpb25fbWFuYWdlcl9jb25maWcu", + "cHJvdG8i4wEKKFRyYWNrZWREZXRlY3Rpb25NYW5hZ2VyQ2FsY3VsYXRvck9w", + "dGlvbnMSUwohdHJhY2tlZF9kZXRlY3Rpb25fbWFuYWdlcl9vcHRpb25zGAEg", + "ASgLMigubWVkaWFwaXBlLlRyYWNrZWREZXRlY3Rpb25NYW5hZ2VyQ29uZmln", + "MmIKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxi25v6PASAB", + "KAsyMy5tZWRpYXBpcGUuVHJhY2tlZERldGVjdGlvbk1hbmFnZXJDYWxjdWxh", + "dG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.TrackedDetectionManagerConfigReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackedDetectionManagerCalculatorOptions), global::Mediapipe.TrackedDetectionManagerCalculatorOptions.Parser, new[]{ "TrackedDetectionManagerOptions" }, null, null, new pb::Extension[] { global::Mediapipe.TrackedDetectionManagerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TrackedDetectionManagerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackedDetectionManagerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackedDetectionManagerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerCalculatorOptions(TrackedDetectionManagerCalculatorOptions other) : this() { + trackedDetectionManagerOptions_ = other.trackedDetectionManagerOptions_ != null ? other.trackedDetectionManagerOptions_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerCalculatorOptions Clone() { + return new TrackedDetectionManagerCalculatorOptions(this); + } + + /// Field number for the "tracked_detection_manager_options" field. + public const int TrackedDetectionManagerOptionsFieldNumber = 1; + private global::Mediapipe.TrackedDetectionManagerConfig trackedDetectionManagerOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackedDetectionManagerConfig TrackedDetectionManagerOptions { + get { return trackedDetectionManagerOptions_; } + set { + trackedDetectionManagerOptions_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackedDetectionManagerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackedDetectionManagerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TrackedDetectionManagerOptions, other.TrackedDetectionManagerOptions)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (trackedDetectionManagerOptions_ != null) hash ^= TrackedDetectionManagerOptions.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (trackedDetectionManagerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackedDetectionManagerOptions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (trackedDetectionManagerOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackedDetectionManagerOptions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (trackedDetectionManagerOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrackedDetectionManagerOptions); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackedDetectionManagerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.trackedDetectionManagerOptions_ != null) { + if (trackedDetectionManagerOptions_ == null) { + TrackedDetectionManagerOptions = new global::Mediapipe.TrackedDetectionManagerConfig(); + } + TrackedDetectionManagerOptions.MergeFrom(other.TrackedDetectionManagerOptions); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (trackedDetectionManagerOptions_ == null) { + TrackedDetectionManagerOptions = new global::Mediapipe.TrackedDetectionManagerConfig(); + } + input.ReadMessage(TrackedDetectionManagerOptions); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (trackedDetectionManagerOptions_ == null) { + TrackedDetectionManagerOptions = new global::Mediapipe.TrackedDetectionManagerConfig(); + } + input.ReadMessage(TrackedDetectionManagerOptions); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TrackedDetectionManagerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(301970230, pb::FieldCodec.ForMessage(2415761842, global::Mediapipe.TrackedDetectionManagerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs.meta new file mode 100644 index 0000000..1b15a63 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/TrackedDetectionManagerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 307450d568ac28d0887d1802e11a74ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs new file mode 100644 index 0000000..05583ed --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs @@ -0,0 +1,798 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/calculators/video/video_pre_stream_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/calculators/video/video_pre_stream_calculator.proto + public static partial class VideoPreStreamCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/calculators/video/video_pre_stream_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static VideoPreStreamCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvY2FsY3VsYXRvcnMvdmlkZW8vdmlkZW9fcHJlX3N0cmVh", + "bV9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvY2FsY3VsYXRvci5wcm90byLPAgofVmlkZW9QcmVTdHJlYW1DYWxj", + "dWxhdG9yT3B0aW9ucxI7CgNmcHMYASABKAsyLi5tZWRpYXBpcGUuVmlkZW9Q", + "cmVTdHJlYW1DYWxjdWxhdG9yT3B0aW9ucy5GcHMalAEKA0ZwcxINCgV2YWx1", + "ZRgBIAEoARJICgVyYXRpbxgCIAEoCzI5Lm1lZGlhcGlwZS5WaWRlb1ByZVN0", + "cmVhbUNhbGN1bGF0b3JPcHRpb25zLkZwcy5SYXRpb25hbDMyGjQKClJhdGlv", + "bmFsMzISEQoJbnVtZXJhdG9yGAEgASgFEhMKC2Rlbm9taW5hdG9yGAIgASgF", + "MlgKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiL8JdIIAEo", + "CzIqLm1lZGlhcGlwZS5WaWRlb1ByZVN0cmVhbUNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VideoPreStreamCalculatorOptions), global::Mediapipe.VideoPreStreamCalculatorOptions.Parser, new[]{ "Fps" }, null, null, new pb::Extension[] { global::Mediapipe.VideoPreStreamCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps), global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Parser, new[]{ "Value", "Ratio" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32), global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32.Parser, new[]{ "Numerator", "Denominator" }, null, null, null, null)})}) + })); + } + #endregion + + } + #region Messages + public sealed partial class VideoPreStreamCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VideoPreStreamCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VideoPreStreamCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VideoPreStreamCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VideoPreStreamCalculatorOptions(VideoPreStreamCalculatorOptions other) : this() { + fps_ = other.fps_ != null ? other.fps_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VideoPreStreamCalculatorOptions Clone() { + return new VideoPreStreamCalculatorOptions(this); + } + + /// Field number for the "fps" field. + public const int FpsFieldNumber = 1; + private global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps fps_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps Fps { + get { return fps_; } + set { + fps_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VideoPreStreamCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VideoPreStreamCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Fps, other.Fps)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (fps_ != null) hash ^= Fps.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (fps_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Fps); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (fps_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Fps); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (fps_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Fps); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VideoPreStreamCalculatorOptions other) { + if (other == null) { + return; + } + if (other.fps_ != null) { + if (fps_ == null) { + Fps = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps(); + } + Fps.MergeFrom(other.Fps); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (fps_ == null) { + Fps = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps(); + } + input.ReadMessage(Fps); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (fps_ == null) { + Fps = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps(); + } + input.ReadMessage(Fps); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the VideoPreStreamCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// An arbitrary number of frames per second. + /// Prefer the StandardFps enum to store industry-standard, safe FPS values. + /// + public sealed partial class Fps : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Fps()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VideoPreStreamCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Fps() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Fps(Fps other) : this() { + _hasBits0 = other._hasBits0; + value_ = other.value_; + ratio_ = other.ratio_ != null ? other.ratio_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Fps Clone() { + return new Fps(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private readonly static double ValueDefaultValue = 0D; + + private double value_; + /// + /// The possibly approximated value of the frame rate, in frames per second. + /// Unsafe to use in accurate computations because prone to rounding errors. + /// For example, the 23.976 FPS value has no exact representation as a + /// double. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Value { + get { if ((_hasBits0 & 1) != 0) { return value_; } else { return ValueDefaultValue; } } + set { + _hasBits0 |= 1; + value_ = value; + } + } + /// Gets whether the "value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasValue { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearValue() { + _hasBits0 &= ~1; + } + + /// Field number for the "ratio" field. + public const int RatioFieldNumber = 2; + private global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32 ratio_; + /// + /// The exact value of the frame rate, as a rational number. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32 Ratio { + get { return ratio_; } + set { + ratio_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Fps); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Fps other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Value, other.Value)) return false; + if (!object.Equals(Ratio, other.Ratio)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Value); + if (ratio_ != null) hash ^= Ratio.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasValue) { + output.WriteRawTag(9); + output.WriteDouble(Value); + } + if (ratio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Ratio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasValue) { + output.WriteRawTag(9); + output.WriteDouble(Value); + } + if (ratio_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Ratio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasValue) { + size += 1 + 8; + } + if (ratio_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ratio); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Fps other) { + if (other == null) { + return; + } + if (other.HasValue) { + Value = other.Value; + } + if (other.ratio_ != null) { + if (ratio_ == null) { + Ratio = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32(); + } + Ratio.MergeFrom(other.Ratio); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + Value = input.ReadDouble(); + break; + } + case 18: { + if (ratio_ == null) { + Ratio = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32(); + } + input.ReadMessage(Ratio); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Value = input.ReadDouble(); + break; + } + case 18: { + if (ratio_ == null) { + Ratio = new global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Types.Rational32(); + } + input.ReadMessage(Ratio); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Fps message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Rational32 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rational32()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.VideoPreStreamCalculatorOptions.Types.Fps.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rational32() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rational32(Rational32 other) : this() { + _hasBits0 = other._hasBits0; + numerator_ = other.numerator_; + denominator_ = other.denominator_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rational32 Clone() { + return new Rational32(this); + } + + /// Field number for the "numerator" field. + public const int NumeratorFieldNumber = 1; + private readonly static int NumeratorDefaultValue = 0; + + private int numerator_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Numerator { + get { if ((_hasBits0 & 1) != 0) { return numerator_; } else { return NumeratorDefaultValue; } } + set { + _hasBits0 |= 1; + numerator_ = value; + } + } + /// Gets whether the "numerator" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumerator { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "numerator" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumerator() { + _hasBits0 &= ~1; + } + + /// Field number for the "denominator" field. + public const int DenominatorFieldNumber = 2; + private readonly static int DenominatorDefaultValue = 0; + + private int denominator_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Denominator { + get { if ((_hasBits0 & 2) != 0) { return denominator_; } else { return DenominatorDefaultValue; } } + set { + _hasBits0 |= 2; + denominator_ = value; + } + } + /// Gets whether the "denominator" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDenominator { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "denominator" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDenominator() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Rational32); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Rational32 other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Numerator != other.Numerator) return false; + if (Denominator != other.Denominator) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumerator) hash ^= Numerator.GetHashCode(); + if (HasDenominator) hash ^= Denominator.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumerator) { + output.WriteRawTag(8); + output.WriteInt32(Numerator); + } + if (HasDenominator) { + output.WriteRawTag(16); + output.WriteInt32(Denominator); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumerator) { + output.WriteRawTag(8); + output.WriteInt32(Numerator); + } + if (HasDenominator) { + output.WriteRawTag(16); + output.WriteInt32(Denominator); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumerator) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Numerator); + } + if (HasDenominator) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Denominator); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Rational32 other) { + if (other == null) { + return; + } + if (other.HasNumerator) { + Numerator = other.Numerator; + } + if (other.HasDenominator) { + Denominator = other.Denominator; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Numerator = input.ReadInt32(); + break; + } + case 16: { + Denominator = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Numerator = input.ReadInt32(); + break; + } + case 16: { + Denominator = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the VideoPreStreamCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(151386123, pb::FieldCodec.ForMessage(1211088986, global::Mediapipe.VideoPreStreamCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs.meta new file mode 100644 index 0000000..41bb7ba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video/VideoPreStreamCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a26dd0cd7d1e0c7c0b757d9e5c45e0f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework.meta new file mode 100644 index 0000000..949497a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be42d5b664091fd4b9bb30c774929e9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs new file mode 100644 index 0000000..5205f93 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs @@ -0,0 +1,3902 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/calculator.proto + public static partial class CalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8SCW1lZGlh", + "cGlwZRosbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yX29wdGlvbnMu", + "cHJvdG8aGWdvb2dsZS9wcm90b2J1Zi9hbnkucHJvdG8aK21lZGlhcGlwZS9m", + "cmFtZXdvcmsvbWVkaWFwaXBlX29wdGlvbnMucHJvdG8aKG1lZGlhcGlwZS9m", + "cmFtZXdvcmsvcGFja2V0X2ZhY3RvcnkucHJvdG8aKm1lZGlhcGlwZS9mcmFt", + "ZXdvcmsvcGFja2V0X2dlbmVyYXRvci5wcm90bxoobWVkaWFwaXBlL2ZyYW1l", + "d29yay9zdGF0dXNfaGFuZGxlci5wcm90bxoobWVkaWFwaXBlL2ZyYW1ld29y", + "ay9zdHJlYW1faGFuZGxlci5wcm90byJaCg5FeGVjdXRvckNvbmZpZxIMCgRu", + "YW1lGAEgASgJEgwKBHR5cGUYAiABKAkSLAoHb3B0aW9ucxgDIAEoCzIbLm1l", + "ZGlhcGlwZS5NZWRpYVBpcGVPcHRpb25zIpECCg9JbnB1dENvbGxlY3Rpb24S", + "DAoEbmFtZRgBIAEoCRIYChBzaWRlX3BhY2tldF9uYW1lGAIgAygJEhwKE2V4", + "dGVybmFsX2lucHV0X25hbWUY6gcgAygJEjgKCmlucHV0X3R5cGUYAyABKA4y", + "JC5tZWRpYXBpcGUuSW5wdXRDb2xsZWN0aW9uLklucHV0VHlwZRIRCglmaWxl", + "X25hbWUYBCABKAkiawoJSW5wdXRUeXBlEgsKB1VOS05PV04QABIMCghSRUNP", + "UkRJTxABEhQKEEZPUkVJR05fUkVDT1JESU8QAhIUChBGT1JFSUdOX0NTVl9U", + "RVhUEAMSFwoTSU5WQUxJRF9VUFBFUl9CT1VORBAEIkoKEklucHV0Q29sbGVj", + "dGlvblNldBI0ChBpbnB1dF9jb2xsZWN0aW9uGAEgAygLMhoubWVkaWFwaXBl", + "LklucHV0Q29sbGVjdGlvbiI3Cg9JbnB1dFN0cmVhbUluZm8SEQoJdGFnX2lu", + "ZGV4GAEgASgJEhEKCWJhY2tfZWRnZRgCIAEoCCLRBAoOUHJvZmlsZXJDb25m", + "aWcSJAocaGlzdG9ncmFtX2ludGVydmFsX3NpemVfdXNlYxgBIAEoAxIfChdu", + "dW1faGlzdG9ncmFtX2ludGVydmFscxgCIAEoAxInChtlbmFibGVfaW5wdXRf", + "b3V0cHV0X2xhdGVuY3kYAyABKAhCAhgBEhcKD2VuYWJsZV9wcm9maWxlchgE", + "IAEoCBIdChVlbmFibGVfc3RyZWFtX2xhdGVuY3kYBSABKAgSLQoldXNlX3Bh", + "Y2tldF90aW1lc3RhbXBfZm9yX2FkZGVkX3BhY2tldBgGIAEoCBIaChJ0cmFj", + "ZV9sb2dfY2FwYWNpdHkYByABKAMSIgoadHJhY2VfZXZlbnRfdHlwZXNfZGlz", + "YWJsZWQYCCADKAUSFgoOdHJhY2VfbG9nX3BhdGgYCSABKAkSFwoPdHJhY2Vf", + "bG9nX2NvdW50GAogASgFEh8KF3RyYWNlX2xvZ19pbnRlcnZhbF91c2VjGAsg", + "ASgDEh0KFXRyYWNlX2xvZ19tYXJnaW5fdXNlYxgMIAEoAxIlChl0cmFjZV9s", + "b2dfZHVyYXRpb25fZXZlbnRzGA0gASgIQgIYARIgChh0cmFjZV9sb2dfaW50", + "ZXJ2YWxfY291bnQYDiABKAUSGgoSdHJhY2VfbG9nX2Rpc2FibGVkGA8gASgI", + "EhUKDXRyYWNlX2VuYWJsZWQYECABKAgSIAoYdHJhY2VfbG9nX2luc3RhbnRf", + "ZXZlbnRzGBEgASgIEhkKEWNhbGN1bGF0b3JfZmlsdGVyGBIgASgJIvAKChVD", + "YWxjdWxhdG9yR3JhcGhDb25maWcSMwoEbm9kZRgBIAMoCzIlLm1lZGlhcGlw", + "ZS5DYWxjdWxhdG9yR3JhcGhDb25maWcuTm9kZRI2Cg5wYWNrZXRfZmFjdG9y", + "eRgGIAMoCzIeLm1lZGlhcGlwZS5QYWNrZXRGYWN0b3J5Q29uZmlnEjoKEHBh", + "Y2tldF9nZW5lcmF0b3IYByADKAsyIC5tZWRpYXBpcGUuUGFja2V0R2VuZXJh", + "dG9yQ29uZmlnEhMKC251bV90aHJlYWRzGAggASgFEjYKDnN0YXR1c19oYW5k", + "bGVyGAkgAygLMh4ubWVkaWFwaXBlLlN0YXR1c0hhbmRsZXJDb25maWcSFAoM", + "aW5wdXRfc3RyZWFtGAogAygJEhUKDW91dHB1dF9zdHJlYW0YDyADKAkSGQoR", + "aW5wdXRfc2lkZV9wYWNrZXQYECADKAkSGgoSb3V0cHV0X3NpZGVfcGFja2V0", + "GBEgAygJEhYKDm1heF9xdWV1ZV9zaXplGAsgASgFEhcKD3JlcG9ydF9kZWFk", + "bG9jaxgVIAEoCBJBChRpbnB1dF9zdHJlYW1faGFuZGxlchgMIAEoCzIjLm1l", + "ZGlhcGlwZS5JbnB1dFN0cmVhbUhhbmRsZXJDb25maWcSQwoVb3V0cHV0X3N0", + "cmVhbV9oYW5kbGVyGA0gASgLMiQubWVkaWFwaXBlLk91dHB1dFN0cmVhbUhh", + "bmRsZXJDb25maWcSKwoIZXhlY3V0b3IYDiADKAsyGS5tZWRpYXBpcGUuRXhl", + "Y3V0b3JDb25maWcSMgoPcHJvZmlsZXJfY29uZmlnGBIgASgLMhkubWVkaWFw", + "aXBlLlByb2ZpbGVyQ29uZmlnEg8KB3BhY2thZ2UYEyABKAkSDAoEdHlwZRgU", + "IAEoCRItCgdvcHRpb25zGOkHIAEoCzIbLm1lZGlhcGlwZS5NZWRpYVBpcGVP", + "cHRpb25zEiwKDWdyYXBoX29wdGlvbnMY6gcgAygLMhQuZ29vZ2xlLnByb3Rv", + "YnVmLkFueRrmBAoETm9kZRIMCgRuYW1lGAEgASgJEhIKCmNhbGN1bGF0b3IY", + "AiABKAkSFAoMaW5wdXRfc3RyZWFtGAMgAygJEhUKDW91dHB1dF9zdHJlYW0Y", + "BCADKAkSGQoRaW5wdXRfc2lkZV9wYWNrZXQYBSADKAkSGgoSb3V0cHV0X3Np", + "ZGVfcGFja2V0GAYgAygJEi0KB29wdGlvbnMYByABKAsyHC5tZWRpYXBpcGUu", + "Q2FsY3VsYXRvck9wdGlvbnMSKgoMbm9kZV9vcHRpb25zGAggAygLMhQuZ29v", + "Z2xlLnByb3RvYnVmLkFueRIUCgxzb3VyY2VfbGF5ZXIYCSABKAUSGAoQYnVm", + "ZmVyX3NpemVfaGludBgKIAEoBRJBChRpbnB1dF9zdHJlYW1faGFuZGxlchgL", + "IAEoCzIjLm1lZGlhcGlwZS5JbnB1dFN0cmVhbUhhbmRsZXJDb25maWcSQwoV", + "b3V0cHV0X3N0cmVhbV9oYW5kbGVyGAwgASgLMiQubWVkaWFwaXBlLk91dHB1", + "dFN0cmVhbUhhbmRsZXJDb25maWcSNQoRaW5wdXRfc3RyZWFtX2luZm8YDSAD", + "KAsyGi5tZWRpYXBpcGUuSW5wdXRTdHJlYW1JbmZvEhAKCGV4ZWN1dG9yGA4g", + "ASgJEjYKD3Byb2ZpbGVyX2NvbmZpZxgPIAEoCzIZLm1lZGlhcGlwZS5Qcm9m", + "aWxlckNvbmZpZ0ICGAESFQoNbWF4X2luX2ZsaWdodBgQIAEoBRIUCgxvcHRp", + "b25fdmFsdWUYESADKAkSFwoOZXh0ZXJuYWxfaW5wdXQY7QcgAygJQi0KGmNv", + "bS5nb29nbGUubWVkaWFwaXBlLnByb3RvQg9DYWxjdWxhdG9yUHJvdG9QAGIG", + "cHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Mediapipe.MediapipeOptionsReflection.Descriptor, global::Mediapipe.PacketFactoryReflection.Descriptor, global::Mediapipe.PacketGeneratorReflection.Descriptor, global::Mediapipe.StatusHandlerReflection.Descriptor, global::Mediapipe.StreamHandlerReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ExecutorConfig), global::Mediapipe.ExecutorConfig.Parser, new[]{ "Name", "Type", "Options" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InputCollection), global::Mediapipe.InputCollection.Parser, new[]{ "Name", "SidePacketName", "ExternalInputName", "InputType", "FileName" }, null, new[]{ typeof(global::Mediapipe.InputCollection.Types.InputType) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InputCollectionSet), global::Mediapipe.InputCollectionSet.Parser, new[]{ "InputCollection" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InputStreamInfo), global::Mediapipe.InputStreamInfo.Parser, new[]{ "TagIndex", "BackEdge" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ProfilerConfig), global::Mediapipe.ProfilerConfig.Parser, new[]{ "HistogramIntervalSizeUsec", "NumHistogramIntervals", "EnableInputOutputLatency", "EnableProfiler", "EnableStreamLatency", "UsePacketTimestampForAddedPacket", "TraceLogCapacity", "TraceEventTypesDisabled", "TraceLogPath", "TraceLogCount", "TraceLogIntervalUsec", "TraceLogMarginUsec", "TraceLogDurationEvents", "TraceLogIntervalCount", "TraceLogDisabled", "TraceEnabled", "TraceLogInstantEvents", "CalculatorFilter" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CalculatorGraphConfig), global::Mediapipe.CalculatorGraphConfig.Parser, new[]{ "Node", "PacketFactory", "PacketGenerator", "NumThreads", "StatusHandler", "InputStream", "OutputStream", "InputSidePacket", "OutputSidePacket", "MaxQueueSize", "ReportDeadlock", "InputStreamHandler", "OutputStreamHandler", "Executor", "ProfilerConfig", "Package", "Type", "Options", "GraphOptions" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CalculatorGraphConfig.Types.Node), global::Mediapipe.CalculatorGraphConfig.Types.Node.Parser, new[]{ "Name", "Calculator", "InputStream", "OutputStream", "InputSidePacket", "OutputSidePacket", "Options", "NodeOptions", "SourceLayer", "BufferSizeHint", "InputStreamHandler", "OutputStreamHandler", "InputStreamInfo", "Executor", "ProfilerConfig", "MaxInFlight", "OptionValue", "ExternalInput" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Describes a MediaPipe Executor. + /// + public sealed partial class ExecutorConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExecutorConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ExecutorConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ExecutorConfig(ExecutorConfig other) : this() { + name_ = other.name_; + type_ = other.type_; + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ExecutorConfig Clone() { + return new ExecutorConfig(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the executor (used by a CalculatorGraphConfig::Node or + /// PacketGeneratorConfig to specify which executor it will execute on). + /// This field must be unique within a CalculatorGraphConfig. If this field + /// is omitted or is an empty string, the ExecutorConfig describes the + /// default executor. + /// + /// NOTE: The names "default" and "gpu" are reserved and must not be used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 2; + private string type_ = ""; + /// + /// The registered type of the executor. For example: "ThreadPoolExecutor". + /// The framework will create an executor of this type (with the options in + /// the options field) for the CalculatorGraph. + /// + /// The ExecutorConfig for the default executor may omit this field and let + /// the framework choose an appropriate executor type. Note: If the options + /// field is used in this case, it should contain the + /// ThreadPoolExecutorOptions. + /// + /// If the ExecutorConfig for an additional (non-default) executor omits this + /// field, the executor must be created outside the CalculatorGraph and + /// passed to the CalculatorGraph for use. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Type { + get { return type_; } + set { + type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 3; + private global::Mediapipe.MediaPipeOptions options_; + /// + /// The options passed to the Executor. The extension in the options field + /// must match the type field. For example, if the type field is + /// "ThreadPoolExecutor", then the options field should contain the + /// ThreadPoolExecutorOptions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MediaPipeOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ExecutorConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ExecutorConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Type != other.Type) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Type.Length != 0) hash ^= Type.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Type.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Type); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Type.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Type); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Type.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); + } + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ExecutorConfig other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Type.Length != 0) { + Type = other.Type; + } + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Type = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Type = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + } + #endif + + } + + /// + /// A collection of input data to a CalculatorGraph. + /// + public sealed partial class InputCollection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputCollection()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollection(InputCollection other) : this() { + name_ = other.name_; + sidePacketName_ = other.sidePacketName_.Clone(); + externalInputName_ = other.externalInputName_.Clone(); + inputType_ = other.inputType_; + fileName_ = other.fileName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollection Clone() { + return new InputCollection(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the input collection. Name must match [a-z_][a-z0-9_]* + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "side_packet_name" field. + public const int SidePacketNameFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_sidePacketName_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField sidePacketName_ = new pbc::RepeatedField(); + /// + /// The names of each side packet. The number of side_packet_name + /// must match the number of packets generated by the input file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SidePacketName { + get { return sidePacketName_; } + } + + /// Field number for the "external_input_name" field. + public const int ExternalInputNameFieldNumber = 1002; + private static readonly pb::FieldCodec _repeated_externalInputName_codec + = pb::FieldCodec.ForString(8018); + private readonly pbc::RepeatedField externalInputName_ = new pbc::RepeatedField(); + /// + /// DEPRECATED: old way of referring to side_packet_name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExternalInputName { + get { return externalInputName_; } + } + + /// Field number for the "input_type" field. + public const int InputTypeFieldNumber = 3; + private global::Mediapipe.InputCollection.Types.InputType inputType_ = global::Mediapipe.InputCollection.Types.InputType.Unknown; + /// + /// Sets the source of the input collection data. + /// The default value is UNKNOWN. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InputCollection.Types.InputType InputType { + get { return inputType_; } + set { + inputType_ = value; + } + } + + /// Field number for the "file_name" field. + public const int FileNameFieldNumber = 4; + private string fileName_ = ""; + /// + /// A file name pointing to the data. The format of the data is + /// specified by the "input_type" field. Multiple shards may be + /// specified using @N or glob expressions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FileName { + get { return fileName_; } + set { + fileName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InputCollection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InputCollection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if(!sidePacketName_.Equals(other.sidePacketName_)) return false; + if(!externalInputName_.Equals(other.externalInputName_)) return false; + if (InputType != other.InputType) return false; + if (FileName != other.FileName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + hash ^= sidePacketName_.GetHashCode(); + hash ^= externalInputName_.GetHashCode(); + if (InputType != global::Mediapipe.InputCollection.Types.InputType.Unknown) hash ^= InputType.GetHashCode(); + if (FileName.Length != 0) hash ^= FileName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + sidePacketName_.WriteTo(output, _repeated_sidePacketName_codec); + if (InputType != global::Mediapipe.InputCollection.Types.InputType.Unknown) { + output.WriteRawTag(24); + output.WriteEnum((int) InputType); + } + if (FileName.Length != 0) { + output.WriteRawTag(34); + output.WriteString(FileName); + } + externalInputName_.WriteTo(output, _repeated_externalInputName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + sidePacketName_.WriteTo(ref output, _repeated_sidePacketName_codec); + if (InputType != global::Mediapipe.InputCollection.Types.InputType.Unknown) { + output.WriteRawTag(24); + output.WriteEnum((int) InputType); + } + if (FileName.Length != 0) { + output.WriteRawTag(34); + output.WriteString(FileName); + } + externalInputName_.WriteTo(ref output, _repeated_externalInputName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + size += sidePacketName_.CalculateSize(_repeated_sidePacketName_codec); + size += externalInputName_.CalculateSize(_repeated_externalInputName_codec); + if (InputType != global::Mediapipe.InputCollection.Types.InputType.Unknown) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) InputType); + } + if (FileName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InputCollection other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + sidePacketName_.Add(other.sidePacketName_); + externalInputName_.Add(other.externalInputName_); + if (other.InputType != global::Mediapipe.InputCollection.Types.InputType.Unknown) { + InputType = other.InputType; + } + if (other.FileName.Length != 0) { + FileName = other.FileName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + sidePacketName_.AddEntriesFrom(input, _repeated_sidePacketName_codec); + break; + } + case 24: { + InputType = (global::Mediapipe.InputCollection.Types.InputType) input.ReadEnum(); + break; + } + case 34: { + FileName = input.ReadString(); + break; + } + case 8018: { + externalInputName_.AddEntriesFrom(input, _repeated_externalInputName_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + sidePacketName_.AddEntriesFrom(ref input, _repeated_sidePacketName_codec); + break; + } + case 24: { + InputType = (global::Mediapipe.InputCollection.Types.InputType) input.ReadEnum(); + break; + } + case 34: { + FileName = input.ReadString(); + break; + } + case 8018: { + externalInputName_.AddEntriesFrom(ref input, _repeated_externalInputName_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the InputCollection message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The input can be specified in several ways. + /// + public enum InputType { + /// + /// An invalid default value. This value is guaranteed to be the + /// lowest enum value (i.e. don't add negative enum values). + /// + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + /// + /// A recordio where each record is a serialized PacketManagerConfig. + /// Each PacketManagerConfig must have the same number of packet + /// factories in it as the number of side packet names. Furthermore, + /// the output side packet name field in each PacketFactoryConfig + /// must not be set. This is the most general input, and allows + /// multiple side packet values to be set in arbitrarily complicated + /// ways before each run. + /// + [pbr::OriginalName("RECORDIO")] Recordio = 1, + /// + /// A recordio where each record is a serialized packet payload. + /// For example a recordio of serialized OmniaFeature protos dumped + /// from Omnia. + /// + [pbr::OriginalName("FOREIGN_RECORDIO")] ForeignRecordio = 2, + /// + /// A text file where each line is a comma separated list. The number + /// of elements for each csv string must be the same as the number + /// of side_packet_name (and the order must match). Each line must + /// be less than 1MiB in size. Lines comprising of only whitespace + /// or only whitespace and a pound comment will be skipped. + /// + [pbr::OriginalName("FOREIGN_CSV_TEXT")] ForeignCsvText = 3, + /// + /// This and all higher values are invalid. Update this value to + /// always be larger than any other enum values you add. + /// + [pbr::OriginalName("INVALID_UPPER_BOUND")] InvalidUpperBound = 4, + } + + } + #endregion + + } + + /// + /// A convenient way to specify a number of InputCollections. + /// + public sealed partial class InputCollectionSet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputCollectionSet()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollectionSet() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollectionSet(InputCollectionSet other) : this() { + inputCollection_ = other.inputCollection_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputCollectionSet Clone() { + return new InputCollectionSet(this); + } + + /// Field number for the "input_collection" field. + public const int InputCollectionFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_inputCollection_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.InputCollection.Parser); + private readonly pbc::RepeatedField inputCollection_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputCollection { + get { return inputCollection_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InputCollectionSet); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InputCollectionSet other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!inputCollection_.Equals(other.inputCollection_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= inputCollection_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + inputCollection_.WriteTo(output, _repeated_inputCollection_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + inputCollection_.WriteTo(ref output, _repeated_inputCollection_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += inputCollection_.CalculateSize(_repeated_inputCollection_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InputCollectionSet other) { + if (other == null) { + return; + } + inputCollection_.Add(other.inputCollection_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + inputCollection_.AddEntriesFrom(input, _repeated_inputCollection_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + inputCollection_.AddEntriesFrom(ref input, _repeated_inputCollection_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Additional information about an input stream. + /// + public sealed partial class InputStreamInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputStreamInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamInfo(InputStreamInfo other) : this() { + tagIndex_ = other.tagIndex_; + backEdge_ = other.backEdge_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamInfo Clone() { + return new InputStreamInfo(this); + } + + /// Field number for the "tag_index" field. + public const int TagIndexFieldNumber = 1; + private string tagIndex_ = ""; + /// + /// A description of the input stream. + /// This description uses the Calculator visible specification of + /// a stream. The format is a tag, then an index with both being + /// optional. If the tag is missing it is assumed to be "" and if + /// the index is missing then it is assumed to be 0. If the index + /// is provided then a colon (':') must be used. + /// Examples: + /// "TAG" -> tag "TAG", index 0 + /// "" -> tag "", index 0 + /// ":0" -> tag "", index 0 + /// ":3" -> tag "", index 3 + /// "VIDEO:0" -> tag "VIDEO", index 0 + /// "VIDEO:2" -> tag "VIDEO", index 2 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TagIndex { + get { return tagIndex_; } + set { + tagIndex_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "back_edge" field. + public const int BackEdgeFieldNumber = 2; + private bool backEdge_; + /// + /// Whether the input stream is a back edge. + /// By default, MediaPipe requires graphs to be acyclic and treats cycles in a + /// graph as errors. To allow MediaPipe to accept a cyclic graph, set the + /// back_edge fields of the input streams that are back edges to true. A + /// cyclic graph usually has an obvious forward direction, and a back edge + /// goes in the opposite direction. For a formal definition of a back edge, + /// please see https://en.wikipedia.org/wiki/Depth-first_search. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BackEdge { + get { return backEdge_; } + set { + backEdge_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InputStreamInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InputStreamInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TagIndex != other.TagIndex) return false; + if (BackEdge != other.BackEdge) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (TagIndex.Length != 0) hash ^= TagIndex.GetHashCode(); + if (BackEdge != false) hash ^= BackEdge.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TagIndex.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TagIndex); + } + if (BackEdge != false) { + output.WriteRawTag(16); + output.WriteBool(BackEdge); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TagIndex.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TagIndex); + } + if (BackEdge != false) { + output.WriteRawTag(16); + output.WriteBool(BackEdge); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (TagIndex.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TagIndex); + } + if (BackEdge != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InputStreamInfo other) { + if (other == null) { + return; + } + if (other.TagIndex.Length != 0) { + TagIndex = other.TagIndex; + } + if (other.BackEdge != false) { + BackEdge = other.BackEdge; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TagIndex = input.ReadString(); + break; + } + case 16: { + BackEdge = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TagIndex = input.ReadString(); + break; + } + case 16: { + BackEdge = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// Configs for the profiler for a calculator. Not applicable to subgraphs. + /// + public sealed partial class ProfilerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProfilerConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ProfilerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ProfilerConfig(ProfilerConfig other) : this() { + histogramIntervalSizeUsec_ = other.histogramIntervalSizeUsec_; + numHistogramIntervals_ = other.numHistogramIntervals_; + enableInputOutputLatency_ = other.enableInputOutputLatency_; + enableProfiler_ = other.enableProfiler_; + enableStreamLatency_ = other.enableStreamLatency_; + usePacketTimestampForAddedPacket_ = other.usePacketTimestampForAddedPacket_; + traceLogCapacity_ = other.traceLogCapacity_; + traceEventTypesDisabled_ = other.traceEventTypesDisabled_.Clone(); + traceLogPath_ = other.traceLogPath_; + traceLogCount_ = other.traceLogCount_; + traceLogIntervalUsec_ = other.traceLogIntervalUsec_; + traceLogMarginUsec_ = other.traceLogMarginUsec_; + traceLogDurationEvents_ = other.traceLogDurationEvents_; + traceLogIntervalCount_ = other.traceLogIntervalCount_; + traceLogDisabled_ = other.traceLogDisabled_; + traceEnabled_ = other.traceEnabled_; + traceLogInstantEvents_ = other.traceLogInstantEvents_; + calculatorFilter_ = other.calculatorFilter_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ProfilerConfig Clone() { + return new ProfilerConfig(this); + } + + /// Field number for the "histogram_interval_size_usec" field. + public const int HistogramIntervalSizeUsecFieldNumber = 1; + private long histogramIntervalSizeUsec_; + /// + /// Size of the runtimes histogram intervals (in microseconds) to generate the + /// histogram of the Process() time. The last interval extends to +inf. + /// If not specified, the interval is 1000000 usec = 1 sec. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long HistogramIntervalSizeUsec { + get { return histogramIntervalSizeUsec_; } + set { + histogramIntervalSizeUsec_ = value; + } + } + + /// Field number for the "num_histogram_intervals" field. + public const int NumHistogramIntervalsFieldNumber = 2; + private long numHistogramIntervals_; + /// + /// Number of intervals to generate the histogram of the Process() runtime. + /// If not specified, one interval is used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long NumHistogramIntervals { + get { return numHistogramIntervals_; } + set { + numHistogramIntervals_ = value; + } + } + + /// Field number for the "enable_input_output_latency" field. + public const int EnableInputOutputLatencyFieldNumber = 3; + private bool enableInputOutputLatency_; + /// + /// TODO: clean up after migration to MediaPipeProfiler. + /// DEPRECATED: If true, the profiler also profiles the input output latency. + /// Should be true only if the packet timestamps corresponds to the + /// microseconds wall time from epoch. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EnableInputOutputLatency { + get { return enableInputOutputLatency_; } + set { + enableInputOutputLatency_ = value; + } + } + + /// Field number for the "enable_profiler" field. + public const int EnableProfilerFieldNumber = 4; + private bool enableProfiler_; + /// + /// If true, the profiler starts profiling when graph is initialized. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EnableProfiler { + get { return enableProfiler_; } + set { + enableProfiler_ = value; + } + } + + /// Field number for the "enable_stream_latency" field. + public const int EnableStreamLatencyFieldNumber = 5; + private bool enableStreamLatency_; + /// + /// If true, the profiler also profiles the stream latency and input-output + /// latency. + /// No-op if enable_profiler is false. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EnableStreamLatency { + get { return enableStreamLatency_; } + set { + enableStreamLatency_ = value; + } + } + + /// Field number for the "use_packet_timestamp_for_added_packet" field. + public const int UsePacketTimestampForAddedPacketFieldNumber = 6; + private bool usePacketTimestampForAddedPacket_; + /// + /// If true, the profiler uses packet timestamp (as production time and source + /// production time) for packets added by calling + /// CalculatorGraph::AddPacketToInputStream(). + /// If false, uses profiler's clock. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UsePacketTimestampForAddedPacket { + get { return usePacketTimestampForAddedPacket_; } + set { + usePacketTimestampForAddedPacket_ = value; + } + } + + /// Field number for the "trace_log_capacity" field. + public const int TraceLogCapacityFieldNumber = 7; + private long traceLogCapacity_; + /// + /// The maximum number of trace events buffered in memory. + /// The default value buffers up to 20000 events. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TraceLogCapacity { + get { return traceLogCapacity_; } + set { + traceLogCapacity_ = value; + } + } + + /// Field number for the "trace_event_types_disabled" field. + public const int TraceEventTypesDisabledFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_traceEventTypesDisabled_codec + = pb::FieldCodec.ForInt32(66); + private readonly pbc::RepeatedField traceEventTypesDisabled_ = new pbc::RepeatedField(); + /// + /// Trace event types that are not logged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TraceEventTypesDisabled { + get { return traceEventTypesDisabled_; } + } + + /// Field number for the "trace_log_path" field. + public const int TraceLogPathFieldNumber = 9; + private string traceLogPath_ = ""; + /// + /// The output directory and base-name prefix for trace log files. + /// Log files are written to: StrCat(trace_log_path, index, ".binarypb") + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TraceLogPath { + get { return traceLogPath_; } + set { + traceLogPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "trace_log_count" field. + public const int TraceLogCountFieldNumber = 10; + private int traceLogCount_; + /// + /// The number of trace log files retained. + /// The trace log files are named "trace_0.log" through "trace_k.log". + /// The default value specifies 2 output files retained. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TraceLogCount { + get { return traceLogCount_; } + set { + traceLogCount_ = value; + } + } + + /// Field number for the "trace_log_interval_usec" field. + public const int TraceLogIntervalUsecFieldNumber = 11; + private long traceLogIntervalUsec_; + /// + /// The interval in microseconds between trace log output. + /// The default value specifies trace log output once every 0.5 sec. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TraceLogIntervalUsec { + get { return traceLogIntervalUsec_; } + set { + traceLogIntervalUsec_ = value; + } + } + + /// Field number for the "trace_log_margin_usec" field. + public const int TraceLogMarginUsecFieldNumber = 12; + private long traceLogMarginUsec_; + /// + /// The interval in microseconds between TimeNow and the highest times + /// included in trace log output. This margin allows time for events + /// to be appended to the TraceBuffer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TraceLogMarginUsec { + get { return traceLogMarginUsec_; } + set { + traceLogMarginUsec_ = value; + } + } + + /// Field number for the "trace_log_duration_events" field. + public const int TraceLogDurationEventsFieldNumber = 13; + private bool traceLogDurationEvents_; + /// + /// Deprecated, replaced by trace_log_instant_events. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TraceLogDurationEvents { + get { return traceLogDurationEvents_; } + set { + traceLogDurationEvents_ = value; + } + } + + /// Field number for the "trace_log_interval_count" field. + public const int TraceLogIntervalCountFieldNumber = 14; + private int traceLogIntervalCount_; + /// + /// The number of trace log intervals per file. The total log duration is: + /// trace_log_interval_usec * trace_log_file_count * trace_log_interval_count. + /// The default value specifies 10 intervals per file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TraceLogIntervalCount { + get { return traceLogIntervalCount_; } + set { + traceLogIntervalCount_ = value; + } + } + + /// Field number for the "trace_log_disabled" field. + public const int TraceLogDisabledFieldNumber = 15; + private bool traceLogDisabled_; + /// + /// An option to turn ON/OFF writing trace files to disk. Saving trace files to + /// disk is enabled by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TraceLogDisabled { + get { return traceLogDisabled_; } + set { + traceLogDisabled_ = value; + } + } + + /// Field number for the "trace_enabled" field. + public const int TraceEnabledFieldNumber = 16; + private bool traceEnabled_; + /// + /// If true, tracer timing events are recorded and reported. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TraceEnabled { + get { return traceEnabled_; } + set { + traceEnabled_ = value; + } + } + + /// Field number for the "trace_log_instant_events" field. + public const int TraceLogInstantEventsFieldNumber = 17; + private bool traceLogInstantEvents_; + /// + /// False specifies an event for each calculator invocation. + /// True specifies a separate event for each start and finish time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TraceLogInstantEvents { + get { return traceLogInstantEvents_; } + set { + traceLogInstantEvents_ = value; + } + } + + /// Field number for the "calculator_filter" field. + public const int CalculatorFilterFieldNumber = 18; + private string calculatorFilter_ = ""; + /// + /// Limits calculator-profile histograms to a subset of calculators. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CalculatorFilter { + get { return calculatorFilter_; } + set { + calculatorFilter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ProfilerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ProfilerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HistogramIntervalSizeUsec != other.HistogramIntervalSizeUsec) return false; + if (NumHistogramIntervals != other.NumHistogramIntervals) return false; + if (EnableInputOutputLatency != other.EnableInputOutputLatency) return false; + if (EnableProfiler != other.EnableProfiler) return false; + if (EnableStreamLatency != other.EnableStreamLatency) return false; + if (UsePacketTimestampForAddedPacket != other.UsePacketTimestampForAddedPacket) return false; + if (TraceLogCapacity != other.TraceLogCapacity) return false; + if(!traceEventTypesDisabled_.Equals(other.traceEventTypesDisabled_)) return false; + if (TraceLogPath != other.TraceLogPath) return false; + if (TraceLogCount != other.TraceLogCount) return false; + if (TraceLogIntervalUsec != other.TraceLogIntervalUsec) return false; + if (TraceLogMarginUsec != other.TraceLogMarginUsec) return false; + if (TraceLogDurationEvents != other.TraceLogDurationEvents) return false; + if (TraceLogIntervalCount != other.TraceLogIntervalCount) return false; + if (TraceLogDisabled != other.TraceLogDisabled) return false; + if (TraceEnabled != other.TraceEnabled) return false; + if (TraceLogInstantEvents != other.TraceLogInstantEvents) return false; + if (CalculatorFilter != other.CalculatorFilter) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HistogramIntervalSizeUsec != 0L) hash ^= HistogramIntervalSizeUsec.GetHashCode(); + if (NumHistogramIntervals != 0L) hash ^= NumHistogramIntervals.GetHashCode(); + if (EnableInputOutputLatency != false) hash ^= EnableInputOutputLatency.GetHashCode(); + if (EnableProfiler != false) hash ^= EnableProfiler.GetHashCode(); + if (EnableStreamLatency != false) hash ^= EnableStreamLatency.GetHashCode(); + if (UsePacketTimestampForAddedPacket != false) hash ^= UsePacketTimestampForAddedPacket.GetHashCode(); + if (TraceLogCapacity != 0L) hash ^= TraceLogCapacity.GetHashCode(); + hash ^= traceEventTypesDisabled_.GetHashCode(); + if (TraceLogPath.Length != 0) hash ^= TraceLogPath.GetHashCode(); + if (TraceLogCount != 0) hash ^= TraceLogCount.GetHashCode(); + if (TraceLogIntervalUsec != 0L) hash ^= TraceLogIntervalUsec.GetHashCode(); + if (TraceLogMarginUsec != 0L) hash ^= TraceLogMarginUsec.GetHashCode(); + if (TraceLogDurationEvents != false) hash ^= TraceLogDurationEvents.GetHashCode(); + if (TraceLogIntervalCount != 0) hash ^= TraceLogIntervalCount.GetHashCode(); + if (TraceLogDisabled != false) hash ^= TraceLogDisabled.GetHashCode(); + if (TraceEnabled != false) hash ^= TraceEnabled.GetHashCode(); + if (TraceLogInstantEvents != false) hash ^= TraceLogInstantEvents.GetHashCode(); + if (CalculatorFilter.Length != 0) hash ^= CalculatorFilter.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HistogramIntervalSizeUsec != 0L) { + output.WriteRawTag(8); + output.WriteInt64(HistogramIntervalSizeUsec); + } + if (NumHistogramIntervals != 0L) { + output.WriteRawTag(16); + output.WriteInt64(NumHistogramIntervals); + } + if (EnableInputOutputLatency != false) { + output.WriteRawTag(24); + output.WriteBool(EnableInputOutputLatency); + } + if (EnableProfiler != false) { + output.WriteRawTag(32); + output.WriteBool(EnableProfiler); + } + if (EnableStreamLatency != false) { + output.WriteRawTag(40); + output.WriteBool(EnableStreamLatency); + } + if (UsePacketTimestampForAddedPacket != false) { + output.WriteRawTag(48); + output.WriteBool(UsePacketTimestampForAddedPacket); + } + if (TraceLogCapacity != 0L) { + output.WriteRawTag(56); + output.WriteInt64(TraceLogCapacity); + } + traceEventTypesDisabled_.WriteTo(output, _repeated_traceEventTypesDisabled_codec); + if (TraceLogPath.Length != 0) { + output.WriteRawTag(74); + output.WriteString(TraceLogPath); + } + if (TraceLogCount != 0) { + output.WriteRawTag(80); + output.WriteInt32(TraceLogCount); + } + if (TraceLogIntervalUsec != 0L) { + output.WriteRawTag(88); + output.WriteInt64(TraceLogIntervalUsec); + } + if (TraceLogMarginUsec != 0L) { + output.WriteRawTag(96); + output.WriteInt64(TraceLogMarginUsec); + } + if (TraceLogDurationEvents != false) { + output.WriteRawTag(104); + output.WriteBool(TraceLogDurationEvents); + } + if (TraceLogIntervalCount != 0) { + output.WriteRawTag(112); + output.WriteInt32(TraceLogIntervalCount); + } + if (TraceLogDisabled != false) { + output.WriteRawTag(120); + output.WriteBool(TraceLogDisabled); + } + if (TraceEnabled != false) { + output.WriteRawTag(128, 1); + output.WriteBool(TraceEnabled); + } + if (TraceLogInstantEvents != false) { + output.WriteRawTag(136, 1); + output.WriteBool(TraceLogInstantEvents); + } + if (CalculatorFilter.Length != 0) { + output.WriteRawTag(146, 1); + output.WriteString(CalculatorFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HistogramIntervalSizeUsec != 0L) { + output.WriteRawTag(8); + output.WriteInt64(HistogramIntervalSizeUsec); + } + if (NumHistogramIntervals != 0L) { + output.WriteRawTag(16); + output.WriteInt64(NumHistogramIntervals); + } + if (EnableInputOutputLatency != false) { + output.WriteRawTag(24); + output.WriteBool(EnableInputOutputLatency); + } + if (EnableProfiler != false) { + output.WriteRawTag(32); + output.WriteBool(EnableProfiler); + } + if (EnableStreamLatency != false) { + output.WriteRawTag(40); + output.WriteBool(EnableStreamLatency); + } + if (UsePacketTimestampForAddedPacket != false) { + output.WriteRawTag(48); + output.WriteBool(UsePacketTimestampForAddedPacket); + } + if (TraceLogCapacity != 0L) { + output.WriteRawTag(56); + output.WriteInt64(TraceLogCapacity); + } + traceEventTypesDisabled_.WriteTo(ref output, _repeated_traceEventTypesDisabled_codec); + if (TraceLogPath.Length != 0) { + output.WriteRawTag(74); + output.WriteString(TraceLogPath); + } + if (TraceLogCount != 0) { + output.WriteRawTag(80); + output.WriteInt32(TraceLogCount); + } + if (TraceLogIntervalUsec != 0L) { + output.WriteRawTag(88); + output.WriteInt64(TraceLogIntervalUsec); + } + if (TraceLogMarginUsec != 0L) { + output.WriteRawTag(96); + output.WriteInt64(TraceLogMarginUsec); + } + if (TraceLogDurationEvents != false) { + output.WriteRawTag(104); + output.WriteBool(TraceLogDurationEvents); + } + if (TraceLogIntervalCount != 0) { + output.WriteRawTag(112); + output.WriteInt32(TraceLogIntervalCount); + } + if (TraceLogDisabled != false) { + output.WriteRawTag(120); + output.WriteBool(TraceLogDisabled); + } + if (TraceEnabled != false) { + output.WriteRawTag(128, 1); + output.WriteBool(TraceEnabled); + } + if (TraceLogInstantEvents != false) { + output.WriteRawTag(136, 1); + output.WriteBool(TraceLogInstantEvents); + } + if (CalculatorFilter.Length != 0) { + output.WriteRawTag(146, 1); + output.WriteString(CalculatorFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HistogramIntervalSizeUsec != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(HistogramIntervalSizeUsec); + } + if (NumHistogramIntervals != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumHistogramIntervals); + } + if (EnableInputOutputLatency != false) { + size += 1 + 1; + } + if (EnableProfiler != false) { + size += 1 + 1; + } + if (EnableStreamLatency != false) { + size += 1 + 1; + } + if (UsePacketTimestampForAddedPacket != false) { + size += 1 + 1; + } + if (TraceLogCapacity != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TraceLogCapacity); + } + size += traceEventTypesDisabled_.CalculateSize(_repeated_traceEventTypesDisabled_codec); + if (TraceLogPath.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TraceLogPath); + } + if (TraceLogCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TraceLogCount); + } + if (TraceLogIntervalUsec != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TraceLogIntervalUsec); + } + if (TraceLogMarginUsec != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TraceLogMarginUsec); + } + if (TraceLogDurationEvents != false) { + size += 1 + 1; + } + if (TraceLogIntervalCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TraceLogIntervalCount); + } + if (TraceLogDisabled != false) { + size += 1 + 1; + } + if (TraceEnabled != false) { + size += 2 + 1; + } + if (TraceLogInstantEvents != false) { + size += 2 + 1; + } + if (CalculatorFilter.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(CalculatorFilter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ProfilerConfig other) { + if (other == null) { + return; + } + if (other.HistogramIntervalSizeUsec != 0L) { + HistogramIntervalSizeUsec = other.HistogramIntervalSizeUsec; + } + if (other.NumHistogramIntervals != 0L) { + NumHistogramIntervals = other.NumHistogramIntervals; + } + if (other.EnableInputOutputLatency != false) { + EnableInputOutputLatency = other.EnableInputOutputLatency; + } + if (other.EnableProfiler != false) { + EnableProfiler = other.EnableProfiler; + } + if (other.EnableStreamLatency != false) { + EnableStreamLatency = other.EnableStreamLatency; + } + if (other.UsePacketTimestampForAddedPacket != false) { + UsePacketTimestampForAddedPacket = other.UsePacketTimestampForAddedPacket; + } + if (other.TraceLogCapacity != 0L) { + TraceLogCapacity = other.TraceLogCapacity; + } + traceEventTypesDisabled_.Add(other.traceEventTypesDisabled_); + if (other.TraceLogPath.Length != 0) { + TraceLogPath = other.TraceLogPath; + } + if (other.TraceLogCount != 0) { + TraceLogCount = other.TraceLogCount; + } + if (other.TraceLogIntervalUsec != 0L) { + TraceLogIntervalUsec = other.TraceLogIntervalUsec; + } + if (other.TraceLogMarginUsec != 0L) { + TraceLogMarginUsec = other.TraceLogMarginUsec; + } + if (other.TraceLogDurationEvents != false) { + TraceLogDurationEvents = other.TraceLogDurationEvents; + } + if (other.TraceLogIntervalCount != 0) { + TraceLogIntervalCount = other.TraceLogIntervalCount; + } + if (other.TraceLogDisabled != false) { + TraceLogDisabled = other.TraceLogDisabled; + } + if (other.TraceEnabled != false) { + TraceEnabled = other.TraceEnabled; + } + if (other.TraceLogInstantEvents != false) { + TraceLogInstantEvents = other.TraceLogInstantEvents; + } + if (other.CalculatorFilter.Length != 0) { + CalculatorFilter = other.CalculatorFilter; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + HistogramIntervalSizeUsec = input.ReadInt64(); + break; + } + case 16: { + NumHistogramIntervals = input.ReadInt64(); + break; + } + case 24: { + EnableInputOutputLatency = input.ReadBool(); + break; + } + case 32: { + EnableProfiler = input.ReadBool(); + break; + } + case 40: { + EnableStreamLatency = input.ReadBool(); + break; + } + case 48: { + UsePacketTimestampForAddedPacket = input.ReadBool(); + break; + } + case 56: { + TraceLogCapacity = input.ReadInt64(); + break; + } + case 66: + case 64: { + traceEventTypesDisabled_.AddEntriesFrom(input, _repeated_traceEventTypesDisabled_codec); + break; + } + case 74: { + TraceLogPath = input.ReadString(); + break; + } + case 80: { + TraceLogCount = input.ReadInt32(); + break; + } + case 88: { + TraceLogIntervalUsec = input.ReadInt64(); + break; + } + case 96: { + TraceLogMarginUsec = input.ReadInt64(); + break; + } + case 104: { + TraceLogDurationEvents = input.ReadBool(); + break; + } + case 112: { + TraceLogIntervalCount = input.ReadInt32(); + break; + } + case 120: { + TraceLogDisabled = input.ReadBool(); + break; + } + case 128: { + TraceEnabled = input.ReadBool(); + break; + } + case 136: { + TraceLogInstantEvents = input.ReadBool(); + break; + } + case 146: { + CalculatorFilter = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + HistogramIntervalSizeUsec = input.ReadInt64(); + break; + } + case 16: { + NumHistogramIntervals = input.ReadInt64(); + break; + } + case 24: { + EnableInputOutputLatency = input.ReadBool(); + break; + } + case 32: { + EnableProfiler = input.ReadBool(); + break; + } + case 40: { + EnableStreamLatency = input.ReadBool(); + break; + } + case 48: { + UsePacketTimestampForAddedPacket = input.ReadBool(); + break; + } + case 56: { + TraceLogCapacity = input.ReadInt64(); + break; + } + case 66: + case 64: { + traceEventTypesDisabled_.AddEntriesFrom(ref input, _repeated_traceEventTypesDisabled_codec); + break; + } + case 74: { + TraceLogPath = input.ReadString(); + break; + } + case 80: { + TraceLogCount = input.ReadInt32(); + break; + } + case 88: { + TraceLogIntervalUsec = input.ReadInt64(); + break; + } + case 96: { + TraceLogMarginUsec = input.ReadInt64(); + break; + } + case 104: { + TraceLogDurationEvents = input.ReadBool(); + break; + } + case 112: { + TraceLogIntervalCount = input.ReadInt32(); + break; + } + case 120: { + TraceLogDisabled = input.ReadBool(); + break; + } + case 128: { + TraceEnabled = input.ReadBool(); + break; + } + case 136: { + TraceLogInstantEvents = input.ReadBool(); + break; + } + case 146: { + CalculatorFilter = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Describes the topology and function of a MediaPipe Graph. The graph of + /// Nodes must be a Directed Acyclic Graph (DAG) except as annotated by + /// "back_edge" in InputStreamInfo. Use a mediapipe::CalculatorGraph object to + /// run the graph. + /// + public sealed partial class CalculatorGraphConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculatorGraphConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorGraphConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorGraphConfig(CalculatorGraphConfig other) : this() { + node_ = other.node_.Clone(); + packetFactory_ = other.packetFactory_.Clone(); + packetGenerator_ = other.packetGenerator_.Clone(); + numThreads_ = other.numThreads_; + statusHandler_ = other.statusHandler_.Clone(); + inputStream_ = other.inputStream_.Clone(); + outputStream_ = other.outputStream_.Clone(); + inputSidePacket_ = other.inputSidePacket_.Clone(); + outputSidePacket_ = other.outputSidePacket_.Clone(); + maxQueueSize_ = other.maxQueueSize_; + reportDeadlock_ = other.reportDeadlock_; + inputStreamHandler_ = other.inputStreamHandler_ != null ? other.inputStreamHandler_.Clone() : null; + outputStreamHandler_ = other.outputStreamHandler_ != null ? other.outputStreamHandler_.Clone() : null; + executor_ = other.executor_.Clone(); + profilerConfig_ = other.profilerConfig_ != null ? other.profilerConfig_.Clone() : null; + package_ = other.package_; + type_ = other.type_; + options_ = other.options_ != null ? other.options_.Clone() : null; + graphOptions_ = other.graphOptions_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorGraphConfig Clone() { + return new CalculatorGraphConfig(this); + } + + /// Field number for the "node" field. + public const int NodeFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_node_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.CalculatorGraphConfig.Types.Node.Parser); + private readonly pbc::RepeatedField node_ = new pbc::RepeatedField(); + /// + /// The nodes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Node { + get { return node_; } + } + + /// Field number for the "packet_factory" field. + public const int PacketFactoryFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_packetFactory_codec + = pb::FieldCodec.ForMessage(50, global::Mediapipe.PacketFactoryConfig.Parser); + private readonly pbc::RepeatedField packetFactory_ = new pbc::RepeatedField(); + /// + /// Create a side packet using a PacketFactory. This side packet is + /// created as close to the worker that does the work as possible. A + /// PacketFactory is basically a PacketGenerator that takes no input side + /// packets and produces a single output side packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PacketFactory { + get { return packetFactory_; } + } + + /// Field number for the "packet_generator" field. + public const int PacketGeneratorFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_packetGenerator_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.PacketGeneratorConfig.Parser); + private readonly pbc::RepeatedField packetGenerator_ = new pbc::RepeatedField(); + /// + /// Configs for PacketGenerators. Generators take zero or more + /// input side packets and produce any number of output side + /// packets. For example, MediaDecoderCalculator takes an input + /// side packet with type DeletingFile. However, most users want + /// to specify videos by ContentIdHex (i.e. video id). By using + /// the VideoIdToLocalFileGenerator, a user can specify a video id + /// (as a string) and obtain a DeletingFile to use with the decoder. + /// PacketGenerators can take as a input side packet the output side + /// packet of another PacketGenerator. The graph of PacketGenerators + /// must be a directed acyclic graph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PacketGenerator { + get { return packetGenerator_; } + } + + /// Field number for the "num_threads" field. + public const int NumThreadsFieldNumber = 8; + private int numThreads_; + /// + /// Number of threads for running calculators in multithreaded mode. + /// If not specified, the scheduler will pick an appropriate number + /// of threads depending on the number of available processors. + /// To run on the calling thread, specify "ApplicationThreadExecutor" + /// see: http://g3doc/mediapipe/g3doc/running.md. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumThreads { + get { return numThreads_; } + set { + numThreads_ = value; + } + } + + /// Field number for the "status_handler" field. + public const int StatusHandlerFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_statusHandler_codec + = pb::FieldCodec.ForMessage(74, global::Mediapipe.StatusHandlerConfig.Parser); + private readonly pbc::RepeatedField statusHandler_ = new pbc::RepeatedField(); + /// + /// Configs for StatusHandlers that will be called after each call to + /// Run() on the graph. StatusHandlers take zero or more input side + /// packets and the absl::Status returned by a graph run. For example, + /// a StatusHandler could store information about graph failures and + /// their causes for later monitoring. Note that graph failures during + /// initialization may cause required input side packets (created by a + /// PacketFactory or PacketGenerator) to be missing. In these cases, + /// the handler with missing input side packets will be skipped. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField StatusHandler { + get { return statusHandler_; } + } + + /// Field number for the "input_stream" field. + public const int InputStreamFieldNumber = 10; + private static readonly pb::FieldCodec _repeated_inputStream_codec + = pb::FieldCodec.ForString(82); + private readonly pbc::RepeatedField inputStream_ = new pbc::RepeatedField(); + /// + /// Specify input streams to the entire graph. Streams specified here may have + /// packets added to them using CalculatorGraph::AddPacketToInputStream. This + /// works much like a source calculator, except that the source is outside of + /// the mediapipe graph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputStream { + get { return inputStream_; } + } + + /// Field number for the "output_stream" field. + public const int OutputStreamFieldNumber = 15; + private static readonly pb::FieldCodec _repeated_outputStream_codec + = pb::FieldCodec.ForString(122); + private readonly pbc::RepeatedField outputStream_ = new pbc::RepeatedField(); + /// + /// Output streams for the graph when used as a subgraph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputStream { + get { return outputStream_; } + } + + /// Field number for the "input_side_packet" field. + public const int InputSidePacketFieldNumber = 16; + private static readonly pb::FieldCodec _repeated_inputSidePacket_codec + = pb::FieldCodec.ForString(130); + private readonly pbc::RepeatedField inputSidePacket_ = new pbc::RepeatedField(); + /// + /// Input side packets for the graph when used as a subgraph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputSidePacket { + get { return inputSidePacket_; } + } + + /// Field number for the "output_side_packet" field. + public const int OutputSidePacketFieldNumber = 17; + private static readonly pb::FieldCodec _repeated_outputSidePacket_codec + = pb::FieldCodec.ForString(138); + private readonly pbc::RepeatedField outputSidePacket_ = new pbc::RepeatedField(); + /// + /// Output side packets for the graph when used as a subgraph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputSidePacket { + get { return outputSidePacket_; } + } + + /// Field number for the "max_queue_size" field. + public const int MaxQueueSizeFieldNumber = 11; + private int maxQueueSize_; + /// + /// Maximum queue size of any input stream in the graph. This can be used to + /// control the memory usage of a MediaPipe graph by preventing fast sources + /// from flooding the graph with packets. Any source that is connected to an + /// input stream that has hit its maximum capacity will not be scheduled until + /// the queue size falls under the specified limits, or if the scheduler queue + /// is empty and no other nodes are running (to prevent possible deadlocks due + /// to a incorrectly specified value). This global parameter is set to 100 + /// packets by default to enable pipelining. If any node indicates that it + /// buffers packets before emitting them, then the max(buffer_size_hint, + /// max_queue_size) is used. Set this parameter to -1 to disable throttling + /// (i.e. the graph will use as much memory as it requires). If not specified, + /// the limit is 100 packets. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxQueueSize { + get { return maxQueueSize_; } + set { + maxQueueSize_ = value; + } + } + + /// Field number for the "report_deadlock" field. + public const int ReportDeadlockFieldNumber = 21; + private bool reportDeadlock_; + /// + /// If true, the graph run fails with an error when throttling prevents all + /// calculators from running. If false, max_queue_size for an input stream + /// is adjusted when throttling prevents all calculators from running. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReportDeadlock { + get { return reportDeadlock_; } + set { + reportDeadlock_ = value; + } + } + + /// Field number for the "input_stream_handler" field. + public const int InputStreamHandlerFieldNumber = 12; + private global::Mediapipe.InputStreamHandlerConfig inputStreamHandler_; + /// + /// Config for this graph's InputStreamHandler. + /// If unspecified, the framework will automatically install the default + /// handler, which works as follows. + /// The calculator's Process() method is called for timestamp t when: + /// - at least one stream has a packet available at t; and, + /// - all other streams either have packets at t, or it is known that they will + /// not have packets at t (i.e. their next timestamp bound is greater than t). + /// The handler then provides all available packets with timestamp t, with no + /// preprocessing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InputStreamHandlerConfig InputStreamHandler { + get { return inputStreamHandler_; } + set { + inputStreamHandler_ = value; + } + } + + /// Field number for the "output_stream_handler" field. + public const int OutputStreamHandlerFieldNumber = 13; + private global::Mediapipe.OutputStreamHandlerConfig outputStreamHandler_; + /// + /// Config for this graph's OutputStreamHandler. + /// If unspecified, the default output stream handler will be automatically + /// installed by the framework which does not modify any outgoing packets. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.OutputStreamHandlerConfig OutputStreamHandler { + get { return outputStreamHandler_; } + set { + outputStreamHandler_ = value; + } + } + + /// Field number for the "executor" field. + public const int ExecutorFieldNumber = 14; + private static readonly pb::FieldCodec _repeated_executor_codec + = pb::FieldCodec.ForMessage(114, global::Mediapipe.ExecutorConfig.Parser); + private readonly pbc::RepeatedField executor_ = new pbc::RepeatedField(); + /// + /// Configs for Executors. + /// The names of the executors must be distinct. The default executor, whose + /// name is the empty string, is predefined. The num_threads field of the + /// CalculatorGraphConfig specifies the number of threads in the default + /// executor. If the config for the default executor is specified, the + /// CalculatorGraphConfig must not have the num_threads field. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Executor { + get { return executor_; } + } + + /// Field number for the "profiler_config" field. + public const int ProfilerConfigFieldNumber = 18; + private global::Mediapipe.ProfilerConfig profilerConfig_; + /// + /// The default profiler-config for all calculators. If set, this defines the + /// profiling settings such as num_histogram_intervals for every calculator in + /// the graph. Each of these settings can be overridden by the + /// |profiler_config| specified for a node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ProfilerConfig ProfilerConfig { + get { return profilerConfig_; } + set { + profilerConfig_ = value; + } + } + + /// Field number for the "package" field. + public const int PackageFieldNumber = 19; + private string package_ = ""; + /// + /// The namespace used for class name lookup within this graph. + /// An unqualified or partially qualified class name is looked up in + /// this namespace first and then in enclosing namespaces. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Package { + get { return package_; } + set { + package_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 20; + private string type_ = ""; + /// + /// The type name for the graph config, used for registering and referencing + /// the graph config. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Type { + get { return type_; } + set { + type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 1001; + private global::Mediapipe.MediaPipeOptions options_; + /// + /// The types and default values for graph options, in proto2 syntax. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MediaPipeOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + /// Field number for the "graph_options" field. + public const int GraphOptionsFieldNumber = 1002; + private static readonly pb::FieldCodec _repeated_graphOptions_codec + = pb::FieldCodec.ForMessage(8018, global::Google.Protobuf.WellKnownTypes.Any.Parser); + private readonly pbc::RepeatedField graphOptions_ = new pbc::RepeatedField(); + /// + /// The types and default values for graph options, in proto3 syntax. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GraphOptions { + get { return graphOptions_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CalculatorGraphConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CalculatorGraphConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!node_.Equals(other.node_)) return false; + if(!packetFactory_.Equals(other.packetFactory_)) return false; + if(!packetGenerator_.Equals(other.packetGenerator_)) return false; + if (NumThreads != other.NumThreads) return false; + if(!statusHandler_.Equals(other.statusHandler_)) return false; + if(!inputStream_.Equals(other.inputStream_)) return false; + if(!outputStream_.Equals(other.outputStream_)) return false; + if(!inputSidePacket_.Equals(other.inputSidePacket_)) return false; + if(!outputSidePacket_.Equals(other.outputSidePacket_)) return false; + if (MaxQueueSize != other.MaxQueueSize) return false; + if (ReportDeadlock != other.ReportDeadlock) return false; + if (!object.Equals(InputStreamHandler, other.InputStreamHandler)) return false; + if (!object.Equals(OutputStreamHandler, other.OutputStreamHandler)) return false; + if(!executor_.Equals(other.executor_)) return false; + if (!object.Equals(ProfilerConfig, other.ProfilerConfig)) return false; + if (Package != other.Package) return false; + if (Type != other.Type) return false; + if (!object.Equals(Options, other.Options)) return false; + if(!graphOptions_.Equals(other.graphOptions_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= node_.GetHashCode(); + hash ^= packetFactory_.GetHashCode(); + hash ^= packetGenerator_.GetHashCode(); + if (NumThreads != 0) hash ^= NumThreads.GetHashCode(); + hash ^= statusHandler_.GetHashCode(); + hash ^= inputStream_.GetHashCode(); + hash ^= outputStream_.GetHashCode(); + hash ^= inputSidePacket_.GetHashCode(); + hash ^= outputSidePacket_.GetHashCode(); + if (MaxQueueSize != 0) hash ^= MaxQueueSize.GetHashCode(); + if (ReportDeadlock != false) hash ^= ReportDeadlock.GetHashCode(); + if (inputStreamHandler_ != null) hash ^= InputStreamHandler.GetHashCode(); + if (outputStreamHandler_ != null) hash ^= OutputStreamHandler.GetHashCode(); + hash ^= executor_.GetHashCode(); + if (profilerConfig_ != null) hash ^= ProfilerConfig.GetHashCode(); + if (Package.Length != 0) hash ^= Package.GetHashCode(); + if (Type.Length != 0) hash ^= Type.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + hash ^= graphOptions_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + node_.WriteTo(output, _repeated_node_codec); + packetFactory_.WriteTo(output, _repeated_packetFactory_codec); + packetGenerator_.WriteTo(output, _repeated_packetGenerator_codec); + if (NumThreads != 0) { + output.WriteRawTag(64); + output.WriteInt32(NumThreads); + } + statusHandler_.WriteTo(output, _repeated_statusHandler_codec); + inputStream_.WriteTo(output, _repeated_inputStream_codec); + if (MaxQueueSize != 0) { + output.WriteRawTag(88); + output.WriteInt32(MaxQueueSize); + } + if (inputStreamHandler_ != null) { + output.WriteRawTag(98); + output.WriteMessage(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + output.WriteRawTag(106); + output.WriteMessage(OutputStreamHandler); + } + executor_.WriteTo(output, _repeated_executor_codec); + outputStream_.WriteTo(output, _repeated_outputStream_codec); + inputSidePacket_.WriteTo(output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(output, _repeated_outputSidePacket_codec); + if (profilerConfig_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(ProfilerConfig); + } + if (Package.Length != 0) { + output.WriteRawTag(154, 1); + output.WriteString(Package); + } + if (Type.Length != 0) { + output.WriteRawTag(162, 1); + output.WriteString(Type); + } + if (ReportDeadlock != false) { + output.WriteRawTag(168, 1); + output.WriteBool(ReportDeadlock); + } + if (options_ != null) { + output.WriteRawTag(202, 62); + output.WriteMessage(Options); + } + graphOptions_.WriteTo(output, _repeated_graphOptions_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + node_.WriteTo(ref output, _repeated_node_codec); + packetFactory_.WriteTo(ref output, _repeated_packetFactory_codec); + packetGenerator_.WriteTo(ref output, _repeated_packetGenerator_codec); + if (NumThreads != 0) { + output.WriteRawTag(64); + output.WriteInt32(NumThreads); + } + statusHandler_.WriteTo(ref output, _repeated_statusHandler_codec); + inputStream_.WriteTo(ref output, _repeated_inputStream_codec); + if (MaxQueueSize != 0) { + output.WriteRawTag(88); + output.WriteInt32(MaxQueueSize); + } + if (inputStreamHandler_ != null) { + output.WriteRawTag(98); + output.WriteMessage(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + output.WriteRawTag(106); + output.WriteMessage(OutputStreamHandler); + } + executor_.WriteTo(ref output, _repeated_executor_codec); + outputStream_.WriteTo(ref output, _repeated_outputStream_codec); + inputSidePacket_.WriteTo(ref output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(ref output, _repeated_outputSidePacket_codec); + if (profilerConfig_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(ProfilerConfig); + } + if (Package.Length != 0) { + output.WriteRawTag(154, 1); + output.WriteString(Package); + } + if (Type.Length != 0) { + output.WriteRawTag(162, 1); + output.WriteString(Type); + } + if (ReportDeadlock != false) { + output.WriteRawTag(168, 1); + output.WriteBool(ReportDeadlock); + } + if (options_ != null) { + output.WriteRawTag(202, 62); + output.WriteMessage(Options); + } + graphOptions_.WriteTo(ref output, _repeated_graphOptions_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += node_.CalculateSize(_repeated_node_codec); + size += packetFactory_.CalculateSize(_repeated_packetFactory_codec); + size += packetGenerator_.CalculateSize(_repeated_packetGenerator_codec); + if (NumThreads != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumThreads); + } + size += statusHandler_.CalculateSize(_repeated_statusHandler_codec); + size += inputStream_.CalculateSize(_repeated_inputStream_codec); + size += outputStream_.CalculateSize(_repeated_outputStream_codec); + size += inputSidePacket_.CalculateSize(_repeated_inputSidePacket_codec); + size += outputSidePacket_.CalculateSize(_repeated_outputSidePacket_codec); + if (MaxQueueSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxQueueSize); + } + if (ReportDeadlock != false) { + size += 2 + 1; + } + if (inputStreamHandler_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputStreamHandler); + } + size += executor_.CalculateSize(_repeated_executor_codec); + if (profilerConfig_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(ProfilerConfig); + } + if (Package.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Package); + } + if (Type.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Type); + } + if (options_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + size += graphOptions_.CalculateSize(_repeated_graphOptions_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CalculatorGraphConfig other) { + if (other == null) { + return; + } + node_.Add(other.node_); + packetFactory_.Add(other.packetFactory_); + packetGenerator_.Add(other.packetGenerator_); + if (other.NumThreads != 0) { + NumThreads = other.NumThreads; + } + statusHandler_.Add(other.statusHandler_); + inputStream_.Add(other.inputStream_); + outputStream_.Add(other.outputStream_); + inputSidePacket_.Add(other.inputSidePacket_); + outputSidePacket_.Add(other.outputSidePacket_); + if (other.MaxQueueSize != 0) { + MaxQueueSize = other.MaxQueueSize; + } + if (other.ReportDeadlock != false) { + ReportDeadlock = other.ReportDeadlock; + } + if (other.inputStreamHandler_ != null) { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + InputStreamHandler.MergeFrom(other.InputStreamHandler); + } + if (other.outputStreamHandler_ != null) { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + OutputStreamHandler.MergeFrom(other.OutputStreamHandler); + } + executor_.Add(other.executor_); + if (other.profilerConfig_ != null) { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + ProfilerConfig.MergeFrom(other.ProfilerConfig); + } + if (other.Package.Length != 0) { + Package = other.Package; + } + if (other.Type.Length != 0) { + Type = other.Type; + } + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + Options.MergeFrom(other.Options); + } + graphOptions_.Add(other.graphOptions_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + node_.AddEntriesFrom(input, _repeated_node_codec); + break; + } + case 50: { + packetFactory_.AddEntriesFrom(input, _repeated_packetFactory_codec); + break; + } + case 58: { + packetGenerator_.AddEntriesFrom(input, _repeated_packetGenerator_codec); + break; + } + case 64: { + NumThreads = input.ReadInt32(); + break; + } + case 74: { + statusHandler_.AddEntriesFrom(input, _repeated_statusHandler_codec); + break; + } + case 82: { + inputStream_.AddEntriesFrom(input, _repeated_inputStream_codec); + break; + } + case 88: { + MaxQueueSize = input.ReadInt32(); + break; + } + case 98: { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + input.ReadMessage(InputStreamHandler); + break; + } + case 106: { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + input.ReadMessage(OutputStreamHandler); + break; + } + case 114: { + executor_.AddEntriesFrom(input, _repeated_executor_codec); + break; + } + case 122: { + outputStream_.AddEntriesFrom(input, _repeated_outputStream_codec); + break; + } + case 130: { + inputSidePacket_.AddEntriesFrom(input, _repeated_inputSidePacket_codec); + break; + } + case 138: { + outputSidePacket_.AddEntriesFrom(input, _repeated_outputSidePacket_codec); + break; + } + case 146: { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + input.ReadMessage(ProfilerConfig); + break; + } + case 154: { + Package = input.ReadString(); + break; + } + case 162: { + Type = input.ReadString(); + break; + } + case 168: { + ReportDeadlock = input.ReadBool(); + break; + } + case 8010: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + graphOptions_.AddEntriesFrom(input, _repeated_graphOptions_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + node_.AddEntriesFrom(ref input, _repeated_node_codec); + break; + } + case 50: { + packetFactory_.AddEntriesFrom(ref input, _repeated_packetFactory_codec); + break; + } + case 58: { + packetGenerator_.AddEntriesFrom(ref input, _repeated_packetGenerator_codec); + break; + } + case 64: { + NumThreads = input.ReadInt32(); + break; + } + case 74: { + statusHandler_.AddEntriesFrom(ref input, _repeated_statusHandler_codec); + break; + } + case 82: { + inputStream_.AddEntriesFrom(ref input, _repeated_inputStream_codec); + break; + } + case 88: { + MaxQueueSize = input.ReadInt32(); + break; + } + case 98: { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + input.ReadMessage(InputStreamHandler); + break; + } + case 106: { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + input.ReadMessage(OutputStreamHandler); + break; + } + case 114: { + executor_.AddEntriesFrom(ref input, _repeated_executor_codec); + break; + } + case 122: { + outputStream_.AddEntriesFrom(ref input, _repeated_outputStream_codec); + break; + } + case 130: { + inputSidePacket_.AddEntriesFrom(ref input, _repeated_inputSidePacket_codec); + break; + } + case 138: { + outputSidePacket_.AddEntriesFrom(ref input, _repeated_outputSidePacket_codec); + break; + } + case 146: { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + input.ReadMessage(ProfilerConfig); + break; + } + case 154: { + Package = input.ReadString(); + break; + } + case 162: { + Type = input.ReadString(); + break; + } + case 168: { + ReportDeadlock = input.ReadBool(); + break; + } + case 8010: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + graphOptions_.AddEntriesFrom(ref input, _repeated_graphOptions_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the CalculatorGraphConfig message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// A single node in the DAG. + /// + public sealed partial class Node : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Node()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorGraphConfig.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Node() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Node(Node other) : this() { + name_ = other.name_; + calculator_ = other.calculator_; + inputStream_ = other.inputStream_.Clone(); + outputStream_ = other.outputStream_.Clone(); + inputSidePacket_ = other.inputSidePacket_.Clone(); + outputSidePacket_ = other.outputSidePacket_.Clone(); + options_ = other.options_ != null ? other.options_.Clone() : null; + nodeOptions_ = other.nodeOptions_.Clone(); + sourceLayer_ = other.sourceLayer_; + bufferSizeHint_ = other.bufferSizeHint_; + inputStreamHandler_ = other.inputStreamHandler_ != null ? other.inputStreamHandler_.Clone() : null; + outputStreamHandler_ = other.outputStreamHandler_ != null ? other.outputStreamHandler_.Clone() : null; + inputStreamInfo_ = other.inputStreamInfo_.Clone(); + executor_ = other.executor_; + profilerConfig_ = other.profilerConfig_ != null ? other.profilerConfig_.Clone() : null; + maxInFlight_ = other.maxInFlight_; + optionValue_ = other.optionValue_.Clone(); + externalInput_ = other.externalInput_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Node Clone() { + return new Node(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the node. This field is optional and doesn't generally + /// need to be specified, but does improve error messaging. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "calculator" field. + public const int CalculatorFieldNumber = 2; + private string calculator_ = ""; + /// + /// The registered type of a calculator (provided via REGISTER_CALCULATOR), + /// or of a subgraph (via REGISTER_MEDIAPIPE_GRAPH). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Calculator { + get { return calculator_; } + set { + calculator_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "input_stream" field. + public const int InputStreamFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_inputStream_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField inputStream_ = new pbc::RepeatedField(); + /// + /// String(s) representing "TAG:name" of the stream(s) from which the current + /// node will get its inputs. "TAG:" part is optional, see above. + /// A calculator with no input stream is a source. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputStream { + get { return inputStream_; } + } + + /// Field number for the "output_stream" field. + public const int OutputStreamFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_outputStream_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField outputStream_ = new pbc::RepeatedField(); + /// + /// String(s) representing "TAG:name" of the stream(s) produced by this node. + /// "TAG:" part is optional, see above. These must be different from any + /// other output_streams specified for other nodes in the graph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputStream { + get { return outputStream_; } + } + + /// Field number for the "input_side_packet" field. + public const int InputSidePacketFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_inputSidePacket_codec + = pb::FieldCodec.ForString(42); + private readonly pbc::RepeatedField inputSidePacket_ = new pbc::RepeatedField(); + /// + /// String(s) representing "TAG:name" of the input side packet(s). + /// "TAG:" part is optional, see above. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputSidePacket { + get { return inputSidePacket_; } + } + + /// Field number for the "output_side_packet" field. + public const int OutputSidePacketFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_outputSidePacket_codec + = pb::FieldCodec.ForString(50); + private readonly pbc::RepeatedField outputSidePacket_ = new pbc::RepeatedField(); + /// + /// String(s) representing "TAG:name" of the output side packet(s). Only + /// used by subgraphs. + /// "TAG:" part is optional, see above. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputSidePacket { + get { return outputSidePacket_; } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 7; + private global::Mediapipe.CalculatorOptions options_; + /// + /// The options passed to the Calculator, in proto2 syntax. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CalculatorOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + /// Field number for the "node_options" field. + public const int NodeOptionsFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_nodeOptions_codec + = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Any.Parser); + private readonly pbc::RepeatedField nodeOptions_ = new pbc::RepeatedField(); + /// + /// The options passed to the Calculator, in proto3 syntax. + /// Each node_options message must have a different message type. + /// If the same message type is specified in |options| and |node_options|, + /// only the message in |options| is used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField NodeOptions { + get { return nodeOptions_; } + } + + /// Field number for the "source_layer" field. + public const int SourceLayerFieldNumber = 9; + private int sourceLayer_; + /// + /// For a Source Calculator (i.e. a calculator with no inputs), + /// this is the "layer" on which the calculator is executed. For a + /// non-source calculator (i.e. a calculator with one or more input + /// streams) this field has no effect. The sources on each layer + /// are completely exhausted before Process() is called on any source + /// calculator on a higher numbered layer. + /// Example: + /// Decoder -> Median Frame (requires all frames) -> Image Subtraction + /// ---------------------------------------> + /// The entire video will be buffered on the edge from the decoder + /// to the Image subtraction. To fix this problem, layers can be used. + /// Decoder (layer 0) -> Median Frame -> Image Subtraction + /// Decoder (layer 1) -----------------> + /// The frames from layer 0 will no longer be buffered, but the video + /// will be decoded again instead. Note, that different options can + /// be used in the second decoder. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SourceLayer { + get { return sourceLayer_; } + set { + sourceLayer_ = value; + } + } + + /// Field number for the "buffer_size_hint" field. + public const int BufferSizeHintFieldNumber = 10; + private int bufferSizeHint_; + /// + /// Optional parameter that allows the user to indicate to the scheduler that + /// this node has a buffering behavior (i.e. waits for a bunch of packets + /// before emitting any) and specify the size of the buffer that is built up. + /// The scheduler will then try to keep the maximum size of any input queues + /// in the graph to remain below the maximum of all buffer_size_hints and + /// max_queue_size (if specified). The ideal value is typically something + /// larger than the actual number of buffered packets to maintain pipelining. + /// The default value 0 indicates that the node has no buffering behavior. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BufferSizeHint { + get { return bufferSizeHint_; } + set { + bufferSizeHint_ = value; + } + } + + /// Field number for the "input_stream_handler" field. + public const int InputStreamHandlerFieldNumber = 11; + private global::Mediapipe.InputStreamHandlerConfig inputStreamHandler_; + /// + /// Config for this node's InputStreamHandler. + /// If unspecified, the graph-level input stream handler will be used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InputStreamHandlerConfig InputStreamHandler { + get { return inputStreamHandler_; } + set { + inputStreamHandler_ = value; + } + } + + /// Field number for the "output_stream_handler" field. + public const int OutputStreamHandlerFieldNumber = 12; + private global::Mediapipe.OutputStreamHandlerConfig outputStreamHandler_; + /// + /// Config for this node's OutputStreamHandler. + /// If unspecified, the graph-level output stream handler will be used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.OutputStreamHandlerConfig OutputStreamHandler { + get { return outputStreamHandler_; } + set { + outputStreamHandler_ = value; + } + } + + /// Field number for the "input_stream_info" field. + public const int InputStreamInfoFieldNumber = 13; + private static readonly pb::FieldCodec _repeated_inputStreamInfo_codec + = pb::FieldCodec.ForMessage(106, global::Mediapipe.InputStreamInfo.Parser); + private readonly pbc::RepeatedField inputStreamInfo_ = new pbc::RepeatedField(); + /// + /// Additional information about an input stream. The |name| field of the + /// InputStreamInfo must match an input_stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputStreamInfo { + get { return inputStreamInfo_; } + } + + /// Field number for the "executor" field. + public const int ExecutorFieldNumber = 14; + private string executor_ = ""; + /// + /// Set the executor which the calculator will execute on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Executor { + get { return executor_; } + set { + executor_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "profiler_config" field. + public const int ProfilerConfigFieldNumber = 15; + private global::Mediapipe.ProfilerConfig profilerConfig_; + /// + /// TODO: Remove from Node when switched to Profiler. + /// DEPRECATED: Configs for the profiler. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ProfilerConfig ProfilerConfig { + get { return profilerConfig_; } + set { + profilerConfig_ = value; + } + } + + /// Field number for the "max_in_flight" field. + public const int MaxInFlightFieldNumber = 16; + private int maxInFlight_; + /// + /// The maximum number of invocations that can be executed in parallel. + /// If not specified, the limit is one invocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxInFlight { + get { return maxInFlight_; } + set { + maxInFlight_ = value; + } + } + + /// Field number for the "option_value" field. + public const int OptionValueFieldNumber = 17; + private static readonly pb::FieldCodec _repeated_optionValue_codec + = pb::FieldCodec.ForString(138); + private readonly pbc::RepeatedField optionValue_ = new pbc::RepeatedField(); + /// + /// Defines an option value for this Node from graph options or packets. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OptionValue { + get { return optionValue_; } + } + + /// Field number for the "external_input" field. + public const int ExternalInputFieldNumber = 1005; + private static readonly pb::FieldCodec _repeated_externalInput_codec + = pb::FieldCodec.ForString(8042); + private readonly pbc::RepeatedField externalInput_ = new pbc::RepeatedField(); + /// + /// DEPRECATED: For backwards compatibility we allow users to + /// specify the old name for "input_side_packet" in proto configs. + /// These are automatically converted to input_side_packets during + /// config canonicalization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExternalInput { + get { return externalInput_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Node); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Node other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Calculator != other.Calculator) return false; + if(!inputStream_.Equals(other.inputStream_)) return false; + if(!outputStream_.Equals(other.outputStream_)) return false; + if(!inputSidePacket_.Equals(other.inputSidePacket_)) return false; + if(!outputSidePacket_.Equals(other.outputSidePacket_)) return false; + if (!object.Equals(Options, other.Options)) return false; + if(!nodeOptions_.Equals(other.nodeOptions_)) return false; + if (SourceLayer != other.SourceLayer) return false; + if (BufferSizeHint != other.BufferSizeHint) return false; + if (!object.Equals(InputStreamHandler, other.InputStreamHandler)) return false; + if (!object.Equals(OutputStreamHandler, other.OutputStreamHandler)) return false; + if(!inputStreamInfo_.Equals(other.inputStreamInfo_)) return false; + if (Executor != other.Executor) return false; + if (!object.Equals(ProfilerConfig, other.ProfilerConfig)) return false; + if (MaxInFlight != other.MaxInFlight) return false; + if(!optionValue_.Equals(other.optionValue_)) return false; + if(!externalInput_.Equals(other.externalInput_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Calculator.Length != 0) hash ^= Calculator.GetHashCode(); + hash ^= inputStream_.GetHashCode(); + hash ^= outputStream_.GetHashCode(); + hash ^= inputSidePacket_.GetHashCode(); + hash ^= outputSidePacket_.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + hash ^= nodeOptions_.GetHashCode(); + if (SourceLayer != 0) hash ^= SourceLayer.GetHashCode(); + if (BufferSizeHint != 0) hash ^= BufferSizeHint.GetHashCode(); + if (inputStreamHandler_ != null) hash ^= InputStreamHandler.GetHashCode(); + if (outputStreamHandler_ != null) hash ^= OutputStreamHandler.GetHashCode(); + hash ^= inputStreamInfo_.GetHashCode(); + if (Executor.Length != 0) hash ^= Executor.GetHashCode(); + if (profilerConfig_ != null) hash ^= ProfilerConfig.GetHashCode(); + if (MaxInFlight != 0) hash ^= MaxInFlight.GetHashCode(); + hash ^= optionValue_.GetHashCode(); + hash ^= externalInput_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Calculator.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Calculator); + } + inputStream_.WriteTo(output, _repeated_inputStream_codec); + outputStream_.WriteTo(output, _repeated_outputStream_codec); + inputSidePacket_.WriteTo(output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(output, _repeated_outputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Options); + } + nodeOptions_.WriteTo(output, _repeated_nodeOptions_codec); + if (SourceLayer != 0) { + output.WriteRawTag(72); + output.WriteInt32(SourceLayer); + } + if (BufferSizeHint != 0) { + output.WriteRawTag(80); + output.WriteInt32(BufferSizeHint); + } + if (inputStreamHandler_ != null) { + output.WriteRawTag(90); + output.WriteMessage(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + output.WriteRawTag(98); + output.WriteMessage(OutputStreamHandler); + } + inputStreamInfo_.WriteTo(output, _repeated_inputStreamInfo_codec); + if (Executor.Length != 0) { + output.WriteRawTag(114); + output.WriteString(Executor); + } + if (profilerConfig_ != null) { + output.WriteRawTag(122); + output.WriteMessage(ProfilerConfig); + } + if (MaxInFlight != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(MaxInFlight); + } + optionValue_.WriteTo(output, _repeated_optionValue_codec); + externalInput_.WriteTo(output, _repeated_externalInput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Calculator.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Calculator); + } + inputStream_.WriteTo(ref output, _repeated_inputStream_codec); + outputStream_.WriteTo(ref output, _repeated_outputStream_codec); + inputSidePacket_.WriteTo(ref output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(ref output, _repeated_outputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Options); + } + nodeOptions_.WriteTo(ref output, _repeated_nodeOptions_codec); + if (SourceLayer != 0) { + output.WriteRawTag(72); + output.WriteInt32(SourceLayer); + } + if (BufferSizeHint != 0) { + output.WriteRawTag(80); + output.WriteInt32(BufferSizeHint); + } + if (inputStreamHandler_ != null) { + output.WriteRawTag(90); + output.WriteMessage(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + output.WriteRawTag(98); + output.WriteMessage(OutputStreamHandler); + } + inputStreamInfo_.WriteTo(ref output, _repeated_inputStreamInfo_codec); + if (Executor.Length != 0) { + output.WriteRawTag(114); + output.WriteString(Executor); + } + if (profilerConfig_ != null) { + output.WriteRawTag(122); + output.WriteMessage(ProfilerConfig); + } + if (MaxInFlight != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(MaxInFlight); + } + optionValue_.WriteTo(ref output, _repeated_optionValue_codec); + externalInput_.WriteTo(ref output, _repeated_externalInput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Calculator.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Calculator); + } + size += inputStream_.CalculateSize(_repeated_inputStream_codec); + size += outputStream_.CalculateSize(_repeated_outputStream_codec); + size += inputSidePacket_.CalculateSize(_repeated_inputSidePacket_codec); + size += outputSidePacket_.CalculateSize(_repeated_outputSidePacket_codec); + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + size += nodeOptions_.CalculateSize(_repeated_nodeOptions_codec); + if (SourceLayer != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SourceLayer); + } + if (BufferSizeHint != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BufferSizeHint); + } + if (inputStreamHandler_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(InputStreamHandler); + } + if (outputStreamHandler_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutputStreamHandler); + } + size += inputStreamInfo_.CalculateSize(_repeated_inputStreamInfo_codec); + if (Executor.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Executor); + } + if (profilerConfig_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProfilerConfig); + } + if (MaxInFlight != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxInFlight); + } + size += optionValue_.CalculateSize(_repeated_optionValue_codec); + size += externalInput_.CalculateSize(_repeated_externalInput_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Node other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Calculator.Length != 0) { + Calculator = other.Calculator; + } + inputStream_.Add(other.inputStream_); + outputStream_.Add(other.outputStream_); + inputSidePacket_.Add(other.inputSidePacket_); + outputSidePacket_.Add(other.outputSidePacket_); + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.CalculatorOptions(); + } + Options.MergeFrom(other.Options); + } + nodeOptions_.Add(other.nodeOptions_); + if (other.SourceLayer != 0) { + SourceLayer = other.SourceLayer; + } + if (other.BufferSizeHint != 0) { + BufferSizeHint = other.BufferSizeHint; + } + if (other.inputStreamHandler_ != null) { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + InputStreamHandler.MergeFrom(other.InputStreamHandler); + } + if (other.outputStreamHandler_ != null) { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + OutputStreamHandler.MergeFrom(other.OutputStreamHandler); + } + inputStreamInfo_.Add(other.inputStreamInfo_); + if (other.Executor.Length != 0) { + Executor = other.Executor; + } + if (other.profilerConfig_ != null) { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + ProfilerConfig.MergeFrom(other.ProfilerConfig); + } + if (other.MaxInFlight != 0) { + MaxInFlight = other.MaxInFlight; + } + optionValue_.Add(other.optionValue_); + externalInput_.Add(other.externalInput_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Calculator = input.ReadString(); + break; + } + case 26: { + inputStream_.AddEntriesFrom(input, _repeated_inputStream_codec); + break; + } + case 34: { + outputStream_.AddEntriesFrom(input, _repeated_outputStream_codec); + break; + } + case 42: { + inputSidePacket_.AddEntriesFrom(input, _repeated_inputSidePacket_codec); + break; + } + case 50: { + outputSidePacket_.AddEntriesFrom(input, _repeated_outputSidePacket_codec); + break; + } + case 58: { + if (options_ == null) { + Options = new global::Mediapipe.CalculatorOptions(); + } + input.ReadMessage(Options); + break; + } + case 66: { + nodeOptions_.AddEntriesFrom(input, _repeated_nodeOptions_codec); + break; + } + case 72: { + SourceLayer = input.ReadInt32(); + break; + } + case 80: { + BufferSizeHint = input.ReadInt32(); + break; + } + case 90: { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + input.ReadMessage(InputStreamHandler); + break; + } + case 98: { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + input.ReadMessage(OutputStreamHandler); + break; + } + case 106: { + inputStreamInfo_.AddEntriesFrom(input, _repeated_inputStreamInfo_codec); + break; + } + case 114: { + Executor = input.ReadString(); + break; + } + case 122: { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + input.ReadMessage(ProfilerConfig); + break; + } + case 128: { + MaxInFlight = input.ReadInt32(); + break; + } + case 138: { + optionValue_.AddEntriesFrom(input, _repeated_optionValue_codec); + break; + } + case 8042: { + externalInput_.AddEntriesFrom(input, _repeated_externalInput_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Calculator = input.ReadString(); + break; + } + case 26: { + inputStream_.AddEntriesFrom(ref input, _repeated_inputStream_codec); + break; + } + case 34: { + outputStream_.AddEntriesFrom(ref input, _repeated_outputStream_codec); + break; + } + case 42: { + inputSidePacket_.AddEntriesFrom(ref input, _repeated_inputSidePacket_codec); + break; + } + case 50: { + outputSidePacket_.AddEntriesFrom(ref input, _repeated_outputSidePacket_codec); + break; + } + case 58: { + if (options_ == null) { + Options = new global::Mediapipe.CalculatorOptions(); + } + input.ReadMessage(Options); + break; + } + case 66: { + nodeOptions_.AddEntriesFrom(ref input, _repeated_nodeOptions_codec); + break; + } + case 72: { + SourceLayer = input.ReadInt32(); + break; + } + case 80: { + BufferSizeHint = input.ReadInt32(); + break; + } + case 90: { + if (inputStreamHandler_ == null) { + InputStreamHandler = new global::Mediapipe.InputStreamHandlerConfig(); + } + input.ReadMessage(InputStreamHandler); + break; + } + case 98: { + if (outputStreamHandler_ == null) { + OutputStreamHandler = new global::Mediapipe.OutputStreamHandlerConfig(); + } + input.ReadMessage(OutputStreamHandler); + break; + } + case 106: { + inputStreamInfo_.AddEntriesFrom(ref input, _repeated_inputStreamInfo_codec); + break; + } + case 114: { + Executor = input.ReadString(); + break; + } + case 122: { + if (profilerConfig_ == null) { + ProfilerConfig = new global::Mediapipe.ProfilerConfig(); + } + input.ReadMessage(ProfilerConfig); + break; + } + case 128: { + MaxInFlight = input.ReadInt32(); + break; + } + case 138: { + optionValue_.AddEntriesFrom(ref input, _repeated_optionValue_codec); + break; + } + case 8042: { + externalInput_.AddEntriesFrom(ref input, _repeated_externalInput_codec); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs.meta new file mode 100644 index 0000000..66eb947 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Calculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb6752375d46fcfab80ce60282bace77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs new file mode 100644 index 0000000..2a0f2a0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs @@ -0,0 +1,316 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/calculator_options.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/calculator_options.proto + public static partial class CalculatorOptionsReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/calculator_options.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CalculatorOptionsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CixtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3Jfb3B0aW9ucy5wcm90", + "bxIJbWVkaWFwaXBlIjkKEUNhbGN1bGF0b3JPcHRpb25zEhgKDG1lcmdlX2Zp", + "ZWxkcxgBIAEoCEICGAEqCgignAEQgICAgAJCNAoaY29tLmdvb2dsZS5tZWRp", + "YXBpcGUucHJvdG9CFkNhbGN1bGF0b3JPcHRpb25zUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CalculatorOptions), global::Mediapipe.CalculatorOptions.Parser, new[]{ "MergeFields" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options for Calculators. Each Calculator implementation should + /// have its own options proto, which should look like this: + /// + /// message MyCalculatorOptions { + /// extend CalculatorOptions { + /// optional MyCalculatorOptions ext = <unique id, e.g. the CL#>; + /// } + /// optional string field_needed_by_my_calculator = 1; + /// optional int32 another_field = 2; + /// // etc + /// } + /// + public sealed partial class CalculatorOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorOptionsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorOptions(CalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + mergeFields_ = other.mergeFields_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorOptions Clone() { + return new CalculatorOptions(this); + } + + /// Field number for the "merge_fields" field. + public const int MergeFieldsFieldNumber = 1; + private readonly static bool MergeFieldsDefaultValue = false; + + private bool mergeFields_; + /// + /// If true, this proto specifies a subset of field values, + /// which should override corresponding field values. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool MergeFields { + get { if ((_hasBits0 & 1) != 0) { return mergeFields_; } else { return MergeFieldsDefaultValue; } } + set { + _hasBits0 |= 1; + mergeFields_ = value; + } + } + /// Gets whether the "merge_fields" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMergeFields { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "merge_fields" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMergeFields() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MergeFields != other.MergeFields) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMergeFields) hash ^= MergeFields.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMergeFields) { + output.WriteRawTag(8); + output.WriteBool(MergeFields); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMergeFields) { + output.WriteRawTag(8); + output.WriteBool(MergeFields); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMergeFields) { + size += 1 + 1; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMergeFields) { + MergeFields = other.MergeFields; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + MergeFields = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + MergeFields = input.ReadBool(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs.meta new file mode 100644 index 0000000..3eb338f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cb942f2d3bb91bfd86552daa2d128fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs new file mode 100644 index 0000000..e18746b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs @@ -0,0 +1,2955 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/calculator_profile.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/calculator_profile.proto + public static partial class CalculatorProfileReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/calculator_profile.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CalculatorProfileReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CixtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3JfcHJvZmlsZS5wcm90", + "bxIJbWVkaWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3Iu", + "cHJvdG8ibwoNVGltZUhpc3RvZ3JhbRIQCgV0b3RhbBgBIAEoAzoBMBIjChJp", + "bnRlcnZhbF9zaXplX3VzZWMYAiABKAM6BzEwMDAwMDASGAoNbnVtX2ludGVy", + "dmFscxgDIAEoAzoBMRINCgVjb3VudBgEIAMoAyJiCg1TdHJlYW1Qcm9maWxl", + "EgwKBG5hbWUYASABKAkSGAoJYmFja19lZGdlGAIgASgIOgVmYWxzZRIpCgds", + "YXRlbmN5GAMgASgLMhgubWVkaWFwaXBlLlRpbWVIaXN0b2dyYW0iswIKEUNh", + "bGN1bGF0b3JQcm9maWxlEgwKBG5hbWUYASABKAkSFwoMb3Blbl9ydW50aW1l", + "GAIgASgDOgEwEhgKDWNsb3NlX3J1bnRpbWUYAyABKAM6ATASMQoPcHJvY2Vz", + "c19ydW50aW1lGAQgASgLMhgubWVkaWFwaXBlLlRpbWVIaXN0b2dyYW0SNwoV", + "cHJvY2Vzc19pbnB1dF9sYXRlbmN5GAUgASgLMhgubWVkaWFwaXBlLlRpbWVI", + "aXN0b2dyYW0SOAoWcHJvY2Vzc19vdXRwdXRfbGF0ZW5jeRgGIAEoCzIYLm1l", + "ZGlhcGlwZS5UaW1lSGlzdG9ncmFtEjcKFWlucHV0X3N0cmVhbV9wcm9maWxl", + "cxgHIAMoCzIYLm1lZGlhcGlwZS5TdHJlYW1Qcm9maWxlIqgHCgpHcmFwaFRy", + "YWNlEhEKCWJhc2VfdGltZRgBIAEoAxIWCg5iYXNlX3RpbWVzdGFtcBgCIAEo", + "AxIXCg9jYWxjdWxhdG9yX25hbWUYAyADKAkSEwoLc3RyZWFtX25hbWUYBCAD", + "KAkSPwoQY2FsY3VsYXRvcl90cmFjZRgFIAMoCzIlLm1lZGlhcGlwZS5HcmFw", + "aFRyYWNlLkNhbGN1bGF0b3JUcmFjZRqOAQoLU3RyZWFtVHJhY2USEgoKc3Rh", + "cnRfdGltZRgBIAEoAxITCgtmaW5pc2hfdGltZRgCIAEoAxIYChBwYWNrZXRf", + "dGltZXN0YW1wGAMgASgDEhEKCXN0cmVhbV9pZBgEIAEoBRIVCglwYWNrZXRf", + "aWQYBSABKANCAhgBEhIKCmV2ZW50X2RhdGEYBiABKAManQIKD0NhbGN1bGF0", + "b3JUcmFjZRIPCgdub2RlX2lkGAEgASgFEhcKD2lucHV0X3RpbWVzdGFtcBgC", + "IAEoAxIzCgpldmVudF90eXBlGAMgASgOMh8ubWVkaWFwaXBlLkdyYXBoVHJh", + "Y2UuRXZlbnRUeXBlEhIKCnN0YXJ0X3RpbWUYBCABKAMSEwoLZmluaXNoX3Rp", + "bWUYBSABKAMSNgoLaW5wdXRfdHJhY2UYBiADKAsyIS5tZWRpYXBpcGUuR3Jh", + "cGhUcmFjZS5TdHJlYW1UcmFjZRI3CgxvdXRwdXRfdHJhY2UYByADKAsyIS5t", + "ZWRpYXBpcGUuR3JhcGhUcmFjZS5TdHJlYW1UcmFjZRIRCgl0aHJlYWRfaWQY", + "CCABKAUizgIKCUV2ZW50VHlwZRILCgdVTktOT1dOEAASCAoET1BFThABEgsK", + "B1BST0NFU1MQAhIJCgVDTE9TRRADEg0KCU5PVF9SRUFEWRAEEhUKEVJFQURZ", + "X0ZPUl9QUk9DRVNTEAUSEwoPUkVBRFlfRk9SX0NMT1NFEAYSDQoJVEhST1RU", + "TEVEEAcSDwoLVU5USFJPVFRMRUQQCBIRCg1DUFVfVEFTS19VU0VSEAkSEwoP", + "Q1BVX1RBU0tfU1lTVEVNEAoSDAoIR1BVX1RBU0sQCxIMCghEU1BfVEFTSxAM", + "EgwKCFRQVV9UQVNLEA0SEwoPR1BVX0NBTElCUkFUSU9OEA4SEQoNUEFDS0VU", + "X1FVRVVFRBAPEhMKD0dQVV9UQVNLX0lOVk9LRRAQEhMKD1RQVV9UQVNLX0lO", + "Vk9LRRAREhMKD0NQVV9UQVNLX0lOVk9LRRASIqcBCgxHcmFwaFByb2ZpbGUS", + "KgoLZ3JhcGhfdHJhY2UYASADKAsyFS5tZWRpYXBpcGUuR3JhcGhUcmFjZRI5", + "ChNjYWxjdWxhdG9yX3Byb2ZpbGVzGAIgAygLMhwubWVkaWFwaXBlLkNhbGN1", + "bGF0b3JQcm9maWxlEjAKBmNvbmZpZxgDIAEoCzIgLm1lZGlhcGlwZS5DYWxj", + "dWxhdG9yR3JhcGhDb25maWdCNAoaY29tLmdvb2dsZS5tZWRpYXBpcGUucHJv", + "dG9CFkNhbGN1bGF0b3JQcm9maWxlUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimeHistogram), global::Mediapipe.TimeHistogram.Parser, new[]{ "Total", "IntervalSizeUsec", "NumIntervals", "Count" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.StreamProfile), global::Mediapipe.StreamProfile.Parser, new[]{ "Name", "BackEdge", "Latency" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CalculatorProfile), global::Mediapipe.CalculatorProfile.Parser, new[]{ "Name", "OpenRuntime", "CloseRuntime", "ProcessRuntime", "ProcessInputLatency", "ProcessOutputLatency", "InputStreamProfiles" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GraphTrace), global::Mediapipe.GraphTrace.Parser, new[]{ "BaseTime", "BaseTimestamp", "CalculatorName", "StreamName", "CalculatorTrace" }, null, new[]{ typeof(global::Mediapipe.GraphTrace.Types.EventType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GraphTrace.Types.StreamTrace), global::Mediapipe.GraphTrace.Types.StreamTrace.Parser, new[]{ "StartTime", "FinishTime", "PacketTimestamp", "StreamId", "PacketId", "EventData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GraphTrace.Types.CalculatorTrace), global::Mediapipe.GraphTrace.Types.CalculatorTrace.Parser, new[]{ "NodeId", "InputTimestamp", "EventType", "StartTime", "FinishTime", "InputTrace", "OutputTrace", "ThreadId" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GraphProfile), global::Mediapipe.GraphProfile.Parser, new[]{ "GraphTrace", "CalculatorProfiles", "Config" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Stores the profiling information. + /// + /// It is the responsibility of the user of this message to make sure the 'total' + /// field and the interval information (num, size and count) are in a valid + /// state and all get updated together. + /// + /// Each interval of the histogram is closed on the lower range and open on the + /// higher end. An example histogram with interval_size=1000 and num_interval=3 + /// will have the following intervals: + /// - First interval = [0, 1000) + /// - Second interval = [1000, 2000) + /// - Third interval = [2000, +inf) + /// + /// IMPORTANT: If You add any new field, update CalculatorProfiler::Reset() + /// accordingly. + /// + public sealed partial class TimeHistogram : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimeHistogram()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorProfileReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeHistogram() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeHistogram(TimeHistogram other) : this() { + _hasBits0 = other._hasBits0; + total_ = other.total_; + intervalSizeUsec_ = other.intervalSizeUsec_; + numIntervals_ = other.numIntervals_; + count_ = other.count_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeHistogram Clone() { + return new TimeHistogram(this); + } + + /// Field number for the "total" field. + public const int TotalFieldNumber = 1; + private readonly static long TotalDefaultValue = 0L; + + private long total_; + /// + /// Total time (in microseconds). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Total { + get { if ((_hasBits0 & 1) != 0) { return total_; } else { return TotalDefaultValue; } } + set { + _hasBits0 |= 1; + total_ = value; + } + } + /// Gets whether the "total" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTotal { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "total" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTotal() { + _hasBits0 &= ~1; + } + + /// Field number for the "interval_size_usec" field. + public const int IntervalSizeUsecFieldNumber = 2; + private readonly static long IntervalSizeUsecDefaultValue = 1000000L; + + private long intervalSizeUsec_; + /// + /// Size of the runtimes histogram intervals (in microseconds) to generate the + /// histogram of the Process() time. The last interval extends to +inf. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long IntervalSizeUsec { + get { if ((_hasBits0 & 2) != 0) { return intervalSizeUsec_; } else { return IntervalSizeUsecDefaultValue; } } + set { + _hasBits0 |= 2; + intervalSizeUsec_ = value; + } + } + /// Gets whether the "interval_size_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntervalSizeUsec { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "interval_size_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntervalSizeUsec() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_intervals" field. + public const int NumIntervalsFieldNumber = 3; + private readonly static long NumIntervalsDefaultValue = 1L; + + private long numIntervals_; + /// + /// Number of intervals to generate the histogram of the Process() runtime. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long NumIntervals { + get { if ((_hasBits0 & 4) != 0) { return numIntervals_; } else { return NumIntervalsDefaultValue; } } + set { + _hasBits0 |= 4; + numIntervals_ = value; + } + } + /// Gets whether the "num_intervals" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumIntervals { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_intervals" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumIntervals() { + _hasBits0 &= ~4; + } + + /// Field number for the "count" field. + public const int CountFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_count_codec + = pb::FieldCodec.ForInt64(32); + private readonly pbc::RepeatedField count_ = new pbc::RepeatedField(); + /// + /// Number of calls in each interval. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Count { + get { return count_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimeHistogram); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimeHistogram other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Total != other.Total) return false; + if (IntervalSizeUsec != other.IntervalSizeUsec) return false; + if (NumIntervals != other.NumIntervals) return false; + if(!count_.Equals(other.count_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTotal) hash ^= Total.GetHashCode(); + if (HasIntervalSizeUsec) hash ^= IntervalSizeUsec.GetHashCode(); + if (HasNumIntervals) hash ^= NumIntervals.GetHashCode(); + hash ^= count_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTotal) { + output.WriteRawTag(8); + output.WriteInt64(Total); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(16); + output.WriteInt64(IntervalSizeUsec); + } + if (HasNumIntervals) { + output.WriteRawTag(24); + output.WriteInt64(NumIntervals); + } + count_.WriteTo(output, _repeated_count_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTotal) { + output.WriteRawTag(8); + output.WriteInt64(Total); + } + if (HasIntervalSizeUsec) { + output.WriteRawTag(16); + output.WriteInt64(IntervalSizeUsec); + } + if (HasNumIntervals) { + output.WriteRawTag(24); + output.WriteInt64(NumIntervals); + } + count_.WriteTo(ref output, _repeated_count_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTotal) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Total); + } + if (HasIntervalSizeUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IntervalSizeUsec); + } + if (HasNumIntervals) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumIntervals); + } + size += count_.CalculateSize(_repeated_count_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimeHistogram other) { + if (other == null) { + return; + } + if (other.HasTotal) { + Total = other.Total; + } + if (other.HasIntervalSizeUsec) { + IntervalSizeUsec = other.IntervalSizeUsec; + } + if (other.HasNumIntervals) { + NumIntervals = other.NumIntervals; + } + count_.Add(other.count_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Total = input.ReadInt64(); + break; + } + case 16: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 24: { + NumIntervals = input.ReadInt64(); + break; + } + case 34: + case 32: { + count_.AddEntriesFrom(input, _repeated_count_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Total = input.ReadInt64(); + break; + } + case 16: { + IntervalSizeUsec = input.ReadInt64(); + break; + } + case 24: { + NumIntervals = input.ReadInt64(); + break; + } + case 34: + case 32: { + count_.AddEntriesFrom(ref input, _repeated_count_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Stores the profiling information of a stream. + /// + public sealed partial class StreamProfile : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamProfile()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorProfileReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamProfile() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamProfile(StreamProfile other) : this() { + _hasBits0 = other._hasBits0; + name_ = other.name_; + backEdge_ = other.backEdge_; + latency_ = other.latency_ != null ? other.latency_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamProfile Clone() { + return new StreamProfile(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private readonly static string NameDefaultValue = ""; + + private string name_; + /// + /// Stream name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_ ?? NameDefaultValue; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasName { + get { return name_ != null; } + } + /// Clears the value of the "name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearName() { + name_ = null; + } + + /// Field number for the "back_edge" field. + public const int BackEdgeFieldNumber = 2; + private readonly static bool BackEdgeDefaultValue = false; + + private bool backEdge_; + /// + /// If true, than this is a back edge input stream and won't be profiled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BackEdge { + get { if ((_hasBits0 & 1) != 0) { return backEdge_; } else { return BackEdgeDefaultValue; } } + set { + _hasBits0 |= 1; + backEdge_ = value; + } + } + /// Gets whether the "back_edge" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBackEdge { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "back_edge" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBackEdge() { + _hasBits0 &= ~1; + } + + /// Field number for the "latency" field. + public const int LatencyFieldNumber = 3; + private global::Mediapipe.TimeHistogram latency_; + /// + /// Total and histogram of the time that this stream took. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeHistogram Latency { + get { return latency_; } + set { + latency_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StreamProfile); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StreamProfile other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (BackEdge != other.BackEdge) return false; + if (!object.Equals(Latency, other.Latency)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasName) hash ^= Name.GetHashCode(); + if (HasBackEdge) hash ^= BackEdge.GetHashCode(); + if (latency_ != null) hash ^= Latency.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasBackEdge) { + output.WriteRawTag(16); + output.WriteBool(BackEdge); + } + if (latency_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Latency); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasBackEdge) { + output.WriteRawTag(16); + output.WriteBool(BackEdge); + } + if (latency_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Latency); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (HasBackEdge) { + size += 1 + 1; + } + if (latency_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Latency); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StreamProfile other) { + if (other == null) { + return; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasBackEdge) { + BackEdge = other.BackEdge; + } + if (other.latency_ != null) { + if (latency_ == null) { + Latency = new global::Mediapipe.TimeHistogram(); + } + Latency.MergeFrom(other.Latency); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + BackEdge = input.ReadBool(); + break; + } + case 26: { + if (latency_ == null) { + Latency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(Latency); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + BackEdge = input.ReadBool(); + break; + } + case 26: { + if (latency_ == null) { + Latency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(Latency); + break; + } + } + } + } + #endif + + } + + /// + /// Stores the profiling information for a calculator node. + /// All the times are in microseconds. + /// + public sealed partial class CalculatorProfile : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculatorProfile()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorProfileReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorProfile() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorProfile(CalculatorProfile other) : this() { + _hasBits0 = other._hasBits0; + name_ = other.name_; + openRuntime_ = other.openRuntime_; + closeRuntime_ = other.closeRuntime_; + processRuntime_ = other.processRuntime_ != null ? other.processRuntime_.Clone() : null; + processInputLatency_ = other.processInputLatency_ != null ? other.processInputLatency_.Clone() : null; + processOutputLatency_ = other.processOutputLatency_ != null ? other.processOutputLatency_.Clone() : null; + inputStreamProfiles_ = other.inputStreamProfiles_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorProfile Clone() { + return new CalculatorProfile(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private readonly static string NameDefaultValue = ""; + + private string name_; + /// + /// The calculator name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_ ?? NameDefaultValue; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasName { + get { return name_ != null; } + } + /// Clears the value of the "name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearName() { + name_ = null; + } + + /// Field number for the "open_runtime" field. + public const int OpenRuntimeFieldNumber = 2; + private readonly static long OpenRuntimeDefaultValue = 0L; + + private long openRuntime_; + /// + /// Total time the calculator spent on Open (in microseconds). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long OpenRuntime { + get { if ((_hasBits0 & 1) != 0) { return openRuntime_; } else { return OpenRuntimeDefaultValue; } } + set { + _hasBits0 |= 1; + openRuntime_ = value; + } + } + /// Gets whether the "open_runtime" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOpenRuntime { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "open_runtime" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOpenRuntime() { + _hasBits0 &= ~1; + } + + /// Field number for the "close_runtime" field. + public const int CloseRuntimeFieldNumber = 3; + private readonly static long CloseRuntimeDefaultValue = 0L; + + private long closeRuntime_; + /// + /// Total time the calculator spent on Close (in microseconds). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long CloseRuntime { + get { if ((_hasBits0 & 2) != 0) { return closeRuntime_; } else { return CloseRuntimeDefaultValue; } } + set { + _hasBits0 |= 2; + closeRuntime_ = value; + } + } + /// Gets whether the "close_runtime" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCloseRuntime { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "close_runtime" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCloseRuntime() { + _hasBits0 &= ~2; + } + + /// Field number for the "process_runtime" field. + public const int ProcessRuntimeFieldNumber = 4; + private global::Mediapipe.TimeHistogram processRuntime_; + /// + /// Total and histogram of the time that the calculator spent on the Process() + /// (in microseconds). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeHistogram ProcessRuntime { + get { return processRuntime_; } + set { + processRuntime_ = value; + } + } + + /// Field number for the "process_input_latency" field. + public const int ProcessInputLatencyFieldNumber = 5; + private global::Mediapipe.TimeHistogram processInputLatency_; + /// + /// Total and histogram of the time that the input latency, ie. difference + /// between input timestamp and process call time. + /// (in microseconds). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeHistogram ProcessInputLatency { + get { return processInputLatency_; } + set { + processInputLatency_ = value; + } + } + + /// Field number for the "process_output_latency" field. + public const int ProcessOutputLatencyFieldNumber = 6; + private global::Mediapipe.TimeHistogram processOutputLatency_; + /// + /// Total and histogram of the time that the output latency, ie. difference + /// between input timestamp and process finished time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeHistogram ProcessOutputLatency { + get { return processOutputLatency_; } + set { + processOutputLatency_ = value; + } + } + + /// Field number for the "input_stream_profiles" field. + public const int InputStreamProfilesFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_inputStreamProfiles_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.StreamProfile.Parser); + private readonly pbc::RepeatedField inputStreamProfiles_ = new pbc::RepeatedField(); + /// + /// Total and histogram of the time that input streams of this calculator took. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputStreamProfiles { + get { return inputStreamProfiles_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CalculatorProfile); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CalculatorProfile other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (OpenRuntime != other.OpenRuntime) return false; + if (CloseRuntime != other.CloseRuntime) return false; + if (!object.Equals(ProcessRuntime, other.ProcessRuntime)) return false; + if (!object.Equals(ProcessInputLatency, other.ProcessInputLatency)) return false; + if (!object.Equals(ProcessOutputLatency, other.ProcessOutputLatency)) return false; + if(!inputStreamProfiles_.Equals(other.inputStreamProfiles_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasName) hash ^= Name.GetHashCode(); + if (HasOpenRuntime) hash ^= OpenRuntime.GetHashCode(); + if (HasCloseRuntime) hash ^= CloseRuntime.GetHashCode(); + if (processRuntime_ != null) hash ^= ProcessRuntime.GetHashCode(); + if (processInputLatency_ != null) hash ^= ProcessInputLatency.GetHashCode(); + if (processOutputLatency_ != null) hash ^= ProcessOutputLatency.GetHashCode(); + hash ^= inputStreamProfiles_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasOpenRuntime) { + output.WriteRawTag(16); + output.WriteInt64(OpenRuntime); + } + if (HasCloseRuntime) { + output.WriteRawTag(24); + output.WriteInt64(CloseRuntime); + } + if (processRuntime_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ProcessRuntime); + } + if (processInputLatency_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ProcessInputLatency); + } + if (processOutputLatency_ != null) { + output.WriteRawTag(50); + output.WriteMessage(ProcessOutputLatency); + } + inputStreamProfiles_.WriteTo(output, _repeated_inputStreamProfiles_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasOpenRuntime) { + output.WriteRawTag(16); + output.WriteInt64(OpenRuntime); + } + if (HasCloseRuntime) { + output.WriteRawTag(24); + output.WriteInt64(CloseRuntime); + } + if (processRuntime_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ProcessRuntime); + } + if (processInputLatency_ != null) { + output.WriteRawTag(42); + output.WriteMessage(ProcessInputLatency); + } + if (processOutputLatency_ != null) { + output.WriteRawTag(50); + output.WriteMessage(ProcessOutputLatency); + } + inputStreamProfiles_.WriteTo(ref output, _repeated_inputStreamProfiles_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (HasOpenRuntime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OpenRuntime); + } + if (HasCloseRuntime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CloseRuntime); + } + if (processRuntime_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProcessRuntime); + } + if (processInputLatency_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProcessInputLatency); + } + if (processOutputLatency_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ProcessOutputLatency); + } + size += inputStreamProfiles_.CalculateSize(_repeated_inputStreamProfiles_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CalculatorProfile other) { + if (other == null) { + return; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasOpenRuntime) { + OpenRuntime = other.OpenRuntime; + } + if (other.HasCloseRuntime) { + CloseRuntime = other.CloseRuntime; + } + if (other.processRuntime_ != null) { + if (processRuntime_ == null) { + ProcessRuntime = new global::Mediapipe.TimeHistogram(); + } + ProcessRuntime.MergeFrom(other.ProcessRuntime); + } + if (other.processInputLatency_ != null) { + if (processInputLatency_ == null) { + ProcessInputLatency = new global::Mediapipe.TimeHistogram(); + } + ProcessInputLatency.MergeFrom(other.ProcessInputLatency); + } + if (other.processOutputLatency_ != null) { + if (processOutputLatency_ == null) { + ProcessOutputLatency = new global::Mediapipe.TimeHistogram(); + } + ProcessOutputLatency.MergeFrom(other.ProcessOutputLatency); + } + inputStreamProfiles_.Add(other.inputStreamProfiles_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + OpenRuntime = input.ReadInt64(); + break; + } + case 24: { + CloseRuntime = input.ReadInt64(); + break; + } + case 34: { + if (processRuntime_ == null) { + ProcessRuntime = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessRuntime); + break; + } + case 42: { + if (processInputLatency_ == null) { + ProcessInputLatency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessInputLatency); + break; + } + case 50: { + if (processOutputLatency_ == null) { + ProcessOutputLatency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessOutputLatency); + break; + } + case 58: { + inputStreamProfiles_.AddEntriesFrom(input, _repeated_inputStreamProfiles_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + OpenRuntime = input.ReadInt64(); + break; + } + case 24: { + CloseRuntime = input.ReadInt64(); + break; + } + case 34: { + if (processRuntime_ == null) { + ProcessRuntime = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessRuntime); + break; + } + case 42: { + if (processInputLatency_ == null) { + ProcessInputLatency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessInputLatency); + break; + } + case 50: { + if (processOutputLatency_ == null) { + ProcessOutputLatency = new global::Mediapipe.TimeHistogram(); + } + input.ReadMessage(ProcessOutputLatency); + break; + } + case 58: { + inputStreamProfiles_.AddEntriesFrom(ref input, _repeated_inputStreamProfiles_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Latency timing for recent mediapipe packets. + /// + public sealed partial class GraphTrace : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTrace()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorProfileReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphTrace() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphTrace(GraphTrace other) : this() { + _hasBits0 = other._hasBits0; + baseTime_ = other.baseTime_; + baseTimestamp_ = other.baseTimestamp_; + calculatorName_ = other.calculatorName_.Clone(); + streamName_ = other.streamName_.Clone(); + calculatorTrace_ = other.calculatorTrace_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphTrace Clone() { + return new GraphTrace(this); + } + + /// Field number for the "base_time" field. + public const int BaseTimeFieldNumber = 1; + private readonly static long BaseTimeDefaultValue = 0L; + + private long baseTime_; + /// + /// The time represented as 0 in the trace. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long BaseTime { + get { if ((_hasBits0 & 1) != 0) { return baseTime_; } else { return BaseTimeDefaultValue; } } + set { + _hasBits0 |= 1; + baseTime_ = value; + } + } + /// Gets whether the "base_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBaseTime { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "base_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBaseTime() { + _hasBits0 &= ~1; + } + + /// Field number for the "base_timestamp" field. + public const int BaseTimestampFieldNumber = 2; + private readonly static long BaseTimestampDefaultValue = 0L; + + private long baseTimestamp_; + /// + /// The timestamp represented as 0 in the trace. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long BaseTimestamp { + get { if ((_hasBits0 & 2) != 0) { return baseTimestamp_; } else { return BaseTimestampDefaultValue; } } + set { + _hasBits0 |= 2; + baseTimestamp_ = value; + } + } + /// Gets whether the "base_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBaseTimestamp { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "base_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBaseTimestamp() { + _hasBits0 &= ~2; + } + + /// Field number for the "calculator_name" field. + public const int CalculatorNameFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_calculatorName_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField calculatorName_ = new pbc::RepeatedField(); + /// + /// The list of calculator node names indexed by node id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CalculatorName { + get { return calculatorName_; } + } + + /// Field number for the "stream_name" field. + public const int StreamNameFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_streamName_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField streamName_ = new pbc::RepeatedField(); + /// + /// The list of stream names indexed by stream id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField StreamName { + get { return streamName_; } + } + + /// Field number for the "calculator_trace" field. + public const int CalculatorTraceFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_calculatorTrace_codec + = pb::FieldCodec.ForMessage(42, global::Mediapipe.GraphTrace.Types.CalculatorTrace.Parser); + private readonly pbc::RepeatedField calculatorTrace_ = new pbc::RepeatedField(); + /// + /// Recent packet timing informtion about each calculator node and stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CalculatorTrace { + get { return calculatorTrace_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GraphTrace); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GraphTrace other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BaseTime != other.BaseTime) return false; + if (BaseTimestamp != other.BaseTimestamp) return false; + if(!calculatorName_.Equals(other.calculatorName_)) return false; + if(!streamName_.Equals(other.streamName_)) return false; + if(!calculatorTrace_.Equals(other.calculatorTrace_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBaseTime) hash ^= BaseTime.GetHashCode(); + if (HasBaseTimestamp) hash ^= BaseTimestamp.GetHashCode(); + hash ^= calculatorName_.GetHashCode(); + hash ^= streamName_.GetHashCode(); + hash ^= calculatorTrace_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBaseTime) { + output.WriteRawTag(8); + output.WriteInt64(BaseTime); + } + if (HasBaseTimestamp) { + output.WriteRawTag(16); + output.WriteInt64(BaseTimestamp); + } + calculatorName_.WriteTo(output, _repeated_calculatorName_codec); + streamName_.WriteTo(output, _repeated_streamName_codec); + calculatorTrace_.WriteTo(output, _repeated_calculatorTrace_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBaseTime) { + output.WriteRawTag(8); + output.WriteInt64(BaseTime); + } + if (HasBaseTimestamp) { + output.WriteRawTag(16); + output.WriteInt64(BaseTimestamp); + } + calculatorName_.WriteTo(ref output, _repeated_calculatorName_codec); + streamName_.WriteTo(ref output, _repeated_streamName_codec); + calculatorTrace_.WriteTo(ref output, _repeated_calculatorTrace_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBaseTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BaseTime); + } + if (HasBaseTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BaseTimestamp); + } + size += calculatorName_.CalculateSize(_repeated_calculatorName_codec); + size += streamName_.CalculateSize(_repeated_streamName_codec); + size += calculatorTrace_.CalculateSize(_repeated_calculatorTrace_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GraphTrace other) { + if (other == null) { + return; + } + if (other.HasBaseTime) { + BaseTime = other.BaseTime; + } + if (other.HasBaseTimestamp) { + BaseTimestamp = other.BaseTimestamp; + } + calculatorName_.Add(other.calculatorName_); + streamName_.Add(other.streamName_); + calculatorTrace_.Add(other.calculatorTrace_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BaseTime = input.ReadInt64(); + break; + } + case 16: { + BaseTimestamp = input.ReadInt64(); + break; + } + case 26: { + calculatorName_.AddEntriesFrom(input, _repeated_calculatorName_codec); + break; + } + case 34: { + streamName_.AddEntriesFrom(input, _repeated_streamName_codec); + break; + } + case 42: { + calculatorTrace_.AddEntriesFrom(input, _repeated_calculatorTrace_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + BaseTime = input.ReadInt64(); + break; + } + case 16: { + BaseTimestamp = input.ReadInt64(); + break; + } + case 26: { + calculatorName_.AddEntriesFrom(ref input, _repeated_calculatorName_codec); + break; + } + case 34: { + streamName_.AddEntriesFrom(ref input, _repeated_streamName_codec); + break; + } + case 42: { + calculatorTrace_.AddEntriesFrom(ref input, _repeated_calculatorTrace_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the GraphTrace message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The kind of event recorded. + /// + public enum EventType { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("OPEN")] Open = 1, + [pbr::OriginalName("PROCESS")] Process = 2, + [pbr::OriginalName("CLOSE")] Close = 3, + [pbr::OriginalName("NOT_READY")] NotReady = 4, + [pbr::OriginalName("READY_FOR_PROCESS")] ReadyForProcess = 5, + [pbr::OriginalName("READY_FOR_CLOSE")] ReadyForClose = 6, + [pbr::OriginalName("THROTTLED")] Throttled = 7, + [pbr::OriginalName("UNTHROTTLED")] Unthrottled = 8, + [pbr::OriginalName("CPU_TASK_USER")] CpuTaskUser = 9, + [pbr::OriginalName("CPU_TASK_SYSTEM")] CpuTaskSystem = 10, + [pbr::OriginalName("GPU_TASK")] GpuTask = 11, + [pbr::OriginalName("DSP_TASK")] DspTask = 12, + [pbr::OriginalName("TPU_TASK")] TpuTask = 13, + [pbr::OriginalName("GPU_CALIBRATION")] GpuCalibration = 14, + [pbr::OriginalName("PACKET_QUEUED")] PacketQueued = 15, + [pbr::OriginalName("GPU_TASK_INVOKE")] GpuTaskInvoke = 16, + [pbr::OriginalName("TPU_TASK_INVOKE")] TpuTaskInvoke = 17, + [pbr::OriginalName("CPU_TASK_INVOKE")] CpuTaskInvoke = 18, + } + + /// + /// The timing for one packet across one packet stream. + /// + public sealed partial class StreamTrace : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamTrace()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GraphTrace.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamTrace() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamTrace(StreamTrace other) : this() { + _hasBits0 = other._hasBits0; + startTime_ = other.startTime_; + finishTime_ = other.finishTime_; + packetTimestamp_ = other.packetTimestamp_; + streamId_ = other.streamId_; + packetId_ = other.packetId_; + eventData_ = other.eventData_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StreamTrace Clone() { + return new StreamTrace(this); + } + + /// Field number for the "start_time" field. + public const int StartTimeFieldNumber = 1; + private readonly static long StartTimeDefaultValue = 0L; + + private long startTime_; + /// + /// The time at which the packet entered the stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long StartTime { + get { if ((_hasBits0 & 1) != 0) { return startTime_; } else { return StartTimeDefaultValue; } } + set { + _hasBits0 |= 1; + startTime_ = value; + } + } + /// Gets whether the "start_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartTime { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "start_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartTime() { + _hasBits0 &= ~1; + } + + /// Field number for the "finish_time" field. + public const int FinishTimeFieldNumber = 2; + private readonly static long FinishTimeDefaultValue = 0L; + + private long finishTime_; + /// + /// The time at which the packet exited the stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long FinishTime { + get { if ((_hasBits0 & 2) != 0) { return finishTime_; } else { return FinishTimeDefaultValue; } } + set { + _hasBits0 |= 2; + finishTime_ = value; + } + } + /// Gets whether the "finish_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFinishTime { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "finish_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFinishTime() { + _hasBits0 &= ~2; + } + + /// Field number for the "packet_timestamp" field. + public const int PacketTimestampFieldNumber = 3; + private readonly static long PacketTimestampDefaultValue = 0L; + + private long packetTimestamp_; + /// + /// The identifying timetamp of the packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long PacketTimestamp { + get { if ((_hasBits0 & 4) != 0) { return packetTimestamp_; } else { return PacketTimestampDefaultValue; } } + set { + _hasBits0 |= 4; + packetTimestamp_ = value; + } + } + /// Gets whether the "packet_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketTimestamp { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "packet_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketTimestamp() { + _hasBits0 &= ~4; + } + + /// Field number for the "stream_id" field. + public const int StreamIdFieldNumber = 4; + private readonly static int StreamIdDefaultValue = 0; + + private int streamId_; + /// + /// The index of the stream in the stream_name list. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StreamId { + get { if ((_hasBits0 & 8) != 0) { return streamId_; } else { return StreamIdDefaultValue; } } + set { + _hasBits0 |= 8; + streamId_ = value; + } + } + /// Gets whether the "stream_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStreamId { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "stream_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStreamId() { + _hasBits0 &= ~8; + } + + /// Field number for the "packet_id" field. + public const int PacketIdFieldNumber = 5; + private readonly static long PacketIdDefaultValue = 0L; + + private long packetId_; + /// + /// The address of the packet contents. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long PacketId { + get { if ((_hasBits0 & 16) != 0) { return packetId_; } else { return PacketIdDefaultValue; } } + set { + _hasBits0 |= 16; + packetId_ = value; + } + } + /// Gets whether the "packet_id" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketId { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "packet_id" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketId() { + _hasBits0 &= ~16; + } + + /// Field number for the "event_data" field. + public const int EventDataFieldNumber = 6; + private readonly static long EventDataDefaultValue = 0L; + + private long eventData_; + /// + /// Data describing the event, such as the packet contents. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long EventData { + get { if ((_hasBits0 & 32) != 0) { return eventData_; } else { return EventDataDefaultValue; } } + set { + _hasBits0 |= 32; + eventData_ = value; + } + } + /// Gets whether the "event_data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEventData { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "event_data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEventData() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StreamTrace); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StreamTrace other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StartTime != other.StartTime) return false; + if (FinishTime != other.FinishTime) return false; + if (PacketTimestamp != other.PacketTimestamp) return false; + if (StreamId != other.StreamId) return false; + if (PacketId != other.PacketId) return false; + if (EventData != other.EventData) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasStartTime) hash ^= StartTime.GetHashCode(); + if (HasFinishTime) hash ^= FinishTime.GetHashCode(); + if (HasPacketTimestamp) hash ^= PacketTimestamp.GetHashCode(); + if (HasStreamId) hash ^= StreamId.GetHashCode(); + if (HasPacketId) hash ^= PacketId.GetHashCode(); + if (HasEventData) hash ^= EventData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasStartTime) { + output.WriteRawTag(8); + output.WriteInt64(StartTime); + } + if (HasFinishTime) { + output.WriteRawTag(16); + output.WriteInt64(FinishTime); + } + if (HasPacketTimestamp) { + output.WriteRawTag(24); + output.WriteInt64(PacketTimestamp); + } + if (HasStreamId) { + output.WriteRawTag(32); + output.WriteInt32(StreamId); + } + if (HasPacketId) { + output.WriteRawTag(40); + output.WriteInt64(PacketId); + } + if (HasEventData) { + output.WriteRawTag(48); + output.WriteInt64(EventData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStartTime) { + output.WriteRawTag(8); + output.WriteInt64(StartTime); + } + if (HasFinishTime) { + output.WriteRawTag(16); + output.WriteInt64(FinishTime); + } + if (HasPacketTimestamp) { + output.WriteRawTag(24); + output.WriteInt64(PacketTimestamp); + } + if (HasStreamId) { + output.WriteRawTag(32); + output.WriteInt32(StreamId); + } + if (HasPacketId) { + output.WriteRawTag(40); + output.WriteInt64(PacketId); + } + if (HasEventData) { + output.WriteRawTag(48); + output.WriteInt64(EventData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasStartTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime); + } + if (HasFinishTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FinishTime); + } + if (HasPacketTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PacketTimestamp); + } + if (HasStreamId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StreamId); + } + if (HasPacketId) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PacketId); + } + if (HasEventData) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(EventData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StreamTrace other) { + if (other == null) { + return; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasFinishTime) { + FinishTime = other.FinishTime; + } + if (other.HasPacketTimestamp) { + PacketTimestamp = other.PacketTimestamp; + } + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasPacketId) { + PacketId = other.PacketId; + } + if (other.HasEventData) { + EventData = other.EventData; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StartTime = input.ReadInt64(); + break; + } + case 16: { + FinishTime = input.ReadInt64(); + break; + } + case 24: { + PacketTimestamp = input.ReadInt64(); + break; + } + case 32: { + StreamId = input.ReadInt32(); + break; + } + case 40: { + PacketId = input.ReadInt64(); + break; + } + case 48: { + EventData = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + StartTime = input.ReadInt64(); + break; + } + case 16: { + FinishTime = input.ReadInt64(); + break; + } + case 24: { + PacketTimestamp = input.ReadInt64(); + break; + } + case 32: { + StreamId = input.ReadInt32(); + break; + } + case 40: { + PacketId = input.ReadInt64(); + break; + } + case 48: { + EventData = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// The timing for one packet set being processed at one caclulator node. + /// + public sealed partial class CalculatorTrace : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalculatorTrace()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GraphTrace.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorTrace() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorTrace(CalculatorTrace other) : this() { + _hasBits0 = other._hasBits0; + nodeId_ = other.nodeId_; + inputTimestamp_ = other.inputTimestamp_; + eventType_ = other.eventType_; + startTime_ = other.startTime_; + finishTime_ = other.finishTime_; + inputTrace_ = other.inputTrace_.Clone(); + outputTrace_ = other.outputTrace_.Clone(); + threadId_ = other.threadId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CalculatorTrace Clone() { + return new CalculatorTrace(this); + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 1; + private readonly static int NodeIdDefaultValue = 0; + + private int nodeId_; + /// + /// The index of the calculator node in the calculator_name list. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NodeId { + get { if ((_hasBits0 & 1) != 0) { return nodeId_; } else { return NodeIdDefaultValue; } } + set { + _hasBits0 |= 1; + nodeId_ = value; + } + } + /// Gets whether the "node_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNodeId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "node_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNodeId() { + _hasBits0 &= ~1; + } + + /// Field number for the "input_timestamp" field. + public const int InputTimestampFieldNumber = 2; + private readonly static long InputTimestampDefaultValue = 0L; + + private long inputTimestamp_; + /// + /// The input timestamp during Open, Process, or Close. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long InputTimestamp { + get { if ((_hasBits0 & 2) != 0) { return inputTimestamp_; } else { return InputTimestampDefaultValue; } } + set { + _hasBits0 |= 2; + inputTimestamp_ = value; + } + } + /// Gets whether the "input_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputTimestamp { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "input_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputTimestamp() { + _hasBits0 &= ~2; + } + + /// Field number for the "event_type" field. + public const int EventTypeFieldNumber = 3; + private readonly static global::Mediapipe.GraphTrace.Types.EventType EventTypeDefaultValue = global::Mediapipe.GraphTrace.Types.EventType.Unknown; + + private global::Mediapipe.GraphTrace.Types.EventType eventType_; + /// + /// The kind of event, 1=Open, 2=Process, 3=Close, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GraphTrace.Types.EventType EventType { + get { if ((_hasBits0 & 4) != 0) { return eventType_; } else { return EventTypeDefaultValue; } } + set { + _hasBits0 |= 4; + eventType_ = value; + } + } + /// Gets whether the "event_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEventType { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "event_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEventType() { + _hasBits0 &= ~4; + } + + /// Field number for the "start_time" field. + public const int StartTimeFieldNumber = 4; + private readonly static long StartTimeDefaultValue = 0L; + + private long startTime_; + /// + /// The time at which the packets entered the caclulator node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long StartTime { + get { if ((_hasBits0 & 8) != 0) { return startTime_; } else { return StartTimeDefaultValue; } } + set { + _hasBits0 |= 8; + startTime_ = value; + } + } + /// Gets whether the "start_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartTime { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "start_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartTime() { + _hasBits0 &= ~8; + } + + /// Field number for the "finish_time" field. + public const int FinishTimeFieldNumber = 5; + private readonly static long FinishTimeDefaultValue = 0L; + + private long finishTime_; + /// + /// The time at which the packets exited the caclulator node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long FinishTime { + get { if ((_hasBits0 & 16) != 0) { return finishTime_; } else { return FinishTimeDefaultValue; } } + set { + _hasBits0 |= 16; + finishTime_ = value; + } + } + /// Gets whether the "finish_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFinishTime { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "finish_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFinishTime() { + _hasBits0 &= ~16; + } + + /// Field number for the "input_trace" field. + public const int InputTraceFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_inputTrace_codec + = pb::FieldCodec.ForMessage(50, global::Mediapipe.GraphTrace.Types.StreamTrace.Parser); + private readonly pbc::RepeatedField inputTrace_ = new pbc::RepeatedField(); + /// + /// The timing data for each input packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputTrace { + get { return inputTrace_; } + } + + /// Field number for the "output_trace" field. + public const int OutputTraceFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_outputTrace_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.GraphTrace.Types.StreamTrace.Parser); + private readonly pbc::RepeatedField outputTrace_ = new pbc::RepeatedField(); + /// + /// The identifying timetamp and stream_id for each output packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputTrace { + get { return outputTrace_; } + } + + /// Field number for the "thread_id" field. + public const int ThreadIdFieldNumber = 8; + private readonly static int ThreadIdDefaultValue = 0; + + private int threadId_; + /// + /// An identifier for the current process thread. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ThreadId { + get { if ((_hasBits0 & 32) != 0) { return threadId_; } else { return ThreadIdDefaultValue; } } + set { + _hasBits0 |= 32; + threadId_ = value; + } + } + /// Gets whether the "thread_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThreadId { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "thread_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThreadId() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CalculatorTrace); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CalculatorTrace other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeId != other.NodeId) return false; + if (InputTimestamp != other.InputTimestamp) return false; + if (EventType != other.EventType) return false; + if (StartTime != other.StartTime) return false; + if (FinishTime != other.FinishTime) return false; + if(!inputTrace_.Equals(other.inputTrace_)) return false; + if(!outputTrace_.Equals(other.outputTrace_)) return false; + if (ThreadId != other.ThreadId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNodeId) hash ^= NodeId.GetHashCode(); + if (HasInputTimestamp) hash ^= InputTimestamp.GetHashCode(); + if (HasEventType) hash ^= EventType.GetHashCode(); + if (HasStartTime) hash ^= StartTime.GetHashCode(); + if (HasFinishTime) hash ^= FinishTime.GetHashCode(); + hash ^= inputTrace_.GetHashCode(); + hash ^= outputTrace_.GetHashCode(); + if (HasThreadId) hash ^= ThreadId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNodeId) { + output.WriteRawTag(8); + output.WriteInt32(NodeId); + } + if (HasInputTimestamp) { + output.WriteRawTag(16); + output.WriteInt64(InputTimestamp); + } + if (HasEventType) { + output.WriteRawTag(24); + output.WriteEnum((int) EventType); + } + if (HasStartTime) { + output.WriteRawTag(32); + output.WriteInt64(StartTime); + } + if (HasFinishTime) { + output.WriteRawTag(40); + output.WriteInt64(FinishTime); + } + inputTrace_.WriteTo(output, _repeated_inputTrace_codec); + outputTrace_.WriteTo(output, _repeated_outputTrace_codec); + if (HasThreadId) { + output.WriteRawTag(64); + output.WriteInt32(ThreadId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNodeId) { + output.WriteRawTag(8); + output.WriteInt32(NodeId); + } + if (HasInputTimestamp) { + output.WriteRawTag(16); + output.WriteInt64(InputTimestamp); + } + if (HasEventType) { + output.WriteRawTag(24); + output.WriteEnum((int) EventType); + } + if (HasStartTime) { + output.WriteRawTag(32); + output.WriteInt64(StartTime); + } + if (HasFinishTime) { + output.WriteRawTag(40); + output.WriteInt64(FinishTime); + } + inputTrace_.WriteTo(ref output, _repeated_inputTrace_codec); + outputTrace_.WriteTo(ref output, _repeated_outputTrace_codec); + if (HasThreadId) { + output.WriteRawTag(64); + output.WriteInt32(ThreadId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNodeId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + if (HasInputTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(InputTimestamp); + } + if (HasEventType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EventType); + } + if (HasStartTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime); + } + if (HasFinishTime) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FinishTime); + } + size += inputTrace_.CalculateSize(_repeated_inputTrace_codec); + size += outputTrace_.CalculateSize(_repeated_outputTrace_codec); + if (HasThreadId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ThreadId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CalculatorTrace other) { + if (other == null) { + return; + } + if (other.HasNodeId) { + NodeId = other.NodeId; + } + if (other.HasInputTimestamp) { + InputTimestamp = other.InputTimestamp; + } + if (other.HasEventType) { + EventType = other.EventType; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasFinishTime) { + FinishTime = other.FinishTime; + } + inputTrace_.Add(other.inputTrace_); + outputTrace_.Add(other.outputTrace_); + if (other.HasThreadId) { + ThreadId = other.ThreadId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NodeId = input.ReadInt32(); + break; + } + case 16: { + InputTimestamp = input.ReadInt64(); + break; + } + case 24: { + EventType = (global::Mediapipe.GraphTrace.Types.EventType) input.ReadEnum(); + break; + } + case 32: { + StartTime = input.ReadInt64(); + break; + } + case 40: { + FinishTime = input.ReadInt64(); + break; + } + case 50: { + inputTrace_.AddEntriesFrom(input, _repeated_inputTrace_codec); + break; + } + case 58: { + outputTrace_.AddEntriesFrom(input, _repeated_outputTrace_codec); + break; + } + case 64: { + ThreadId = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NodeId = input.ReadInt32(); + break; + } + case 16: { + InputTimestamp = input.ReadInt64(); + break; + } + case 24: { + EventType = (global::Mediapipe.GraphTrace.Types.EventType) input.ReadEnum(); + break; + } + case 32: { + StartTime = input.ReadInt64(); + break; + } + case 40: { + FinishTime = input.ReadInt64(); + break; + } + case 50: { + inputTrace_.AddEntriesFrom(ref input, _repeated_inputTrace_codec); + break; + } + case 58: { + outputTrace_.AddEntriesFrom(ref input, _repeated_outputTrace_codec); + break; + } + case 64: { + ThreadId = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Latency events and summaries for recent mediapipe packets. + /// + public sealed partial class GraphProfile : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphProfile()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CalculatorProfileReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfile() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfile(GraphProfile other) : this() { + graphTrace_ = other.graphTrace_.Clone(); + calculatorProfiles_ = other.calculatorProfiles_.Clone(); + config_ = other.config_ != null ? other.config_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GraphProfile Clone() { + return new GraphProfile(this); + } + + /// Field number for the "graph_trace" field. + public const int GraphTraceFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_graphTrace_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.GraphTrace.Parser); + private readonly pbc::RepeatedField graphTrace_ = new pbc::RepeatedField(); + /// + /// Recent packet timing informtion about each calculator node and stream. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField GraphTrace { + get { return graphTrace_; } + } + + /// Field number for the "calculator_profiles" field. + public const int CalculatorProfilesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_calculatorProfiles_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.CalculatorProfile.Parser); + private readonly pbc::RepeatedField calculatorProfiles_ = new pbc::RepeatedField(); + /// + /// Aggregated latency information about each calculator node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CalculatorProfiles { + get { return calculatorProfiles_; } + } + + /// Field number for the "config" field. + public const int ConfigFieldNumber = 3; + private global::Mediapipe.CalculatorGraphConfig config_; + /// + /// The canonicalized calculator graph that is traced. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CalculatorGraphConfig Config { + get { return config_; } + set { + config_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GraphProfile); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GraphProfile other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!graphTrace_.Equals(other.graphTrace_)) return false; + if(!calculatorProfiles_.Equals(other.calculatorProfiles_)) return false; + if (!object.Equals(Config, other.Config)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= graphTrace_.GetHashCode(); + hash ^= calculatorProfiles_.GetHashCode(); + if (config_ != null) hash ^= Config.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + graphTrace_.WriteTo(output, _repeated_graphTrace_codec); + calculatorProfiles_.WriteTo(output, _repeated_calculatorProfiles_codec); + if (config_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Config); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + graphTrace_.WriteTo(ref output, _repeated_graphTrace_codec); + calculatorProfiles_.WriteTo(ref output, _repeated_calculatorProfiles_codec); + if (config_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Config); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += graphTrace_.CalculateSize(_repeated_graphTrace_codec); + size += calculatorProfiles_.CalculateSize(_repeated_calculatorProfiles_codec); + if (config_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Config); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GraphProfile other) { + if (other == null) { + return; + } + graphTrace_.Add(other.graphTrace_); + calculatorProfiles_.Add(other.calculatorProfiles_); + if (other.config_ != null) { + if (config_ == null) { + Config = new global::Mediapipe.CalculatorGraphConfig(); + } + Config.MergeFrom(other.Config); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + graphTrace_.AddEntriesFrom(input, _repeated_graphTrace_codec); + break; + } + case 18: { + calculatorProfiles_.AddEntriesFrom(input, _repeated_calculatorProfiles_codec); + break; + } + case 26: { + if (config_ == null) { + Config = new global::Mediapipe.CalculatorGraphConfig(); + } + input.ReadMessage(Config); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + graphTrace_.AddEntriesFrom(ref input, _repeated_graphTrace_codec); + break; + } + case 18: { + calculatorProfiles_.AddEntriesFrom(ref input, _repeated_calculatorProfiles_codec); + break; + } + case 26: { + if (config_ == null) { + Config = new global::Mediapipe.CalculatorGraphConfig(); + } + input.ReadMessage(Config); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs.meta new file mode 100644 index 0000000..d494e3e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/CalculatorProfile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd30252ab0ccfd362ad469d8fde0f8df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats.meta new file mode 100644 index 0000000..381c126 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ba1fc5f91ea86247a7464f0230283fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs new file mode 100644 index 0000000..38d4bd0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs @@ -0,0 +1,659 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/affine_transform_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/affine_transform_data.proto + public static partial class AffineTransformDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/affine_transform_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AffineTransformDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjdtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvYWZmaW5lX3RyYW5zZm9y", + "bV9kYXRhLnByb3RvEgltZWRpYXBpcGUiIwoLVmVjdG9yMkRhdGESCQoBeBgB", + "IAEoAhIJCgF5GAIgASgCIqIBChNBZmZpbmVUcmFuc2Zvcm1EYXRhEisKC3Ry", + "YW5zbGF0aW9uGAEgASgLMhYubWVkaWFwaXBlLlZlY3RvcjJEYXRhEiUKBXNj", + "YWxlGAIgASgLMhYubWVkaWFwaXBlLlZlY3RvcjJEYXRhEiUKBXNoZWFyGAMg", + "ASgLMhYubWVkaWFwaXBlLlZlY3RvcjJEYXRhEhAKCHJvdGF0aW9uGAQgASgC")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Vector2Data), global::Mediapipe.Vector2Data.Parser, new[]{ "X", "Y" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AffineTransformData), global::Mediapipe.AffineTransformData.Parser, new[]{ "Translation", "Scale", "Shear", "Rotation" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Proto for serializing Vector2 data + /// + public sealed partial class Vector2Data : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vector2Data()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AffineTransformDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector2Data() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector2Data(Vector2Data other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector2Data Clone() { + return new Vector2Data(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Vector2Data); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Vector2Data other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Vector2Data other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Proto for serializing Affine Transform data. + /// + public sealed partial class AffineTransformData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AffineTransformData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AffineTransformDataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineTransformData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineTransformData(AffineTransformData other) : this() { + _hasBits0 = other._hasBits0; + translation_ = other.translation_ != null ? other.translation_.Clone() : null; + scale_ = other.scale_ != null ? other.scale_.Clone() : null; + shear_ = other.shear_ != null ? other.shear_.Clone() : null; + rotation_ = other.rotation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineTransformData Clone() { + return new AffineTransformData(this); + } + + /// Field number for the "translation" field. + public const int TranslationFieldNumber = 1; + private global::Mediapipe.Vector2Data translation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Vector2Data Translation { + get { return translation_; } + set { + translation_ = value; + } + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 2; + private global::Mediapipe.Vector2Data scale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Vector2Data Scale { + get { return scale_; } + set { + scale_ = value; + } + } + + /// Field number for the "shear" field. + public const int ShearFieldNumber = 3; + private global::Mediapipe.Vector2Data shear_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Vector2Data Shear { + get { return shear_; } + set { + shear_ = value; + } + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 4; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// in radians + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 1) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 1; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AffineTransformData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AffineTransformData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Translation, other.Translation)) return false; + if (!object.Equals(Scale, other.Scale)) return false; + if (!object.Equals(Shear, other.Shear)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (translation_ != null) hash ^= Translation.GetHashCode(); + if (scale_ != null) hash ^= Scale.GetHashCode(); + if (shear_ != null) hash ^= Shear.GetHashCode(); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (translation_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Translation); + } + if (scale_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Scale); + } + if (shear_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Shear); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (translation_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Translation); + } + if (scale_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Scale); + } + if (shear_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Shear); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (translation_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Translation); + } + if (scale_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Scale); + } + if (shear_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shear); + } + if (HasRotation) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AffineTransformData other) { + if (other == null) { + return; + } + if (other.translation_ != null) { + if (translation_ == null) { + Translation = new global::Mediapipe.Vector2Data(); + } + Translation.MergeFrom(other.Translation); + } + if (other.scale_ != null) { + if (scale_ == null) { + Scale = new global::Mediapipe.Vector2Data(); + } + Scale.MergeFrom(other.Scale); + } + if (other.shear_ != null) { + if (shear_ == null) { + Shear = new global::Mediapipe.Vector2Data(); + } + Shear.MergeFrom(other.Shear); + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (translation_ == null) { + Translation = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Translation); + break; + } + case 18: { + if (scale_ == null) { + Scale = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Scale); + break; + } + case 26: { + if (shear_ == null) { + Shear = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Shear); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (translation_ == null) { + Translation = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Translation); + break; + } + case 18: { + if (scale_ == null) { + Scale = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Scale); + break; + } + case 26: { + if (shear_ == null) { + Shear = new global::Mediapipe.Vector2Data(); + } + input.ReadMessage(Shear); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs.meta new file mode 100644 index 0000000..ce93c17 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/AffineTransformData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 881600dc6afee0d00a3573e5f1c82935 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation.meta new file mode 100644 index 0000000..d04a901 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3460eef1722d0874fb83e5914ce68f34 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs new file mode 100644 index 0000000..b21fc30 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs @@ -0,0 +1,1021 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/annotation/locus.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/annotation/locus.proto + public static partial class LocusReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/annotation/locus.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LocusReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjJtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvYW5ub3RhdGlvbi9sb2N1", + "cy5wcm90bxIJbWVkaWFwaXBlGjptZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1h", + "dHMvYW5ub3RhdGlvbi9yYXN0ZXJpemF0aW9uLnByb3RvIt8CCgVMb2N1cxIu", + "Cgpsb2N1c190eXBlGAEgASgOMhoubWVkaWFwaXBlLkxvY3VzLkxvY3VzVHlw", + "ZRIQCghsb2N1c19pZBgCIAEoBhIVCg1sb2N1c19pZF9zZWVkGAYgASgGEhwK", + "DmNvbmNhdGVuYXRhYmxlGAUgASgIOgR0cnVlEiwKDGJvdW5kaW5nX2JveBgD", + "IAEoCzIWLm1lZGlhcGlwZS5Cb3VuZGluZ0JveBIVCgl0aW1lc3RhbXAYByAB", + "KAU6Ai0xEigKBnJlZ2lvbhgEIAEoCzIYLm1lZGlhcGlwZS5SYXN0ZXJpemF0", + "aW9uEikKD2NvbXBvbmVudF9sb2N1cxgIIAMoCzIQLm1lZGlhcGlwZS5Mb2N1", + "cyJFCglMb2N1c1R5cGUSCgoGR0xPQkFMEAESEAoMQk9VTkRJTkdfQk9YEAIS", + "CgoGUkVHSU9OEAMSDgoKVklERU9fVFVCRRAEIlAKC0JvdW5kaW5nQm94Eg4K", + "BmxlZnRfeBgBIAEoBRIPCgd1cHBlcl95GAIgASgFEg8KB3JpZ2h0X3gYAyAB", + "KAUSDwoHbG93ZXJfeRgEIAEoBUID+AEB")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.RasterizationReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Locus), global::Mediapipe.Locus.Parser, new[]{ "LocusType", "LocusId", "LocusIdSeed", "Concatenatable", "BoundingBox", "Timestamp", "Region", "ComponentLocus" }, null, new[]{ typeof(global::Mediapipe.Locus.Types.LocusType) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoundingBox), global::Mediapipe.BoundingBox.Parser, new[]{ "LeftX", "UpperY", "RightX", "LowerY" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// A way to identify a part of an image. A locus does not need to correspond to + /// a subset of pixels -- e.g. for a local descriptor we might define a locus in + /// terms of its location and scale, even if the support of the descriptor is the + /// entire image (with location-dependent weighting). + /// + public sealed partial class Locus : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Locus()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocusReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locus() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locus(Locus other) : this() { + _hasBits0 = other._hasBits0; + locusType_ = other.locusType_; + locusId_ = other.locusId_; + locusIdSeed_ = other.locusIdSeed_; + concatenatable_ = other.concatenatable_; + boundingBox_ = other.boundingBox_ != null ? other.boundingBox_.Clone() : null; + timestamp_ = other.timestamp_; + region_ = other.region_ != null ? other.region_.Clone() : null; + componentLocus_ = other.componentLocus_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Locus Clone() { + return new Locus(this); + } + + /// Field number for the "locus_type" field. + public const int LocusTypeFieldNumber = 1; + private readonly static global::Mediapipe.Locus.Types.LocusType LocusTypeDefaultValue = global::Mediapipe.Locus.Types.LocusType.Global; + + private global::Mediapipe.Locus.Types.LocusType locusType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Locus.Types.LocusType LocusType { + get { if ((_hasBits0 & 1) != 0) { return locusType_; } else { return LocusTypeDefaultValue; } } + set { + _hasBits0 |= 1; + locusType_ = value; + } + } + /// Gets whether the "locus_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLocusType { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "locus_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLocusType() { + _hasBits0 &= ~1; + } + + /// Field number for the "locus_id" field. + public const int LocusIdFieldNumber = 2; + private readonly static ulong LocusIdDefaultValue = 0UL; + + private ulong locusId_; + /// + /// A unique identifier for the locus. It is meaningless to compare the + /// locus_ids in different images. The client should not also assume that + /// applying the same processing to the same image multiple times will produce + /// the same locus_id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong LocusId { + get { if ((_hasBits0 & 2) != 0) { return locusId_; } else { return LocusIdDefaultValue; } } + set { + _hasBits0 |= 2; + locusId_ = value; + } + } + /// Gets whether the "locus_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLocusId { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "locus_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLocusId() { + _hasBits0 &= ~2; + } + + /// Field number for the "locus_id_seed" field. + public const int LocusIdSeedFieldNumber = 6; + private readonly static ulong LocusIdSeedDefaultValue = 0UL; + + private ulong locusIdSeed_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong LocusIdSeed { + get { if ((_hasBits0 & 8) != 0) { return locusIdSeed_; } else { return LocusIdSeedDefaultValue; } } + set { + _hasBits0 |= 8; + locusIdSeed_ = value; + } + } + /// Gets whether the "locus_id_seed" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLocusIdSeed { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "locus_id_seed" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLocusIdSeed() { + _hasBits0 &= ~8; + } + + /// Field number for the "concatenatable" field. + public const int ConcatenatableFieldNumber = 5; + private readonly static bool ConcatenatableDefaultValue = true; + + private bool concatenatable_; + /// + /// "Concatenatable" loci have the property that they appear in the same number + /// and order for all images, so their corresponding features can be + /// concatenated. Examples of concatenatable loci include global loci, those + /// corresponding to fixed bounding boxes, or a single most salient + /// region. Loci produced by segmentation with a variable number of segments, + /// on the other hand, are not concatenatable. This flag is true by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Concatenatable { + get { if ((_hasBits0 & 4) != 0) { return concatenatable_; } else { return ConcatenatableDefaultValue; } } + set { + _hasBits0 |= 4; + concatenatable_ = value; + } + } + /// Gets whether the "concatenatable" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasConcatenatable { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "concatenatable" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearConcatenatable() { + _hasBits0 &= ~4; + } + + /// Field number for the "bounding_box" field. + public const int BoundingBoxFieldNumber = 3; + private global::Mediapipe.BoundingBox boundingBox_; + /// + /// Required if locus_type = BOUNDING_BOX, Specifies a bounding box for the + /// label + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BoundingBox BoundingBox { + get { return boundingBox_; } + set { + boundingBox_ = value; + } + } + + /// Field number for the "timestamp" field. + public const int TimestampFieldNumber = 7; + private readonly static int TimestampDefaultValue = -1; + + private int timestamp_; + /// + /// Specifies a timestamp if this locus appears in a video. + /// timestamp is specified in mSec from start of the video and refers to the + /// begining of the locus. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Timestamp { + get { if ((_hasBits0 & 16) != 0) { return timestamp_; } else { return TimestampDefaultValue; } } + set { + _hasBits0 |= 16; + timestamp_ = value; + } + } + /// Gets whether the "timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestamp { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestamp() { + _hasBits0 &= ~16; + } + + /// Field number for the "region" field. + public const int RegionFieldNumber = 4; + private global::Mediapipe.Rasterization region_; + /// + /// Required if locus_type = REGION, Specifies a region using a scanline + /// encoding + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Rasterization Region { + get { return region_; } + set { + region_ = value; + } + } + + /// Field number for the "component_locus" field. + public const int ComponentLocusFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_componentLocus_codec + = pb::FieldCodec.ForMessage(66, global::Mediapipe.Locus.Parser); + private readonly pbc::RepeatedField componentLocus_ = new pbc::RepeatedField(); + /// + /// Required if locus_type = VIDEO_TUBE. Specifies the component loci of the + /// tube. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ComponentLocus { + get { return componentLocus_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Locus); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Locus other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LocusType != other.LocusType) return false; + if (LocusId != other.LocusId) return false; + if (LocusIdSeed != other.LocusIdSeed) return false; + if (Concatenatable != other.Concatenatable) return false; + if (!object.Equals(BoundingBox, other.BoundingBox)) return false; + if (Timestamp != other.Timestamp) return false; + if (!object.Equals(Region, other.Region)) return false; + if(!componentLocus_.Equals(other.componentLocus_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLocusType) hash ^= LocusType.GetHashCode(); + if (HasLocusId) hash ^= LocusId.GetHashCode(); + if (HasLocusIdSeed) hash ^= LocusIdSeed.GetHashCode(); + if (HasConcatenatable) hash ^= Concatenatable.GetHashCode(); + if (boundingBox_ != null) hash ^= BoundingBox.GetHashCode(); + if (HasTimestamp) hash ^= Timestamp.GetHashCode(); + if (region_ != null) hash ^= Region.GetHashCode(); + hash ^= componentLocus_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLocusType) { + output.WriteRawTag(8); + output.WriteEnum((int) LocusType); + } + if (HasLocusId) { + output.WriteRawTag(17); + output.WriteFixed64(LocusId); + } + if (boundingBox_ != null) { + output.WriteRawTag(26); + output.WriteMessage(BoundingBox); + } + if (region_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Region); + } + if (HasConcatenatable) { + output.WriteRawTag(40); + output.WriteBool(Concatenatable); + } + if (HasLocusIdSeed) { + output.WriteRawTag(49); + output.WriteFixed64(LocusIdSeed); + } + if (HasTimestamp) { + output.WriteRawTag(56); + output.WriteInt32(Timestamp); + } + componentLocus_.WriteTo(output, _repeated_componentLocus_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLocusType) { + output.WriteRawTag(8); + output.WriteEnum((int) LocusType); + } + if (HasLocusId) { + output.WriteRawTag(17); + output.WriteFixed64(LocusId); + } + if (boundingBox_ != null) { + output.WriteRawTag(26); + output.WriteMessage(BoundingBox); + } + if (region_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Region); + } + if (HasConcatenatable) { + output.WriteRawTag(40); + output.WriteBool(Concatenatable); + } + if (HasLocusIdSeed) { + output.WriteRawTag(49); + output.WriteFixed64(LocusIdSeed); + } + if (HasTimestamp) { + output.WriteRawTag(56); + output.WriteInt32(Timestamp); + } + componentLocus_.WriteTo(ref output, _repeated_componentLocus_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLocusType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LocusType); + } + if (HasLocusId) { + size += 1 + 8; + } + if (HasLocusIdSeed) { + size += 1 + 8; + } + if (HasConcatenatable) { + size += 1 + 1; + } + if (boundingBox_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoundingBox); + } + if (HasTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Timestamp); + } + if (region_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Region); + } + size += componentLocus_.CalculateSize(_repeated_componentLocus_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Locus other) { + if (other == null) { + return; + } + if (other.HasLocusType) { + LocusType = other.LocusType; + } + if (other.HasLocusId) { + LocusId = other.LocusId; + } + if (other.HasLocusIdSeed) { + LocusIdSeed = other.LocusIdSeed; + } + if (other.HasConcatenatable) { + Concatenatable = other.Concatenatable; + } + if (other.boundingBox_ != null) { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.BoundingBox(); + } + BoundingBox.MergeFrom(other.BoundingBox); + } + if (other.HasTimestamp) { + Timestamp = other.Timestamp; + } + if (other.region_ != null) { + if (region_ == null) { + Region = new global::Mediapipe.Rasterization(); + } + Region.MergeFrom(other.Region); + } + componentLocus_.Add(other.componentLocus_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + LocusType = (global::Mediapipe.Locus.Types.LocusType) input.ReadEnum(); + break; + } + case 17: { + LocusId = input.ReadFixed64(); + break; + } + case 26: { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.BoundingBox(); + } + input.ReadMessage(BoundingBox); + break; + } + case 34: { + if (region_ == null) { + Region = new global::Mediapipe.Rasterization(); + } + input.ReadMessage(Region); + break; + } + case 40: { + Concatenatable = input.ReadBool(); + break; + } + case 49: { + LocusIdSeed = input.ReadFixed64(); + break; + } + case 56: { + Timestamp = input.ReadInt32(); + break; + } + case 66: { + componentLocus_.AddEntriesFrom(input, _repeated_componentLocus_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + LocusType = (global::Mediapipe.Locus.Types.LocusType) input.ReadEnum(); + break; + } + case 17: { + LocusId = input.ReadFixed64(); + break; + } + case 26: { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.BoundingBox(); + } + input.ReadMessage(BoundingBox); + break; + } + case 34: { + if (region_ == null) { + Region = new global::Mediapipe.Rasterization(); + } + input.ReadMessage(Region); + break; + } + case 40: { + Concatenatable = input.ReadBool(); + break; + } + case 49: { + LocusIdSeed = input.ReadFixed64(); + break; + } + case 56: { + Timestamp = input.ReadInt32(); + break; + } + case 66: { + componentLocus_.AddEntriesFrom(ref input, _repeated_componentLocus_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Locus message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Types of image loci on the granularity of the annotation. + /// + public enum LocusType { + /// + /// The whole image, without localization. + /// + [pbr::OriginalName("GLOBAL")] Global = 1, + /// + /// The locus refers to a specified bounding box. + /// Requires bounding_box below. + /// + [pbr::OriginalName("BOUNDING_BOX")] BoundingBox = 2, + /// + /// The locus refers to specified regions in the image. + /// Requires region below. + /// + [pbr::OriginalName("REGION")] Region = 3, + /// + /// This locus refers to groups of loci. Requires component_locus below. + /// + [pbr::OriginalName("VIDEO_TUBE")] VideoTube = 4, + } + + } + #endregion + + } + + /// + /// A representation of a bounding box. + /// + public sealed partial class BoundingBox : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoundingBox()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocusReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox(BoundingBox other) : this() { + _hasBits0 = other._hasBits0; + leftX_ = other.leftX_; + upperY_ = other.upperY_; + rightX_ = other.rightX_; + lowerY_ = other.lowerY_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox Clone() { + return new BoundingBox(this); + } + + /// Field number for the "left_x" field. + public const int LeftXFieldNumber = 1; + private readonly static int LeftXDefaultValue = 0; + + private int leftX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LeftX { + get { if ((_hasBits0 & 1) != 0) { return leftX_; } else { return LeftXDefaultValue; } } + set { + _hasBits0 |= 1; + leftX_ = value; + } + } + /// Gets whether the "left_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeftX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "left_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeftX() { + _hasBits0 &= ~1; + } + + /// Field number for the "upper_y" field. + public const int UpperYFieldNumber = 2; + private readonly static int UpperYDefaultValue = 0; + + private int upperY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int UpperY { + get { if ((_hasBits0 & 2) != 0) { return upperY_; } else { return UpperYDefaultValue; } } + set { + _hasBits0 |= 2; + upperY_ = value; + } + } + /// Gets whether the "upper_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpperY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "upper_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpperY() { + _hasBits0 &= ~2; + } + + /// Field number for the "right_x" field. + public const int RightXFieldNumber = 3; + private readonly static int RightXDefaultValue = 0; + + private int rightX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RightX { + get { if ((_hasBits0 & 4) != 0) { return rightX_; } else { return RightXDefaultValue; } } + set { + _hasBits0 |= 4; + rightX_ = value; + } + } + /// Gets whether the "right_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRightX { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "right_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRightX() { + _hasBits0 &= ~4; + } + + /// Field number for the "lower_y" field. + public const int LowerYFieldNumber = 4; + private readonly static int LowerYDefaultValue = 0; + + private int lowerY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LowerY { + get { if ((_hasBits0 & 8) != 0) { return lowerY_; } else { return LowerYDefaultValue; } } + set { + _hasBits0 |= 8; + lowerY_ = value; + } + } + /// Gets whether the "lower_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowerY { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "lower_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowerY() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoundingBox); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoundingBox other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LeftX != other.LeftX) return false; + if (UpperY != other.UpperY) return false; + if (RightX != other.RightX) return false; + if (LowerY != other.LowerY) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLeftX) hash ^= LeftX.GetHashCode(); + if (HasUpperY) hash ^= UpperY.GetHashCode(); + if (HasRightX) hash ^= RightX.GetHashCode(); + if (HasLowerY) hash ^= LowerY.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLeftX) { + output.WriteRawTag(8); + output.WriteInt32(LeftX); + } + if (HasUpperY) { + output.WriteRawTag(16); + output.WriteInt32(UpperY); + } + if (HasRightX) { + output.WriteRawTag(24); + output.WriteInt32(RightX); + } + if (HasLowerY) { + output.WriteRawTag(32); + output.WriteInt32(LowerY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLeftX) { + output.WriteRawTag(8); + output.WriteInt32(LeftX); + } + if (HasUpperY) { + output.WriteRawTag(16); + output.WriteInt32(UpperY); + } + if (HasRightX) { + output.WriteRawTag(24); + output.WriteInt32(RightX); + } + if (HasLowerY) { + output.WriteRawTag(32); + output.WriteInt32(LowerY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLeftX) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LeftX); + } + if (HasUpperY) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(UpperY); + } + if (HasRightX) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RightX); + } + if (HasLowerY) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LowerY); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoundingBox other) { + if (other == null) { + return; + } + if (other.HasLeftX) { + LeftX = other.LeftX; + } + if (other.HasUpperY) { + UpperY = other.UpperY; + } + if (other.HasRightX) { + RightX = other.RightX; + } + if (other.HasLowerY) { + LowerY = other.LowerY; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + LeftX = input.ReadInt32(); + break; + } + case 16: { + UpperY = input.ReadInt32(); + break; + } + case 24: { + RightX = input.ReadInt32(); + break; + } + case 32: { + LowerY = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + LeftX = input.ReadInt32(); + break; + } + case 16: { + UpperY = input.ReadInt32(); + break; + } + case 24: { + RightX = input.ReadInt32(); + break; + } + case 32: { + LowerY = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs.meta new file mode 100644 index 0000000..6087aa5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Locus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0ce23cd032a4e3fc8c97cf73787a889 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs new file mode 100644 index 0000000..daf0c8e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs @@ -0,0 +1,555 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/annotation/rasterization.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/annotation/rasterization.proto + public static partial class RasterizationReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/annotation/rasterization.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RasterizationReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvYW5ub3RhdGlvbi9yYXN0", + "ZXJpemF0aW9uLnByb3RvEgltZWRpYXBpcGUifAoNUmFzdGVyaXphdGlvbhIz", + "CghpbnRlcnZhbBgBIAMoCzIhLm1lZGlhcGlwZS5SYXN0ZXJpemF0aW9uLklu", + "dGVydmFsGjYKCEludGVydmFsEgkKAXkYASACKAUSDgoGbGVmdF94GAIgAigF", + "Eg8KB3JpZ2h0X3gYAyACKAVCQwotY29tLmdvb2dsZS5tZWRpYXBpcGUuZm9y", + "bWF0cy5hbm5vdGF0aW9uLnByb3RvQhJSYXN0ZXJpemF0aW9uUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Rasterization), global::Mediapipe.Rasterization.Parser, new[]{ "Interval" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Rasterization.Types.Interval), global::Mediapipe.Rasterization.Types.Interval.Parser, new[]{ "Y", "LeftX", "RightX" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// A Region can be represented in each frame as a set of scanlines + /// (compressed RLE, similar to rasterization of polygons). + /// For each scanline with y-coordinate y, we save (possibly multiple) intervals + /// of occupied pixels represented as a pair [left_x, right_x]. + /// + public sealed partial class Rasterization : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rasterization()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RasterizationReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rasterization() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rasterization(Rasterization other) : this() { + interval_ = other.interval_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rasterization Clone() { + return new Rasterization(this); + } + + /// Field number for the "interval" field. + public const int IntervalFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_interval_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Rasterization.Types.Interval.Parser); + private readonly pbc::RepeatedField interval_ = new pbc::RepeatedField(); + /// + /// Intervals are always sorted by y-coordinate. + /// Therefore, a region occupies a set of scanlines ranging + /// from interval(0).y() to interval(interval_size() - 1)).y(). + /// Note: In video, at some scanlines no interval might be present. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Interval { + get { return interval_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Rasterization); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Rasterization other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!interval_.Equals(other.interval_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= interval_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + interval_.WriteTo(output, _repeated_interval_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + interval_.WriteTo(ref output, _repeated_interval_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += interval_.CalculateSize(_repeated_interval_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Rasterization other) { + if (other == null) { + return; + } + interval_.Add(other.interval_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + interval_.AddEntriesFrom(input, _repeated_interval_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + interval_.AddEntriesFrom(ref input, _repeated_interval_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Rasterization message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Interval : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Interval()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.Rasterization.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Interval() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Interval(Interval other) : this() { + _hasBits0 = other._hasBits0; + y_ = other.y_; + leftX_ = other.leftX_; + rightX_ = other.rightX_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Interval Clone() { + return new Interval(this); + } + + /// Field number for the "y" field. + public const int YFieldNumber = 1; + private readonly static int YDefaultValue = 0; + + private int y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Y { + get { if ((_hasBits0 & 1) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 1; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~1; + } + + /// Field number for the "left_x" field. + public const int LeftXFieldNumber = 2; + private readonly static int LeftXDefaultValue = 0; + + private int leftX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LeftX { + get { if ((_hasBits0 & 2) != 0) { return leftX_; } else { return LeftXDefaultValue; } } + set { + _hasBits0 |= 2; + leftX_ = value; + } + } + /// Gets whether the "left_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeftX { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "left_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeftX() { + _hasBits0 &= ~2; + } + + /// Field number for the "right_x" field. + public const int RightXFieldNumber = 3; + private readonly static int RightXDefaultValue = 0; + + private int rightX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RightX { + get { if ((_hasBits0 & 4) != 0) { return rightX_; } else { return RightXDefaultValue; } } + set { + _hasBits0 |= 4; + rightX_ = value; + } + } + /// Gets whether the "right_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRightX { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "right_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRightX() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Interval); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Interval other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Y != other.Y) return false; + if (LeftX != other.LeftX) return false; + if (RightX != other.RightX) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasY) hash ^= Y.GetHashCode(); + if (HasLeftX) hash ^= LeftX.GetHashCode(); + if (HasRightX) hash ^= RightX.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasY) { + output.WriteRawTag(8); + output.WriteInt32(Y); + } + if (HasLeftX) { + output.WriteRawTag(16); + output.WriteInt32(LeftX); + } + if (HasRightX) { + output.WriteRawTag(24); + output.WriteInt32(RightX); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasY) { + output.WriteRawTag(8); + output.WriteInt32(Y); + } + if (HasLeftX) { + output.WriteRawTag(16); + output.WriteInt32(LeftX); + } + if (HasRightX) { + output.WriteRawTag(24); + output.WriteInt32(RightX); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasY) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y); + } + if (HasLeftX) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LeftX); + } + if (HasRightX) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RightX); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Interval other) { + if (other == null) { + return; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasLeftX) { + LeftX = other.LeftX; + } + if (other.HasRightX) { + RightX = other.RightX; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Y = input.ReadInt32(); + break; + } + case 16: { + LeftX = input.ReadInt32(); + break; + } + case 24: { + RightX = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Y = input.ReadInt32(); + break; + } + case 16: { + LeftX = input.ReadInt32(); + break; + } + case 24: { + RightX = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs.meta new file mode 100644 index 0000000..1d2372d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Annotation/Rasterization.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bedb393db8070b50d8ba4d6448a065d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs new file mode 100644 index 0000000..b8de108 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs @@ -0,0 +1,786 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/classification.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/classification.proto + public static partial class ClassificationReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/classification.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ClassificationReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvY2xhc3NpZmljYXRpb24u", + "cHJvdG8SCW1lZGlhcGlwZSJTCg5DbGFzc2lmaWNhdGlvbhINCgVpbmRleBgB", + "IAEoBRINCgVzY29yZRgCIAEoAhINCgVsYWJlbBgDIAEoCRIUCgxkaXNwbGF5", + "X25hbWUYBCABKAkiRwoSQ2xhc3NpZmljYXRpb25MaXN0EjEKDmNsYXNzaWZp", + "Y2F0aW9uGAEgAygLMhkubWVkaWFwaXBlLkNsYXNzaWZpY2F0aW9uIloKHENs", + "YXNzaWZpY2F0aW9uTGlzdENvbGxlY3Rpb24SOgoTY2xhc3NpZmljYXRpb25f", + "bGlzdBgBIAMoCzIdLm1lZGlhcGlwZS5DbGFzc2lmaWNhdGlvbkxpc3RCOQoi", + "Y29tLmdvb2dsZS5tZWRpYXBpcGUuZm9ybWF0cy5wcm90b0ITQ2xhc3NpZmlj", + "YXRpb25Qcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Classification), global::Mediapipe.Classification.Parser, new[]{ "Index", "Score", "Label", "DisplayName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ClassificationList), global::Mediapipe.ClassificationList.Parser, new[]{ "Classification" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ClassificationListCollection), global::Mediapipe.ClassificationListCollection.Parser, new[]{ "ClassificationList" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Classification : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Classification()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ClassificationReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Classification() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Classification(Classification other) : this() { + _hasBits0 = other._hasBits0; + index_ = other.index_; + score_ = other.score_; + label_ = other.label_; + displayName_ = other.displayName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Classification Clone() { + return new Classification(this); + } + + /// Field number for the "index" field. + public const int IndexFieldNumber = 1; + private readonly static int IndexDefaultValue = 0; + + private int index_; + /// + /// The index of the class in the corresponding label map. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Index { + get { if ((_hasBits0 & 1) != 0) { return index_; } else { return IndexDefaultValue; } } + set { + _hasBits0 |= 1; + index_ = value; + } + } + /// Gets whether the "index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIndex { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIndex() { + _hasBits0 &= ~1; + } + + /// Field number for the "score" field. + public const int ScoreFieldNumber = 2; + private readonly static float ScoreDefaultValue = 0F; + + private float score_; + /// + /// The probability score for this class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Score { + get { if ((_hasBits0 & 2) != 0) { return score_; } else { return ScoreDefaultValue; } } + set { + _hasBits0 |= 2; + score_ = value; + } + } + /// Gets whether the "score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScore { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScore() { + _hasBits0 &= ~2; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 3; + private readonly static string LabelDefaultValue = ""; + + private string label_; + /// + /// Label or name of the class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 4; + private readonly static string DisplayNameDefaultValue = ""; + + private string displayName_; + /// + /// Optional human-readable string for display purposes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayName { + get { return displayName_ ?? DisplayNameDefaultValue; } + set { + displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "display_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisplayName { + get { return displayName_ != null; } + } + /// Clears the value of the "display_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisplayName() { + displayName_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Classification); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Classification other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Index != other.Index) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Score, other.Score)) return false; + if (Label != other.Label) return false; + if (DisplayName != other.DisplayName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIndex) hash ^= Index.GetHashCode(); + if (HasScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Score); + if (HasLabel) hash ^= Label.GetHashCode(); + if (HasDisplayName) hash ^= DisplayName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIndex) { + output.WriteRawTag(8); + output.WriteInt32(Index); + } + if (HasScore) { + output.WriteRawTag(21); + output.WriteFloat(Score); + } + if (HasLabel) { + output.WriteRawTag(26); + output.WriteString(Label); + } + if (HasDisplayName) { + output.WriteRawTag(34); + output.WriteString(DisplayName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIndex) { + output.WriteRawTag(8); + output.WriteInt32(Index); + } + if (HasScore) { + output.WriteRawTag(21); + output.WriteFloat(Score); + } + if (HasLabel) { + output.WriteRawTag(26); + output.WriteString(Label); + } + if (HasDisplayName) { + output.WriteRawTag(34); + output.WriteString(DisplayName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Index); + } + if (HasScore) { + size += 1 + 4; + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (HasDisplayName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Classification other) { + if (other == null) { + return; + } + if (other.HasIndex) { + Index = other.Index; + } + if (other.HasScore) { + Score = other.Score; + } + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasDisplayName) { + DisplayName = other.DisplayName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Index = input.ReadInt32(); + break; + } + case 21: { + Score = input.ReadFloat(); + break; + } + case 26: { + Label = input.ReadString(); + break; + } + case 34: { + DisplayName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Index = input.ReadInt32(); + break; + } + case 21: { + Score = input.ReadFloat(); + break; + } + case 26: { + Label = input.ReadString(); + break; + } + case 34: { + DisplayName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Group of Classification protos. + /// + public sealed partial class ClassificationList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClassificationList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ClassificationReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationList(ClassificationList other) : this() { + classification_ = other.classification_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationList Clone() { + return new ClassificationList(this); + } + + /// Field number for the "classification" field. + public const int ClassificationFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_classification_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Classification.Parser); + private readonly pbc::RepeatedField classification_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Classification { + get { return classification_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ClassificationList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ClassificationList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!classification_.Equals(other.classification_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= classification_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + classification_.WriteTo(output, _repeated_classification_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + classification_.WriteTo(ref output, _repeated_classification_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += classification_.CalculateSize(_repeated_classification_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ClassificationList other) { + if (other == null) { + return; + } + classification_.Add(other.classification_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + classification_.AddEntriesFrom(input, _repeated_classification_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + classification_.AddEntriesFrom(ref input, _repeated_classification_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Group of ClassificationList protos. + /// + public sealed partial class ClassificationListCollection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClassificationListCollection()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ClassificationReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationListCollection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationListCollection(ClassificationListCollection other) : this() { + classificationList_ = other.classificationList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClassificationListCollection Clone() { + return new ClassificationListCollection(this); + } + + /// Field number for the "classification_list" field. + public const int ClassificationListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_classificationList_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ClassificationList.Parser); + private readonly pbc::RepeatedField classificationList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ClassificationList { + get { return classificationList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ClassificationListCollection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ClassificationListCollection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!classificationList_.Equals(other.classificationList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= classificationList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + classificationList_.WriteTo(output, _repeated_classificationList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + classificationList_.WriteTo(ref output, _repeated_classificationList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += classificationList_.CalculateSize(_repeated_classificationList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ClassificationListCollection other) { + if (other == null) { + return; + } + classificationList_.Add(other.classificationList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + classificationList_.AddEntriesFrom(input, _repeated_classificationList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + classificationList_.AddEntriesFrom(ref input, _repeated_classificationList_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs.meta new file mode 100644 index 0000000..e533b06 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Classification.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f38215582182a0826954a8789b14676a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs new file mode 100644 index 0000000..2f21d83 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs @@ -0,0 +1,1071 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/detection.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/detection.proto + public static partial class DetectionReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/detection.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DetectionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CittZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvZGV0ZWN0aW9uLnByb3Rv", + "EgltZWRpYXBpcGUaL21lZGlhcGlwZS9mcmFtZXdvcmsvZm9ybWF0cy9sb2Nh", + "dGlvbl9kYXRhLnByb3RvIt4CCglEZXRlY3Rpb24SDQoFbGFiZWwYASADKAkS", + "FAoIbGFiZWxfaWQYAiADKAVCAhABEhEKBXNjb3JlGAMgAygCQgIQARIuCg1s", + "b2NhdGlvbl9kYXRhGAQgASgLMhcubWVkaWFwaXBlLkxvY2F0aW9uRGF0YRIT", + "CgtmZWF0dXJlX3RhZxgFIAEoCRIQCgh0cmFja19pZBgGIAEoCRIUCgxkZXRl", + "Y3Rpb25faWQYByABKAMSRwoVYXNzb2NpYXRlZF9kZXRlY3Rpb25zGAggAygL", + "MigubWVkaWFwaXBlLkRldGVjdGlvbi5Bc3NvY2lhdGVkRGV0ZWN0aW9uEhQK", + "DGRpc3BsYXlfbmFtZRgJIAMoCRIWCg50aW1lc3RhbXBfdXNlYxgKIAEoAxo1", + "ChNBc3NvY2lhdGVkRGV0ZWN0aW9uEgoKAmlkGAEgASgFEhIKCmNvbmZpZGVu", + "Y2UYAiABKAIiOAoNRGV0ZWN0aW9uTGlzdBInCglkZXRlY3Rpb24YASADKAsy", + "FC5tZWRpYXBpcGUuRGV0ZWN0aW9uQjQKImNvbS5nb29nbGUubWVkaWFwaXBl", + "LmZvcm1hdHMucHJvdG9CDkRldGVjdGlvblByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.LocationDataReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Detection), global::Mediapipe.Detection.Parser, new[]{ "Label", "LabelId", "Score", "LocationData", "FeatureTag", "TrackId", "DetectionId", "AssociatedDetections", "DisplayName", "TimestampUsec" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Detection.Types.AssociatedDetection), global::Mediapipe.Detection.Types.AssociatedDetection.Parser, new[]{ "Id", "Confidence" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.DetectionList), global::Mediapipe.DetectionList.Parser, new[]{ "Detection" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Detection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Detection()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DetectionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Detection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Detection(Detection other) : this() { + _hasBits0 = other._hasBits0; + label_ = other.label_.Clone(); + labelId_ = other.labelId_.Clone(); + score_ = other.score_.Clone(); + locationData_ = other.locationData_ != null ? other.locationData_.Clone() : null; + featureTag_ = other.featureTag_; + trackId_ = other.trackId_; + detectionId_ = other.detectionId_; + associatedDetections_ = other.associatedDetections_.Clone(); + displayName_ = other.displayName_.Clone(); + timestampUsec_ = other.timestampUsec_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Detection Clone() { + return new Detection(this); + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_label_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField label_ = new pbc::RepeatedField(); + /// + /// i-th label or label_id has a score encoded by the i-th element in score. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Label { + get { return label_; } + } + + /// Field number for the "label_id" field. + public const int LabelIdFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_labelId_codec + = pb::FieldCodec.ForInt32(18); + private readonly pbc::RepeatedField labelId_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LabelId { + get { return labelId_; } + } + + /// Field number for the "score" field. + public const int ScoreFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_score_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField score_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Score { + get { return score_; } + } + + /// Field number for the "location_data" field. + public const int LocationDataFieldNumber = 4; + private global::Mediapipe.LocationData locationData_; + /// + /// Location data corresponding to all detected labels above. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LocationData LocationData { + get { return locationData_; } + set { + locationData_ = value; + } + } + + /// Field number for the "feature_tag" field. + public const int FeatureTagFieldNumber = 5; + private readonly static string FeatureTagDefaultValue = ""; + + private string featureTag_; + /// + /// Optional string to indicate the feature generation method. Useful in + /// associating a name to the pipeline used to generate this detection. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FeatureTag { + get { return featureTag_ ?? FeatureTagDefaultValue; } + set { + featureTag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "feature_tag" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureTag { + get { return featureTag_ != null; } + } + /// Clears the value of the "feature_tag" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureTag() { + featureTag_ = null; + } + + /// Field number for the "track_id" field. + public const int TrackIdFieldNumber = 6; + private readonly static string TrackIdDefaultValue = ""; + + private string trackId_; + /// + /// Optional string to specify track_id if detection is part of a track. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TrackId { + get { return trackId_ ?? TrackIdDefaultValue; } + set { + trackId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "track_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackId { + get { return trackId_ != null; } + } + /// Clears the value of the "track_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackId() { + trackId_ = null; + } + + /// Field number for the "detection_id" field. + public const int DetectionIdFieldNumber = 7; + private readonly static long DetectionIdDefaultValue = 0L; + + private long detectionId_; + /// + /// Optional unique id to help associate different Detections to each other. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long DetectionId { + get { if ((_hasBits0 & 1) != 0) { return detectionId_; } else { return DetectionIdDefaultValue; } } + set { + _hasBits0 |= 1; + detectionId_ = value; + } + } + /// Gets whether the "detection_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDetectionId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "detection_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDetectionId() { + _hasBits0 &= ~1; + } + + /// Field number for the "associated_detections" field. + public const int AssociatedDetectionsFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_associatedDetections_codec + = pb::FieldCodec.ForMessage(66, global::Mediapipe.Detection.Types.AssociatedDetection.Parser); + private readonly pbc::RepeatedField associatedDetections_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AssociatedDetections { + get { return associatedDetections_; } + } + + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_displayName_codec + = pb::FieldCodec.ForString(74); + private readonly pbc::RepeatedField displayName_ = new pbc::RepeatedField(); + /// + /// Human-readable string for display, intended for debugging purposes. The + /// display name corresponds to the label (or label_id). This is optional. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField DisplayName { + get { return displayName_; } + } + + /// Field number for the "timestamp_usec" field. + public const int TimestampUsecFieldNumber = 10; + private readonly static long TimestampUsecDefaultValue = 0L; + + private long timestampUsec_; + /// + /// The timestamp (in microseconds) *at which* this detection was + /// created/detected. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimestampUsec { + get { if ((_hasBits0 & 2) != 0) { return timestampUsec_; } else { return TimestampUsecDefaultValue; } } + set { + _hasBits0 |= 2; + timestampUsec_ = value; + } + } + /// Gets whether the "timestamp_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestampUsec { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "timestamp_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestampUsec() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Detection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Detection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!label_.Equals(other.label_)) return false; + if(!labelId_.Equals(other.labelId_)) return false; + if(!score_.Equals(other.score_)) return false; + if (!object.Equals(LocationData, other.LocationData)) return false; + if (FeatureTag != other.FeatureTag) return false; + if (TrackId != other.TrackId) return false; + if (DetectionId != other.DetectionId) return false; + if(!associatedDetections_.Equals(other.associatedDetections_)) return false; + if(!displayName_.Equals(other.displayName_)) return false; + if (TimestampUsec != other.TimestampUsec) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= label_.GetHashCode(); + hash ^= labelId_.GetHashCode(); + hash ^= score_.GetHashCode(); + if (locationData_ != null) hash ^= LocationData.GetHashCode(); + if (HasFeatureTag) hash ^= FeatureTag.GetHashCode(); + if (HasTrackId) hash ^= TrackId.GetHashCode(); + if (HasDetectionId) hash ^= DetectionId.GetHashCode(); + hash ^= associatedDetections_.GetHashCode(); + hash ^= displayName_.GetHashCode(); + if (HasTimestampUsec) hash ^= TimestampUsec.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + label_.WriteTo(output, _repeated_label_codec); + labelId_.WriteTo(output, _repeated_labelId_codec); + score_.WriteTo(output, _repeated_score_codec); + if (locationData_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LocationData); + } + if (HasFeatureTag) { + output.WriteRawTag(42); + output.WriteString(FeatureTag); + } + if (HasTrackId) { + output.WriteRawTag(50); + output.WriteString(TrackId); + } + if (HasDetectionId) { + output.WriteRawTag(56); + output.WriteInt64(DetectionId); + } + associatedDetections_.WriteTo(output, _repeated_associatedDetections_codec); + displayName_.WriteTo(output, _repeated_displayName_codec); + if (HasTimestampUsec) { + output.WriteRawTag(80); + output.WriteInt64(TimestampUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + label_.WriteTo(ref output, _repeated_label_codec); + labelId_.WriteTo(ref output, _repeated_labelId_codec); + score_.WriteTo(ref output, _repeated_score_codec); + if (locationData_ != null) { + output.WriteRawTag(34); + output.WriteMessage(LocationData); + } + if (HasFeatureTag) { + output.WriteRawTag(42); + output.WriteString(FeatureTag); + } + if (HasTrackId) { + output.WriteRawTag(50); + output.WriteString(TrackId); + } + if (HasDetectionId) { + output.WriteRawTag(56); + output.WriteInt64(DetectionId); + } + associatedDetections_.WriteTo(ref output, _repeated_associatedDetections_codec); + displayName_.WriteTo(ref output, _repeated_displayName_codec); + if (HasTimestampUsec) { + output.WriteRawTag(80); + output.WriteInt64(TimestampUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += label_.CalculateSize(_repeated_label_codec); + size += labelId_.CalculateSize(_repeated_labelId_codec); + size += score_.CalculateSize(_repeated_score_codec); + if (locationData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LocationData); + } + if (HasFeatureTag) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FeatureTag); + } + if (HasTrackId) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TrackId); + } + if (HasDetectionId) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DetectionId); + } + size += associatedDetections_.CalculateSize(_repeated_associatedDetections_codec); + size += displayName_.CalculateSize(_repeated_displayName_codec); + if (HasTimestampUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimestampUsec); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Detection other) { + if (other == null) { + return; + } + label_.Add(other.label_); + labelId_.Add(other.labelId_); + score_.Add(other.score_); + if (other.locationData_ != null) { + if (locationData_ == null) { + LocationData = new global::Mediapipe.LocationData(); + } + LocationData.MergeFrom(other.LocationData); + } + if (other.HasFeatureTag) { + FeatureTag = other.FeatureTag; + } + if (other.HasTrackId) { + TrackId = other.TrackId; + } + if (other.HasDetectionId) { + DetectionId = other.DetectionId; + } + associatedDetections_.Add(other.associatedDetections_); + displayName_.Add(other.displayName_); + if (other.HasTimestampUsec) { + TimestampUsec = other.TimestampUsec; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + label_.AddEntriesFrom(input, _repeated_label_codec); + break; + } + case 18: + case 16: { + labelId_.AddEntriesFrom(input, _repeated_labelId_codec); + break; + } + case 26: + case 29: { + score_.AddEntriesFrom(input, _repeated_score_codec); + break; + } + case 34: { + if (locationData_ == null) { + LocationData = new global::Mediapipe.LocationData(); + } + input.ReadMessage(LocationData); + break; + } + case 42: { + FeatureTag = input.ReadString(); + break; + } + case 50: { + TrackId = input.ReadString(); + break; + } + case 56: { + DetectionId = input.ReadInt64(); + break; + } + case 66: { + associatedDetections_.AddEntriesFrom(input, _repeated_associatedDetections_codec); + break; + } + case 74: { + displayName_.AddEntriesFrom(input, _repeated_displayName_codec); + break; + } + case 80: { + TimestampUsec = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + label_.AddEntriesFrom(ref input, _repeated_label_codec); + break; + } + case 18: + case 16: { + labelId_.AddEntriesFrom(ref input, _repeated_labelId_codec); + break; + } + case 26: + case 29: { + score_.AddEntriesFrom(ref input, _repeated_score_codec); + break; + } + case 34: { + if (locationData_ == null) { + LocationData = new global::Mediapipe.LocationData(); + } + input.ReadMessage(LocationData); + break; + } + case 42: { + FeatureTag = input.ReadString(); + break; + } + case 50: { + TrackId = input.ReadString(); + break; + } + case 56: { + DetectionId = input.ReadInt64(); + break; + } + case 66: { + associatedDetections_.AddEntriesFrom(ref input, _repeated_associatedDetections_codec); + break; + } + case 74: { + displayName_.AddEntriesFrom(ref input, _repeated_displayName_codec); + break; + } + case 80: { + TimestampUsec = input.ReadInt64(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Detection message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Useful for associating a detection with other detections based on the + /// detection_id. For example, this could be used to associate a face detection + /// with a body detection when they belong to the same person. + /// + public sealed partial class AssociatedDetection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AssociatedDetection()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.Detection.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociatedDetection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociatedDetection(AssociatedDetection other) : this() { + _hasBits0 = other._hasBits0; + id_ = other.id_; + confidence_ = other.confidence_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AssociatedDetection Clone() { + return new AssociatedDetection(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private readonly static int IdDefaultValue = 0; + + private int id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 1) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 1; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~1; + } + + /// Field number for the "confidence" field. + public const int ConfidenceFieldNumber = 2; + private readonly static float ConfidenceDefaultValue = 0F; + + private float confidence_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Confidence { + get { if ((_hasBits0 & 2) != 0) { return confidence_; } else { return ConfidenceDefaultValue; } } + set { + _hasBits0 |= 2; + confidence_ = value; + } + } + /// Gets whether the "confidence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasConfidence { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "confidence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearConfidence() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AssociatedDetection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AssociatedDetection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Confidence, other.Confidence)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasId) hash ^= Id.GetHashCode(); + if (HasConfidence) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Confidence); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasConfidence) { + output.WriteRawTag(21); + output.WriteFloat(Confidence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasConfidence) { + output.WriteRawTag(21); + output.WriteFloat(Confidence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (HasConfidence) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AssociatedDetection other) { + if (other == null) { + return; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasConfidence) { + Confidence = other.Confidence; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 21: { + Confidence = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 21: { + Confidence = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Group of Detection protos. + /// + public sealed partial class DetectionList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DetectionList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.DetectionReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionList(DetectionList other) : this() { + detection_ = other.detection_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DetectionList Clone() { + return new DetectionList(this); + } + + /// Field number for the "detection" field. + public const int DetectionFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_detection_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Detection.Parser); + private readonly pbc::RepeatedField detection_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Detection { + get { return detection_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DetectionList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DetectionList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!detection_.Equals(other.detection_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= detection_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + detection_.WriteTo(output, _repeated_detection_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + detection_.WriteTo(ref output, _repeated_detection_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += detection_.CalculateSize(_repeated_detection_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DetectionList other) { + if (other == null) { + return; + } + detection_.Add(other.detection_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + detection_.AddEntriesFrom(input, _repeated_detection_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + detection_.AddEntriesFrom(ref input, _repeated_detection_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs.meta new file mode 100644 index 0000000..e61ce90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Detection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8959a6aaf727953d7bf3e26020dc1421 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs new file mode 100644 index 0000000..7479172 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs @@ -0,0 +1,475 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/image_file_properties.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/image_file_properties.proto + public static partial class ImageFilePropertiesReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/image_file_properties.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageFilePropertiesReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjdtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvaW1hZ2VfZmlsZV9wcm9w", + "ZXJ0aWVzLnByb3RvEgltZWRpYXBpcGUikQEKE0ltYWdlRmlsZVByb3BlcnRp", + "ZXMSEwoLaW1hZ2Vfd2lkdGgYASABKA0SFAoMaW1hZ2VfaGVpZ2h0GAIgASgN", + "EhcKD2ZvY2FsX2xlbmd0aF9tbRgDIAEoARIZChFmb2NhbF9sZW5ndGhfMzVt", + "bRgEIAEoARIbChNmb2NhbF9sZW5ndGhfcGl4ZWxzGAUgASgB")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageFileProperties), global::Mediapipe.ImageFileProperties.Parser, new[]{ "ImageWidth", "ImageHeight", "FocalLengthMm", "FocalLength35Mm", "FocalLengthPixels" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// A list of properties extracted from EXIF metadata from an image file. + /// + public sealed partial class ImageFileProperties : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageFileProperties()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageFilePropertiesReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFileProperties() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFileProperties(ImageFileProperties other) : this() { + _hasBits0 = other._hasBits0; + imageWidth_ = other.imageWidth_; + imageHeight_ = other.imageHeight_; + focalLengthMm_ = other.focalLengthMm_; + focalLength35Mm_ = other.focalLength35Mm_; + focalLengthPixels_ = other.focalLengthPixels_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFileProperties Clone() { + return new ImageFileProperties(this); + } + + /// Field number for the "image_width" field. + public const int ImageWidthFieldNumber = 1; + private readonly static uint ImageWidthDefaultValue = 0; + + private uint imageWidth_; + /// + /// Image dimensions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ImageWidth { + get { if ((_hasBits0 & 1) != 0) { return imageWidth_; } else { return ImageWidthDefaultValue; } } + set { + _hasBits0 |= 1; + imageWidth_ = value; + } + } + /// Gets whether the "image_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "image_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "image_height" field. + public const int ImageHeightFieldNumber = 2; + private readonly static uint ImageHeightDefaultValue = 0; + + private uint imageHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ImageHeight { + get { if ((_hasBits0 & 2) != 0) { return imageHeight_; } else { return ImageHeightDefaultValue; } } + set { + _hasBits0 |= 2; + imageHeight_ = value; + } + } + /// Gets whether the "image_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "image_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "focal_length_mm" field. + public const int FocalLengthMmFieldNumber = 3; + private readonly static double FocalLengthMmDefaultValue = 0D; + + private double focalLengthMm_; + /// + /// Focal length of camera lens in millimeters. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FocalLengthMm { + get { if ((_hasBits0 & 4) != 0) { return focalLengthMm_; } else { return FocalLengthMmDefaultValue; } } + set { + _hasBits0 |= 4; + focalLengthMm_ = value; + } + } + /// Gets whether the "focal_length_mm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFocalLengthMm { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "focal_length_mm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFocalLengthMm() { + _hasBits0 &= ~4; + } + + /// Field number for the "focal_length_35mm" field. + public const int FocalLength35MmFieldNumber = 4; + private readonly static double FocalLength35MmDefaultValue = 0D; + + private double focalLength35Mm_; + /// + /// Focal length of camera lens in 35 mm equivalent. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FocalLength35Mm { + get { if ((_hasBits0 & 8) != 0) { return focalLength35Mm_; } else { return FocalLength35MmDefaultValue; } } + set { + _hasBits0 |= 8; + focalLength35Mm_ = value; + } + } + /// Gets whether the "focal_length_35mm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFocalLength35Mm { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "focal_length_35mm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFocalLength35Mm() { + _hasBits0 &= ~8; + } + + /// Field number for the "focal_length_pixels" field. + public const int FocalLengthPixelsFieldNumber = 5; + private readonly static double FocalLengthPixelsDefaultValue = 0D; + + private double focalLengthPixels_; + /// + /// Focal length in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FocalLengthPixels { + get { if ((_hasBits0 & 16) != 0) { return focalLengthPixels_; } else { return FocalLengthPixelsDefaultValue; } } + set { + _hasBits0 |= 16; + focalLengthPixels_ = value; + } + } + /// Gets whether the "focal_length_pixels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFocalLengthPixels { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "focal_length_pixels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFocalLengthPixels() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageFileProperties); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageFileProperties other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ImageWidth != other.ImageWidth) return false; + if (ImageHeight != other.ImageHeight) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FocalLengthMm, other.FocalLengthMm)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FocalLength35Mm, other.FocalLength35Mm)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FocalLengthPixels, other.FocalLengthPixels)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasImageWidth) hash ^= ImageWidth.GetHashCode(); + if (HasImageHeight) hash ^= ImageHeight.GetHashCode(); + if (HasFocalLengthMm) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FocalLengthMm); + if (HasFocalLength35Mm) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FocalLength35Mm); + if (HasFocalLengthPixels) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FocalLengthPixels); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasImageWidth) { + output.WriteRawTag(8); + output.WriteUInt32(ImageWidth); + } + if (HasImageHeight) { + output.WriteRawTag(16); + output.WriteUInt32(ImageHeight); + } + if (HasFocalLengthMm) { + output.WriteRawTag(25); + output.WriteDouble(FocalLengthMm); + } + if (HasFocalLength35Mm) { + output.WriteRawTag(33); + output.WriteDouble(FocalLength35Mm); + } + if (HasFocalLengthPixels) { + output.WriteRawTag(41); + output.WriteDouble(FocalLengthPixels); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasImageWidth) { + output.WriteRawTag(8); + output.WriteUInt32(ImageWidth); + } + if (HasImageHeight) { + output.WriteRawTag(16); + output.WriteUInt32(ImageHeight); + } + if (HasFocalLengthMm) { + output.WriteRawTag(25); + output.WriteDouble(FocalLengthMm); + } + if (HasFocalLength35Mm) { + output.WriteRawTag(33); + output.WriteDouble(FocalLength35Mm); + } + if (HasFocalLengthPixels) { + output.WriteRawTag(41); + output.WriteDouble(FocalLengthPixels); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasImageWidth) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ImageWidth); + } + if (HasImageHeight) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ImageHeight); + } + if (HasFocalLengthMm) { + size += 1 + 8; + } + if (HasFocalLength35Mm) { + size += 1 + 8; + } + if (HasFocalLengthPixels) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageFileProperties other) { + if (other == null) { + return; + } + if (other.HasImageWidth) { + ImageWidth = other.ImageWidth; + } + if (other.HasImageHeight) { + ImageHeight = other.ImageHeight; + } + if (other.HasFocalLengthMm) { + FocalLengthMm = other.FocalLengthMm; + } + if (other.HasFocalLength35Mm) { + FocalLength35Mm = other.FocalLength35Mm; + } + if (other.HasFocalLengthPixels) { + FocalLengthPixels = other.FocalLengthPixels; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ImageWidth = input.ReadUInt32(); + break; + } + case 16: { + ImageHeight = input.ReadUInt32(); + break; + } + case 25: { + FocalLengthMm = input.ReadDouble(); + break; + } + case 33: { + FocalLength35Mm = input.ReadDouble(); + break; + } + case 41: { + FocalLengthPixels = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ImageWidth = input.ReadUInt32(); + break; + } + case 16: { + ImageHeight = input.ReadUInt32(); + break; + } + case 25: { + FocalLengthMm = input.ReadDouble(); + break; + } + case 33: { + FocalLength35Mm = input.ReadDouble(); + break; + } + case 41: { + FocalLengthPixels = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs.meta new file mode 100644 index 0000000..65dcafc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFileProperties.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0228463cfe686d54b97cfb6a22bf08b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs new file mode 100644 index 0000000..cdd76b7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs @@ -0,0 +1,273 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/image_format.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/image_format.proto + public static partial class ImageFormatReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/image_format.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ImageFormatReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci5tZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvaW1hZ2VfZm9ybWF0LnBy", + "b3RvEgltZWRpYXBpcGUiuQEKC0ltYWdlRm9ybWF0IqkBCgZGb3JtYXQSCwoH", + "VU5LTk9XThAAEggKBFNSR0IQARIJCgVTUkdCQRACEgkKBUdSQVk4EAMSCgoG", + "R1JBWTE2EAQSDQoJWUNCQ1I0MjBQEAUSDwoLWUNCQ1I0MjBQMTAQBhIKCgZT", + "UkdCNDgQBxILCgdTUkdCQTY0EAgSCwoHVkVDMzJGMRAJEgsKB1ZFQzMyRjIQ", + "DBIICgRMQUI4EAoSCQoFU0JHUkEQC0I2CiJjb20uZ29vZ2xlLm1lZGlhcGlw", + "ZS5mb3JtYXRzLnByb3RvQhBJbWFnZUZvcm1hdFByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ImageFormat), global::Mediapipe.ImageFormat.Parser, null, null, new[]{ typeof(global::Mediapipe.ImageFormat.Types.Format) }, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ImageFormat : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageFormat()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ImageFormatReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFormat() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFormat(ImageFormat other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageFormat Clone() { + return new ImageFormat(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageFormat); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageFormat other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageFormat other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ImageFormat message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Format { + /// + /// The format is unknown. It is not valid for an ImageFrame to be + /// initialized with this value. + /// + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + /// + /// sRGB, interleaved: one byte for R, then one byte for G, then one + /// byte for B for each pixel. + /// + [pbr::OriginalName("SRGB")] Srgb = 1, + /// + /// sRGBA, interleaved: one byte for R, one byte for G, one byte for B, + /// one byte for alpha or unused. + /// + [pbr::OriginalName("SRGBA")] Srgba = 2, + /// + /// Grayscale, one byte per pixel. + /// + [pbr::OriginalName("GRAY8")] Gray8 = 3, + /// + /// Grayscale, one uint16 per pixel. + /// + [pbr::OriginalName("GRAY16")] Gray16 = 4, + /// + /// YCbCr420P (1 bpp for Y, 0.25 bpp for U and V). + /// NOTE: NOT a valid ImageFrame format, but intended for + /// ScaleImageCalculatorOptions, VideoHeader, etc. to indicate that + /// YUVImage is used in place of ImageFrame. + /// + [pbr::OriginalName("YCBCR420P")] Ycbcr420P = 5, + /// + /// Similar to YCbCr420P, but the data is represented as the lower 10bits of + /// a uint16. Like YCbCr420P, this is NOT a valid ImageFrame, and the data is + /// carried within a YUVImage. + /// + [pbr::OriginalName("YCBCR420P10")] Ycbcr420P10 = 6, + /// + /// sRGB, interleaved, each component is a uint16. + /// + [pbr::OriginalName("SRGB48")] Srgb48 = 7, + /// + /// sRGBA, interleaved, each component is a uint16. + /// + [pbr::OriginalName("SRGBA64")] Srgba64 = 8, + /// + /// One float per pixel. + /// + [pbr::OriginalName("VEC32F1")] Vec32F1 = 9, + /// + /// Two floats per pixel. + /// + [pbr::OriginalName("VEC32F2")] Vec32F2 = 12, + /// + /// LAB, interleaved: one byte for L, then one byte for a, then one + /// byte for b for each pixel. + /// + [pbr::OriginalName("LAB8")] Lab8 = 10, + /// + /// sBGRA, interleaved: one byte for B, one byte for G, one byte for R, + /// one byte for alpha or unused. This is the N32 format for Skia. + /// + [pbr::OriginalName("SBGRA")] Sbgra = 11, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs.meta new file mode 100644 index 0000000..65bb208 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ImageFormat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42b9b71153dfe3f078eb289643ba4e11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs new file mode 100644 index 0000000..746c363 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs @@ -0,0 +1,1634 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/landmark.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/landmark.proto + public static partial class LandmarkReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/landmark.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LandmarkReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiptZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvbGFuZG1hcmsucHJvdG8S", + "CW1lZGlhcGlwZSJRCghMYW5kbWFyaxIJCgF4GAEgASgCEgkKAXkYAiABKAIS", + "CQoBehgDIAEoAhISCgp2aXNpYmlsaXR5GAQgASgCEhAKCHByZXNlbmNlGAUg", + "ASgCIjUKDExhbmRtYXJrTGlzdBIlCghsYW5kbWFyaxgBIAMoCzITLm1lZGlh", + "cGlwZS5MYW5kbWFyayJIChZMYW5kbWFya0xpc3RDb2xsZWN0aW9uEi4KDWxh", + "bmRtYXJrX2xpc3QYASADKAsyFy5tZWRpYXBpcGUuTGFuZG1hcmtMaXN0IlsK", + "Ek5vcm1hbGl6ZWRMYW5kbWFyaxIJCgF4GAEgASgCEgkKAXkYAiABKAISCQoB", + "ehgDIAEoAhISCgp2aXNpYmlsaXR5GAQgASgCEhAKCHByZXNlbmNlGAUgASgC", + "IkkKFk5vcm1hbGl6ZWRMYW5kbWFya0xpc3QSLwoIbGFuZG1hcmsYASADKAsy", + "HS5tZWRpYXBpcGUuTm9ybWFsaXplZExhbmRtYXJrIlwKIE5vcm1hbGl6ZWRM", + "YW5kbWFya0xpc3RDb2xsZWN0aW9uEjgKDWxhbmRtYXJrX2xpc3QYASADKAsy", + "IS5tZWRpYXBpcGUuTm9ybWFsaXplZExhbmRtYXJrTGlzdEIzCiJjb20uZ29v", + "Z2xlLm1lZGlhcGlwZS5mb3JtYXRzLnByb3RvQg1MYW5kbWFya1Byb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Landmark), global::Mediapipe.Landmark.Parser, new[]{ "X", "Y", "Z", "Visibility", "Presence" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarkList), global::Mediapipe.LandmarkList.Parser, new[]{ "Landmark" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LandmarkListCollection), global::Mediapipe.LandmarkListCollection.Parser, new[]{ "LandmarkList" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NormalizedLandmark), global::Mediapipe.NormalizedLandmark.Parser, new[]{ "X", "Y", "Z", "Visibility", "Presence" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NormalizedLandmarkList), global::Mediapipe.NormalizedLandmarkList.Parser, new[]{ "Landmark" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NormalizedLandmarkListCollection), global::Mediapipe.NormalizedLandmarkListCollection.Parser, new[]{ "LandmarkList" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// A landmark that can have 1 to 3 dimensions. Use x for 1D points, (x, y) for + /// 2D points and (x, y, z) for 3D points. For more dimensions, consider using + /// matrix_data.proto. + /// + public sealed partial class Landmark : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Landmark()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Landmark() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Landmark(Landmark other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + visibility_ = other.visibility_; + presence_ = other.presence_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Landmark Clone() { + return new Landmark(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + /// Field number for the "visibility" field. + public const int VisibilityFieldNumber = 4; + private readonly static float VisibilityDefaultValue = 0F; + + private float visibility_; + /// + /// Landmark visibility. Should stay unset if not supported. + /// Float score of whether landmark is visible or occluded by other objects. + /// Landmark considered as invisible also if it is not present on the screen + /// (out of scene bounds). Depending on the model, visibility value is either a + /// sigmoid or an argument of sigmoid. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Visibility { + get { if ((_hasBits0 & 8) != 0) { return visibility_; } else { return VisibilityDefaultValue; } } + set { + _hasBits0 |= 8; + visibility_ = value; + } + } + /// Gets whether the "visibility" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisibility { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "visibility" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisibility() { + _hasBits0 &= ~8; + } + + /// Field number for the "presence" field. + public const int PresenceFieldNumber = 5; + private readonly static float PresenceDefaultValue = 0F; + + private float presence_; + /// + /// Landmark presence. Should stay unset if not supported. + /// Float score of whether landmark is present on the scene (located within + /// scene bounds). Depending on the model, presence value is either a result of + /// sigmoid or an argument of sigmoid function to get landmark presence + /// probability. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Presence { + get { if ((_hasBits0 & 16) != 0) { return presence_; } else { return PresenceDefaultValue; } } + set { + _hasBits0 |= 16; + presence_ = value; + } + } + /// Gets whether the "presence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPresence { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "presence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPresence() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Landmark); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Landmark other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Visibility, other.Visibility)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Presence, other.Presence)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (HasVisibility) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Visibility); + if (HasPresence) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Presence); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (HasVisibility) { + output.WriteRawTag(37); + output.WriteFloat(Visibility); + } + if (HasPresence) { + output.WriteRawTag(45); + output.WriteFloat(Presence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (HasVisibility) { + output.WriteRawTag(37); + output.WriteFloat(Visibility); + } + if (HasPresence) { + output.WriteRawTag(45); + output.WriteFloat(Presence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (HasVisibility) { + size += 1 + 4; + } + if (HasPresence) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Landmark other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + if (other.HasVisibility) { + Visibility = other.Visibility; + } + if (other.HasPresence) { + Presence = other.Presence; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + Visibility = input.ReadFloat(); + break; + } + case 45: { + Presence = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + Visibility = input.ReadFloat(); + break; + } + case 45: { + Presence = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Group of Landmark protos. + /// + public sealed partial class LandmarkList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarkList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkList(LandmarkList other) : this() { + landmark_ = other.landmark_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkList Clone() { + return new LandmarkList(this); + } + + /// Field number for the "landmark" field. + public const int LandmarkFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_landmark_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Landmark.Parser); + private readonly pbc::RepeatedField landmark_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Landmark { + get { return landmark_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarkList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarkList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!landmark_.Equals(other.landmark_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= landmark_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + landmark_.WriteTo(output, _repeated_landmark_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + landmark_.WriteTo(ref output, _repeated_landmark_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += landmark_.CalculateSize(_repeated_landmark_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarkList other) { + if (other == null) { + return; + } + landmark_.Add(other.landmark_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + landmark_.AddEntriesFrom(input, _repeated_landmark_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + landmark_.AddEntriesFrom(ref input, _repeated_landmark_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Group of LandmarkList protos. + /// + public sealed partial class LandmarkListCollection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarkListCollection()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkListCollection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkListCollection(LandmarkListCollection other) : this() { + landmarkList_ = other.landmarkList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarkListCollection Clone() { + return new LandmarkListCollection(this); + } + + /// Field number for the "landmark_list" field. + public const int LandmarkListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_landmarkList_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.LandmarkList.Parser); + private readonly pbc::RepeatedField landmarkList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LandmarkList { + get { return landmarkList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarkListCollection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarkListCollection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!landmarkList_.Equals(other.landmarkList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= landmarkList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + landmarkList_.WriteTo(output, _repeated_landmarkList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + landmarkList_.WriteTo(ref output, _repeated_landmarkList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += landmarkList_.CalculateSize(_repeated_landmarkList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarkListCollection other) { + if (other == null) { + return; + } + landmarkList_.Add(other.landmarkList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + landmarkList_.AddEntriesFrom(input, _repeated_landmarkList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + landmarkList_.AddEntriesFrom(ref input, _repeated_landmarkList_codec); + break; + } + } + } + } + #endif + + } + + /// + /// A normalized version of above Landmark proto. All coordinates should be + /// within [0, 1]. + /// + public sealed partial class NormalizedLandmark : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizedLandmark()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmark() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmark(NormalizedLandmark other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + visibility_ = other.visibility_; + presence_ = other.presence_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmark Clone() { + return new NormalizedLandmark(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + /// Field number for the "visibility" field. + public const int VisibilityFieldNumber = 4; + private readonly static float VisibilityDefaultValue = 0F; + + private float visibility_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Visibility { + get { if ((_hasBits0 & 8) != 0) { return visibility_; } else { return VisibilityDefaultValue; } } + set { + _hasBits0 |= 8; + visibility_ = value; + } + } + /// Gets whether the "visibility" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisibility { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "visibility" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisibility() { + _hasBits0 &= ~8; + } + + /// Field number for the "presence" field. + public const int PresenceFieldNumber = 5; + private readonly static float PresenceDefaultValue = 0F; + + private float presence_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Presence { + get { if ((_hasBits0 & 16) != 0) { return presence_; } else { return PresenceDefaultValue; } } + set { + _hasBits0 |= 16; + presence_ = value; + } + } + /// Gets whether the "presence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPresence { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "presence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPresence() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NormalizedLandmark); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NormalizedLandmark other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Visibility, other.Visibility)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Presence, other.Presence)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (HasVisibility) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Visibility); + if (HasPresence) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Presence); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (HasVisibility) { + output.WriteRawTag(37); + output.WriteFloat(Visibility); + } + if (HasPresence) { + output.WriteRawTag(45); + output.WriteFloat(Presence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (HasVisibility) { + output.WriteRawTag(37); + output.WriteFloat(Visibility); + } + if (HasPresence) { + output.WriteRawTag(45); + output.WriteFloat(Presence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (HasVisibility) { + size += 1 + 4; + } + if (HasPresence) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NormalizedLandmark other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + if (other.HasVisibility) { + Visibility = other.Visibility; + } + if (other.HasPresence) { + Presence = other.Presence; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + Visibility = input.ReadFloat(); + break; + } + case 45: { + Presence = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + Visibility = input.ReadFloat(); + break; + } + case 45: { + Presence = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Group of NormalizedLandmark protos. + /// + public sealed partial class NormalizedLandmarkList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizedLandmarkList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkList(NormalizedLandmarkList other) : this() { + landmark_ = other.landmark_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkList Clone() { + return new NormalizedLandmarkList(this); + } + + /// Field number for the "landmark" field. + public const int LandmarkFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_landmark_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.NormalizedLandmark.Parser); + private readonly pbc::RepeatedField landmark_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Landmark { + get { return landmark_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NormalizedLandmarkList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NormalizedLandmarkList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!landmark_.Equals(other.landmark_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= landmark_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + landmark_.WriteTo(output, _repeated_landmark_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + landmark_.WriteTo(ref output, _repeated_landmark_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += landmark_.CalculateSize(_repeated_landmark_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NormalizedLandmarkList other) { + if (other == null) { + return; + } + landmark_.Add(other.landmark_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + landmark_.AddEntriesFrom(input, _repeated_landmark_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + landmark_.AddEntriesFrom(ref input, _repeated_landmark_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Group of NormalizedLandmarkList protos. + /// + public sealed partial class NormalizedLandmarkListCollection : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizedLandmarkListCollection()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LandmarkReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkListCollection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkListCollection(NormalizedLandmarkListCollection other) : this() { + landmarkList_ = other.landmarkList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedLandmarkListCollection Clone() { + return new NormalizedLandmarkListCollection(this); + } + + /// Field number for the "landmark_list" field. + public const int LandmarkListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_landmarkList_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.NormalizedLandmarkList.Parser); + private readonly pbc::RepeatedField landmarkList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LandmarkList { + get { return landmarkList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NormalizedLandmarkListCollection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NormalizedLandmarkListCollection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!landmarkList_.Equals(other.landmarkList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= landmarkList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + landmarkList_.WriteTo(output, _repeated_landmarkList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + landmarkList_.WriteTo(ref output, _repeated_landmarkList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += landmarkList_.CalculateSize(_repeated_landmarkList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NormalizedLandmarkListCollection other) { + if (other == null) { + return; + } + landmarkList_.Add(other.landmarkList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + landmarkList_.AddEntriesFrom(input, _repeated_landmarkList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + landmarkList_.AddEntriesFrom(ref input, _repeated_landmarkList_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs.meta new file mode 100644 index 0000000..5e88048 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Landmark.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78c597cedf10ba4f8994d0386ada83f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs new file mode 100644 index 0000000..aeaac95 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs @@ -0,0 +1,1884 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/location_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/location_data.proto + public static partial class LocationDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/location_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LocationDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci9tZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvbG9jYXRpb25fZGF0YS5w", + "cm90bxIJbWVkaWFwaXBlGjptZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMv", + "YW5ub3RhdGlvbi9yYXN0ZXJpemF0aW9uLnByb3RvItUFCgxMb2NhdGlvbkRh", + "dGESLgoGZm9ybWF0GAEgASgOMh4ubWVkaWFwaXBlLkxvY2F0aW9uRGF0YS5G", + "b3JtYXQSOQoMYm91bmRpbmdfYm94GAIgASgLMiMubWVkaWFwaXBlLkxvY2F0", + "aW9uRGF0YS5Cb3VuZGluZ0JveBJKChVyZWxhdGl2ZV9ib3VuZGluZ19ib3gY", + "AyABKAsyKy5tZWRpYXBpcGUuTG9jYXRpb25EYXRhLlJlbGF0aXZlQm91bmRp", + "bmdCb3gSMAoEbWFzaxgEIAEoCzIiLm1lZGlhcGlwZS5Mb2NhdGlvbkRhdGEu", + "QmluYXJ5TWFzaxJEChJyZWxhdGl2ZV9rZXlwb2ludHMYBSADKAsyKC5tZWRp", + "YXBpcGUuTG9jYXRpb25EYXRhLlJlbGF0aXZlS2V5cG9pbnQaSAoLQm91bmRp", + "bmdCb3gSDAoEeG1pbhgBIAEoBRIMCgR5bWluGAIgASgFEg0KBXdpZHRoGAMg", + "ASgFEg4KBmhlaWdodBgEIAEoBRpQChNSZWxhdGl2ZUJvdW5kaW5nQm94EgwK", + "BHhtaW4YASABKAISDAoEeW1pbhgCIAEoAhINCgV3aWR0aBgDIAEoAhIOCgZo", + "ZWlnaHQYBCABKAIaXAoKQmluYXJ5TWFzaxINCgV3aWR0aBgBIAEoBRIOCgZo", + "ZWlnaHQYAiABKAUSLwoNcmFzdGVyaXphdGlvbhgDIAEoCzIYLm1lZGlhcGlw", + "ZS5SYXN0ZXJpemF0aW9uGk8KEFJlbGF0aXZlS2V5cG9pbnQSCQoBeBgBIAEo", + "AhIJCgF5GAIgASgCEhYKDmtleXBvaW50X2xhYmVsGAMgASgJEg0KBXNjb3Jl", + "GAQgASgCIksKBkZvcm1hdBIKCgZHTE9CQUwQABIQCgxCT1VORElOR19CT1gQ", + "ARIZChVSRUxBVElWRV9CT1VORElOR19CT1gQAhIICgRNQVNLEANCNwoiY29t", + "Lmdvb2dsZS5tZWRpYXBpcGUuZm9ybWF0cy5wcm90b0IRTG9jYXRpb25EYXRh", + "UHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.RasterizationReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocationData), global::Mediapipe.LocationData.Parser, new[]{ "Format", "BoundingBox", "RelativeBoundingBox", "Mask", "RelativeKeypoints" }, null, new[]{ typeof(global::Mediapipe.LocationData.Types.Format) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocationData.Types.BoundingBox), global::Mediapipe.LocationData.Types.BoundingBox.Parser, new[]{ "Xmin", "Ymin", "Width", "Height" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocationData.Types.RelativeBoundingBox), global::Mediapipe.LocationData.Types.RelativeBoundingBox.Parser, new[]{ "Xmin", "Ymin", "Width", "Height" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocationData.Types.BinaryMask), global::Mediapipe.LocationData.Types.BinaryMask.Parser, new[]{ "Width", "Height", "Rasterization" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LocationData.Types.RelativeKeypoint), global::Mediapipe.LocationData.Types.RelativeKeypoint.Parser, new[]{ "X", "Y", "KeypointLabel", "Score" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class LocationData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LocationData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocationDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocationData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocationData(LocationData other) : this() { + _hasBits0 = other._hasBits0; + format_ = other.format_; + boundingBox_ = other.boundingBox_ != null ? other.boundingBox_.Clone() : null; + relativeBoundingBox_ = other.relativeBoundingBox_ != null ? other.relativeBoundingBox_.Clone() : null; + mask_ = other.mask_ != null ? other.mask_.Clone() : null; + relativeKeypoints_ = other.relativeKeypoints_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LocationData Clone() { + return new LocationData(this); + } + + /// Field number for the "format" field. + public const int FormatFieldNumber = 1; + private readonly static global::Mediapipe.LocationData.Types.Format FormatDefaultValue = global::Mediapipe.LocationData.Types.Format.Global; + + private global::Mediapipe.LocationData.Types.Format format_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LocationData.Types.Format Format { + get { if ((_hasBits0 & 1) != 0) { return format_; } else { return FormatDefaultValue; } } + set { + _hasBits0 |= 1; + format_ = value; + } + } + /// Gets whether the "format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFormat { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFormat() { + _hasBits0 &= ~1; + } + + /// Field number for the "bounding_box" field. + public const int BoundingBoxFieldNumber = 2; + private global::Mediapipe.LocationData.Types.BoundingBox boundingBox_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LocationData.Types.BoundingBox BoundingBox { + get { return boundingBox_; } + set { + boundingBox_ = value; + } + } + + /// Field number for the "relative_bounding_box" field. + public const int RelativeBoundingBoxFieldNumber = 3; + private global::Mediapipe.LocationData.Types.RelativeBoundingBox relativeBoundingBox_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LocationData.Types.RelativeBoundingBox RelativeBoundingBox { + get { return relativeBoundingBox_; } + set { + relativeBoundingBox_ = value; + } + } + + /// Field number for the "mask" field. + public const int MaskFieldNumber = 4; + private global::Mediapipe.LocationData.Types.BinaryMask mask_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LocationData.Types.BinaryMask Mask { + get { return mask_; } + set { + mask_ = value; + } + } + + /// Field number for the "relative_keypoints" field. + public const int RelativeKeypointsFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_relativeKeypoints_codec + = pb::FieldCodec.ForMessage(42, global::Mediapipe.LocationData.Types.RelativeKeypoint.Parser); + private readonly pbc::RepeatedField relativeKeypoints_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField RelativeKeypoints { + get { return relativeKeypoints_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LocationData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LocationData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Format != other.Format) return false; + if (!object.Equals(BoundingBox, other.BoundingBox)) return false; + if (!object.Equals(RelativeBoundingBox, other.RelativeBoundingBox)) return false; + if (!object.Equals(Mask, other.Mask)) return false; + if(!relativeKeypoints_.Equals(other.relativeKeypoints_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFormat) hash ^= Format.GetHashCode(); + if (boundingBox_ != null) hash ^= BoundingBox.GetHashCode(); + if (relativeBoundingBox_ != null) hash ^= RelativeBoundingBox.GetHashCode(); + if (mask_ != null) hash ^= Mask.GetHashCode(); + hash ^= relativeKeypoints_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFormat) { + output.WriteRawTag(8); + output.WriteEnum((int) Format); + } + if (boundingBox_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BoundingBox); + } + if (relativeBoundingBox_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RelativeBoundingBox); + } + if (mask_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Mask); + } + relativeKeypoints_.WriteTo(output, _repeated_relativeKeypoints_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFormat) { + output.WriteRawTag(8); + output.WriteEnum((int) Format); + } + if (boundingBox_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BoundingBox); + } + if (relativeBoundingBox_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RelativeBoundingBox); + } + if (mask_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Mask); + } + relativeKeypoints_.WriteTo(ref output, _repeated_relativeKeypoints_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFormat) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Format); + } + if (boundingBox_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoundingBox); + } + if (relativeBoundingBox_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RelativeBoundingBox); + } + if (mask_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mask); + } + size += relativeKeypoints_.CalculateSize(_repeated_relativeKeypoints_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LocationData other) { + if (other == null) { + return; + } + if (other.HasFormat) { + Format = other.Format; + } + if (other.boundingBox_ != null) { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.LocationData.Types.BoundingBox(); + } + BoundingBox.MergeFrom(other.BoundingBox); + } + if (other.relativeBoundingBox_ != null) { + if (relativeBoundingBox_ == null) { + RelativeBoundingBox = new global::Mediapipe.LocationData.Types.RelativeBoundingBox(); + } + RelativeBoundingBox.MergeFrom(other.RelativeBoundingBox); + } + if (other.mask_ != null) { + if (mask_ == null) { + Mask = new global::Mediapipe.LocationData.Types.BinaryMask(); + } + Mask.MergeFrom(other.Mask); + } + relativeKeypoints_.Add(other.relativeKeypoints_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Format = (global::Mediapipe.LocationData.Types.Format) input.ReadEnum(); + break; + } + case 18: { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.LocationData.Types.BoundingBox(); + } + input.ReadMessage(BoundingBox); + break; + } + case 26: { + if (relativeBoundingBox_ == null) { + RelativeBoundingBox = new global::Mediapipe.LocationData.Types.RelativeBoundingBox(); + } + input.ReadMessage(RelativeBoundingBox); + break; + } + case 34: { + if (mask_ == null) { + Mask = new global::Mediapipe.LocationData.Types.BinaryMask(); + } + input.ReadMessage(Mask); + break; + } + case 42: { + relativeKeypoints_.AddEntriesFrom(input, _repeated_relativeKeypoints_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Format = (global::Mediapipe.LocationData.Types.Format) input.ReadEnum(); + break; + } + case 18: { + if (boundingBox_ == null) { + BoundingBox = new global::Mediapipe.LocationData.Types.BoundingBox(); + } + input.ReadMessage(BoundingBox); + break; + } + case 26: { + if (relativeBoundingBox_ == null) { + RelativeBoundingBox = new global::Mediapipe.LocationData.Types.RelativeBoundingBox(); + } + input.ReadMessage(RelativeBoundingBox); + break; + } + case 34: { + if (mask_ == null) { + Mask = new global::Mediapipe.LocationData.Types.BinaryMask(); + } + input.ReadMessage(Mask); + break; + } + case 42: { + relativeKeypoints_.AddEntriesFrom(ref input, _repeated_relativeKeypoints_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the LocationData message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The supported formats for representing location data. A single location + /// must store its data in exactly one way. + /// + public enum Format { + /// + /// The full image. This is a handy format when one needs to refer to the + /// full image, e.g. one uses global image labels. No other fields need to + /// be populated. + /// + [pbr::OriginalName("GLOBAL")] Global = 0, + /// + /// A rectangle aka bounding box of an object. The field bounding_box must be + /// used to store the location data. + /// + [pbr::OriginalName("BOUNDING_BOX")] BoundingBox = 1, + /// + /// A rectangle aka bounding box of an object, defined in coordinates + /// normalized by the image dimensions. The field relative_bounding_box must + /// be used to store the location data. + /// + [pbr::OriginalName("RELATIVE_BOUNDING_BOX")] RelativeBoundingBox = 2, + /// + /// A foreground mask. The field mask must be used to store the location + /// data. + /// + [pbr::OriginalName("MASK")] Mask = 3, + } + + /// + /// A bounding box in pixel units. The box is defined by its upper left corner + /// (xmin, ymin) and its width and height. + /// + public sealed partial class BoundingBox : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoundingBox()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocationData.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox(BoundingBox other) : this() { + _hasBits0 = other._hasBits0; + xmin_ = other.xmin_; + ymin_ = other.ymin_; + width_ = other.width_; + height_ = other.height_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoundingBox Clone() { + return new BoundingBox(this); + } + + /// Field number for the "xmin" field. + public const int XminFieldNumber = 1; + private readonly static int XminDefaultValue = 0; + + private int xmin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Xmin { + get { if ((_hasBits0 & 1) != 0) { return xmin_; } else { return XminDefaultValue; } } + set { + _hasBits0 |= 1; + xmin_ = value; + } + } + /// Gets whether the "xmin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXmin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "xmin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXmin() { + _hasBits0 &= ~1; + } + + /// Field number for the "ymin" field. + public const int YminFieldNumber = 2; + private readonly static int YminDefaultValue = 0; + + private int ymin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Ymin { + get { if ((_hasBits0 & 2) != 0) { return ymin_; } else { return YminDefaultValue; } } + set { + _hasBits0 |= 2; + ymin_ = value; + } + } + /// Gets whether the "ymin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYmin { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "ymin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYmin() { + _hasBits0 &= ~2; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 3; + private readonly static int WidthDefaultValue = 0; + + private int width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 4) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 4; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~4; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 4; + private readonly static int HeightDefaultValue = 0; + + private int height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 8) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 8; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoundingBox); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoundingBox other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Xmin != other.Xmin) return false; + if (Ymin != other.Ymin) return false; + if (Width != other.Width) return false; + if (Height != other.Height) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXmin) hash ^= Xmin.GetHashCode(); + if (HasYmin) hash ^= Ymin.GetHashCode(); + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXmin) { + output.WriteRawTag(8); + output.WriteInt32(Xmin); + } + if (HasYmin) { + output.WriteRawTag(16); + output.WriteInt32(Ymin); + } + if (HasWidth) { + output.WriteRawTag(24); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(32); + output.WriteInt32(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXmin) { + output.WriteRawTag(8); + output.WriteInt32(Xmin); + } + if (HasYmin) { + output.WriteRawTag(16); + output.WriteInt32(Ymin); + } + if (HasWidth) { + output.WriteRawTag(24); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(32); + output.WriteInt32(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXmin) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Xmin); + } + if (HasYmin) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Ymin); + } + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoundingBox other) { + if (other == null) { + return; + } + if (other.HasXmin) { + Xmin = other.Xmin; + } + if (other.HasYmin) { + Ymin = other.Ymin; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Xmin = input.ReadInt32(); + break; + } + case 16: { + Ymin = input.ReadInt32(); + break; + } + case 24: { + Width = input.ReadInt32(); + break; + } + case 32: { + Height = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Xmin = input.ReadInt32(); + break; + } + case 16: { + Ymin = input.ReadInt32(); + break; + } + case 24: { + Width = input.ReadInt32(); + break; + } + case 32: { + Height = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// A bounding box. The box is defined by its upper left corner (xmin, ymin) + /// and its width and height, all in coordinates normalized by the image + /// dimensions. + /// + public sealed partial class RelativeBoundingBox : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RelativeBoundingBox()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocationData.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeBoundingBox() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeBoundingBox(RelativeBoundingBox other) : this() { + _hasBits0 = other._hasBits0; + xmin_ = other.xmin_; + ymin_ = other.ymin_; + width_ = other.width_; + height_ = other.height_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeBoundingBox Clone() { + return new RelativeBoundingBox(this); + } + + /// Field number for the "xmin" field. + public const int XminFieldNumber = 1; + private readonly static float XminDefaultValue = 0F; + + private float xmin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Xmin { + get { if ((_hasBits0 & 1) != 0) { return xmin_; } else { return XminDefaultValue; } } + set { + _hasBits0 |= 1; + xmin_ = value; + } + } + /// Gets whether the "xmin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXmin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "xmin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXmin() { + _hasBits0 &= ~1; + } + + /// Field number for the "ymin" field. + public const int YminFieldNumber = 2; + private readonly static float YminDefaultValue = 0F; + + private float ymin_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Ymin { + get { if ((_hasBits0 & 2) != 0) { return ymin_; } else { return YminDefaultValue; } } + set { + _hasBits0 |= 2; + ymin_ = value; + } + } + /// Gets whether the "ymin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYmin { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "ymin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYmin() { + _hasBits0 &= ~2; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 3; + private readonly static float WidthDefaultValue = 0F; + + private float width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Width { + get { if ((_hasBits0 & 4) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 4; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~4; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 4; + private readonly static float HeightDefaultValue = 0F; + + private float height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Height { + get { if ((_hasBits0 & 8) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 8; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RelativeBoundingBox); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RelativeBoundingBox other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Xmin, other.Xmin)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Ymin, other.Ymin)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Width, other.Width)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Height, other.Height)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXmin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Xmin); + if (HasYmin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Ymin); + if (HasWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Width); + if (HasHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Height); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXmin) { + output.WriteRawTag(13); + output.WriteFloat(Xmin); + } + if (HasYmin) { + output.WriteRawTag(21); + output.WriteFloat(Ymin); + } + if (HasWidth) { + output.WriteRawTag(29); + output.WriteFloat(Width); + } + if (HasHeight) { + output.WriteRawTag(37); + output.WriteFloat(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXmin) { + output.WriteRawTag(13); + output.WriteFloat(Xmin); + } + if (HasYmin) { + output.WriteRawTag(21); + output.WriteFloat(Ymin); + } + if (HasWidth) { + output.WriteRawTag(29); + output.WriteFloat(Width); + } + if (HasHeight) { + output.WriteRawTag(37); + output.WriteFloat(Height); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXmin) { + size += 1 + 4; + } + if (HasYmin) { + size += 1 + 4; + } + if (HasWidth) { + size += 1 + 4; + } + if (HasHeight) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RelativeBoundingBox other) { + if (other == null) { + return; + } + if (other.HasXmin) { + Xmin = other.Xmin; + } + if (other.HasYmin) { + Ymin = other.Ymin; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Xmin = input.ReadFloat(); + break; + } + case 21: { + Ymin = input.ReadFloat(); + break; + } + case 29: { + Width = input.ReadFloat(); + break; + } + case 37: { + Height = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Xmin = input.ReadFloat(); + break; + } + case 21: { + Ymin = input.ReadFloat(); + break; + } + case 29: { + Width = input.ReadFloat(); + break; + } + case 37: { + Height = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// A mask of size equivalent to the image size. It encodes a region, which + /// can be thought of as a foreground object mask. + /// + public sealed partial class BinaryMask : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BinaryMask()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocationData.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryMask() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryMask(BinaryMask other) : this() { + _hasBits0 = other._hasBits0; + width_ = other.width_; + height_ = other.height_; + rasterization_ = other.rasterization_ != null ? other.rasterization_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryMask Clone() { + return new BinaryMask(this); + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 1; + private readonly static int WidthDefaultValue = 0; + + private int width_; + /// + /// Dimensions of the mask. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 1) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 1; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 2; + private readonly static int HeightDefaultValue = 0; + + private int height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 2) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 2; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "rasterization" field. + public const int RasterizationFieldNumber = 3; + private global::Mediapipe.Rasterization rasterization_; + /// + /// A rasterization-like format for storing the mask. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Rasterization Rasterization { + get { return rasterization_; } + set { + rasterization_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BinaryMask); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BinaryMask other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Width != other.Width) return false; + if (Height != other.Height) return false; + if (!object.Equals(Rasterization, other.Rasterization)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (rasterization_ != null) hash ^= Rasterization.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (rasterization_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Rasterization); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + if (rasterization_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Rasterization); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (rasterization_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rasterization); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BinaryMask other) { + if (other == null) { + return; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.rasterization_ != null) { + if (rasterization_ == null) { + Rasterization = new global::Mediapipe.Rasterization(); + } + Rasterization.MergeFrom(other.Rasterization); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 26: { + if (rasterization_ == null) { + Rasterization = new global::Mediapipe.Rasterization(); + } + input.ReadMessage(Rasterization); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 26: { + if (rasterization_ == null) { + Rasterization = new global::Mediapipe.Rasterization(); + } + input.ReadMessage(Rasterization); + break; + } + } + } + } + #endif + + } + + /// + /// A keypoint. The keypoint is defined by the coordinates (x, y), normalized + /// by the image dimensions. + /// + public sealed partial class RelativeKeypoint : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RelativeKeypoint()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LocationData.Descriptor.NestedTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeKeypoint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeKeypoint(RelativeKeypoint other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + keypointLabel_ = other.keypointLabel_; + score_ = other.score_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RelativeKeypoint Clone() { + return new RelativeKeypoint(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "keypoint_label" field. + public const int KeypointLabelFieldNumber = 3; + private readonly static string KeypointLabelDefaultValue = ""; + + private string keypointLabel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string KeypointLabel { + get { return keypointLabel_ ?? KeypointLabelDefaultValue; } + set { + keypointLabel_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "keypoint_label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKeypointLabel { + get { return keypointLabel_ != null; } + } + /// Clears the value of the "keypoint_label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKeypointLabel() { + keypointLabel_ = null; + } + + /// Field number for the "score" field. + public const int ScoreFieldNumber = 4; + private readonly static float ScoreDefaultValue = 0F; + + private float score_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Score { + get { if ((_hasBits0 & 4) != 0) { return score_; } else { return ScoreDefaultValue; } } + set { + _hasBits0 |= 4; + score_ = value; + } + } + /// Gets whether the "score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScore { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScore() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RelativeKeypoint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RelativeKeypoint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (KeypointLabel != other.KeypointLabel) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Score, other.Score)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasKeypointLabel) hash ^= KeypointLabel.GetHashCode(); + if (HasScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Score); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasKeypointLabel) { + output.WriteRawTag(26); + output.WriteString(KeypointLabel); + } + if (HasScore) { + output.WriteRawTag(37); + output.WriteFloat(Score); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasKeypointLabel) { + output.WriteRawTag(26); + output.WriteString(KeypointLabel); + } + if (HasScore) { + output.WriteRawTag(37); + output.WriteFloat(Score); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasKeypointLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(KeypointLabel); + } + if (HasScore) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RelativeKeypoint other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasKeypointLabel) { + KeypointLabel = other.KeypointLabel; + } + if (other.HasScore) { + Score = other.Score; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 26: { + KeypointLabel = input.ReadString(); + break; + } + case 37: { + Score = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 26: { + KeypointLabel = input.ReadString(); + break; + } + case 37: { + Score = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs.meta new file mode 100644 index 0000000..094f1b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/LocationData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a74389b68d1b8516a3d72cf9140826a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs new file mode 100644 index 0000000..46be92e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs @@ -0,0 +1,407 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/matrix_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/matrix_data.proto + public static partial class MatrixDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/matrix_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MatrixDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci1tZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvbWF0cml4X2RhdGEucHJv", + "dG8SCW1lZGlhcGlwZSKoAQoKTWF0cml4RGF0YRIMCgRyb3dzGAEgASgFEgwK", + "BGNvbHMYAiABKAUSFwoLcGFja2VkX2RhdGEYAyADKAJCAhABEjoKBmxheW91", + "dBgEIAEoDjIcLm1lZGlhcGlwZS5NYXRyaXhEYXRhLkxheW91dDoMQ09MVU1O", + "X01BSk9SIikKBkxheW91dBIQCgxDT0xVTU5fTUFKT1IQABINCglST1dfTUFK", + "T1IQAUI1CiJjb20uZ29vZ2xlLm1lZGlhcGlwZS5mb3JtYXRzLnByb3RvQg9N", + "YXRyaXhEYXRhUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MatrixData), global::Mediapipe.MatrixData.Parser, new[]{ "Rows", "Cols", "PackedData", "Layout" }, null, new[]{ typeof(global::Mediapipe.MatrixData.Types.Layout) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Proto for serializing Matrix data. + /// Data are stored in column-major order by default. + /// + public sealed partial class MatrixData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MatrixData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MatrixDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MatrixData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MatrixData(MatrixData other) : this() { + _hasBits0 = other._hasBits0; + rows_ = other.rows_; + cols_ = other.cols_; + packedData_ = other.packedData_.Clone(); + layout_ = other.layout_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MatrixData Clone() { + return new MatrixData(this); + } + + /// Field number for the "rows" field. + public const int RowsFieldNumber = 1; + private readonly static int RowsDefaultValue = 0; + + private int rows_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Rows { + get { if ((_hasBits0 & 1) != 0) { return rows_; } else { return RowsDefaultValue; } } + set { + _hasBits0 |= 1; + rows_ = value; + } + } + /// Gets whether the "rows" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRows { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "rows" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRows() { + _hasBits0 &= ~1; + } + + /// Field number for the "cols" field. + public const int ColsFieldNumber = 2; + private readonly static int ColsDefaultValue = 0; + + private int cols_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Cols { + get { if ((_hasBits0 & 2) != 0) { return cols_; } else { return ColsDefaultValue; } } + set { + _hasBits0 |= 2; + cols_ = value; + } + } + /// Gets whether the "cols" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCols { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "cols" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCols() { + _hasBits0 &= ~2; + } + + /// Field number for the "packed_data" field. + public const int PackedDataFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_packedData_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField packedData_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PackedData { + get { return packedData_; } + } + + /// Field number for the "layout" field. + public const int LayoutFieldNumber = 4; + private readonly static global::Mediapipe.MatrixData.Types.Layout LayoutDefaultValue = global::Mediapipe.MatrixData.Types.Layout.ColumnMajor; + + private global::Mediapipe.MatrixData.Types.Layout layout_; + /// + /// Order in which the data are stored. Defaults to COLUMN_MAJOR, which matches + /// the default for mediapipe::Matrix and Eigen::Matrix*. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MatrixData.Types.Layout Layout { + get { if ((_hasBits0 & 4) != 0) { return layout_; } else { return LayoutDefaultValue; } } + set { + _hasBits0 |= 4; + layout_ = value; + } + } + /// Gets whether the "layout" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLayout { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "layout" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLayout() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MatrixData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MatrixData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Rows != other.Rows) return false; + if (Cols != other.Cols) return false; + if(!packedData_.Equals(other.packedData_)) return false; + if (Layout != other.Layout) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRows) hash ^= Rows.GetHashCode(); + if (HasCols) hash ^= Cols.GetHashCode(); + hash ^= packedData_.GetHashCode(); + if (HasLayout) hash ^= Layout.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRows) { + output.WriteRawTag(8); + output.WriteInt32(Rows); + } + if (HasCols) { + output.WriteRawTag(16); + output.WriteInt32(Cols); + } + packedData_.WriteTo(output, _repeated_packedData_codec); + if (HasLayout) { + output.WriteRawTag(32); + output.WriteEnum((int) Layout); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRows) { + output.WriteRawTag(8); + output.WriteInt32(Rows); + } + if (HasCols) { + output.WriteRawTag(16); + output.WriteInt32(Cols); + } + packedData_.WriteTo(ref output, _repeated_packedData_codec); + if (HasLayout) { + output.WriteRawTag(32); + output.WriteEnum((int) Layout); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRows) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Rows); + } + if (HasCols) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Cols); + } + size += packedData_.CalculateSize(_repeated_packedData_codec); + if (HasLayout) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Layout); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MatrixData other) { + if (other == null) { + return; + } + if (other.HasRows) { + Rows = other.Rows; + } + if (other.HasCols) { + Cols = other.Cols; + } + packedData_.Add(other.packedData_); + if (other.HasLayout) { + Layout = other.Layout; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Rows = input.ReadInt32(); + break; + } + case 16: { + Cols = input.ReadInt32(); + break; + } + case 26: + case 29: { + packedData_.AddEntriesFrom(input, _repeated_packedData_codec); + break; + } + case 32: { + Layout = (global::Mediapipe.MatrixData.Types.Layout) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Rows = input.ReadInt32(); + break; + } + case 16: { + Cols = input.ReadInt32(); + break; + } + case 26: + case 29: { + packedData_.AddEntriesFrom(ref input, _repeated_packedData_codec); + break; + } + case 32: { + Layout = (global::Mediapipe.MatrixData.Types.Layout) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MatrixData message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Layout { + [pbr::OriginalName("COLUMN_MAJOR")] ColumnMajor = 0, + [pbr::OriginalName("ROW_MAJOR")] RowMajor = 1, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs.meta new file mode 100644 index 0000000..c905b66 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/MatrixData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 929f5350423bf1842a3e76a8bf6398c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion.meta new file mode 100644 index 0000000..1f5e28c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a44707eeaf10f764e815e490588c2ea3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs new file mode 100644 index 0000000..c7cb275 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs @@ -0,0 +1,362 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/motion/optical_flow_field_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/motion/optical_flow_field_data.proto + public static partial class OpticalFlowFieldDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/motion/optical_flow_field_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static OpticalFlowFieldDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvbW90aW9uL29wdGljYWxf", + "Zmxvd19maWVsZF9kYXRhLnByb3RvEgltZWRpYXBpcGUiVQoUT3B0aWNhbEZs", + "b3dGaWVsZERhdGESDQoFd2lkdGgYASABKAUSDgoGaGVpZ2h0GAIgASgFEg4K", + "AmR4GAMgAygCQgIQARIOCgJkeRgEIAMoAkICEAE=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OpticalFlowFieldData), global::Mediapipe.OpticalFlowFieldData.Parser, new[]{ "Width", "Height", "Dx", "Dy" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class OpticalFlowFieldData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OpticalFlowFieldData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.OpticalFlowFieldDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpticalFlowFieldData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpticalFlowFieldData(OpticalFlowFieldData other) : this() { + _hasBits0 = other._hasBits0; + width_ = other.width_; + height_ = other.height_; + dx_ = other.dx_.Clone(); + dy_ = other.dy_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OpticalFlowFieldData Clone() { + return new OpticalFlowFieldData(this); + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 1; + private readonly static int WidthDefaultValue = 0; + + private int width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 1) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 1; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 2; + private readonly static int HeightDefaultValue = 0; + + private int height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 2) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 2; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_dx_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField dx_ = new pbc::RepeatedField(); + /// + /// Stores the two channels of the flow field in raster order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Dx { + get { return dx_; } + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_dy_codec + = pb::FieldCodec.ForFloat(34); + private readonly pbc::RepeatedField dy_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Dy { + get { return dy_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OpticalFlowFieldData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OpticalFlowFieldData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Width != other.Width) return false; + if (Height != other.Height) return false; + if(!dx_.Equals(other.dx_)) return false; + if(!dy_.Equals(other.dy_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + hash ^= dx_.GetHashCode(); + hash ^= dy_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + dx_.WriteTo(output, _repeated_dx_codec); + dy_.WriteTo(output, _repeated_dy_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasWidth) { + output.WriteRawTag(8); + output.WriteInt32(Width); + } + if (HasHeight) { + output.WriteRawTag(16); + output.WriteInt32(Height); + } + dx_.WriteTo(ref output, _repeated_dx_codec); + dy_.WriteTo(ref output, _repeated_dy_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + size += dx_.CalculateSize(_repeated_dx_codec); + size += dy_.CalculateSize(_repeated_dy_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OpticalFlowFieldData other) { + if (other == null) { + return; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + dx_.Add(other.dx_); + dy_.Add(other.dy_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 26: + case 29: { + dx_.AddEntriesFrom(input, _repeated_dx_codec); + break; + } + case 34: + case 37: { + dy_.AddEntriesFrom(input, _repeated_dy_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Width = input.ReadInt32(); + break; + } + case 16: { + Height = input.ReadInt32(); + break; + } + case 26: + case 29: { + dx_.AddEntriesFrom(ref input, _repeated_dx_codec); + break; + } + case 34: + case 37: { + dy_.AddEntriesFrom(ref input, _repeated_dy_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs.meta new file mode 100644 index 0000000..0d27544 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Motion/OpticalFlowFieldData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b75b15ae6d2ff83a8d6d211e1698c98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection.meta new file mode 100644 index 0000000..3980a8a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd4d7de934069ee4d89debb25bb3c024 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs new file mode 100644 index 0000000..656a7e8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs @@ -0,0 +1,419 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/object_detection/anchor.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/object_detection/anchor.proto + public static partial class AnchorReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/object_detection/anchor.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AnchorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjltZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvb2JqZWN0X2RldGVjdGlv", + "bi9hbmNob3IucHJvdG8SCW1lZGlhcGlwZSJCCgZBbmNob3ISEAoIeF9jZW50", + "ZXIYASACKAISEAoIeV9jZW50ZXIYAiACKAISCQoBaBgDIAIoAhIJCgF3GAQg", + "AigC")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Anchor), global::Mediapipe.Anchor.Parser, new[]{ "XCenter", "YCenter", "H", "W" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// The anchor representation for object detection. + /// + public sealed partial class Anchor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Anchor()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnchorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Anchor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Anchor(Anchor other) : this() { + _hasBits0 = other._hasBits0; + xCenter_ = other.xCenter_; + yCenter_ = other.yCenter_; + h_ = other.h_; + w_ = other.w_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Anchor Clone() { + return new Anchor(this); + } + + /// Field number for the "x_center" field. + public const int XCenterFieldNumber = 1; + private readonly static float XCenterDefaultValue = 0F; + + private float xCenter_; + /// + /// Encoded anchor box center. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float XCenter { + get { if ((_hasBits0 & 1) != 0) { return xCenter_; } else { return XCenterDefaultValue; } } + set { + _hasBits0 |= 1; + xCenter_ = value; + } + } + /// Gets whether the "x_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXCenter { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXCenter() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_center" field. + public const int YCenterFieldNumber = 2; + private readonly static float YCenterDefaultValue = 0F; + + private float yCenter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float YCenter { + get { if ((_hasBits0 & 2) != 0) { return yCenter_; } else { return YCenterDefaultValue; } } + set { + _hasBits0 |= 2; + yCenter_ = value; + } + } + /// Gets whether the "y_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYCenter { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYCenter() { + _hasBits0 &= ~2; + } + + /// Field number for the "h" field. + public const int HFieldNumber = 3; + private readonly static float HDefaultValue = 0F; + + private float h_; + /// + /// Encoded anchor box height. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H { + get { if ((_hasBits0 & 4) != 0) { return h_; } else { return HDefaultValue; } } + set { + _hasBits0 |= 4; + h_ = value; + } + } + /// Gets whether the "h" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "h" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH() { + _hasBits0 &= ~4; + } + + /// Field number for the "w" field. + public const int WFieldNumber = 4; + private readonly static float WDefaultValue = 0F; + + private float w_; + /// + /// Encoded anchor box width. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float W { + get { if ((_hasBits0 & 8) != 0) { return w_; } else { return WDefaultValue; } } + set { + _hasBits0 |= 8; + w_ = value; + } + } + /// Gets whether the "w" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasW { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "w" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearW() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Anchor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Anchor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XCenter, other.XCenter)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YCenter, other.YCenter)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H, other.H)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(W, other.W)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXCenter) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XCenter); + if (HasYCenter) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YCenter); + if (HasH) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H); + if (HasW) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(W); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXCenter) { + output.WriteRawTag(13); + output.WriteFloat(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(21); + output.WriteFloat(YCenter); + } + if (HasH) { + output.WriteRawTag(29); + output.WriteFloat(H); + } + if (HasW) { + output.WriteRawTag(37); + output.WriteFloat(W); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXCenter) { + output.WriteRawTag(13); + output.WriteFloat(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(21); + output.WriteFloat(YCenter); + } + if (HasH) { + output.WriteRawTag(29); + output.WriteFloat(H); + } + if (HasW) { + output.WriteRawTag(37); + output.WriteFloat(W); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXCenter) { + size += 1 + 4; + } + if (HasYCenter) { + size += 1 + 4; + } + if (HasH) { + size += 1 + 4; + } + if (HasW) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Anchor other) { + if (other == null) { + return; + } + if (other.HasXCenter) { + XCenter = other.XCenter; + } + if (other.HasYCenter) { + YCenter = other.YCenter; + } + if (other.HasH) { + H = other.H; + } + if (other.HasW) { + W = other.W; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + XCenter = input.ReadFloat(); + break; + } + case 21: { + YCenter = input.ReadFloat(); + break; + } + case 29: { + H = input.ReadFloat(); + break; + } + case 37: { + W = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + XCenter = input.ReadFloat(); + break; + } + case 21: { + YCenter = input.ReadFloat(); + break; + } + case 29: { + H = input.ReadFloat(); + break; + } + case 37: { + W = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs.meta new file mode 100644 index 0000000..f135071 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/ObjectDetection/Anchor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 615465bf568b94fee8a1e1a67bc072a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs new file mode 100644 index 0000000..f014e02 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs @@ -0,0 +1,1016 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/rect.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/rect.proto + public static partial class RectReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/rect.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RectReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvcmVjdC5wcm90bxIJbWVk", + "aWFwaXBlIm8KBFJlY3QSEAoIeF9jZW50ZXIYASACKAUSEAoIeV9jZW50ZXIY", + "AiACKAUSDgoGaGVpZ2h0GAMgAigFEg0KBXdpZHRoGAQgAigFEhMKCHJvdGF0", + "aW9uGAUgASgCOgEwEg8KB3JlY3RfaWQYBiABKAMieQoOTm9ybWFsaXplZFJl", + "Y3QSEAoIeF9jZW50ZXIYASACKAISEAoIeV9jZW50ZXIYAiACKAISDgoGaGVp", + "Z2h0GAMgAigCEg0KBXdpZHRoGAQgAigCEhMKCHJvdGF0aW9uGAUgASgCOgEw", + "Eg8KB3JlY3RfaWQYBiABKANCLwoiY29tLmdvb2dsZS5tZWRpYXBpcGUuZm9y", + "bWF0cy5wcm90b0IJUmVjdFByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Rect), global::Mediapipe.Rect.Parser, new[]{ "XCenter", "YCenter", "Height", "Width", "Rotation", "RectId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NormalizedRect), global::Mediapipe.NormalizedRect.Parser, new[]{ "XCenter", "YCenter", "Height", "Width", "Rotation", "RectId" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// A rectangle with rotation in image coordinates. + /// + public sealed partial class Rect : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rect()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RectReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rect() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rect(Rect other) : this() { + _hasBits0 = other._hasBits0; + xCenter_ = other.xCenter_; + yCenter_ = other.yCenter_; + height_ = other.height_; + width_ = other.width_; + rotation_ = other.rotation_; + rectId_ = other.rectId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rect Clone() { + return new Rect(this); + } + + /// Field number for the "x_center" field. + public const int XCenterFieldNumber = 1; + private readonly static int XCenterDefaultValue = 0; + + private int xCenter_; + /// + /// Location of the center of the rectangle in image coordinates. + /// The (0, 0) point is at the (top, left) corner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int XCenter { + get { if ((_hasBits0 & 1) != 0) { return xCenter_; } else { return XCenterDefaultValue; } } + set { + _hasBits0 |= 1; + xCenter_ = value; + } + } + /// Gets whether the "x_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXCenter { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXCenter() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_center" field. + public const int YCenterFieldNumber = 2; + private readonly static int YCenterDefaultValue = 0; + + private int yCenter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int YCenter { + get { if ((_hasBits0 & 2) != 0) { return yCenter_; } else { return YCenterDefaultValue; } } + set { + _hasBits0 |= 2; + yCenter_ = value; + } + } + /// Gets whether the "y_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYCenter { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYCenter() { + _hasBits0 &= ~2; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 3; + private readonly static int HeightDefaultValue = 0; + + private int height_; + /// + /// Size of the rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Height { + get { if ((_hasBits0 & 4) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 4; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 4; + private readonly static int WidthDefaultValue = 0; + + private int width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Width { + get { if ((_hasBits0 & 8) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 8; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~8; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 5; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// Rotation angle is clockwise in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 16) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 16; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~16; + } + + /// Field number for the "rect_id" field. + public const int RectIdFieldNumber = 6; + private readonly static long RectIdDefaultValue = 0L; + + private long rectId_; + /// + /// Optional unique id to help associate different Rects to each other. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long RectId { + get { if ((_hasBits0 & 32) != 0) { return rectId_; } else { return RectIdDefaultValue; } } + set { + _hasBits0 |= 32; + rectId_ = value; + } + } + /// Gets whether the "rect_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRectId { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "rect_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRectId() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Rect); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Rect other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (XCenter != other.XCenter) return false; + if (YCenter != other.YCenter) return false; + if (Height != other.Height) return false; + if (Width != other.Width) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (RectId != other.RectId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXCenter) hash ^= XCenter.GetHashCode(); + if (HasYCenter) hash ^= YCenter.GetHashCode(); + if (HasHeight) hash ^= Height.GetHashCode(); + if (HasWidth) hash ^= Width.GetHashCode(); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (HasRectId) hash ^= RectId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXCenter) { + output.WriteRawTag(8); + output.WriteInt32(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(16); + output.WriteInt32(YCenter); + } + if (HasHeight) { + output.WriteRawTag(24); + output.WriteInt32(Height); + } + if (HasWidth) { + output.WriteRawTag(32); + output.WriteInt32(Width); + } + if (HasRotation) { + output.WriteRawTag(45); + output.WriteFloat(Rotation); + } + if (HasRectId) { + output.WriteRawTag(48); + output.WriteInt64(RectId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXCenter) { + output.WriteRawTag(8); + output.WriteInt32(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(16); + output.WriteInt32(YCenter); + } + if (HasHeight) { + output.WriteRawTag(24); + output.WriteInt32(Height); + } + if (HasWidth) { + output.WriteRawTag(32); + output.WriteInt32(Width); + } + if (HasRotation) { + output.WriteRawTag(45); + output.WriteFloat(Rotation); + } + if (HasRectId) { + output.WriteRawTag(48); + output.WriteInt64(RectId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXCenter) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(XCenter); + } + if (HasYCenter) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(YCenter); + } + if (HasHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); + } + if (HasWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); + } + if (HasRotation) { + size += 1 + 4; + } + if (HasRectId) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(RectId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Rect other) { + if (other == null) { + return; + } + if (other.HasXCenter) { + XCenter = other.XCenter; + } + if (other.HasYCenter) { + YCenter = other.YCenter; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasRectId) { + RectId = other.RectId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + XCenter = input.ReadInt32(); + break; + } + case 16: { + YCenter = input.ReadInt32(); + break; + } + case 24: { + Height = input.ReadInt32(); + break; + } + case 32: { + Width = input.ReadInt32(); + break; + } + case 45: { + Rotation = input.ReadFloat(); + break; + } + case 48: { + RectId = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + XCenter = input.ReadInt32(); + break; + } + case 16: { + YCenter = input.ReadInt32(); + break; + } + case 24: { + Height = input.ReadInt32(); + break; + } + case 32: { + Width = input.ReadInt32(); + break; + } + case 45: { + Rotation = input.ReadFloat(); + break; + } + case 48: { + RectId = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// A rectangle with rotation in normalized coordinates. The values of box center + /// location and size are within [0, 1]. + /// + public sealed partial class NormalizedRect : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizedRect()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RectReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedRect() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedRect(NormalizedRect other) : this() { + _hasBits0 = other._hasBits0; + xCenter_ = other.xCenter_; + yCenter_ = other.yCenter_; + height_ = other.height_; + width_ = other.width_; + rotation_ = other.rotation_; + rectId_ = other.rectId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedRect Clone() { + return new NormalizedRect(this); + } + + /// Field number for the "x_center" field. + public const int XCenterFieldNumber = 1; + private readonly static float XCenterDefaultValue = 0F; + + private float xCenter_; + /// + /// Location of the center of the rectangle in image coordinates. + /// The (0.0, 0.0) point is at the (top, left) corner. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float XCenter { + get { if ((_hasBits0 & 1) != 0) { return xCenter_; } else { return XCenterDefaultValue; } } + set { + _hasBits0 |= 1; + xCenter_ = value; + } + } + /// Gets whether the "x_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXCenter { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXCenter() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_center" field. + public const int YCenterFieldNumber = 2; + private readonly static float YCenterDefaultValue = 0F; + + private float yCenter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float YCenter { + get { if ((_hasBits0 & 2) != 0) { return yCenter_; } else { return YCenterDefaultValue; } } + set { + _hasBits0 |= 2; + yCenter_ = value; + } + } + /// Gets whether the "y_center" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYCenter { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_center" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYCenter() { + _hasBits0 &= ~2; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 3; + private readonly static float HeightDefaultValue = 0F; + + private float height_; + /// + /// Size of the rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Height { + get { if ((_hasBits0 & 4) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 4; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 4; + private readonly static float WidthDefaultValue = 0F; + + private float width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Width { + get { if ((_hasBits0 & 8) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 8; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~8; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 5; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// Rotation angle is clockwise in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 16) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 16; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~16; + } + + /// Field number for the "rect_id" field. + public const int RectIdFieldNumber = 6; + private readonly static long RectIdDefaultValue = 0L; + + private long rectId_; + /// + /// Optional unique id to help associate different NormalizedRects to each + /// other. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long RectId { + get { if ((_hasBits0 & 32) != 0) { return rectId_; } else { return RectIdDefaultValue; } } + set { + _hasBits0 |= 32; + rectId_ = value; + } + } + /// Gets whether the "rect_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRectId { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "rect_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRectId() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NormalizedRect); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NormalizedRect other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XCenter, other.XCenter)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YCenter, other.YCenter)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Height, other.Height)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Width, other.Width)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (RectId != other.RectId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXCenter) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XCenter); + if (HasYCenter) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YCenter); + if (HasHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Height); + if (HasWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Width); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (HasRectId) hash ^= RectId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXCenter) { + output.WriteRawTag(13); + output.WriteFloat(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(21); + output.WriteFloat(YCenter); + } + if (HasHeight) { + output.WriteRawTag(29); + output.WriteFloat(Height); + } + if (HasWidth) { + output.WriteRawTag(37); + output.WriteFloat(Width); + } + if (HasRotation) { + output.WriteRawTag(45); + output.WriteFloat(Rotation); + } + if (HasRectId) { + output.WriteRawTag(48); + output.WriteInt64(RectId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXCenter) { + output.WriteRawTag(13); + output.WriteFloat(XCenter); + } + if (HasYCenter) { + output.WriteRawTag(21); + output.WriteFloat(YCenter); + } + if (HasHeight) { + output.WriteRawTag(29); + output.WriteFloat(Height); + } + if (HasWidth) { + output.WriteRawTag(37); + output.WriteFloat(Width); + } + if (HasRotation) { + output.WriteRawTag(45); + output.WriteFloat(Rotation); + } + if (HasRectId) { + output.WriteRawTag(48); + output.WriteInt64(RectId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXCenter) { + size += 1 + 4; + } + if (HasYCenter) { + size += 1 + 4; + } + if (HasHeight) { + size += 1 + 4; + } + if (HasWidth) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + 4; + } + if (HasRectId) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(RectId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NormalizedRect other) { + if (other == null) { + return; + } + if (other.HasXCenter) { + XCenter = other.XCenter; + } + if (other.HasYCenter) { + YCenter = other.YCenter; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasRectId) { + RectId = other.RectId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + XCenter = input.ReadFloat(); + break; + } + case 21: { + YCenter = input.ReadFloat(); + break; + } + case 29: { + Height = input.ReadFloat(); + break; + } + case 37: { + Width = input.ReadFloat(); + break; + } + case 45: { + Rotation = input.ReadFloat(); + break; + } + case 48: { + RectId = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + XCenter = input.ReadFloat(); + break; + } + case 21: { + YCenter = input.ReadFloat(); + break; + } + case 29: { + Height = input.ReadFloat(); + break; + } + case 37: { + Width = input.ReadFloat(); + break; + } + case 45: { + Rotation = input.ReadFloat(); + break; + } + case 48: { + RectId = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs.meta new file mode 100644 index 0000000..0bf8a34 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/Rect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d0ab6ed8000b4ec99584572ab00de53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs new file mode 100644 index 0000000..af2319d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs @@ -0,0 +1,798 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/formats/time_series_header.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/formats/time_series_header.proto + public static partial class TimeSeriesHeaderReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/formats/time_series_header.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TimeSeriesHeaderReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjRtZWRpYXBpcGUvZnJhbWV3b3JrL2Zvcm1hdHMvdGltZV9zZXJpZXNfaGVh", + "ZGVyLnByb3RvEgltZWRpYXBpcGUijgEKEFRpbWVTZXJpZXNIZWFkZXISEwoL", + "c2FtcGxlX3JhdGUYASABKAESFAoMbnVtX2NoYW5uZWxzGAIgASgFEhMKC251", + "bV9zYW1wbGVzGAMgASgFEhMKC3BhY2tldF9yYXRlGAQgASgBEhkKEWF1ZGlv", + "X3NhbXBsZV9yYXRlGAUgASgBKgoIoJwBEICAgIACImsKG011bHRpU3RyZWFt", + "VGltZVNlcmllc0hlYWRlchI3ChJ0aW1lX3Nlcmllc19oZWFkZXIYASABKAsy", + "Gy5tZWRpYXBpcGUuVGltZVNlcmllc0hlYWRlchITCgtudW1fc3RyZWFtcxgC", + "IAEoBQ==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimeSeriesHeader), global::Mediapipe.TimeSeriesHeader.Parser, new[]{ "SampleRate", "NumChannels", "NumSamples", "PacketRate", "AudioSampleRate" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MultiStreamTimeSeriesHeader), global::Mediapipe.MultiStreamTimeSeriesHeader.Parser, new[]{ "TimeSeriesHeader", "NumStreams" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Header for a uniformly sampled time series stream. Each Packet in + /// the stream is a Matrix, and each column is a (vector-valued) sample of + /// the series, i.e. each column corresponds to a distinct sample in time. + /// + public sealed partial class TimeSeriesHeader : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimeSeriesHeader()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TimeSeriesHeaderReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesHeader() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesHeader(TimeSeriesHeader other) : this() { + _hasBits0 = other._hasBits0; + sampleRate_ = other.sampleRate_; + numChannels_ = other.numChannels_; + numSamples_ = other.numSamples_; + packetRate_ = other.packetRate_; + audioSampleRate_ = other.audioSampleRate_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimeSeriesHeader Clone() { + return new TimeSeriesHeader(this); + } + + /// Field number for the "sample_rate" field. + public const int SampleRateFieldNumber = 1; + private readonly static double SampleRateDefaultValue = 0D; + + private double sampleRate_; + /// + /// Number of samples per second (hertz). The sample_rate is the + /// reciprocal of the period between consecutive samples within a + /// packet. Required, and must be greater than zero. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double SampleRate { + get { if ((_hasBits0 & 1) != 0) { return sampleRate_; } else { return SampleRateDefaultValue; } } + set { + _hasBits0 |= 1; + sampleRate_ = value; + } + } + /// Gets whether the "sample_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSampleRate { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "sample_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSampleRate() { + _hasBits0 &= ~1; + } + + /// Field number for the "num_channels" field. + public const int NumChannelsFieldNumber = 2; + private readonly static int NumChannelsDefaultValue = 0; + + private int numChannels_; + /// + /// The number of channels in each sample. This is the number of + /// rows in the matrix. Required, and must be greater than zero. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumChannels { + get { if ((_hasBits0 & 2) != 0) { return numChannels_; } else { return NumChannelsDefaultValue; } } + set { + _hasBits0 |= 2; + numChannels_ = value; + } + } + /// Gets whether the "num_channels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumChannels { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_channels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumChannels() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_samples" field. + public const int NumSamplesFieldNumber = 3; + private readonly static int NumSamplesDefaultValue = 0; + + private int numSamples_; + /// + /// For streams that output a fixed number of samples per packet. + /// This field should not be set if the number of samples varies from + /// packet to packet. This is the number of columns in the matrix. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumSamples { + get { if ((_hasBits0 & 4) != 0) { return numSamples_; } else { return NumSamplesDefaultValue; } } + set { + _hasBits0 |= 4; + numSamples_ = value; + } + } + /// Gets whether the "num_samples" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumSamples { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_samples" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumSamples() { + _hasBits0 &= ~4; + } + + /// Field number for the "packet_rate" field. + public const int PacketRateFieldNumber = 4; + private readonly static double PacketRateDefaultValue = 0D; + + private double packetRate_; + /// + /// For streams that output Packets at a fixed rate, in Packets per + /// second. In other words, the reciprocal of the difference between + /// consecutive Packet timestamps. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double PacketRate { + get { if ((_hasBits0 & 8) != 0) { return packetRate_; } else { return PacketRateDefaultValue; } } + set { + _hasBits0 |= 8; + packetRate_ = value; + } + } + /// Gets whether the "packet_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketRate { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "packet_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketRate() { + _hasBits0 &= ~8; + } + + /// Field number for the "audio_sample_rate" field. + public const int AudioSampleRateFieldNumber = 5; + private readonly static double AudioSampleRateDefaultValue = 0D; + + private double audioSampleRate_; + /// + /// Spectral representations (e.g. from SpectrogramCalculator) will + /// have their sample_rate field indicating the frame rate (e.g. 100 + /// Hz), but downstream consumers need to know the sample_rate of the + /// source time-domain waveform in order to correctly interpret the + /// spectral bins. Units are hertz. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double AudioSampleRate { + get { if ((_hasBits0 & 16) != 0) { return audioSampleRate_; } else { return AudioSampleRateDefaultValue; } } + set { + _hasBits0 |= 16; + audioSampleRate_ = value; + } + } + /// Gets whether the "audio_sample_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAudioSampleRate { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "audio_sample_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAudioSampleRate() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimeSeriesHeader); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimeSeriesHeader other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(SampleRate, other.SampleRate)) return false; + if (NumChannels != other.NumChannels) return false; + if (NumSamples != other.NumSamples) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(PacketRate, other.PacketRate)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(AudioSampleRate, other.AudioSampleRate)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasSampleRate) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SampleRate); + if (HasNumChannels) hash ^= NumChannels.GetHashCode(); + if (HasNumSamples) hash ^= NumSamples.GetHashCode(); + if (HasPacketRate) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PacketRate); + if (HasAudioSampleRate) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AudioSampleRate); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasSampleRate) { + output.WriteRawTag(9); + output.WriteDouble(SampleRate); + } + if (HasNumChannels) { + output.WriteRawTag(16); + output.WriteInt32(NumChannels); + } + if (HasNumSamples) { + output.WriteRawTag(24); + output.WriteInt32(NumSamples); + } + if (HasPacketRate) { + output.WriteRawTag(33); + output.WriteDouble(PacketRate); + } + if (HasAudioSampleRate) { + output.WriteRawTag(41); + output.WriteDouble(AudioSampleRate); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasSampleRate) { + output.WriteRawTag(9); + output.WriteDouble(SampleRate); + } + if (HasNumChannels) { + output.WriteRawTag(16); + output.WriteInt32(NumChannels); + } + if (HasNumSamples) { + output.WriteRawTag(24); + output.WriteInt32(NumSamples); + } + if (HasPacketRate) { + output.WriteRawTag(33); + output.WriteDouble(PacketRate); + } + if (HasAudioSampleRate) { + output.WriteRawTag(41); + output.WriteDouble(AudioSampleRate); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasSampleRate) { + size += 1 + 8; + } + if (HasNumChannels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumChannels); + } + if (HasNumSamples) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumSamples); + } + if (HasPacketRate) { + size += 1 + 8; + } + if (HasAudioSampleRate) { + size += 1 + 8; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimeSeriesHeader other) { + if (other == null) { + return; + } + if (other.HasSampleRate) { + SampleRate = other.SampleRate; + } + if (other.HasNumChannels) { + NumChannels = other.NumChannels; + } + if (other.HasNumSamples) { + NumSamples = other.NumSamples; + } + if (other.HasPacketRate) { + PacketRate = other.PacketRate; + } + if (other.HasAudioSampleRate) { + AudioSampleRate = other.AudioSampleRate; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 9: { + SampleRate = input.ReadDouble(); + break; + } + case 16: { + NumChannels = input.ReadInt32(); + break; + } + case 24: { + NumSamples = input.ReadInt32(); + break; + } + case 33: { + PacketRate = input.ReadDouble(); + break; + } + case 41: { + AudioSampleRate = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 9: { + SampleRate = input.ReadDouble(); + break; + } + case 16: { + NumChannels = input.ReadInt32(); + break; + } + case 24: { + NumSamples = input.ReadInt32(); + break; + } + case 33: { + PacketRate = input.ReadDouble(); + break; + } + case 41: { + AudioSampleRate = input.ReadDouble(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + /// + /// Header for a multi-stream time series. Each packet in the + /// associated stream is a vector<Matrix> of size num_streams. Each + /// Matrix in the vector is as specified by the time_series_header + /// field. + /// + public sealed partial class MultiStreamTimeSeriesHeader : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MultiStreamTimeSeriesHeader()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TimeSeriesHeaderReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiStreamTimeSeriesHeader() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiStreamTimeSeriesHeader(MultiStreamTimeSeriesHeader other) : this() { + _hasBits0 = other._hasBits0; + timeSeriesHeader_ = other.timeSeriesHeader_ != null ? other.timeSeriesHeader_.Clone() : null; + numStreams_ = other.numStreams_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MultiStreamTimeSeriesHeader Clone() { + return new MultiStreamTimeSeriesHeader(this); + } + + /// Field number for the "time_series_header" field. + public const int TimeSeriesHeaderFieldNumber = 1; + private global::Mediapipe.TimeSeriesHeader timeSeriesHeader_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimeSeriesHeader TimeSeriesHeader { + get { return timeSeriesHeader_; } + set { + timeSeriesHeader_ = value; + } + } + + /// Field number for the "num_streams" field. + public const int NumStreamsFieldNumber = 2; + private readonly static int NumStreamsDefaultValue = 0; + + private int numStreams_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumStreams { + get { if ((_hasBits0 & 1) != 0) { return numStreams_; } else { return NumStreamsDefaultValue; } } + set { + _hasBits0 |= 1; + numStreams_ = value; + } + } + /// Gets whether the "num_streams" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumStreams { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_streams" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumStreams() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MultiStreamTimeSeriesHeader); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MultiStreamTimeSeriesHeader other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TimeSeriesHeader, other.TimeSeriesHeader)) return false; + if (NumStreams != other.NumStreams) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (timeSeriesHeader_ != null) hash ^= TimeSeriesHeader.GetHashCode(); + if (HasNumStreams) hash ^= NumStreams.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (timeSeriesHeader_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TimeSeriesHeader); + } + if (HasNumStreams) { + output.WriteRawTag(16); + output.WriteInt32(NumStreams); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (timeSeriesHeader_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TimeSeriesHeader); + } + if (HasNumStreams) { + output.WriteRawTag(16); + output.WriteInt32(NumStreams); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (timeSeriesHeader_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TimeSeriesHeader); + } + if (HasNumStreams) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumStreams); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MultiStreamTimeSeriesHeader other) { + if (other == null) { + return; + } + if (other.timeSeriesHeader_ != null) { + if (timeSeriesHeader_ == null) { + TimeSeriesHeader = new global::Mediapipe.TimeSeriesHeader(); + } + TimeSeriesHeader.MergeFrom(other.TimeSeriesHeader); + } + if (other.HasNumStreams) { + NumStreams = other.NumStreams; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (timeSeriesHeader_ == null) { + TimeSeriesHeader = new global::Mediapipe.TimeSeriesHeader(); + } + input.ReadMessage(TimeSeriesHeader); + break; + } + case 16: { + NumStreams = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (timeSeriesHeader_ == null) { + TimeSeriesHeader = new global::Mediapipe.TimeSeriesHeader(); + } + input.ReadMessage(TimeSeriesHeader); + break; + } + case 16: { + NumStreams = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs.meta new file mode 100644 index 0000000..fd2a4b9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/Formats/TimeSeriesHeader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0169013c78498316488386bfa21d8994 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs new file mode 100644 index 0000000..d9ec0f1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs @@ -0,0 +1,245 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/mediapipe_options.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/mediapipe_options.proto + public static partial class MediapipeOptionsReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/mediapipe_options.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MediapipeOptionsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CittZWRpYXBpcGUvZnJhbWV3b3JrL21lZGlhcGlwZV9vcHRpb25zLnByb3Rv", + "EgltZWRpYXBpcGUiHgoQTWVkaWFQaXBlT3B0aW9ucyoKCKCcARCAgICAAkIz", + "Chpjb20uZ29vZ2xlLm1lZGlhcGlwZS5wcm90b0IVTWVkaWFQaXBlT3B0aW9u", + "c1Byb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MediaPipeOptions), global::Mediapipe.MediaPipeOptions.Parser, null, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options used by a MediaPipe object. + /// + public sealed partial class MediaPipeOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MediaPipeOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MediapipeOptionsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MediaPipeOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MediaPipeOptions(MediaPipeOptions other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MediaPipeOptions Clone() { + return new MediaPipeOptions(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MediaPipeOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MediaPipeOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MediaPipeOptions other) { + if (other == null) { + return; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs.meta new file mode 100644 index 0000000..713fd46 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/MediapipeOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fb4306bf765ed020b56723aef9429ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs new file mode 100644 index 0000000..548733e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs @@ -0,0 +1,799 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/packet_factory.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/packet_factory.proto + public static partial class PacketFactoryReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/packet_factory.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketFactoryReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CihtZWRpYXBpcGUvZnJhbWV3b3JrL3BhY2tldF9mYWN0b3J5LnByb3RvEglt", + "ZWRpYXBpcGUiIgoUUGFja2V0RmFjdG9yeU9wdGlvbnMqCgignAEQgICAgAIi", + "lQEKE1BhY2tldEZhY3RvcnlDb25maWcSFgoOcGFja2V0X2ZhY3RvcnkYASAB", + "KAkSGgoSb3V0cHV0X3NpZGVfcGFja2V0GAIgASgJEhgKD2V4dGVybmFsX291", + "dHB1dBjqByABKAkSMAoHb3B0aW9ucxgDIAEoCzIfLm1lZGlhcGlwZS5QYWNr", + "ZXRGYWN0b3J5T3B0aW9ucyJFChNQYWNrZXRNYW5hZ2VyQ29uZmlnEi4KBnBh", + "Y2tldBgBIAMoCzIeLm1lZGlhcGlwZS5QYWNrZXRGYWN0b3J5Q29uZmlnQjAK", + "GmNvbS5nb29nbGUubWVkaWFwaXBlLnByb3RvQhJQYWNrZXRGYWN0b3J5UHJv", + "dG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketFactoryOptions), global::Mediapipe.PacketFactoryOptions.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketFactoryConfig), global::Mediapipe.PacketFactoryConfig.Parser, new[]{ "PacketFactory", "OutputSidePacket", "ExternalOutput", "Options" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketManagerConfig), global::Mediapipe.PacketManagerConfig.Parser, new[]{ "Packet" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options used by a PacketFactory to create the Packet. + /// + public sealed partial class PacketFactoryOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketFactoryOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketFactoryReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryOptions(PacketFactoryOptions other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryOptions Clone() { + return new PacketFactoryOptions(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketFactoryOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketFactoryOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketFactoryOptions other) { + if (other == null) { + return; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + /// + /// A PacketFactory creates a side packet. + /// + public sealed partial class PacketFactoryConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketFactoryConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketFactoryReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryConfig(PacketFactoryConfig other) : this() { + packetFactory_ = other.packetFactory_; + outputSidePacket_ = other.outputSidePacket_; + externalOutput_ = other.externalOutput_; + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketFactoryConfig Clone() { + return new PacketFactoryConfig(this); + } + + /// Field number for the "packet_factory" field. + public const int PacketFactoryFieldNumber = 1; + private readonly static string PacketFactoryDefaultValue = ""; + + private string packetFactory_; + /// + /// The name of the registered packet factory class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string PacketFactory { + get { return packetFactory_ ?? PacketFactoryDefaultValue; } + set { + packetFactory_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "packet_factory" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketFactory { + get { return packetFactory_ != null; } + } + /// Clears the value of the "packet_factory" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketFactory() { + packetFactory_ = null; + } + + /// Field number for the "output_side_packet" field. + public const int OutputSidePacketFieldNumber = 2; + private readonly static string OutputSidePacketDefaultValue = ""; + + private string outputSidePacket_; + /// + /// The name of the output side packet that this packet factory creates. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OutputSidePacket { + get { return outputSidePacket_ ?? OutputSidePacketDefaultValue; } + set { + outputSidePacket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "output_side_packet" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputSidePacket { + get { return outputSidePacket_ != null; } + } + /// Clears the value of the "output_side_packet" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputSidePacket() { + outputSidePacket_ = null; + } + + /// Field number for the "external_output" field. + public const int ExternalOutputFieldNumber = 1002; + private readonly static string ExternalOutputDefaultValue = ""; + + private string externalOutput_; + /// + /// DEPRECATED: The old name for output_side_packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ExternalOutput { + get { return externalOutput_ ?? ExternalOutputDefaultValue; } + set { + externalOutput_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "external_output" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasExternalOutput { + get { return externalOutput_ != null; } + } + /// Clears the value of the "external_output" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearExternalOutput() { + externalOutput_ = null; + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 3; + private global::Mediapipe.PacketFactoryOptions options_; + /// + /// The options for the packet factory. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PacketFactoryOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketFactoryConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketFactoryConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (PacketFactory != other.PacketFactory) return false; + if (OutputSidePacket != other.OutputSidePacket) return false; + if (ExternalOutput != other.ExternalOutput) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPacketFactory) hash ^= PacketFactory.GetHashCode(); + if (HasOutputSidePacket) hash ^= OutputSidePacket.GetHashCode(); + if (HasExternalOutput) hash ^= ExternalOutput.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPacketFactory) { + output.WriteRawTag(10); + output.WriteString(PacketFactory); + } + if (HasOutputSidePacket) { + output.WriteRawTag(18); + output.WriteString(OutputSidePacket); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (HasExternalOutput) { + output.WriteRawTag(210, 62); + output.WriteString(ExternalOutput); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPacketFactory) { + output.WriteRawTag(10); + output.WriteString(PacketFactory); + } + if (HasOutputSidePacket) { + output.WriteRawTag(18); + output.WriteString(OutputSidePacket); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (HasExternalOutput) { + output.WriteRawTag(210, 62); + output.WriteString(ExternalOutput); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPacketFactory) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(PacketFactory); + } + if (HasOutputSidePacket) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OutputSidePacket); + } + if (HasExternalOutput) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(ExternalOutput); + } + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketFactoryConfig other) { + if (other == null) { + return; + } + if (other.HasPacketFactory) { + PacketFactory = other.PacketFactory; + } + if (other.HasOutputSidePacket) { + OutputSidePacket = other.OutputSidePacket; + } + if (other.HasExternalOutput) { + ExternalOutput = other.ExternalOutput; + } + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.PacketFactoryOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + PacketFactory = input.ReadString(); + break; + } + case 18: { + OutputSidePacket = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.PacketFactoryOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + ExternalOutput = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + PacketFactory = input.ReadString(); + break; + } + case 18: { + OutputSidePacket = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.PacketFactoryOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + ExternalOutput = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// The configuration for a PacketManager. + /// + public sealed partial class PacketManagerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketManagerConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketFactoryReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketManagerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketManagerConfig(PacketManagerConfig other) : this() { + packet_ = other.packet_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketManagerConfig Clone() { + return new PacketManagerConfig(this); + } + + /// Field number for the "packet" field. + public const int PacketFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_packet_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.PacketFactoryConfig.Parser); + private readonly pbc::RepeatedField packet_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Packet { + get { return packet_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketManagerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketManagerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!packet_.Equals(other.packet_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= packet_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + packet_.WriteTo(output, _repeated_packet_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + packet_.WriteTo(ref output, _repeated_packet_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += packet_.CalculateSize(_repeated_packet_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketManagerConfig other) { + if (other == null) { + return; + } + packet_.Add(other.packet_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + packet_.AddEntriesFrom(input, _repeated_packet_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + packet_.AddEntriesFrom(ref input, _repeated_packet_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs.meta new file mode 100644 index 0000000..a047f26 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 829f26255b03dd08bbdcd4815faacf47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs new file mode 100644 index 0000000..5bd62a6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs @@ -0,0 +1,686 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/packet_generator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/packet_generator.proto + public static partial class PacketGeneratorReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/packet_generator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PacketGeneratorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiptZWRpYXBpcGUvZnJhbWV3b3JrL3BhY2tldF9nZW5lcmF0b3IucHJvdG8S", + "CW1lZGlhcGlwZSJAChZQYWNrZXRHZW5lcmF0b3JPcHRpb25zEhoKDG1lcmdl", + "X2ZpZWxkcxgBIAEoCDoEdHJ1ZSoKCKCcARCAgICAAiLPAQoVUGFja2V0R2Vu", + "ZXJhdG9yQ29uZmlnEhgKEHBhY2tldF9nZW5lcmF0b3IYASABKAkSGQoRaW5w", + "dXRfc2lkZV9wYWNrZXQYAiADKAkSFwoOZXh0ZXJuYWxfaW5wdXQY6gcgAygJ", + "EhoKEm91dHB1dF9zaWRlX3BhY2tldBgDIAMoCRIYCg9leHRlcm5hbF9vdXRw", + "dXQY6wcgAygJEjIKB29wdGlvbnMYBCABKAsyIS5tZWRpYXBpcGUuUGFja2V0", + "R2VuZXJhdG9yT3B0aW9uc0IyChpjb20uZ29vZ2xlLm1lZGlhcGlwZS5wcm90", + "b0IUUGFja2V0R2VuZXJhdG9yUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketGeneratorOptions), global::Mediapipe.PacketGeneratorOptions.Parser, new[]{ "MergeFields" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PacketGeneratorConfig), global::Mediapipe.PacketGeneratorConfig.Parser, new[]{ "PacketGenerator", "InputSidePacket", "ExternalInput", "OutputSidePacket", "ExternalOutput", "Options" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Options used by a PacketGenerator. + /// + public sealed partial class PacketGeneratorOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketGeneratorOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketGeneratorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorOptions(PacketGeneratorOptions other) : this() { + _hasBits0 = other._hasBits0; + mergeFields_ = other.mergeFields_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorOptions Clone() { + return new PacketGeneratorOptions(this); + } + + /// Field number for the "merge_fields" field. + public const int MergeFieldsFieldNumber = 1; + private readonly static bool MergeFieldsDefaultValue = true; + + private bool mergeFields_; + /// + /// If true, this proto specifies a subset of field values, + /// which should override corresponding field values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool MergeFields { + get { if ((_hasBits0 & 1) != 0) { return mergeFields_; } else { return MergeFieldsDefaultValue; } } + set { + _hasBits0 |= 1; + mergeFields_ = value; + } + } + /// Gets whether the "merge_fields" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMergeFields { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "merge_fields" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMergeFields() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketGeneratorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketGeneratorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MergeFields != other.MergeFields) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMergeFields) hash ^= MergeFields.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMergeFields) { + output.WriteRawTag(8); + output.WriteBool(MergeFields); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMergeFields) { + output.WriteRawTag(8); + output.WriteBool(MergeFields); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMergeFields) { + size += 1 + 1; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketGeneratorOptions other) { + if (other == null) { + return; + } + if (other.HasMergeFields) { + MergeFields = other.MergeFields; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + MergeFields = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + MergeFields = input.ReadBool(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + /// + /// The settings specifying a packet generator and how it is connected. + /// + public sealed partial class PacketGeneratorConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PacketGeneratorConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PacketGeneratorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorConfig(PacketGeneratorConfig other) : this() { + packetGenerator_ = other.packetGenerator_; + inputSidePacket_ = other.inputSidePacket_.Clone(); + externalInput_ = other.externalInput_.Clone(); + outputSidePacket_ = other.outputSidePacket_.Clone(); + externalOutput_ = other.externalOutput_.Clone(); + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PacketGeneratorConfig Clone() { + return new PacketGeneratorConfig(this); + } + + /// Field number for the "packet_generator" field. + public const int PacketGeneratorFieldNumber = 1; + private readonly static string PacketGeneratorDefaultValue = ""; + + private string packetGenerator_; + /// + /// The name of the registered packet generator class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string PacketGenerator { + get { return packetGenerator_ ?? PacketGeneratorDefaultValue; } + set { + packetGenerator_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "packet_generator" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPacketGenerator { + get { return packetGenerator_ != null; } + } + /// Clears the value of the "packet_generator" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPacketGenerator() { + packetGenerator_ = null; + } + + /// Field number for the "input_side_packet" field. + public const int InputSidePacketFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_inputSidePacket_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField inputSidePacket_ = new pbc::RepeatedField(); + /// + /// The names of the input side packets. The PacketGenerator can choose + /// to access its input side packets either by index or by tag. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputSidePacket { + get { return inputSidePacket_; } + } + + /// Field number for the "external_input" field. + public const int ExternalInputFieldNumber = 1002; + private static readonly pb::FieldCodec _repeated_externalInput_codec + = pb::FieldCodec.ForString(8018); + private readonly pbc::RepeatedField externalInput_ = new pbc::RepeatedField(); + /// + /// DEPRECATED(mgeorg) The old name for input_side_packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExternalInput { + get { return externalInput_; } + } + + /// Field number for the "output_side_packet" field. + public const int OutputSidePacketFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_outputSidePacket_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField outputSidePacket_ = new pbc::RepeatedField(); + /// + /// The names of the output side packets that this generator produces. + /// The PacketGenerator can choose to access its output side packets + /// either by index or by tag. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutputSidePacket { + get { return outputSidePacket_; } + } + + /// Field number for the "external_output" field. + public const int ExternalOutputFieldNumber = 1003; + private static readonly pb::FieldCodec _repeated_externalOutput_codec + = pb::FieldCodec.ForString(8026); + private readonly pbc::RepeatedField externalOutput_ = new pbc::RepeatedField(); + /// + /// DEPRECATED(mgeorg) The old name for output_side_packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExternalOutput { + get { return externalOutput_; } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 4; + private global::Mediapipe.PacketGeneratorOptions options_; + /// + /// The options for the packet generator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PacketGeneratorOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PacketGeneratorConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PacketGeneratorConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (PacketGenerator != other.PacketGenerator) return false; + if(!inputSidePacket_.Equals(other.inputSidePacket_)) return false; + if(!externalInput_.Equals(other.externalInput_)) return false; + if(!outputSidePacket_.Equals(other.outputSidePacket_)) return false; + if(!externalOutput_.Equals(other.externalOutput_)) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPacketGenerator) hash ^= PacketGenerator.GetHashCode(); + hash ^= inputSidePacket_.GetHashCode(); + hash ^= externalInput_.GetHashCode(); + hash ^= outputSidePacket_.GetHashCode(); + hash ^= externalOutput_.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPacketGenerator) { + output.WriteRawTag(10); + output.WriteString(PacketGenerator); + } + inputSidePacket_.WriteTo(output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(output, _repeated_outputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Options); + } + externalInput_.WriteTo(output, _repeated_externalInput_codec); + externalOutput_.WriteTo(output, _repeated_externalOutput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPacketGenerator) { + output.WriteRawTag(10); + output.WriteString(PacketGenerator); + } + inputSidePacket_.WriteTo(ref output, _repeated_inputSidePacket_codec); + outputSidePacket_.WriteTo(ref output, _repeated_outputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Options); + } + externalInput_.WriteTo(ref output, _repeated_externalInput_codec); + externalOutput_.WriteTo(ref output, _repeated_externalOutput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPacketGenerator) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(PacketGenerator); + } + size += inputSidePacket_.CalculateSize(_repeated_inputSidePacket_codec); + size += externalInput_.CalculateSize(_repeated_externalInput_codec); + size += outputSidePacket_.CalculateSize(_repeated_outputSidePacket_codec); + size += externalOutput_.CalculateSize(_repeated_externalOutput_codec); + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PacketGeneratorConfig other) { + if (other == null) { + return; + } + if (other.HasPacketGenerator) { + PacketGenerator = other.PacketGenerator; + } + inputSidePacket_.Add(other.inputSidePacket_); + externalInput_.Add(other.externalInput_); + outputSidePacket_.Add(other.outputSidePacket_); + externalOutput_.Add(other.externalOutput_); + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.PacketGeneratorOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + PacketGenerator = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + outputSidePacket_.AddEntriesFrom(input, _repeated_outputSidePacket_codec); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Mediapipe.PacketGeneratorOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + externalInput_.AddEntriesFrom(input, _repeated_externalInput_codec); + break; + } + case 8026: { + externalOutput_.AddEntriesFrom(input, _repeated_externalOutput_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + PacketGenerator = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(ref input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + outputSidePacket_.AddEntriesFrom(ref input, _repeated_outputSidePacket_codec); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Mediapipe.PacketGeneratorOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + externalInput_.AddEntriesFrom(ref input, _repeated_externalInput_codec); + break; + } + case 8026: { + externalOutput_.AddEntriesFrom(ref input, _repeated_externalOutput_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs.meta new file mode 100644 index 0000000..d689946 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/PacketGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf6b21134f073285e9e457e2762ef4fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs new file mode 100644 index 0000000..4109063 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs @@ -0,0 +1,368 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/status_handler.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/status_handler.proto + public static partial class StatusHandlerReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/status_handler.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StatusHandlerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CihtZWRpYXBpcGUvZnJhbWV3b3JrL3N0YXR1c19oYW5kbGVyLnByb3RvEglt", + "ZWRpYXBpcGUaK21lZGlhcGlwZS9mcmFtZXdvcmsvbWVkaWFwaXBlX29wdGlv", + "bnMucHJvdG8ijwEKE1N0YXR1c0hhbmRsZXJDb25maWcSFgoOc3RhdHVzX2hh", + "bmRsZXIYASABKAkSGQoRaW5wdXRfc2lkZV9wYWNrZXQYAiADKAkSFwoOZXh0", + "ZXJuYWxfaW5wdXQY6gcgAygJEiwKB29wdGlvbnMYAyABKAsyGy5tZWRpYXBp", + "cGUuTWVkaWFQaXBlT3B0aW9uc0IwChpjb20uZ29vZ2xlLm1lZGlhcGlwZS5w", + "cm90b0ISU3RhdHVzSGFuZGxlclByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MediapipeOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.StatusHandlerConfig), global::Mediapipe.StatusHandlerConfig.Parser, new[]{ "StatusHandler", "InputSidePacket", "ExternalInput", "Options" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// The settings specifying a status handler and its required external inputs. + /// + public sealed partial class StatusHandlerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatusHandlerConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StatusHandlerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatusHandlerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatusHandlerConfig(StatusHandlerConfig other) : this() { + statusHandler_ = other.statusHandler_; + inputSidePacket_ = other.inputSidePacket_.Clone(); + externalInput_ = other.externalInput_.Clone(); + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatusHandlerConfig Clone() { + return new StatusHandlerConfig(this); + } + + /// Field number for the "status_handler" field. + public const int StatusHandlerFieldNumber = 1; + private readonly static string StatusHandlerDefaultValue = ""; + + private string statusHandler_; + /// + /// The name of the registered status handler class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string StatusHandler { + get { return statusHandler_ ?? StatusHandlerDefaultValue; } + set { + statusHandler_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "status_handler" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatusHandler { + get { return statusHandler_ != null; } + } + /// Clears the value of the "status_handler" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatusHandler() { + statusHandler_ = null; + } + + /// Field number for the "input_side_packet" field. + public const int InputSidePacketFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_inputSidePacket_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField inputSidePacket_ = new pbc::RepeatedField(); + /// + /// The name of the input side packets. The StatusHandler can access its + /// input side packets by index or by tag. A StatusHandler will only + /// be called if all of its requested input side packets are available + /// (and won't be called if a PacketFactory or PacketGenerator which + /// produces one fails). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputSidePacket { + get { return inputSidePacket_; } + } + + /// Field number for the "external_input" field. + public const int ExternalInputFieldNumber = 1002; + private static readonly pb::FieldCodec _repeated_externalInput_codec + = pb::FieldCodec.ForString(8018); + private readonly pbc::RepeatedField externalInput_ = new pbc::RepeatedField(); + /// + /// DEPRECATED(mgeorg) The old name for input_side_packet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExternalInput { + get { return externalInput_; } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 3; + private global::Mediapipe.MediaPipeOptions options_; + /// + /// The options for the status handler. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MediaPipeOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatusHandlerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatusHandlerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StatusHandler != other.StatusHandler) return false; + if(!inputSidePacket_.Equals(other.inputSidePacket_)) return false; + if(!externalInput_.Equals(other.externalInput_)) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasStatusHandler) hash ^= StatusHandler.GetHashCode(); + hash ^= inputSidePacket_.GetHashCode(); + hash ^= externalInput_.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasStatusHandler) { + output.WriteRawTag(10); + output.WriteString(StatusHandler); + } + inputSidePacket_.WriteTo(output, _repeated_inputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + externalInput_.WriteTo(output, _repeated_externalInput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStatusHandler) { + output.WriteRawTag(10); + output.WriteString(StatusHandler); + } + inputSidePacket_.WriteTo(ref output, _repeated_inputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + externalInput_.WriteTo(ref output, _repeated_externalInput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasStatusHandler) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StatusHandler); + } + size += inputSidePacket_.CalculateSize(_repeated_inputSidePacket_codec); + size += externalInput_.CalculateSize(_repeated_externalInput_codec); + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatusHandlerConfig other) { + if (other == null) { + return; + } + if (other.HasStatusHandler) { + StatusHandler = other.StatusHandler; + } + inputSidePacket_.Add(other.inputSidePacket_); + externalInput_.Add(other.externalInput_); + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + StatusHandler = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + externalInput_.AddEntriesFrom(input, _repeated_externalInput_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + StatusHandler = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(ref input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + case 8018: { + externalInput_.AddEntriesFrom(ref input, _repeated_externalInput_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs.meta new file mode 100644 index 0000000..14602c7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StatusHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1e3e4b165949a853abfa2cdb9666bc1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs new file mode 100644 index 0000000..1c40db6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs @@ -0,0 +1,598 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/stream_handler.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/stream_handler.proto + public static partial class StreamHandlerReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/stream_handler.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StreamHandlerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CihtZWRpYXBpcGUvZnJhbWV3b3JrL3N0cmVhbV9oYW5kbGVyLnByb3RvEglt", + "ZWRpYXBpcGUaK21lZGlhcGlwZS9mcmFtZXdvcmsvbWVkaWFwaXBlX29wdGlv", + "bnMucHJvdG8igQEKGElucHV0U3RyZWFtSGFuZGxlckNvbmZpZxI3ChRpbnB1", + "dF9zdHJlYW1faGFuZGxlchgBIAEoCToZRGVmYXVsdElucHV0U3RyZWFtSGFu", + "ZGxlchIsCgdvcHRpb25zGAMgASgLMhsubWVkaWFwaXBlLk1lZGlhUGlwZU9w", + "dGlvbnMinwEKGU91dHB1dFN0cmVhbUhhbmRsZXJDb25maWcSOQoVb3V0cHV0", + "X3N0cmVhbV9oYW5kbGVyGAEgASgJOhpJbk9yZGVyT3V0cHV0U3RyZWFtSGFu", + "ZGxlchIZChFpbnB1dF9zaWRlX3BhY2tldBgCIAMoCRIsCgdvcHRpb25zGAMg", + "ASgLMhsubWVkaWFwaXBlLk1lZGlhUGlwZU9wdGlvbnNCMAoaY29tLmdvb2ds", + "ZS5tZWRpYXBpcGUucHJvdG9CElN0cmVhbUhhbmRsZXJQcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MediapipeOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.InputStreamHandlerConfig), global::Mediapipe.InputStreamHandlerConfig.Parser, new[]{ "InputStreamHandler", "Options" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.OutputStreamHandlerConfig), global::Mediapipe.OutputStreamHandlerConfig.Parser, new[]{ "OutputStreamHandler", "InputSidePacket", "Options" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Settings specifying an input stream handler. + /// + public sealed partial class InputStreamHandlerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputStreamHandlerConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StreamHandlerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamHandlerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamHandlerConfig(InputStreamHandlerConfig other) : this() { + inputStreamHandler_ = other.inputStreamHandler_; + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public InputStreamHandlerConfig Clone() { + return new InputStreamHandlerConfig(this); + } + + /// Field number for the "input_stream_handler" field. + public const int InputStreamHandlerFieldNumber = 1; + private readonly static string InputStreamHandlerDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("RGVmYXVsdElucHV0U3RyZWFtSGFuZGxlcg=="), 0, 25); + + private string inputStreamHandler_; + /// + /// Name of the registered input stream handler class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string InputStreamHandler { + get { return inputStreamHandler_ ?? InputStreamHandlerDefaultValue; } + set { + inputStreamHandler_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "input_stream_handler" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputStreamHandler { + get { return inputStreamHandler_ != null; } + } + /// Clears the value of the "input_stream_handler" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputStreamHandler() { + inputStreamHandler_ = null; + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 3; + private global::Mediapipe.MediaPipeOptions options_; + /// + /// Options for the input stream handler. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MediaPipeOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as InputStreamHandlerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(InputStreamHandlerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InputStreamHandler != other.InputStreamHandler) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasInputStreamHandler) hash ^= InputStreamHandler.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasInputStreamHandler) { + output.WriteRawTag(10); + output.WriteString(InputStreamHandler); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasInputStreamHandler) { + output.WriteRawTag(10); + output.WriteString(InputStreamHandler); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasInputStreamHandler) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(InputStreamHandler); + } + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(InputStreamHandlerConfig other) { + if (other == null) { + return; + } + if (other.HasInputStreamHandler) { + InputStreamHandler = other.InputStreamHandler; + } + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + InputStreamHandler = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + InputStreamHandler = input.ReadString(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + } + #endif + + } + + /// + /// Settings specifying an output stream handler. + /// + public sealed partial class OutputStreamHandlerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OutputStreamHandlerConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StreamHandlerReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OutputStreamHandlerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OutputStreamHandlerConfig(OutputStreamHandlerConfig other) : this() { + outputStreamHandler_ = other.outputStreamHandler_; + inputSidePacket_ = other.inputSidePacket_.Clone(); + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OutputStreamHandlerConfig Clone() { + return new OutputStreamHandlerConfig(this); + } + + /// Field number for the "output_stream_handler" field. + public const int OutputStreamHandlerFieldNumber = 1; + private readonly static string OutputStreamHandlerDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("SW5PcmRlck91dHB1dFN0cmVhbUhhbmRsZXI="), 0, 26); + + private string outputStreamHandler_; + /// + /// Name of the registered output stream handler class. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OutputStreamHandler { + get { return outputStreamHandler_ ?? OutputStreamHandlerDefaultValue; } + set { + outputStreamHandler_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "output_stream_handler" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputStreamHandler { + get { return outputStreamHandler_ != null; } + } + /// Clears the value of the "output_stream_handler" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputStreamHandler() { + outputStreamHandler_ = null; + } + + /// Field number for the "input_side_packet" field. + public const int InputSidePacketFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_inputSidePacket_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField inputSidePacket_ = new pbc::RepeatedField(); + /// + /// Names of the input side packets for the handler specifically and distinct + /// from the side packets for the calculator (but could be shared). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InputSidePacket { + get { return inputSidePacket_; } + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 3; + private global::Mediapipe.MediaPipeOptions options_; + /// + /// Options for the output stream handler. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MediaPipeOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OutputStreamHandlerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OutputStreamHandlerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputStreamHandler != other.OutputStreamHandler) return false; + if(!inputSidePacket_.Equals(other.inputSidePacket_)) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputStreamHandler) hash ^= OutputStreamHandler.GetHashCode(); + hash ^= inputSidePacket_.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputStreamHandler) { + output.WriteRawTag(10); + output.WriteString(OutputStreamHandler); + } + inputSidePacket_.WriteTo(output, _repeated_inputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputStreamHandler) { + output.WriteRawTag(10); + output.WriteString(OutputStreamHandler); + } + inputSidePacket_.WriteTo(ref output, _repeated_inputSidePacket_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputStreamHandler) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OutputStreamHandler); + } + size += inputSidePacket_.CalculateSize(_repeated_inputSidePacket_codec); + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OutputStreamHandlerConfig other) { + if (other == null) { + return; + } + if (other.HasOutputStreamHandler) { + OutputStreamHandler = other.OutputStreamHandler; + } + inputSidePacket_.Add(other.inputSidePacket_); + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + OutputStreamHandler = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + OutputStreamHandler = input.ReadString(); + break; + } + case 18: { + inputSidePacket_.AddEntriesFrom(ref input, _repeated_inputSidePacket_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Mediapipe.MediaPipeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs.meta new file mode 100644 index 0000000..347affd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/StreamHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fd32667399239461813fefe99012c04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs new file mode 100644 index 0000000..8f1025b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs @@ -0,0 +1,521 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/framework/thread_pool_executor.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/framework/thread_pool_executor.proto + public static partial class ThreadPoolExecutorReflection { + + #region Descriptor + /// File descriptor for mediapipe/framework/thread_pool_executor.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ThreadPoolExecutorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci5tZWRpYXBpcGUvZnJhbWV3b3JrL3RocmVhZF9wb29sX2V4ZWN1dG9yLnBy", + "b3RvEgltZWRpYXBpcGUaK21lZGlhcGlwZS9mcmFtZXdvcmsvbWVkaWFwaXBl", + "X29wdGlvbnMucHJvdG8i6QIKGVRocmVhZFBvb2xFeGVjdXRvck9wdGlvbnMS", + "EwoLbnVtX3RocmVhZHMYASABKAUSEgoKc3RhY2tfc2l6ZRgCIAEoBRIbChNu", + "aWNlX3ByaW9yaXR5X2xldmVsGAMgASgFEmAKHXJlcXVpcmVfcHJvY2Vzc29y", + "X3BlcmZvcm1hbmNlGAQgASgOMjkubWVkaWFwaXBlLlRocmVhZFBvb2xFeGVj", + "dXRvck9wdGlvbnMuUHJvY2Vzc29yUGVyZm9ybWFuY2USGgoSdGhyZWFkX25h", + "bWVfcHJlZml4GAUgASgJIjUKFFByb2Nlc3NvclBlcmZvcm1hbmNlEgoKBk5P", + "Uk1BTBAAEgcKA0xPVxABEggKBEhJR0gQAjJRCgNleHQSGy5tZWRpYXBpcGUu", + "TWVkaWFQaXBlT3B0aW9ucxiT0/VKIAEoCzIkLm1lZGlhcGlwZS5UaHJlYWRQ", + "b29sRXhlY3V0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MediapipeOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ThreadPoolExecutorOptions), global::Mediapipe.ThreadPoolExecutorOptions.Parser, new[]{ "NumThreads", "StackSize", "NicePriorityLevel", "RequireProcessorPerformance", "ThreadNamePrefix" }, null, new[]{ typeof(global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance) }, new pb::Extension[] { global::Mediapipe.ThreadPoolExecutorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ThreadPoolExecutorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ThreadPoolExecutorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ThreadPoolExecutorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThreadPoolExecutorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThreadPoolExecutorOptions(ThreadPoolExecutorOptions other) : this() { + _hasBits0 = other._hasBits0; + numThreads_ = other.numThreads_; + stackSize_ = other.stackSize_; + nicePriorityLevel_ = other.nicePriorityLevel_; + requireProcessorPerformance_ = other.requireProcessorPerformance_; + threadNamePrefix_ = other.threadNamePrefix_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ThreadPoolExecutorOptions Clone() { + return new ThreadPoolExecutorOptions(this); + } + + /// Field number for the "num_threads" field. + public const int NumThreadsFieldNumber = 1; + private readonly static int NumThreadsDefaultValue = 0; + + private int numThreads_; + /// + /// Number of threads for running calculators in multithreaded mode. + /// + /// When ThreadPoolExecutorOptions is used in the ExecutorOptions for the + /// default executor with the executor type unspecified, the num_threads + /// field is allowed to be -1 or 0. If not specified or -1, the scheduler + /// will pick an appropriate number of threads depending on the number of + /// available processors. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumThreads { + get { if ((_hasBits0 & 1) != 0) { return numThreads_; } else { return NumThreadsDefaultValue; } } + set { + _hasBits0 |= 1; + numThreads_ = value; + } + } + /// Gets whether the "num_threads" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumThreads { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_threads" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumThreads() { + _hasBits0 &= ~1; + } + + /// Field number for the "stack_size" field. + public const int StackSizeFieldNumber = 2; + private readonly static int StackSizeDefaultValue = 0; + + private int stackSize_; + /// + /// Make all worker threads have the specified stack size (in bytes). + /// NOTE: The stack_size option may not be implemented on some platforms. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int StackSize { + get { if ((_hasBits0 & 2) != 0) { return stackSize_; } else { return StackSizeDefaultValue; } } + set { + _hasBits0 |= 2; + stackSize_ = value; + } + } + /// Gets whether the "stack_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStackSize { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "stack_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStackSize() { + _hasBits0 &= ~2; + } + + /// Field number for the "nice_priority_level" field. + public const int NicePriorityLevelFieldNumber = 3; + private readonly static int NicePriorityLevelDefaultValue = 0; + + private int nicePriorityLevel_; + /// + /// The nice priority level of the worker threads. + /// The nice priority level is 0 by default, and lower value means higher + /// priority. The valid thread nice priority level value range varies by OS. + /// Refer to system documentation for more details. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NicePriorityLevel { + get { if ((_hasBits0 & 4) != 0) { return nicePriorityLevel_; } else { return NicePriorityLevelDefaultValue; } } + set { + _hasBits0 |= 4; + nicePriorityLevel_ = value; + } + } + /// Gets whether the "nice_priority_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNicePriorityLevel { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "nice_priority_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNicePriorityLevel() { + _hasBits0 &= ~4; + } + + /// Field number for the "require_processor_performance" field. + public const int RequireProcessorPerformanceFieldNumber = 4; + private readonly static global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance RequireProcessorPerformanceDefaultValue = global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance.Normal; + + private global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance requireProcessorPerformance_; + /// + /// The performance hint of the processor(s) that the threads will be bound to. + /// Framework will make the best effort to run the threads on the specific + /// processors based on the performance hint. + /// The attempt may fail for various reasons. Success isn't guaranteed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance RequireProcessorPerformance { + get { if ((_hasBits0 & 8) != 0) { return requireProcessorPerformance_; } else { return RequireProcessorPerformanceDefaultValue; } } + set { + _hasBits0 |= 8; + requireProcessorPerformance_ = value; + } + } + /// Gets whether the "require_processor_performance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRequireProcessorPerformance { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "require_processor_performance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRequireProcessorPerformance() { + _hasBits0 &= ~8; + } + + /// Field number for the "thread_name_prefix" field. + public const int ThreadNamePrefixFieldNumber = 5; + private readonly static string ThreadNamePrefixDefaultValue = ""; + + private string threadNamePrefix_; + /// + /// Name prefix for worker threads, which can be useful for debugging + /// multithreaded applications. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ThreadNamePrefix { + get { return threadNamePrefix_ ?? ThreadNamePrefixDefaultValue; } + set { + threadNamePrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "thread_name_prefix" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThreadNamePrefix { + get { return threadNamePrefix_ != null; } + } + /// Clears the value of the "thread_name_prefix" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThreadNamePrefix() { + threadNamePrefix_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ThreadPoolExecutorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ThreadPoolExecutorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumThreads != other.NumThreads) return false; + if (StackSize != other.StackSize) return false; + if (NicePriorityLevel != other.NicePriorityLevel) return false; + if (RequireProcessorPerformance != other.RequireProcessorPerformance) return false; + if (ThreadNamePrefix != other.ThreadNamePrefix) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumThreads) hash ^= NumThreads.GetHashCode(); + if (HasStackSize) hash ^= StackSize.GetHashCode(); + if (HasNicePriorityLevel) hash ^= NicePriorityLevel.GetHashCode(); + if (HasRequireProcessorPerformance) hash ^= RequireProcessorPerformance.GetHashCode(); + if (HasThreadNamePrefix) hash ^= ThreadNamePrefix.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (HasStackSize) { + output.WriteRawTag(16); + output.WriteInt32(StackSize); + } + if (HasNicePriorityLevel) { + output.WriteRawTag(24); + output.WriteInt32(NicePriorityLevel); + } + if (HasRequireProcessorPerformance) { + output.WriteRawTag(32); + output.WriteEnum((int) RequireProcessorPerformance); + } + if (HasThreadNamePrefix) { + output.WriteRawTag(42); + output.WriteString(ThreadNamePrefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumThreads) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (HasStackSize) { + output.WriteRawTag(16); + output.WriteInt32(StackSize); + } + if (HasNicePriorityLevel) { + output.WriteRawTag(24); + output.WriteInt32(NicePriorityLevel); + } + if (HasRequireProcessorPerformance) { + output.WriteRawTag(32); + output.WriteEnum((int) RequireProcessorPerformance); + } + if (HasThreadNamePrefix) { + output.WriteRawTag(42); + output.WriteString(ThreadNamePrefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumThreads) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumThreads); + } + if (HasStackSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StackSize); + } + if (HasNicePriorityLevel) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NicePriorityLevel); + } + if (HasRequireProcessorPerformance) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequireProcessorPerformance); + } + if (HasThreadNamePrefix) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ThreadNamePrefix); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ThreadPoolExecutorOptions other) { + if (other == null) { + return; + } + if (other.HasNumThreads) { + NumThreads = other.NumThreads; + } + if (other.HasStackSize) { + StackSize = other.StackSize; + } + if (other.HasNicePriorityLevel) { + NicePriorityLevel = other.NicePriorityLevel; + } + if (other.HasRequireProcessorPerformance) { + RequireProcessorPerformance = other.RequireProcessorPerformance; + } + if (other.HasThreadNamePrefix) { + ThreadNamePrefix = other.ThreadNamePrefix; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + case 16: { + StackSize = input.ReadInt32(); + break; + } + case 24: { + NicePriorityLevel = input.ReadInt32(); + break; + } + case 32: { + RequireProcessorPerformance = (global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance) input.ReadEnum(); + break; + } + case 42: { + ThreadNamePrefix = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + case 16: { + StackSize = input.ReadInt32(); + break; + } + case 24: { + NicePriorityLevel = input.ReadInt32(); + break; + } + case 32: { + RequireProcessorPerformance = (global::Mediapipe.ThreadPoolExecutorOptions.Types.ProcessorPerformance) input.ReadEnum(); + break; + } + case 42: { + ThreadNamePrefix = input.ReadString(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ThreadPoolExecutorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Processor performance enum. + /// + public enum ProcessorPerformance { + [pbr::OriginalName("NORMAL")] Normal = 0, + [pbr::OriginalName("LOW")] Low = 1, + [pbr::OriginalName("HIGH")] High = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the ThreadPoolExecutorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(157116819, pb::FieldCodec.ForMessage(1256934554, global::Mediapipe.ThreadPoolExecutorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs.meta new file mode 100644 index 0000000..2252ec2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Framework/ThreadPoolExecutor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15eb1ffc03c83d25592251d6e502968e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu.meta new file mode 100644 index 0000000..5dad495 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b5deb96b073afa469eafca2686f6960 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs new file mode 100644 index 0000000..d04db90 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs @@ -0,0 +1,284 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/copy_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/copy_calculator.proto + public static partial class CopyCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/copy_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CopyCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiNtZWRpYXBpcGUvZ3B1L2NvcHlfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFw", + "aXBlGiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8i1wEK", + "FUNvcHlDYWxjdWxhdG9yT3B0aW9ucxJBCghyb3RhdGlvbhgBIAEoDjIpLm1l", + "ZGlhcGlwZS5Db3B5Q2FsY3VsYXRvck9wdGlvbnMuUm90YXRpb246BE5PTkUi", + "KwoIUm90YXRpb24SCAoETk9ORRAAEgcKA0NDVxABEgwKCENDV19GTElQEAIy", + "TgoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGLTykU0gASgL", + "MiAubWVkaWFwaXBlLkNvcHlDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CopyCalculatorOptions), global::Mediapipe.CopyCalculatorOptions.Parser, new[]{ "Rotation" }, null, new[]{ typeof(global::Mediapipe.CopyCalculatorOptions.Types.Rotation) }, new pb::Extension[] { global::Mediapipe.CopyCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class CopyCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CopyCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CopyCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CopyCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CopyCalculatorOptions(CopyCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + rotation_ = other.rotation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CopyCalculatorOptions Clone() { + return new CopyCalculatorOptions(this); + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 1; + private readonly static global::Mediapipe.CopyCalculatorOptions.Types.Rotation RotationDefaultValue = global::Mediapipe.CopyCalculatorOptions.Types.Rotation.None; + + private global::Mediapipe.CopyCalculatorOptions.Types.Rotation rotation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CopyCalculatorOptions.Types.Rotation Rotation { + get { if ((_hasBits0 & 1) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 1; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CopyCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CopyCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Rotation != other.Rotation) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRotation) hash ^= Rotation.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRotation) { + output.WriteRawTag(8); + output.WriteEnum((int) Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRotation) { + output.WriteRawTag(8); + output.WriteEnum((int) Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRotation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Rotation); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CopyCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Rotation = (global::Mediapipe.CopyCalculatorOptions.Types.Rotation) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Rotation = (global::Mediapipe.CopyCalculatorOptions.Types.Rotation) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the CopyCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Rotation { + [pbr::OriginalName("NONE")] None = 0, + /// + /// rotate 90 degrees counterclockwise + /// + [pbr::OriginalName("CCW")] Ccw = 1, + /// + /// hack to rectify convfloat + /// + [pbr::OriginalName("CCW_FLIP")] CcwFlip = 2, + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the CopyCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(161773876, pb::FieldCodec.ForMessage(1294191010, global::Mediapipe.CopyCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs.meta new file mode 100644 index 0000000..5096869 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/CopyCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71e3596855ccbafab8b85ccbac6097f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs new file mode 100644 index 0000000..1c60146 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs @@ -0,0 +1,259 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/gl_context_options.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/gl_context_options.proto + public static partial class GlContextOptionsReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/gl_context_options.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GlContextOptionsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZtZWRpYXBpcGUvZ3B1L2dsX2NvbnRleHRfb3B0aW9ucy5wcm90bxIJbWVk", + "aWFwaXBlGiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8i", + "dgoQR2xDb250ZXh0T3B0aW9ucxIXCg9nbF9jb250ZXh0X25hbWUYASABKAky", + "SQoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGIKJgmogASgL", + "MhsubWVkaWFwaXBlLkdsQ29udGV4dE9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GlContextOptions), global::Mediapipe.GlContextOptions.Parser, new[]{ "GlContextName" }, null, null, new pb::Extension[] { global::Mediapipe.GlContextOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GlContextOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GlContextOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GlContextOptionsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlContextOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlContextOptions(GlContextOptions other) : this() { + glContextName_ = other.glContextName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlContextOptions Clone() { + return new GlContextOptions(this); + } + + /// Field number for the "gl_context_name" field. + public const int GlContextNameFieldNumber = 1; + private readonly static string GlContextNameDefaultValue = ""; + + private string glContextName_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string GlContextName { + get { return glContextName_ ?? GlContextNameDefaultValue; } + set { + glContextName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "gl_context_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGlContextName { + get { return glContextName_ != null; } + } + /// Clears the value of the "gl_context_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGlContextName() { + glContextName_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GlContextOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GlContextOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (GlContextName != other.GlContextName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasGlContextName) hash ^= GlContextName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasGlContextName) { + output.WriteRawTag(10); + output.WriteString(GlContextName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasGlContextName) { + output.WriteRawTag(10); + output.WriteString(GlContextName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasGlContextName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(GlContextName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GlContextOptions other) { + if (other == null) { + return; + } + if (other.HasGlContextName) { + GlContextName = other.GlContextName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + GlContextName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + GlContextName = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the GlContextOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(222332034, pb::FieldCodec.ForMessage(1778656274, global::Mediapipe.GlContextOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs.meta new file mode 100644 index 0000000..120589c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlContextOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bae330538d4b01aab7160136c80ef68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs new file mode 100644 index 0000000..3acb45e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs @@ -0,0 +1,599 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/gl_scaler_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/gl_scaler_calculator.proto + public static partial class GlScalerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/gl_scaler_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GlScalerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CihtZWRpYXBpcGUvZ3B1L2dsX3NjYWxlcl9jYWxjdWxhdG9yLnByb3RvEglt", + "ZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90", + "bxoebWVkaWFwaXBlL2dwdS9zY2FsZV9tb2RlLnByb3RvIqYCChlHbFNjYWxl", + "ckNhbGN1bGF0b3JPcHRpb25zEhQKDG91dHB1dF93aWR0aBgBIAEoBRIVCg1v", + "dXRwdXRfaGVpZ2h0GAIgASgFEhcKDG91dHB1dF9zY2FsZRgHIAEoAjoBMRIQ", + "Cghyb3RhdGlvbhgDIAEoBRIVCg1mbGlwX3ZlcnRpY2FsGAQgASgIEhcKD2Zs", + "aXBfaG9yaXpvbnRhbBgFIAEoCBItCgpzY2FsZV9tb2RlGAYgASgOMhkubWVk", + "aWFwaXBlLlNjYWxlTW9kZS5Nb2RlMlIKA2V4dBIcLm1lZGlhcGlwZS5DYWxj", + "dWxhdG9yT3B0aW9ucxiWzapPIAEoCzIkLm1lZGlhcGlwZS5HbFNjYWxlckNh", + "bGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ScaleModeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GlScalerCalculatorOptions), global::Mediapipe.GlScalerCalculatorOptions.Parser, new[]{ "OutputWidth", "OutputHeight", "OutputScale", "Rotation", "FlipVertical", "FlipHorizontal", "ScaleMode" }, null, null, new pb::Extension[] { global::Mediapipe.GlScalerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Next id: 8. + /// + public sealed partial class GlScalerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GlScalerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GlScalerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlScalerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlScalerCalculatorOptions(GlScalerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + outputWidth_ = other.outputWidth_; + outputHeight_ = other.outputHeight_; + outputScale_ = other.outputScale_; + rotation_ = other.rotation_; + flipVertical_ = other.flipVertical_; + flipHorizontal_ = other.flipHorizontal_; + scaleMode_ = other.scaleMode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlScalerCalculatorOptions Clone() { + return new GlScalerCalculatorOptions(this); + } + + /// Field number for the "output_width" field. + public const int OutputWidthFieldNumber = 1; + private readonly static int OutputWidthDefaultValue = 0; + + private int outputWidth_; + /// + /// Output dimensions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputWidth { + get { if ((_hasBits0 & 1) != 0) { return outputWidth_; } else { return OutputWidthDefaultValue; } } + set { + _hasBits0 |= 1; + outputWidth_ = value; + } + } + /// Gets whether the "output_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "output_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "output_height" field. + public const int OutputHeightFieldNumber = 2; + private readonly static int OutputHeightDefaultValue = 0; + + private int outputHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OutputHeight { + get { if ((_hasBits0 & 2) != 0) { return outputHeight_; } else { return OutputHeightDefaultValue; } } + set { + _hasBits0 |= 2; + outputHeight_ = value; + } + } + /// Gets whether the "output_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "output_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "output_scale" field. + public const int OutputScaleFieldNumber = 7; + private readonly static float OutputScaleDefaultValue = 1F; + + private float outputScale_; + /// + /// A scale factor for output size, while keeping aspect ratio. It has lower + /// priority than the above two fields. That is, it is effective only when the + /// above two fields are unset. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OutputScale { + get { if ((_hasBits0 & 64) != 0) { return outputScale_; } else { return OutputScaleDefaultValue; } } + set { + _hasBits0 |= 64; + outputScale_ = value; + } + } + /// Gets whether the "output_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputScale { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "output_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputScale() { + _hasBits0 &= ~64; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 3; + private readonly static int RotationDefaultValue = 0; + + private int rotation_; + /// + /// Counterclockwise rotation in degrees. Must be a multiple of 90. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Rotation { + get { if ((_hasBits0 & 4) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 4; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~4; + } + + /// Field number for the "flip_vertical" field. + public const int FlipVerticalFieldNumber = 4; + private readonly static bool FlipVerticalDefaultValue = false; + + private bool flipVertical_; + /// + /// Flip the output texture vertically. This is applied after rotation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipVertical { + get { if ((_hasBits0 & 8) != 0) { return flipVertical_; } else { return FlipVerticalDefaultValue; } } + set { + _hasBits0 |= 8; + flipVertical_ = value; + } + } + /// Gets whether the "flip_vertical" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipVertical { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "flip_vertical" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipVertical() { + _hasBits0 &= ~8; + } + + /// Field number for the "flip_horizontal" field. + public const int FlipHorizontalFieldNumber = 5; + private readonly static bool FlipHorizontalDefaultValue = false; + + private bool flipHorizontal_; + /// + /// Flip the output texture horizontally. This is applied after rotation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlipHorizontal { + get { if ((_hasBits0 & 16) != 0) { return flipHorizontal_; } else { return FlipHorizontalDefaultValue; } } + set { + _hasBits0 |= 16; + flipHorizontal_ = value; + } + } + /// Gets whether the "flip_horizontal" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlipHorizontal { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "flip_horizontal" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlipHorizontal() { + _hasBits0 &= ~16; + } + + /// Field number for the "scale_mode" field. + public const int ScaleModeFieldNumber = 6; + private readonly static global::Mediapipe.ScaleMode.Types.Mode ScaleModeDefaultValue = global::Mediapipe.ScaleMode.Types.Mode.Default; + + private global::Mediapipe.ScaleMode.Types.Mode scaleMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ScaleMode.Types.Mode ScaleMode { + get { if ((_hasBits0 & 32) != 0) { return scaleMode_; } else { return ScaleModeDefaultValue; } } + set { + _hasBits0 |= 32; + scaleMode_ = value; + } + } + /// Gets whether the "scale_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleMode { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "scale_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleMode() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GlScalerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GlScalerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OutputWidth != other.OutputWidth) return false; + if (OutputHeight != other.OutputHeight) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OutputScale, other.OutputScale)) return false; + if (Rotation != other.Rotation) return false; + if (FlipVertical != other.FlipVertical) return false; + if (FlipHorizontal != other.FlipHorizontal) return false; + if (ScaleMode != other.ScaleMode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOutputWidth) hash ^= OutputWidth.GetHashCode(); + if (HasOutputHeight) hash ^= OutputHeight.GetHashCode(); + if (HasOutputScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OutputScale); + if (HasRotation) hash ^= Rotation.GetHashCode(); + if (HasFlipVertical) hash ^= FlipVertical.GetHashCode(); + if (HasFlipHorizontal) hash ^= FlipHorizontal.GetHashCode(); + if (HasScaleMode) hash ^= ScaleMode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOutputWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputWidth); + } + if (HasOutputHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputHeight); + } + if (HasRotation) { + output.WriteRawTag(24); + output.WriteInt32(Rotation); + } + if (HasFlipVertical) { + output.WriteRawTag(32); + output.WriteBool(FlipVertical); + } + if (HasFlipHorizontal) { + output.WriteRawTag(40); + output.WriteBool(FlipHorizontal); + } + if (HasScaleMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ScaleMode); + } + if (HasOutputScale) { + output.WriteRawTag(61); + output.WriteFloat(OutputScale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOutputWidth) { + output.WriteRawTag(8); + output.WriteInt32(OutputWidth); + } + if (HasOutputHeight) { + output.WriteRawTag(16); + output.WriteInt32(OutputHeight); + } + if (HasRotation) { + output.WriteRawTag(24); + output.WriteInt32(Rotation); + } + if (HasFlipVertical) { + output.WriteRawTag(32); + output.WriteBool(FlipVertical); + } + if (HasFlipHorizontal) { + output.WriteRawTag(40); + output.WriteBool(FlipHorizontal); + } + if (HasScaleMode) { + output.WriteRawTag(48); + output.WriteEnum((int) ScaleMode); + } + if (HasOutputScale) { + output.WriteRawTag(61); + output.WriteFloat(OutputScale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOutputWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputWidth); + } + if (HasOutputHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputHeight); + } + if (HasOutputScale) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Rotation); + } + if (HasFlipVertical) { + size += 1 + 1; + } + if (HasFlipHorizontal) { + size += 1 + 1; + } + if (HasScaleMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ScaleMode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GlScalerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOutputWidth) { + OutputWidth = other.OutputWidth; + } + if (other.HasOutputHeight) { + OutputHeight = other.OutputHeight; + } + if (other.HasOutputScale) { + OutputScale = other.OutputScale; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasFlipVertical) { + FlipVertical = other.FlipVertical; + } + if (other.HasFlipHorizontal) { + FlipHorizontal = other.FlipHorizontal; + } + if (other.HasScaleMode) { + ScaleMode = other.ScaleMode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OutputWidth = input.ReadInt32(); + break; + } + case 16: { + OutputHeight = input.ReadInt32(); + break; + } + case 24: { + Rotation = input.ReadInt32(); + break; + } + case 32: { + FlipVertical = input.ReadBool(); + break; + } + case 40: { + FlipHorizontal = input.ReadBool(); + break; + } + case 48: { + ScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + case 61: { + OutputScale = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OutputWidth = input.ReadInt32(); + break; + } + case 16: { + OutputHeight = input.ReadInt32(); + break; + } + case 24: { + Rotation = input.ReadInt32(); + break; + } + case 32: { + FlipVertical = input.ReadBool(); + break; + } + case 40: { + FlipHorizontal = input.ReadBool(); + break; + } + case 48: { + ScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + case 61: { + OutputScale = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the GlScalerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(166373014, pb::FieldCodec.ForMessage(1330984114, global::Mediapipe.GlScalerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs.meta new file mode 100644 index 0000000..50fa6b9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlScalerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e437594b1f0bc2bfb36773bf65f9b5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs new file mode 100644 index 0000000..f17baf7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs @@ -0,0 +1,267 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/gl_surface_sink_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/gl_surface_sink_calculator.proto + public static partial class GlSurfaceSinkCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/gl_surface_sink_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GlSurfaceSinkCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci5tZWRpYXBpcGUvZ3B1L2dsX3N1cmZhY2Vfc2lua19jYWxjdWxhdG9yLnBy", + "b3RvEgltZWRpYXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRv", + "ci5wcm90bxoebWVkaWFwaXBlL2dwdS9zY2FsZV9tb2RlLnByb3RvIq4BCh5H", + "bFN1cmZhY2VTaW5rQ2FsY3VsYXRvck9wdGlvbnMSMwoQZnJhbWVfc2NhbGVf", + "bW9kZRgBIAEoDjIZLm1lZGlhcGlwZS5TY2FsZU1vZGUuTW9kZTJXCgNleHQS", + "HC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYivuDdCABKAsyKS5tZWRp", + "YXBpcGUuR2xTdXJmYWNlU2lua0NhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.ScaleModeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GlSurfaceSinkCalculatorOptions), global::Mediapipe.GlSurfaceSinkCalculatorOptions.Parser, new[]{ "FrameScaleMode" }, null, null, new pb::Extension[] { global::Mediapipe.GlSurfaceSinkCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GlSurfaceSinkCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GlSurfaceSinkCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GlSurfaceSinkCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlSurfaceSinkCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlSurfaceSinkCalculatorOptions(GlSurfaceSinkCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + frameScaleMode_ = other.frameScaleMode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GlSurfaceSinkCalculatorOptions Clone() { + return new GlSurfaceSinkCalculatorOptions(this); + } + + /// Field number for the "frame_scale_mode" field. + public const int FrameScaleModeFieldNumber = 1; + private readonly static global::Mediapipe.ScaleMode.Types.Mode FrameScaleModeDefaultValue = global::Mediapipe.ScaleMode.Types.Mode.Default; + + private global::Mediapipe.ScaleMode.Types.Mode frameScaleMode_; + /// + /// Output frame scale mode. Default is FILL_AND_CROP. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ScaleMode.Types.Mode FrameScaleMode { + get { if ((_hasBits0 & 1) != 0) { return frameScaleMode_; } else { return FrameScaleModeDefaultValue; } } + set { + _hasBits0 |= 1; + frameScaleMode_ = value; + } + } + /// Gets whether the "frame_scale_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameScaleMode { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_scale_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameScaleMode() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GlSurfaceSinkCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GlSurfaceSinkCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FrameScaleMode != other.FrameScaleMode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrameScaleMode) hash ^= FrameScaleMode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrameScaleMode) { + output.WriteRawTag(8); + output.WriteEnum((int) FrameScaleMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrameScaleMode) { + output.WriteRawTag(8); + output.WriteEnum((int) FrameScaleMode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrameScaleMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) FrameScaleMode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GlSurfaceSinkCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasFrameScaleMode) { + FrameScaleMode = other.FrameScaleMode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FrameScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FrameScaleMode = (global::Mediapipe.ScaleMode.Types.Mode) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the GlSurfaceSinkCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(243334538, pb::FieldCodec.ForMessage(1946676306, global::Mediapipe.GlSurfaceSinkCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs.meta new file mode 100644 index 0000000..7212ed6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GlSurfaceSinkCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33119b5384370efd09b9087d2ce189dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs new file mode 100644 index 0000000..7228ebf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs @@ -0,0 +1,218 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/gpu_origin.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/gpu_origin.proto + public static partial class GpuOriginReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/gpu_origin.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GpuOriginReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch5tZWRpYXBpcGUvZ3B1L2dwdV9vcmlnaW4ucHJvdG8SCW1lZGlhcGlwZSJA", + "CglHcHVPcmlnaW4iMwoETW9kZRILCgdERUZBVUxUEAASEAoMQ09OVkVOVElP", + "TkFMEAESDAoIVE9QX0xFRlQQAg==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GpuOrigin), global::Mediapipe.GpuOrigin.Parser, null, null, new[]{ typeof(global::Mediapipe.GpuOrigin.Types.Mode) }, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GpuOrigin : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GpuOrigin()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GpuOriginReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GpuOrigin() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GpuOrigin(GpuOrigin other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GpuOrigin Clone() { + return new GpuOrigin(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GpuOrigin); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GpuOrigin other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GpuOrigin other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the GpuOrigin message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Mode { + [pbr::OriginalName("DEFAULT")] Default = 0, + /// + /// OpenGL: bottom-left origin + /// Metal : top-left origin + /// + [pbr::OriginalName("CONVENTIONAL")] Conventional = 1, + /// + /// OpenGL: top-left origin + /// Metal : top-left origin + /// + [pbr::OriginalName("TOP_LEFT")] TopLeft = 2, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs.meta new file mode 100644 index 0000000..5d4efa1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/GpuOrigin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c71092f0698acee60854c9e32f6689e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs new file mode 100644 index 0000000..393ea66 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs @@ -0,0 +1,228 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/gpu/scale_mode.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/gpu/scale_mode.proto + public static partial class ScaleModeReflection { + + #region Descriptor + /// File descriptor for mediapipe/gpu/scale_mode.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ScaleModeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch5tZWRpYXBpcGUvZ3B1L3NjYWxlX21vZGUucHJvdG8SCW1lZGlhcGlwZSJJ", + "CglTY2FsZU1vZGUiPAoETW9kZRILCgdERUZBVUxUEAASCwoHU1RSRVRDSBAB", + "EgcKA0ZJVBACEhEKDUZJTExfQU5EX0NST1AQAw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ScaleMode), global::Mediapipe.ScaleMode.Parser, null, null, new[]{ typeof(global::Mediapipe.ScaleMode.Types.Mode) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// We wrap the enum in a message to avoid namespace collisions. + /// + public sealed partial class ScaleMode : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScaleMode()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ScaleModeReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleMode() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleMode(ScaleMode other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ScaleMode Clone() { + return new ScaleMode(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ScaleMode); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ScaleMode other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ScaleMode other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ScaleMode message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// This enum mirrors the ScaleModes supported by Quad Renderer. + /// + public enum Mode { + [pbr::OriginalName("DEFAULT")] Default = 0, + /// + /// Stretch the frame to the exact provided output dimensions. + /// + [pbr::OriginalName("STRETCH")] Stretch = 1, + /// + /// Scale the frame up to fit the drawing area, preserving aspect ratio; may + /// letterbox. + /// + [pbr::OriginalName("FIT")] Fit = 2, + /// + /// Scale the frame up to fill the drawing area, preserving aspect ratio; may + /// crop. + /// + [pbr::OriginalName("FILL_AND_CROP")] FillAndCrop = 3, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs.meta new file mode 100644 index 0000000..717e63a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Gpu/ScaleMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bccb5502ab1f3fcffabae7f2ccecd023 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs.meta new file mode 100644 index 0000000..c3be3b8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b33529890a1d11418f664d41d187811 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking.meta new file mode 100644 index 0000000..9318a05 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26877d6ed3b070a42b4ba046ab663d8b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators.meta new file mode 100644 index 0000000..0f823fb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 296bb2461c6520442aeda2acdfeffdf6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs new file mode 100644 index 0000000..ea8348d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs @@ -0,0 +1,693 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/graphs/instant_motion_tracking/calculators/sticker_buffer.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/graphs/instant_motion_tracking/calculators/sticker_buffer.proto + public static partial class StickerBufferReflection { + + #region Descriptor + /// File descriptor for mediapipe/graphs/instant_motion_tracking/calculators/sticker_buffer.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StickerBufferReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkltZWRpYXBpcGUvZ3JhcGhzL2luc3RhbnRfbW90aW9uX3RyYWNraW5nL2Nh", + "bGN1bGF0b3JzL3N0aWNrZXJfYnVmZmVyLnByb3RvEgltZWRpYXBpcGUiXwoH", + "U3RpY2tlchIKCgJpZBgBIAEoBRIJCgF4GAIgASgCEgkKAXkYAyABKAISEAoI", + "cm90YXRpb24YBCABKAISDQoFc2NhbGUYBSABKAISEQoJcmVuZGVyX2lkGAYg", + "ASgFIjIKC1N0aWNrZXJSb2xsEiMKB3N0aWNrZXIYASADKAsyEi5tZWRpYXBp", + "cGUuU3RpY2tlckJHCjFjb20uZ29vZ2xlLm1lZGlhcGlwZS5ncmFwaHMuaW5z", + "dGFudG1vdGlvbnRyYWNraW5nQhJTdGlja2VyQnVmZmVyUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Sticker), global::Mediapipe.Sticker.Parser, new[]{ "Id", "X", "Y", "Rotation", "Scale", "RenderId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.StickerRoll), global::Mediapipe.StickerRoll.Parser, new[]{ "Sticker" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Sticker : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Sticker()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StickerBufferReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sticker() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sticker(Sticker other) : this() { + _hasBits0 = other._hasBits0; + id_ = other.id_; + x_ = other.x_; + y_ = other.y_; + rotation_ = other.rotation_; + scale_ = other.scale_; + renderId_ = other.renderId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sticker Clone() { + return new Sticker(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private readonly static int IdDefaultValue = 0; + + private int id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 1) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 1; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~1; + } + + /// Field number for the "x" field. + public const int XFieldNumber = 2; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 2) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 2; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~2; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 3; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 4) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 4; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~4; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 4; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 8) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 8; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~8; + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 5; + private readonly static float ScaleDefaultValue = 0F; + + private float scale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Scale { + get { if ((_hasBits0 & 16) != 0) { return scale_; } else { return ScaleDefaultValue; } } + set { + _hasBits0 |= 16; + scale_ = value; + } + } + /// Gets whether the "scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "render_id" field. + public const int RenderIdFieldNumber = 6; + private readonly static int RenderIdDefaultValue = 0; + + private int renderId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RenderId { + get { if ((_hasBits0 & 32) != 0) { return renderId_; } else { return RenderIdDefaultValue; } } + set { + _hasBits0 |= 32; + renderId_ = value; + } + } + /// Gets whether the "render_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRenderId { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "render_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRenderId() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Sticker); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Sticker other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Scale, other.Scale)) return false; + if (RenderId != other.RenderId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasId) hash ^= Id.GetHashCode(); + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (HasScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Scale); + if (HasRenderId) hash ^= RenderId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasX) { + output.WriteRawTag(21); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(29); + output.WriteFloat(Y); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (HasScale) { + output.WriteRawTag(45); + output.WriteFloat(Scale); + } + if (HasRenderId) { + output.WriteRawTag(48); + output.WriteInt32(RenderId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasId) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (HasX) { + output.WriteRawTag(21); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(29); + output.WriteFloat(Y); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (HasScale) { + output.WriteRawTag(45); + output.WriteFloat(Scale); + } + if (HasRenderId) { + output.WriteRawTag(48); + output.WriteInt32(RenderId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + 4; + } + if (HasScale) { + size += 1 + 4; + } + if (HasRenderId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RenderId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Sticker other) { + if (other == null) { + return; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasScale) { + Scale = other.Scale; + } + if (other.HasRenderId) { + RenderId = other.RenderId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 21: { + X = input.ReadFloat(); + break; + } + case 29: { + Y = input.ReadFloat(); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + case 45: { + Scale = input.ReadFloat(); + break; + } + case 48: { + RenderId = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 21: { + X = input.ReadFloat(); + break; + } + case 29: { + Y = input.ReadFloat(); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + case 45: { + Scale = input.ReadFloat(); + break; + } + case 48: { + RenderId = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class StickerRoll : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StickerRoll()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.StickerBufferReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StickerRoll() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StickerRoll(StickerRoll other) : this() { + sticker_ = other.sticker_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StickerRoll Clone() { + return new StickerRoll(this); + } + + /// Field number for the "sticker" field. + public const int StickerFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_sticker_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Sticker.Parser); + private readonly pbc::RepeatedField sticker_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Sticker { + get { return sticker_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StickerRoll); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StickerRoll other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!sticker_.Equals(other.sticker_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= sticker_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + sticker_.WriteTo(output, _repeated_sticker_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + sticker_.WriteTo(ref output, _repeated_sticker_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += sticker_.CalculateSize(_repeated_sticker_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StickerRoll other) { + if (other == null) { + return; + } + sticker_.Add(other.sticker_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + sticker_.AddEntriesFrom(input, _repeated_sticker_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + sticker_.AddEntriesFrom(ref input, _repeated_sticker_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs.meta new file mode 100644 index 0000000..9848b9e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/InstantMotionTracking/Calculators/StickerBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a11b00ac8e39a8b818d36a1a4f0fce79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d.meta new file mode 100644 index 0000000..57b8bd8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efd4ba4e1c22a3b48ac3ab7514a5e78d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators.meta new file mode 100644 index 0000000..c397335 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f4235a26422f24e4485c3ad525f7426b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs new file mode 100644 index 0000000..7df1790 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs @@ -0,0 +1,1005 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/graphs/object_detection_3d/calculators/model_matrix.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/graphs/object_detection_3d/calculators/model_matrix.proto + public static partial class ModelMatrixReflection { + + #region Descriptor + /// File descriptor for mediapipe/graphs/object_detection_3d/calculators/model_matrix.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ModelMatrixReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkNtZWRpYXBpcGUvZ3JhcGhzL29iamVjdF9kZXRlY3Rpb25fM2QvY2FsY3Vs", + "YXRvcnMvbW9kZWxfbWF0cml4LnByb3RvEgltZWRpYXBpcGUiWQoVVGltZWRN", + "b2RlbE1hdHJpeFByb3RvEhoKDm1hdHJpeF9lbnRyaWVzGAEgAygCQgIQARIU", + "Cgl0aW1lX21zZWMYAiABKAM6ATASDgoCaWQYAyABKAU6Ai0xIlMKGVRpbWVk", + "TW9kZWxNYXRyaXhQcm90b0xpc3QSNgoMbW9kZWxfbWF0cml4GAEgAygLMiAu", + "bWVkaWFwaXBlLlRpbWVkTW9kZWxNYXRyaXhQcm90byJUChBUaW1lZFZlY3Rv", + "clByb3RvEhoKDnZlY3Rvcl9lbnRyaWVzGAEgAygCQgIQARIUCgl0aW1lX21z", + "ZWMYAiABKAM6ATASDgoCaWQYAyABKAU6Ai0xIkgKFFRpbWVkVmVjdG9yUHJv", + "dG9MaXN0EjAKC3ZlY3Rvcl9saXN0GAEgAygLMhsubWVkaWFwaXBlLlRpbWVk", + "VmVjdG9yUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedModelMatrixProto), global::Mediapipe.TimedModelMatrixProto.Parser, new[]{ "MatrixEntries", "TimeMsec", "Id" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedModelMatrixProtoList), global::Mediapipe.TimedModelMatrixProtoList.Parser, new[]{ "ModelMatrix" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedVectorProto), global::Mediapipe.TimedVectorProto.Parser, new[]{ "VectorEntries", "TimeMsec", "Id" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedVectorProtoList), global::Mediapipe.TimedVectorProtoList.Parser, new[]{ "VectorList" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TimedModelMatrixProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedModelMatrixProto()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ModelMatrixReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProto(TimedModelMatrixProto other) : this() { + _hasBits0 = other._hasBits0; + matrixEntries_ = other.matrixEntries_.Clone(); + timeMsec_ = other.timeMsec_; + id_ = other.id_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProto Clone() { + return new TimedModelMatrixProto(this); + } + + /// Field number for the "matrix_entries" field. + public const int MatrixEntriesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_matrixEntries_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField matrixEntries_ = new pbc::RepeatedField(); + /// + /// 4x4 model matrix stored in ROW major order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField MatrixEntries { + get { return matrixEntries_; } + } + + /// Field number for the "time_msec" field. + public const int TimeMsecFieldNumber = 2; + private readonly static long TimeMsecDefaultValue = 0L; + + private long timeMsec_; + /// + /// Timestamp of this model matrix in milliseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimeMsec { + get { if ((_hasBits0 & 1) != 0) { return timeMsec_; } else { return TimeMsecDefaultValue; } } + set { + _hasBits0 |= 1; + timeMsec_ = value; + } + } + /// Gets whether the "time_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimeMsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "time_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimeMsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 3; + private readonly static int IdDefaultValue = -1; + + private int id_; + /// + /// Unique per object id + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 2) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 2; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedModelMatrixProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedModelMatrixProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!matrixEntries_.Equals(other.matrixEntries_)) return false; + if (TimeMsec != other.TimeMsec) return false; + if (Id != other.Id) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= matrixEntries_.GetHashCode(); + if (HasTimeMsec) hash ^= TimeMsec.GetHashCode(); + if (HasId) hash ^= Id.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + matrixEntries_.WriteTo(output, _repeated_matrixEntries_codec); + if (HasTimeMsec) { + output.WriteRawTag(16); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(24); + output.WriteInt32(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + matrixEntries_.WriteTo(ref output, _repeated_matrixEntries_codec); + if (HasTimeMsec) { + output.WriteRawTag(16); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(24); + output.WriteInt32(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += matrixEntries_.CalculateSize(_repeated_matrixEntries_codec); + if (HasTimeMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimeMsec); + } + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedModelMatrixProto other) { + if (other == null) { + return; + } + matrixEntries_.Add(other.matrixEntries_); + if (other.HasTimeMsec) { + TimeMsec = other.TimeMsec; + } + if (other.HasId) { + Id = other.Id; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + matrixEntries_.AddEntriesFrom(input, _repeated_matrixEntries_codec); + break; + } + case 16: { + TimeMsec = input.ReadInt64(); + break; + } + case 24: { + Id = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + matrixEntries_.AddEntriesFrom(ref input, _repeated_matrixEntries_codec); + break; + } + case 16: { + TimeMsec = input.ReadInt64(); + break; + } + case 24: { + Id = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TimedModelMatrixProtoList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedModelMatrixProtoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ModelMatrixReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProtoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProtoList(TimedModelMatrixProtoList other) : this() { + modelMatrix_ = other.modelMatrix_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedModelMatrixProtoList Clone() { + return new TimedModelMatrixProtoList(this); + } + + /// Field number for the "model_matrix" field. + public const int ModelMatrixFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_modelMatrix_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.TimedModelMatrixProto.Parser); + private readonly pbc::RepeatedField modelMatrix_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ModelMatrix { + get { return modelMatrix_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedModelMatrixProtoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedModelMatrixProtoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!modelMatrix_.Equals(other.modelMatrix_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= modelMatrix_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + modelMatrix_.WriteTo(output, _repeated_modelMatrix_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + modelMatrix_.WriteTo(ref output, _repeated_modelMatrix_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += modelMatrix_.CalculateSize(_repeated_modelMatrix_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedModelMatrixProtoList other) { + if (other == null) { + return; + } + modelMatrix_.Add(other.modelMatrix_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + modelMatrix_.AddEntriesFrom(input, _repeated_modelMatrix_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + modelMatrix_.AddEntriesFrom(ref input, _repeated_modelMatrix_codec); + break; + } + } + } + } + #endif + + } + + /// + /// For convenience, when the desired information or transformation can be + /// encoded into vectors (e.g. when the matrix represents a scale or Euler-angle- + /// based rotation operation.) + /// + public sealed partial class TimedVectorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedVectorProto()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ModelMatrixReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProto(TimedVectorProto other) : this() { + _hasBits0 = other._hasBits0; + vectorEntries_ = other.vectorEntries_.Clone(); + timeMsec_ = other.timeMsec_; + id_ = other.id_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProto Clone() { + return new TimedVectorProto(this); + } + + /// Field number for the "vector_entries" field. + public const int VectorEntriesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_vectorEntries_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField vectorEntries_ = new pbc::RepeatedField(); + /// + /// The vector values themselves. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VectorEntries { + get { return vectorEntries_; } + } + + /// Field number for the "time_msec" field. + public const int TimeMsecFieldNumber = 2; + private readonly static long TimeMsecDefaultValue = 0L; + + private long timeMsec_; + /// + /// Timestamp of this vector in milliseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimeMsec { + get { if ((_hasBits0 & 1) != 0) { return timeMsec_; } else { return TimeMsecDefaultValue; } } + set { + _hasBits0 |= 1; + timeMsec_ = value; + } + } + /// Gets whether the "time_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimeMsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "time_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimeMsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 3; + private readonly static int IdDefaultValue = -1; + + private int id_; + /// + /// Unique per object id + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 2) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 2; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedVectorProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedVectorProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!vectorEntries_.Equals(other.vectorEntries_)) return false; + if (TimeMsec != other.TimeMsec) return false; + if (Id != other.Id) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= vectorEntries_.GetHashCode(); + if (HasTimeMsec) hash ^= TimeMsec.GetHashCode(); + if (HasId) hash ^= Id.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + vectorEntries_.WriteTo(output, _repeated_vectorEntries_codec); + if (HasTimeMsec) { + output.WriteRawTag(16); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(24); + output.WriteInt32(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + vectorEntries_.WriteTo(ref output, _repeated_vectorEntries_codec); + if (HasTimeMsec) { + output.WriteRawTag(16); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(24); + output.WriteInt32(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += vectorEntries_.CalculateSize(_repeated_vectorEntries_codec); + if (HasTimeMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimeMsec); + } + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedVectorProto other) { + if (other == null) { + return; + } + vectorEntries_.Add(other.vectorEntries_); + if (other.HasTimeMsec) { + TimeMsec = other.TimeMsec; + } + if (other.HasId) { + Id = other.Id; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + vectorEntries_.AddEntriesFrom(input, _repeated_vectorEntries_codec); + break; + } + case 16: { + TimeMsec = input.ReadInt64(); + break; + } + case 24: { + Id = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + vectorEntries_.AddEntriesFrom(ref input, _repeated_vectorEntries_codec); + break; + } + case 16: { + TimeMsec = input.ReadInt64(); + break; + } + case 24: { + Id = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TimedVectorProtoList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedVectorProtoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ModelMatrixReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProtoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProtoList(TimedVectorProtoList other) : this() { + vectorList_ = other.vectorList_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedVectorProtoList Clone() { + return new TimedVectorProtoList(this); + } + + /// Field number for the "vector_list" field. + public const int VectorListFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_vectorList_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.TimedVectorProto.Parser); + private readonly pbc::RepeatedField vectorList_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VectorList { + get { return vectorList_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedVectorProtoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedVectorProtoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!vectorList_.Equals(other.vectorList_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= vectorList_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + vectorList_.WriteTo(output, _repeated_vectorList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + vectorList_.WriteTo(ref output, _repeated_vectorList_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += vectorList_.CalculateSize(_repeated_vectorList_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedVectorProtoList other) { + if (other == null) { + return; + } + vectorList_.Add(other.vectorList_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + vectorList_.AddEntriesFrom(input, _repeated_vectorList_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + vectorList_.AddEntriesFrom(ref input, _repeated_vectorList_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs.meta new file mode 100644 index 0000000..b246df9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Graphs/ObjectDetection3d/Calculators/ModelMatrix.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce2b8f727949ebd1fb12a76204377e2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules.meta new file mode 100644 index 0000000..5109fa5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f7d5e5035bd5f746a09697800125802 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection.meta new file mode 100644 index 0000000..764c57d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69a17f5b080c84345ac876605aa32966 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs new file mode 100644 index 0000000..7957c80 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs @@ -0,0 +1,952 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_detection/face_detection.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/face_detection/face_detection.proto + public static partial class FaceDetectionReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_detection/face_detection.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FaceDetectionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjVtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2RldGVjdGlvbi9mYWNlX2RldGVj", + "dGlvbi5wcm90bxIJbWVkaWFwaXBlGjdtZWRpYXBpcGUvY2FsY3VsYXRvcnMv", + "dGVuc29yL2luZmVyZW5jZV9jYWxjdWxhdG9yLnByb3RvGixtZWRpYXBpcGUv", + "ZnJhbWV3b3JrL2NhbGN1bGF0b3Jfb3B0aW9ucy5wcm90bxoebWVkaWFwaXBl", + "L2dwdS9ncHVfb3JpZ2luLnByb3RvIuYDChRGYWNlRGV0ZWN0aW9uT3B0aW9u", + "cxISCgptb2RlbF9wYXRoGAEgASgJEi0KCmdwdV9vcmlnaW4YCyABKA4yGS5t", + "ZWRpYXBpcGUuR3B1T3JpZ2luLk1vZGUSFAoMdGVuc29yX3dpZHRoGBUgASgF", + "EhUKDXRlbnNvcl9oZWlnaHQYFiABKAUSEgoKbnVtX2xheWVycxgXIAEoBRIP", + "CgdzdHJpZGVzGBggAygFEioKH2ludGVycG9sYXRlZF9zY2FsZV9hc3BlY3Rf", + "cmF0aW8YGSABKAI6ATESEQoJbnVtX2JveGVzGB8gASgFEhIKB3hfc2NhbGUY", + "ICABKAI6ATASEgoHeV9zY2FsZRghIAEoAjoBMBISCgd3X3NjYWxlGCIgASgC", + "OgEwEhIKB2hfc2NhbGUYIyABKAI6ATASGAoQbWluX3Njb3JlX3RocmVzaBgk", + "IAEoAhJACghkZWxlZ2F0ZRgGIAEoCzIuLm1lZGlhcGlwZS5JbmZlcmVuY2VD", + "YWxjdWxhdG9yT3B0aW9ucy5EZWxlZ2F0ZTJOCgNleHQSHC5tZWRpYXBpcGUu", + "Q2FsY3VsYXRvck9wdGlvbnMY7vO8sgEgASgLMh8ubWVkaWFwaXBlLkZhY2VE", + "ZXRlY3Rpb25PcHRpb25zQkUKKmNvbS5nb29nbGUubWVkaWFwaXBlLm1vZHVs", + "ZXMuZmFjZWRldGVjdGlvbkIXRmFjZURldGVjdGlvbkZyb250UHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.InferenceCalculatorReflection.Descriptor, global::Mediapipe.CalculatorOptionsReflection.Descriptor, global::Mediapipe.GpuOriginReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceDetectionOptions), global::Mediapipe.FaceDetectionOptions.Parser, new[]{ "ModelPath", "GpuOrigin", "TensorWidth", "TensorHeight", "NumLayers", "Strides", "InterpolatedScaleAspectRatio", "NumBoxes", "XScale", "YScale", "WScale", "HScale", "MinScoreThresh", "Delegate" }, null, null, new pb::Extension[] { global::Mediapipe.FaceDetectionOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + /// + /// Defines the face geometry pipeline estimation result format. + /// + public sealed partial class FaceDetectionOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FaceDetectionOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceDetectionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceDetectionOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceDetectionOptions(FaceDetectionOptions other) : this() { + _hasBits0 = other._hasBits0; + modelPath_ = other.modelPath_; + gpuOrigin_ = other.gpuOrigin_; + tensorWidth_ = other.tensorWidth_; + tensorHeight_ = other.tensorHeight_; + numLayers_ = other.numLayers_; + strides_ = other.strides_.Clone(); + interpolatedScaleAspectRatio_ = other.interpolatedScaleAspectRatio_; + numBoxes_ = other.numBoxes_; + xScale_ = other.xScale_; + yScale_ = other.yScale_; + wScale_ = other.wScale_; + hScale_ = other.hScale_; + minScoreThresh_ = other.minScoreThresh_; + delegate_ = other.delegate_ != null ? other.delegate_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceDetectionOptions Clone() { + return new FaceDetectionOptions(this); + } + + /// Field number for the "model_path" field. + public const int ModelPathFieldNumber = 1; + private readonly static string ModelPathDefaultValue = ""; + + private string modelPath_; + /// + /// Path to the TF Lite model (ex: /path/to/modelname.tflite). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ModelPath { + get { return modelPath_ ?? ModelPathDefaultValue; } + set { + modelPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "model_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModelPath { + get { return modelPath_ != null; } + } + /// Clears the value of the "model_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModelPath() { + modelPath_ = null; + } + + /// Field number for the "gpu_origin" field. + public const int GpuOriginFieldNumber = 11; + private readonly static global::Mediapipe.GpuOrigin.Types.Mode GpuOriginDefaultValue = global::Mediapipe.GpuOrigin.Types.Mode.Default; + + private global::Mediapipe.GpuOrigin.Types.Mode gpuOrigin_; + /// + /// The coordinate origin corner, either CONVENTIONAL or TOP_LEFT. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GpuOrigin.Types.Mode GpuOrigin { + get { if ((_hasBits0 & 1) != 0) { return gpuOrigin_; } else { return GpuOriginDefaultValue; } } + set { + _hasBits0 |= 1; + gpuOrigin_ = value; + } + } + /// Gets whether the "gpu_origin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGpuOrigin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "gpu_origin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGpuOrigin() { + _hasBits0 &= ~1; + } + + /// Field number for the "tensor_width" field. + public const int TensorWidthFieldNumber = 21; + private readonly static int TensorWidthDefaultValue = 0; + + private int tensorWidth_; + /// + /// Size of the tensor provided to the face-detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TensorWidth { + get { if ((_hasBits0 & 2) != 0) { return tensorWidth_; } else { return TensorWidthDefaultValue; } } + set { + _hasBits0 |= 2; + tensorWidth_ = value; + } + } + /// Gets whether the "tensor_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTensorWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "tensor_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTensorWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "tensor_height" field. + public const int TensorHeightFieldNumber = 22; + private readonly static int TensorHeightDefaultValue = 0; + + private int tensorHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TensorHeight { + get { if ((_hasBits0 & 4) != 0) { return tensorHeight_; } else { return TensorHeightDefaultValue; } } + set { + _hasBits0 |= 4; + tensorHeight_ = value; + } + } + /// Gets whether the "tensor_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTensorHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "tensor_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTensorHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "num_layers" field. + public const int NumLayersFieldNumber = 23; + private readonly static int NumLayersDefaultValue = 0; + + private int numLayers_; + /// + /// Number of output feature maps to generate the anchors on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumLayers { + get { if ((_hasBits0 & 8) != 0) { return numLayers_; } else { return NumLayersDefaultValue; } } + set { + _hasBits0 |= 8; + numLayers_ = value; + } + } + /// Gets whether the "num_layers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumLayers { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "num_layers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumLayers() { + _hasBits0 &= ~8; + } + + /// Field number for the "strides" field. + public const int StridesFieldNumber = 24; + private static readonly pb::FieldCodec _repeated_strides_codec + = pb::FieldCodec.ForInt32(192); + private readonly pbc::RepeatedField strides_ = new pbc::RepeatedField(); + /// + /// Strides of each output feature maps. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Strides { + get { return strides_; } + } + + /// Field number for the "interpolated_scale_aspect_ratio" field. + public const int InterpolatedScaleAspectRatioFieldNumber = 25; + private readonly static float InterpolatedScaleAspectRatioDefaultValue = 1F; + + private float interpolatedScaleAspectRatio_; + /// + /// The aspect ratio of the interpolated anchor from the SsdAnchorsCalculator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InterpolatedScaleAspectRatio { + get { if ((_hasBits0 & 16) != 0) { return interpolatedScaleAspectRatio_; } else { return InterpolatedScaleAspectRatioDefaultValue; } } + set { + _hasBits0 |= 16; + interpolatedScaleAspectRatio_ = value; + } + } + /// Gets whether the "interpolated_scale_aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInterpolatedScaleAspectRatio { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "interpolated_scale_aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInterpolatedScaleAspectRatio() { + _hasBits0 &= ~16; + } + + /// Field number for the "num_boxes" field. + public const int NumBoxesFieldNumber = 31; + private readonly static int NumBoxesDefaultValue = 0; + + private int numBoxes_; + /// + /// The number of output boxes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumBoxes { + get { if ((_hasBits0 & 32) != 0) { return numBoxes_; } else { return NumBoxesDefaultValue; } } + set { + _hasBits0 |= 32; + numBoxes_ = value; + } + } + /// Gets whether the "num_boxes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumBoxes { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "num_boxes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumBoxes() { + _hasBits0 &= ~32; + } + + /// Field number for the "x_scale" field. + public const int XScaleFieldNumber = 32; + private readonly static float XScaleDefaultValue = 0F; + + private float xScale_; + /// + /// Parameters for decoding SSD detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float XScale { + get { if ((_hasBits0 & 64) != 0) { return xScale_; } else { return XScaleDefaultValue; } } + set { + _hasBits0 |= 64; + xScale_ = value; + } + } + /// Gets whether the "x_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXScale { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "x_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXScale() { + _hasBits0 &= ~64; + } + + /// Field number for the "y_scale" field. + public const int YScaleFieldNumber = 33; + private readonly static float YScaleDefaultValue = 0F; + + private float yScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float YScale { + get { if ((_hasBits0 & 128) != 0) { return yScale_; } else { return YScaleDefaultValue; } } + set { + _hasBits0 |= 128; + yScale_ = value; + } + } + /// Gets whether the "y_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYScale { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "y_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYScale() { + _hasBits0 &= ~128; + } + + /// Field number for the "w_scale" field. + public const int WScaleFieldNumber = 34; + private readonly static float WScaleDefaultValue = 0F; + + private float wScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float WScale { + get { if ((_hasBits0 & 256) != 0) { return wScale_; } else { return WScaleDefaultValue; } } + set { + _hasBits0 |= 256; + wScale_ = value; + } + } + /// Gets whether the "w_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWScale { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "w_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWScale() { + _hasBits0 &= ~256; + } + + /// Field number for the "h_scale" field. + public const int HScaleFieldNumber = 35; + private readonly static float HScaleDefaultValue = 0F; + + private float hScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HScale { + get { if ((_hasBits0 & 512) != 0) { return hScale_; } else { return HScaleDefaultValue; } } + set { + _hasBits0 |= 512; + hScale_ = value; + } + } + /// Gets whether the "h_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHScale { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "h_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHScale() { + _hasBits0 &= ~512; + } + + /// Field number for the "min_score_thresh" field. + public const int MinScoreThreshFieldNumber = 36; + private readonly static float MinScoreThreshDefaultValue = 0F; + + private float minScoreThresh_; + /// + /// Score threshold for perserving from the SSD detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScoreThresh { + get { if ((_hasBits0 & 1024) != 0) { return minScoreThresh_; } else { return MinScoreThreshDefaultValue; } } + set { + _hasBits0 |= 1024; + minScoreThresh_ = value; + } + } + /// Gets whether the "min_score_thresh" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScoreThresh { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "min_score_thresh" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScoreThresh() { + _hasBits0 &= ~1024; + } + + /// Field number for the "delegate" field. + public const int DelegateFieldNumber = 6; + private global::Mediapipe.InferenceCalculatorOptions.Types.Delegate delegate_; + /// + /// TfLite delegate to run inference. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.InferenceCalculatorOptions.Types.Delegate Delegate { + get { return delegate_; } + set { + delegate_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FaceDetectionOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FaceDetectionOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ModelPath != other.ModelPath) return false; + if (GpuOrigin != other.GpuOrigin) return false; + if (TensorWidth != other.TensorWidth) return false; + if (TensorHeight != other.TensorHeight) return false; + if (NumLayers != other.NumLayers) return false; + if(!strides_.Equals(other.strides_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InterpolatedScaleAspectRatio, other.InterpolatedScaleAspectRatio)) return false; + if (NumBoxes != other.NumBoxes) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XScale, other.XScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YScale, other.YScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WScale, other.WScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HScale, other.HScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThresh, other.MinScoreThresh)) return false; + if (!object.Equals(Delegate, other.Delegate)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasModelPath) hash ^= ModelPath.GetHashCode(); + if (HasGpuOrigin) hash ^= GpuOrigin.GetHashCode(); + if (HasTensorWidth) hash ^= TensorWidth.GetHashCode(); + if (HasTensorHeight) hash ^= TensorHeight.GetHashCode(); + if (HasNumLayers) hash ^= NumLayers.GetHashCode(); + hash ^= strides_.GetHashCode(); + if (HasInterpolatedScaleAspectRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InterpolatedScaleAspectRatio); + if (HasNumBoxes) hash ^= NumBoxes.GetHashCode(); + if (HasXScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XScale); + if (HasYScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YScale); + if (HasWScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WScale); + if (HasHScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HScale); + if (HasMinScoreThresh) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThresh); + if (delegate_ != null) hash ^= Delegate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (delegate_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Delegate); + } + if (HasGpuOrigin) { + output.WriteRawTag(88); + output.WriteEnum((int) GpuOrigin); + } + if (HasTensorWidth) { + output.WriteRawTag(168, 1); + output.WriteInt32(TensorWidth); + } + if (HasTensorHeight) { + output.WriteRawTag(176, 1); + output.WriteInt32(TensorHeight); + } + if (HasNumLayers) { + output.WriteRawTag(184, 1); + output.WriteInt32(NumLayers); + } + strides_.WriteTo(output, _repeated_strides_codec); + if (HasInterpolatedScaleAspectRatio) { + output.WriteRawTag(205, 1); + output.WriteFloat(InterpolatedScaleAspectRatio); + } + if (HasNumBoxes) { + output.WriteRawTag(248, 1); + output.WriteInt32(NumBoxes); + } + if (HasXScale) { + output.WriteRawTag(133, 2); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(141, 2); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(149, 2); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(157, 2); + output.WriteFloat(HScale); + } + if (HasMinScoreThresh) { + output.WriteRawTag(165, 2); + output.WriteFloat(MinScoreThresh); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasModelPath) { + output.WriteRawTag(10); + output.WriteString(ModelPath); + } + if (delegate_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Delegate); + } + if (HasGpuOrigin) { + output.WriteRawTag(88); + output.WriteEnum((int) GpuOrigin); + } + if (HasTensorWidth) { + output.WriteRawTag(168, 1); + output.WriteInt32(TensorWidth); + } + if (HasTensorHeight) { + output.WriteRawTag(176, 1); + output.WriteInt32(TensorHeight); + } + if (HasNumLayers) { + output.WriteRawTag(184, 1); + output.WriteInt32(NumLayers); + } + strides_.WriteTo(ref output, _repeated_strides_codec); + if (HasInterpolatedScaleAspectRatio) { + output.WriteRawTag(205, 1); + output.WriteFloat(InterpolatedScaleAspectRatio); + } + if (HasNumBoxes) { + output.WriteRawTag(248, 1); + output.WriteInt32(NumBoxes); + } + if (HasXScale) { + output.WriteRawTag(133, 2); + output.WriteFloat(XScale); + } + if (HasYScale) { + output.WriteRawTag(141, 2); + output.WriteFloat(YScale); + } + if (HasWScale) { + output.WriteRawTag(149, 2); + output.WriteFloat(WScale); + } + if (HasHScale) { + output.WriteRawTag(157, 2); + output.WriteFloat(HScale); + } + if (HasMinScoreThresh) { + output.WriteRawTag(165, 2); + output.WriteFloat(MinScoreThresh); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasModelPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ModelPath); + } + if (HasGpuOrigin) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GpuOrigin); + } + if (HasTensorWidth) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(TensorWidth); + } + if (HasTensorHeight) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(TensorHeight); + } + if (HasNumLayers) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(NumLayers); + } + size += strides_.CalculateSize(_repeated_strides_codec); + if (HasInterpolatedScaleAspectRatio) { + size += 2 + 4; + } + if (HasNumBoxes) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(NumBoxes); + } + if (HasXScale) { + size += 2 + 4; + } + if (HasYScale) { + size += 2 + 4; + } + if (HasWScale) { + size += 2 + 4; + } + if (HasHScale) { + size += 2 + 4; + } + if (HasMinScoreThresh) { + size += 2 + 4; + } + if (delegate_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Delegate); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FaceDetectionOptions other) { + if (other == null) { + return; + } + if (other.HasModelPath) { + ModelPath = other.ModelPath; + } + if (other.HasGpuOrigin) { + GpuOrigin = other.GpuOrigin; + } + if (other.HasTensorWidth) { + TensorWidth = other.TensorWidth; + } + if (other.HasTensorHeight) { + TensorHeight = other.TensorHeight; + } + if (other.HasNumLayers) { + NumLayers = other.NumLayers; + } + strides_.Add(other.strides_); + if (other.HasInterpolatedScaleAspectRatio) { + InterpolatedScaleAspectRatio = other.InterpolatedScaleAspectRatio; + } + if (other.HasNumBoxes) { + NumBoxes = other.NumBoxes; + } + if (other.HasXScale) { + XScale = other.XScale; + } + if (other.HasYScale) { + YScale = other.YScale; + } + if (other.HasWScale) { + WScale = other.WScale; + } + if (other.HasHScale) { + HScale = other.HScale; + } + if (other.HasMinScoreThresh) { + MinScoreThresh = other.MinScoreThresh; + } + if (other.delegate_ != null) { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + Delegate.MergeFrom(other.Delegate); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 50: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + case 88: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 168: { + TensorWidth = input.ReadInt32(); + break; + } + case 176: { + TensorHeight = input.ReadInt32(); + break; + } + case 184: { + NumLayers = input.ReadInt32(); + break; + } + case 194: + case 192: { + strides_.AddEntriesFrom(input, _repeated_strides_codec); + break; + } + case 205: { + InterpolatedScaleAspectRatio = input.ReadFloat(); + break; + } + case 248: { + NumBoxes = input.ReadInt32(); + break; + } + case 261: { + XScale = input.ReadFloat(); + break; + } + case 269: { + YScale = input.ReadFloat(); + break; + } + case 277: { + WScale = input.ReadFloat(); + break; + } + case 285: { + HScale = input.ReadFloat(); + break; + } + case 293: { + MinScoreThresh = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ModelPath = input.ReadString(); + break; + } + case 50: { + if (delegate_ == null) { + Delegate = new global::Mediapipe.InferenceCalculatorOptions.Types.Delegate(); + } + input.ReadMessage(Delegate); + break; + } + case 88: { + GpuOrigin = (global::Mediapipe.GpuOrigin.Types.Mode) input.ReadEnum(); + break; + } + case 168: { + TensorWidth = input.ReadInt32(); + break; + } + case 176: { + TensorHeight = input.ReadInt32(); + break; + } + case 184: { + NumLayers = input.ReadInt32(); + break; + } + case 194: + case 192: { + strides_.AddEntriesFrom(ref input, _repeated_strides_codec); + break; + } + case 205: { + InterpolatedScaleAspectRatio = input.ReadFloat(); + break; + } + case 248: { + NumBoxes = input.ReadInt32(); + break; + } + case 261: { + XScale = input.ReadFloat(); + break; + } + case 269: { + YScale = input.ReadFloat(); + break; + } + case 277: { + WScale = input.ReadFloat(); + break; + } + case 285: { + HScale = input.ReadFloat(); + break; + } + case 293: { + MinScoreThresh = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FaceDetectionOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(374290926, pb::FieldCodec.ForMessage(2994327410, global::Mediapipe.FaceDetectionOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs.meta new file mode 100644 index 0000000..530354c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceDetection/FaceDetection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8397728c6e167cbd98856f7baf51be1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry.meta new file mode 100644 index 0000000..fb27677 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ac7f5a471b772e4d869fdc5eeefccef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs new file mode 100644 index 0000000..fa51cd9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs @@ -0,0 +1,334 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/effect_renderer_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/effect_renderer_calculator.proto + public static partial class EffectRendererCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/effect_renderer_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static EffectRendererCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L2VmZmVjdF9yZW5k", + "ZXJlcl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaLG1lZGlhcGlwZS9m", + "cmFtZXdvcmsvY2FsY3VsYXRvcl9vcHRpb25zLnByb3RvIs4BCitGYWNlR2Vv", + "bWV0cnlFZmZlY3RSZW5kZXJlckNhbGN1bGF0b3JPcHRpb25zEhsKE2VmZmVj", + "dF90ZXh0dXJlX3BhdGgYASABKAkSGwoTZWZmZWN0X21lc2hfM2RfcGF0aBgC", + "IAEoCTJlCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMY8Nms", + "mgEgASgLMjYubWVkaWFwaXBlLkZhY2VHZW9tZXRyeUVmZmVjdFJlbmRlcmVy", + "Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometryEffectRendererCalculatorOptions), global::Mediapipe.FaceGeometryEffectRendererCalculatorOptions.Parser, new[]{ "EffectTexturePath", "EffectMesh3DPath" }, null, null, new pb::Extension[] { global::Mediapipe.FaceGeometryEffectRendererCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FaceGeometryEffectRendererCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FaceGeometryEffectRendererCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.EffectRendererCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEffectRendererCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEffectRendererCalculatorOptions(FaceGeometryEffectRendererCalculatorOptions other) : this() { + effectTexturePath_ = other.effectTexturePath_; + effectMesh3DPath_ = other.effectMesh3DPath_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEffectRendererCalculatorOptions Clone() { + return new FaceGeometryEffectRendererCalculatorOptions(this); + } + + /// Field number for the "effect_texture_path" field. + public const int EffectTexturePathFieldNumber = 1; + private readonly static string EffectTexturePathDefaultValue = ""; + + private string effectTexturePath_; + /// + /// Defines a path for the visual effect texture file. The effect texture is + /// later rendered on top of the effect mesh. + /// + /// Please be aware about the difference between the CPU texture memory layout + /// and the GPU texture sampler coordinate space. This renderer follows + /// conventions discussed here: https://open.gl/textures + /// + /// The texture file format must be supported by the OpenCV image decoder. It + /// must also define either an RGB or an RGBA texture. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string EffectTexturePath { + get { return effectTexturePath_ ?? EffectTexturePathDefaultValue; } + set { + effectTexturePath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "effect_texture_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEffectTexturePath { + get { return effectTexturePath_ != null; } + } + /// Clears the value of the "effect_texture_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEffectTexturePath() { + effectTexturePath_ = null; + } + + /// Field number for the "effect_mesh_3d_path" field. + public const int EffectMesh3DPathFieldNumber = 2; + private readonly static string EffectMesh3DPathDefaultValue = ""; + + private string effectMesh3DPath_; + /// + /// Defines a path for the visual effect mesh 3D file. The effect mesh is later + /// "attached" to the face and is driven by the face pose transformation + /// matrix. + /// + /// The mesh 3D file format must be the binary `face_system.Mesh3d` proto. + /// + /// If is not present, the runtime face mesh will be used as the effect mesh + /// - this mode is handy for facepaint effects. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string EffectMesh3DPath { + get { return effectMesh3DPath_ ?? EffectMesh3DPathDefaultValue; } + set { + effectMesh3DPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "effect_mesh_3d_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEffectMesh3DPath { + get { return effectMesh3DPath_ != null; } + } + /// Clears the value of the "effect_mesh_3d_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEffectMesh3DPath() { + effectMesh3DPath_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FaceGeometryEffectRendererCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FaceGeometryEffectRendererCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (EffectTexturePath != other.EffectTexturePath) return false; + if (EffectMesh3DPath != other.EffectMesh3DPath) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasEffectTexturePath) hash ^= EffectTexturePath.GetHashCode(); + if (HasEffectMesh3DPath) hash ^= EffectMesh3DPath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasEffectTexturePath) { + output.WriteRawTag(10); + output.WriteString(EffectTexturePath); + } + if (HasEffectMesh3DPath) { + output.WriteRawTag(18); + output.WriteString(EffectMesh3DPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasEffectTexturePath) { + output.WriteRawTag(10); + output.WriteString(EffectTexturePath); + } + if (HasEffectMesh3DPath) { + output.WriteRawTag(18); + output.WriteString(EffectMesh3DPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasEffectTexturePath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(EffectTexturePath); + } + if (HasEffectMesh3DPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(EffectMesh3DPath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FaceGeometryEffectRendererCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasEffectTexturePath) { + EffectTexturePath = other.EffectTexturePath; + } + if (other.HasEffectMesh3DPath) { + EffectMesh3DPath = other.EffectMesh3DPath; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + EffectTexturePath = input.ReadString(); + break; + } + case 18: { + EffectMesh3DPath = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + EffectTexturePath = input.ReadString(); + break; + } + case 18: { + EffectMesh3DPath = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FaceGeometryEffectRendererCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(323693808, pb::FieldCodec.ForMessage(2589550466, global::Mediapipe.FaceGeometryEffectRendererCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs.meta new file mode 100644 index 0000000..d599a98 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EffectRendererCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64856f22fa5ced2cdabfde7cf22602e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs new file mode 100644 index 0000000..2ee8b51 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs @@ -0,0 +1,264 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/env_generator_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/env_generator_calculator.proto + public static partial class EnvGeneratorCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/env_generator_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static EnvGeneratorCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L2Vudl9nZW5lcmF0", + "b3JfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBlGixtZWRpYXBpcGUvZnJh", + "bWV3b3JrL2NhbGN1bGF0b3Jfb3B0aW9ucy5wcm90bxo4bWVkaWFwaXBlL21v", + "ZHVsZXMvZmFjZV9nZW9tZXRyeS9wcm90b3MvZW52aXJvbm1lbnQucHJvdG8i", + "ywEKKUZhY2VHZW9tZXRyeUVudkdlbmVyYXRvckNhbGN1bGF0b3JPcHRpb25z", + "EjkKC2Vudmlyb25tZW50GAEgASgLMiQubWVkaWFwaXBlLmZhY2VfZ2VvbWV0", + "cnkuRW52aXJvbm1lbnQyYwoDZXh0EhwubWVkaWFwaXBlLkNhbGN1bGF0b3JP", + "cHRpb25zGPLZrJoBIAEoCzI0Lm1lZGlhcGlwZS5GYWNlR2VvbWV0cnlFbnZH", + "ZW5lcmF0b3JDYWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, global::Mediapipe.FaceGeometry.EnvironmentReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometryEnvGeneratorCalculatorOptions), global::Mediapipe.FaceGeometryEnvGeneratorCalculatorOptions.Parser, new[]{ "Environment" }, null, null, new pb::Extension[] { global::Mediapipe.FaceGeometryEnvGeneratorCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FaceGeometryEnvGeneratorCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FaceGeometryEnvGeneratorCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.EnvGeneratorCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEnvGeneratorCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEnvGeneratorCalculatorOptions(FaceGeometryEnvGeneratorCalculatorOptions other) : this() { + environment_ = other.environment_ != null ? other.environment_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryEnvGeneratorCalculatorOptions Clone() { + return new FaceGeometryEnvGeneratorCalculatorOptions(this); + } + + /// Field number for the "environment" field. + public const int EnvironmentFieldNumber = 1; + private global::Mediapipe.FaceGeometry.Environment environment_; + /// + /// Defines an environment to be packed as the output side packet. + /// + /// Must be valid (for details, please refer to the proto message definition + /// comments and/or `modules/face_geometry/libs/validation_utils.h/cc`) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.Environment Environment { + get { return environment_; } + set { + environment_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FaceGeometryEnvGeneratorCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FaceGeometryEnvGeneratorCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Environment, other.Environment)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (environment_ != null) hash ^= Environment.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (environment_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Environment); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (environment_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Environment); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (environment_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Environment); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FaceGeometryEnvGeneratorCalculatorOptions other) { + if (other == null) { + return; + } + if (other.environment_ != null) { + if (environment_ == null) { + Environment = new global::Mediapipe.FaceGeometry.Environment(); + } + Environment.MergeFrom(other.Environment); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (environment_ == null) { + Environment = new global::Mediapipe.FaceGeometry.Environment(); + } + input.ReadMessage(Environment); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (environment_ == null) { + Environment = new global::Mediapipe.FaceGeometry.Environment(); + } + input.ReadMessage(Environment); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FaceGeometryEnvGeneratorCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(323693810, pb::FieldCodec.ForMessage(2589550482, global::Mediapipe.FaceGeometryEnvGeneratorCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs.meta new file mode 100644 index 0000000..33b0848 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/EnvGeneratorCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c7348ed702634ae1bed9d24f5df5af0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs new file mode 100644 index 0000000..4ab24e2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs @@ -0,0 +1,261 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/geometry_pipeline_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/geometry_pipeline_calculator.proto + public static partial class GeometryPipelineCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/geometry_pipeline_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GeometryPipelineCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkJtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L2dlb21ldHJ5X3Bp", + "cGVsaW5lX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRosbWVkaWFwaXBl", + "L2ZyYW1ld29yay9jYWxjdWxhdG9yX29wdGlvbnMucHJvdG8inwEKJUZhY2VH", + "ZW9tZXRyeVBpcGVsaW5lQ2FsY3VsYXRvck9wdGlvbnMSFQoNbWV0YWRhdGFf", + "cGF0aBgBIAEoCTJfCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlv", + "bnMY9NmsmgEgASgLMjAubWVkaWFwaXBlLkZhY2VHZW9tZXRyeVBpcGVsaW5l", + "Q2FsY3VsYXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorOptionsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometryPipelineCalculatorOptions), global::Mediapipe.FaceGeometryPipelineCalculatorOptions.Parser, new[]{ "MetadataPath" }, null, null, new pb::Extension[] { global::Mediapipe.FaceGeometryPipelineCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FaceGeometryPipelineCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FaceGeometryPipelineCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.GeometryPipelineCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryPipelineCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryPipelineCalculatorOptions(FaceGeometryPipelineCalculatorOptions other) : this() { + metadataPath_ = other.metadataPath_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometryPipelineCalculatorOptions Clone() { + return new FaceGeometryPipelineCalculatorOptions(this); + } + + /// Field number for the "metadata_path" field. + public const int MetadataPathFieldNumber = 1; + private readonly static string MetadataPathDefaultValue = ""; + + private string metadataPath_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string MetadataPath { + get { return metadataPath_ ?? MetadataPathDefaultValue; } + set { + metadataPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "metadata_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMetadataPath { + get { return metadataPath_ != null; } + } + /// Clears the value of the "metadata_path" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMetadataPath() { + metadataPath_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FaceGeometryPipelineCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FaceGeometryPipelineCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MetadataPath != other.MetadataPath) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMetadataPath) hash ^= MetadataPath.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMetadataPath) { + output.WriteRawTag(10); + output.WriteString(MetadataPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMetadataPath) { + output.WriteRawTag(10); + output.WriteString(MetadataPath); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMetadataPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MetadataPath); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FaceGeometryPipelineCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMetadataPath) { + MetadataPath = other.MetadataPath; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MetadataPath = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + MetadataPath = input.ReadString(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FaceGeometryPipelineCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(323693812, pb::FieldCodec.ForMessage(2589550498, global::Mediapipe.FaceGeometryPipelineCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs.meta new file mode 100644 index 0000000..f5b2745 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/GeometryPipelineCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 179d060f02ec2c10fb0b66d898be90da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos.meta new file mode 100644 index 0000000..792fa39 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f4cffdef1a215b146a16fad7b68bc342 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs new file mode 100644 index 0000000..38f1379 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs @@ -0,0 +1,679 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/protos/environment.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe.FaceGeometry { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/protos/environment.proto + public static partial class EnvironmentReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/protos/environment.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static EnvironmentReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L3Byb3Rvcy9lbnZp", + "cm9ubWVudC5wcm90bxIXbWVkaWFwaXBlLmZhY2VfZ2VvbWV0cnkiTAoRUGVy", + "c3BlY3RpdmVDYW1lcmESHAoUdmVydGljYWxfZm92X2RlZ3JlZXMYASABKAIS", + "DAoEbmVhchgCIAEoAhILCgNmYXIYAyABKAIiogEKC0Vudmlyb25tZW50EksK", + "FW9yaWdpbl9wb2ludF9sb2NhdGlvbhgBIAEoDjIsLm1lZGlhcGlwZS5mYWNl", + "X2dlb21ldHJ5Lk9yaWdpblBvaW50TG9jYXRpb24SRgoScGVyc3BlY3RpdmVf", + "Y2FtZXJhGAIgASgLMioubWVkaWFwaXBlLmZhY2VfZ2VvbWV0cnkuUGVyc3Bl", + "Y3RpdmVDYW1lcmEqQgoTT3JpZ2luUG9pbnRMb2NhdGlvbhIWChJCT1RUT01f", + "TEVGVF9DT1JORVIQARITCg9UT1BfTEVGVF9DT1JORVIQAkI9Ciljb20uZ29v", + "Z2xlLm1lZGlhcGlwZS5tb2R1bGVzLmZhY2VnZW9tZXRyeUIQRW52aXJvbm1l", + "bnRQcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mediapipe.FaceGeometry.OriginPointLocation), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.PerspectiveCamera), global::Mediapipe.FaceGeometry.PerspectiveCamera.Parser, new[]{ "VerticalFovDegrees", "Near", "Far" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.Environment), global::Mediapipe.FaceGeometry.Environment.Parser, new[]{ "OriginPointLocation", "PerspectiveCamera" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + /// + /// Defines the (0, 0) origin point location of the environment. + /// + /// The variation in the origin point location can be traced back to the memory + /// layout of the camera video frame buffers. + /// + /// Usually, the memory layout for most CPU (and also some GPU) camera video + /// frame buffers results in having the (0, 0) origin point located in the + /// Top Left corner. + /// + /// On the contrary, the memory layout for most GPU camera video frame buffers + /// results in having the (0, 0) origin point located in the Bottom Left corner. + /// + /// Let's consider the following example: + /// + /// (A) ---------------+ + /// ___ | + /// | (1) | | | + /// | / \ | | | + /// | |---|===|-| | + /// | |---| | | | + /// | / \ | | | + /// | | | | | | + /// | | (2) |=| | | + /// | | | | | | + /// | |_______| |_| | + /// | |@| |@| | | | + /// | ___________|_|_ | + /// | + /// (B) ---------------+ + /// + /// On this example, (1) and (2) have the same X coordinate regardless of the + /// origin point location. However, having the origin point located at (A) + /// (Top Left corner) results in (1) having a smaller Y coordinate if compared to + /// (2). Similarly, having the origin point located at (B) (Bottom Left corner) + /// results in (1) having a greater Y coordinate if compared to (2). + /// + /// Providing the correct origin point location for your environment and making + /// sure all the input landmarks are in-sync with this location is crucial + /// for receiving the correct output face geometry and visual renders. + /// + public enum OriginPointLocation { + [pbr::OriginalName("BOTTOM_LEFT_CORNER")] BottomLeftCorner = 1, + [pbr::OriginalName("TOP_LEFT_CORNER")] TopLeftCorner = 2, + } + + #endregion + + #region Messages + /// + /// The perspective camera is defined through its vertical FOV angle and the + /// Z-clipping planes. The aspect ratio is a runtime variable for the face + /// geometry module and should be provided alongside the face landmarks in order + /// to estimate the face geometry on a given frame. + /// + /// More info on Perspective Cameras: + /// http://www.songho.ca/opengl/gl_projectionmatrix.html#perspective + /// + public sealed partial class PerspectiveCamera : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PerspectiveCamera()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.EnvironmentReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PerspectiveCamera() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PerspectiveCamera(PerspectiveCamera other) : this() { + _hasBits0 = other._hasBits0; + verticalFovDegrees_ = other.verticalFovDegrees_; + near_ = other.near_; + far_ = other.far_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PerspectiveCamera Clone() { + return new PerspectiveCamera(this); + } + + /// Field number for the "vertical_fov_degrees" field. + public const int VerticalFovDegreesFieldNumber = 1; + private readonly static float VerticalFovDegreesDefaultValue = 0F; + + private float verticalFovDegrees_; + /// + /// `0 < vertical_fov_degrees < 180`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VerticalFovDegrees { + get { if ((_hasBits0 & 1) != 0) { return verticalFovDegrees_; } else { return VerticalFovDegreesDefaultValue; } } + set { + _hasBits0 |= 1; + verticalFovDegrees_ = value; + } + } + /// Gets whether the "vertical_fov_degrees" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerticalFovDegrees { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "vertical_fov_degrees" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerticalFovDegrees() { + _hasBits0 &= ~1; + } + + /// Field number for the "near" field. + public const int NearFieldNumber = 2; + private readonly static float NearDefaultValue = 0F; + + private float near_; + /// + /// `0 < near < far`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Near { + get { if ((_hasBits0 & 2) != 0) { return near_; } else { return NearDefaultValue; } } + set { + _hasBits0 |= 2; + near_ = value; + } + } + /// Gets whether the "near" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNear { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "near" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNear() { + _hasBits0 &= ~2; + } + + /// Field number for the "far" field. + public const int FarFieldNumber = 3; + private readonly static float FarDefaultValue = 0F; + + private float far_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Far { + get { if ((_hasBits0 & 4) != 0) { return far_; } else { return FarDefaultValue; } } + set { + _hasBits0 |= 4; + far_ = value; + } + } + /// Gets whether the "far" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFar { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "far" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFar() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PerspectiveCamera); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PerspectiveCamera other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VerticalFovDegrees, other.VerticalFovDegrees)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Near, other.Near)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Far, other.Far)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasVerticalFovDegrees) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VerticalFovDegrees); + if (HasNear) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Near); + if (HasFar) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Far); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasVerticalFovDegrees) { + output.WriteRawTag(13); + output.WriteFloat(VerticalFovDegrees); + } + if (HasNear) { + output.WriteRawTag(21); + output.WriteFloat(Near); + } + if (HasFar) { + output.WriteRawTag(29); + output.WriteFloat(Far); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasVerticalFovDegrees) { + output.WriteRawTag(13); + output.WriteFloat(VerticalFovDegrees); + } + if (HasNear) { + output.WriteRawTag(21); + output.WriteFloat(Near); + } + if (HasFar) { + output.WriteRawTag(29); + output.WriteFloat(Far); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasVerticalFovDegrees) { + size += 1 + 4; + } + if (HasNear) { + size += 1 + 4; + } + if (HasFar) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PerspectiveCamera other) { + if (other == null) { + return; + } + if (other.HasVerticalFovDegrees) { + VerticalFovDegrees = other.VerticalFovDegrees; + } + if (other.HasNear) { + Near = other.Near; + } + if (other.HasFar) { + Far = other.Far; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + VerticalFovDegrees = input.ReadFloat(); + break; + } + case 21: { + Near = input.ReadFloat(); + break; + } + case 29: { + Far = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + VerticalFovDegrees = input.ReadFloat(); + break; + } + case 21: { + Near = input.ReadFloat(); + break; + } + case 29: { + Far = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Environment : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Environment()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.EnvironmentReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Environment() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Environment(Environment other) : this() { + _hasBits0 = other._hasBits0; + originPointLocation_ = other.originPointLocation_; + perspectiveCamera_ = other.perspectiveCamera_ != null ? other.perspectiveCamera_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Environment Clone() { + return new Environment(this); + } + + /// Field number for the "origin_point_location" field. + public const int OriginPointLocationFieldNumber = 1; + private readonly static global::Mediapipe.FaceGeometry.OriginPointLocation OriginPointLocationDefaultValue = global::Mediapipe.FaceGeometry.OriginPointLocation.BottomLeftCorner; + + private global::Mediapipe.FaceGeometry.OriginPointLocation originPointLocation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.OriginPointLocation OriginPointLocation { + get { if ((_hasBits0 & 1) != 0) { return originPointLocation_; } else { return OriginPointLocationDefaultValue; } } + set { + _hasBits0 |= 1; + originPointLocation_ = value; + } + } + /// Gets whether the "origin_point_location" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOriginPointLocation { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "origin_point_location" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOriginPointLocation() { + _hasBits0 &= ~1; + } + + /// Field number for the "perspective_camera" field. + public const int PerspectiveCameraFieldNumber = 2; + private global::Mediapipe.FaceGeometry.PerspectiveCamera perspectiveCamera_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.PerspectiveCamera PerspectiveCamera { + get { return perspectiveCamera_; } + set { + perspectiveCamera_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Environment); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Environment other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OriginPointLocation != other.OriginPointLocation) return false; + if (!object.Equals(PerspectiveCamera, other.PerspectiveCamera)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOriginPointLocation) hash ^= OriginPointLocation.GetHashCode(); + if (perspectiveCamera_ != null) hash ^= PerspectiveCamera.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOriginPointLocation) { + output.WriteRawTag(8); + output.WriteEnum((int) OriginPointLocation); + } + if (perspectiveCamera_ != null) { + output.WriteRawTag(18); + output.WriteMessage(PerspectiveCamera); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOriginPointLocation) { + output.WriteRawTag(8); + output.WriteEnum((int) OriginPointLocation); + } + if (perspectiveCamera_ != null) { + output.WriteRawTag(18); + output.WriteMessage(PerspectiveCamera); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOriginPointLocation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OriginPointLocation); + } + if (perspectiveCamera_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(PerspectiveCamera); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Environment other) { + if (other == null) { + return; + } + if (other.HasOriginPointLocation) { + OriginPointLocation = other.OriginPointLocation; + } + if (other.perspectiveCamera_ != null) { + if (perspectiveCamera_ == null) { + PerspectiveCamera = new global::Mediapipe.FaceGeometry.PerspectiveCamera(); + } + PerspectiveCamera.MergeFrom(other.PerspectiveCamera); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OriginPointLocation = (global::Mediapipe.FaceGeometry.OriginPointLocation) input.ReadEnum(); + break; + } + case 18: { + if (perspectiveCamera_ == null) { + PerspectiveCamera = new global::Mediapipe.FaceGeometry.PerspectiveCamera(); + } + input.ReadMessage(PerspectiveCamera); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OriginPointLocation = (global::Mediapipe.FaceGeometry.OriginPointLocation) input.ReadEnum(); + break; + } + case 18: { + if (perspectiveCamera_ == null) { + PerspectiveCamera = new global::Mediapipe.FaceGeometry.PerspectiveCamera(); + } + input.ReadMessage(PerspectiveCamera); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs.meta new file mode 100644 index 0000000..edf5bf5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Environment.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27261b8f2120b83ca871805186fc2688 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs new file mode 100644 index 0000000..9219ce9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs @@ -0,0 +1,331 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/protos/face_geometry.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe.FaceGeometry { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/protos/face_geometry.proto + public static partial class FaceGeometryReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/protos/face_geometry.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FaceGeometryReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjptZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L3Byb3Rvcy9mYWNl", + "X2dlb21ldHJ5LnByb3RvEhdtZWRpYXBpcGUuZmFjZV9nZW9tZXRyeRotbWVk", + "aWFwaXBlL2ZyYW1ld29yay9mb3JtYXRzL21hdHJpeF9kYXRhLnByb3RvGjRt", + "ZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L3Byb3Rvcy9tZXNoXzNk", + "LnByb3RvInMKDEZhY2VHZW9tZXRyeRItCgRtZXNoGAEgASgLMh8ubWVkaWFw", + "aXBlLmZhY2VfZ2VvbWV0cnkuTWVzaDNkEjQKFXBvc2VfdHJhbnNmb3JtX21h", + "dHJpeBgCIAEoCzIVLm1lZGlhcGlwZS5NYXRyaXhEYXRhQj4KKWNvbS5nb29n", + "bGUubWVkaWFwaXBlLm1vZHVsZXMuZmFjZWdlb21ldHJ5QhFGYWNlR2VvbWV0", + "cnlQcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MatrixDataReflection.Descriptor, global::Mediapipe.FaceGeometry.Mesh3DReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.FaceGeometry), global::Mediapipe.FaceGeometry.FaceGeometry.Parser, new[]{ "Mesh", "PoseTransformMatrix" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Defines the face geometry pipeline estimation result format. + /// + public sealed partial class FaceGeometry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FaceGeometry()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.FaceGeometryReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometry(FaceGeometry other) : this() { + mesh_ = other.mesh_ != null ? other.mesh_.Clone() : null; + poseTransformMatrix_ = other.poseTransformMatrix_ != null ? other.poseTransformMatrix_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FaceGeometry Clone() { + return new FaceGeometry(this); + } + + /// Field number for the "mesh" field. + public const int MeshFieldNumber = 1; + private global::Mediapipe.FaceGeometry.Mesh3d mesh_; + /// + /// Defines a mesh surface for a face. The face mesh vertex IDs are the same as + /// the face landmark IDs. + /// + /// XYZ coordinates exist in the right-handed Metric 3D space configured by an + /// environment. UV coodinates are taken from the canonical face mesh model. + /// + /// XY coordinates are guaranteed to match the screen positions of + /// the input face landmarks after (1) being multiplied by the face pose + /// transformation matrix and then (2) being projected with a perspective + /// camera matrix of the same environment. + /// + /// NOTE: the triangular topology of the face mesh is only useful when derived + /// from the 468 face landmarks, not from the 6 face detection landmarks + /// (keypoints). The former don't cover the entire face and this mesh is + /// defined here only to comply with the API. It should be considered as + /// a placeholder and/or for debugging purposes. + /// + /// Use the face geometry derived from the face detection landmarks + /// (keypoints) for the face pose transformation matrix, not the mesh. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.Mesh3d Mesh { + get { return mesh_; } + set { + mesh_ = value; + } + } + + /// Field number for the "pose_transform_matrix" field. + public const int PoseTransformMatrixFieldNumber = 2; + private global::Mediapipe.MatrixData poseTransformMatrix_; + /// + /// Defines a face pose transformation matrix, which provides mapping from + /// the static canonical face model to the runtime face. Tries to distinguish + /// a head pose change from a facial expression change and to only reflect the + /// former. + /// + /// Is a 4x4 matrix and contains only the following components: + /// * Uniform scale + /// * Rotation + /// * Translation + /// + /// The last row is guaranteed to be `[0 0 0 1]`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MatrixData PoseTransformMatrix { + get { return poseTransformMatrix_; } + set { + poseTransformMatrix_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FaceGeometry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FaceGeometry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Mesh, other.Mesh)) return false; + if (!object.Equals(PoseTransformMatrix, other.PoseTransformMatrix)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (mesh_ != null) hash ^= Mesh.GetHashCode(); + if (poseTransformMatrix_ != null) hash ^= PoseTransformMatrix.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (mesh_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Mesh); + } + if (poseTransformMatrix_ != null) { + output.WriteRawTag(18); + output.WriteMessage(PoseTransformMatrix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (mesh_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Mesh); + } + if (poseTransformMatrix_ != null) { + output.WriteRawTag(18); + output.WriteMessage(PoseTransformMatrix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (mesh_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mesh); + } + if (poseTransformMatrix_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(PoseTransformMatrix); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FaceGeometry other) { + if (other == null) { + return; + } + if (other.mesh_ != null) { + if (mesh_ == null) { + Mesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + Mesh.MergeFrom(other.Mesh); + } + if (other.poseTransformMatrix_ != null) { + if (poseTransformMatrix_ == null) { + PoseTransformMatrix = new global::Mediapipe.MatrixData(); + } + PoseTransformMatrix.MergeFrom(other.PoseTransformMatrix); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (mesh_ == null) { + Mesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + input.ReadMessage(Mesh); + break; + } + case 18: { + if (poseTransformMatrix_ == null) { + PoseTransformMatrix = new global::Mediapipe.MatrixData(); + } + input.ReadMessage(PoseTransformMatrix); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (mesh_ == null) { + Mesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + input.ReadMessage(Mesh); + break; + } + case 18: { + if (poseTransformMatrix_ == null) { + PoseTransformMatrix = new global::Mediapipe.MatrixData(); + } + input.ReadMessage(PoseTransformMatrix); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs.meta new file mode 100644 index 0000000..710e068 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/FaceGeometry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95c0ec47a36687ba8e49a70c3261e78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs new file mode 100644 index 0000000..134a387 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs @@ -0,0 +1,640 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe.FaceGeometry { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata.proto + public static partial class GeometryPipelineMetadataReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GeometryPipelineMetadataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkdtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L3Byb3Rvcy9nZW9t", + "ZXRyeV9waXBlbGluZV9tZXRhZGF0YS5wcm90bxIXbWVkaWFwaXBlLmZhY2Vf", + "Z2VvbWV0cnkaNG1lZGlhcGlwZS9tb2R1bGVzL2ZhY2VfZ2VvbWV0cnkvcHJv", + "dG9zL21lc2hfM2QucHJvdG8iOgoTV2VpZ2h0ZWRMYW5kbWFya1JlZhITCgts", + "YW5kbWFya19pZBgBIAEoDRIOCgZ3ZWlnaHQYAiABKAIi4AEKGEdlb21ldHJ5", + "UGlwZWxpbmVNZXRhZGF0YRI6CgxpbnB1dF9zb3VyY2UYAyABKA4yJC5tZWRp", + "YXBpcGUuZmFjZV9nZW9tZXRyeS5JbnB1dFNvdXJjZRI3Cg5jYW5vbmljYWxf", + "bWVzaBgBIAEoCzIfLm1lZGlhcGlwZS5mYWNlX2dlb21ldHJ5Lk1lc2gzZBJP", + "Chlwcm9jcnVzdGVzX2xhbmRtYXJrX2Jhc2lzGAIgAygLMiwubWVkaWFwaXBl", + "LmZhY2VfZ2VvbWV0cnkuV2VpZ2h0ZWRMYW5kbWFya1JlZipTCgtJbnB1dFNv", + "dXJjZRILCgdERUZBVUxUEAASGgoWRkFDRV9MQU5ETUFSS19QSVBFTElORRAB", + "EhsKF0ZBQ0VfREVURUNUSU9OX1BJUEVMSU5FEAJCSgopY29tLmdvb2dsZS5t", + "ZWRpYXBpcGUubW9kdWxlcy5mYWNlZ2VvbWV0cnlCHUdlb21ldHJ5UGlwZWxp", + "bmVNZXRhZGF0YVByb3Rv")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.FaceGeometry.Mesh3DReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mediapipe.FaceGeometry.InputSource), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.WeightedLandmarkRef), global::Mediapipe.FaceGeometry.WeightedLandmarkRef.Parser, new[]{ "LandmarkId", "Weight" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.GeometryPipelineMetadata), global::Mediapipe.FaceGeometry.GeometryPipelineMetadata.Parser, new[]{ "InputSource", "CanonicalMesh", "ProcrustesLandmarkBasis" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum InputSource { + /// + /// FACE_LANDMARK_PIPELINE + /// + [pbr::OriginalName("DEFAULT")] Default = 0, + [pbr::OriginalName("FACE_LANDMARK_PIPELINE")] FaceLandmarkPipeline = 1, + [pbr::OriginalName("FACE_DETECTION_PIPELINE")] FaceDetectionPipeline = 2, + } + + #endregion + + #region Messages + public sealed partial class WeightedLandmarkRef : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedLandmarkRef()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.GeometryPipelineMetadataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WeightedLandmarkRef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WeightedLandmarkRef(WeightedLandmarkRef other) : this() { + _hasBits0 = other._hasBits0; + landmarkId_ = other.landmarkId_; + weight_ = other.weight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WeightedLandmarkRef Clone() { + return new WeightedLandmarkRef(this); + } + + /// Field number for the "landmark_id" field. + public const int LandmarkIdFieldNumber = 1; + private readonly static uint LandmarkIdDefaultValue = 0; + + private uint landmarkId_; + /// + /// Defines the landmark ID. References an existing face landmark ID. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint LandmarkId { + get { if ((_hasBits0 & 1) != 0) { return landmarkId_; } else { return LandmarkIdDefaultValue; } } + set { + _hasBits0 |= 1; + landmarkId_ = value; + } + } + /// Gets whether the "landmark_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLandmarkId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "landmark_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLandmarkId() { + _hasBits0 &= ~1; + } + + /// Field number for the "weight" field. + public const int WeightFieldNumber = 2; + private readonly static float WeightDefaultValue = 0F; + + private float weight_; + /// + /// Defines the landmark weight. The larger the weight the more influence this + /// landmark has in the basis. + /// + /// Is positive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Weight { + get { if ((_hasBits0 & 2) != 0) { return weight_; } else { return WeightDefaultValue; } } + set { + _hasBits0 |= 2; + weight_ = value; + } + } + /// Gets whether the "weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWeight() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WeightedLandmarkRef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WeightedLandmarkRef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LandmarkId != other.LandmarkId) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Weight, other.Weight)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLandmarkId) hash ^= LandmarkId.GetHashCode(); + if (HasWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLandmarkId) { + output.WriteRawTag(8); + output.WriteUInt32(LandmarkId); + } + if (HasWeight) { + output.WriteRawTag(21); + output.WriteFloat(Weight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLandmarkId) { + output.WriteRawTag(8); + output.WriteUInt32(LandmarkId); + } + if (HasWeight) { + output.WriteRawTag(21); + output.WriteFloat(Weight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLandmarkId) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(LandmarkId); + } + if (HasWeight) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WeightedLandmarkRef other) { + if (other == null) { + return; + } + if (other.HasLandmarkId) { + LandmarkId = other.LandmarkId; + } + if (other.HasWeight) { + Weight = other.Weight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + LandmarkId = input.ReadUInt32(); + break; + } + case 21: { + Weight = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + LandmarkId = input.ReadUInt32(); + break; + } + case 21: { + Weight = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Next field ID: 4 + /// + public sealed partial class GeometryPipelineMetadata : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GeometryPipelineMetadata()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.GeometryPipelineMetadataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GeometryPipelineMetadata() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GeometryPipelineMetadata(GeometryPipelineMetadata other) : this() { + _hasBits0 = other._hasBits0; + inputSource_ = other.inputSource_; + canonicalMesh_ = other.canonicalMesh_ != null ? other.canonicalMesh_.Clone() : null; + procrustesLandmarkBasis_ = other.procrustesLandmarkBasis_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GeometryPipelineMetadata Clone() { + return new GeometryPipelineMetadata(this); + } + + /// Field number for the "input_source" field. + public const int InputSourceFieldNumber = 3; + private readonly static global::Mediapipe.FaceGeometry.InputSource InputSourceDefaultValue = global::Mediapipe.FaceGeometry.InputSource.Default; + + private global::Mediapipe.FaceGeometry.InputSource inputSource_; + /// + /// Defines the source of the input landmarks to let the underlying geometry + /// pipeline to adjust in order to produce the best results. + /// + /// Face landmark pipeline is expected to produce 3D landmarks with relative Z + /// coordinate, which is scaled as the X coordinate assuming the weak + /// perspective projection camera model. + /// + /// Face landmark pipeline is expected to produce 2D landmarks with Z + /// coordinate being equal to 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.InputSource InputSource { + get { if ((_hasBits0 & 1) != 0) { return inputSource_; } else { return InputSourceDefaultValue; } } + set { + _hasBits0 |= 1; + inputSource_ = value; + } + } + /// Gets whether the "input_source" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInputSource { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "input_source" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInputSource() { + _hasBits0 &= ~1; + } + + /// Field number for the "canonical_mesh" field. + public const int CanonicalMeshFieldNumber = 1; + private global::Mediapipe.FaceGeometry.Mesh3d canonicalMesh_; + /// + /// Defines a mesh surface for a canonical face. The canonical face mesh vertex + /// IDs are the same as the face landmark IDs. + /// + /// XYZ coordinates are defined in centimeter units. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.Mesh3d CanonicalMesh { + get { return canonicalMesh_; } + set { + canonicalMesh_ = value; + } + } + + /// Field number for the "procrustes_landmark_basis" field. + public const int ProcrustesLandmarkBasisFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_procrustesLandmarkBasis_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.FaceGeometry.WeightedLandmarkRef.Parser); + private readonly pbc::RepeatedField procrustesLandmarkBasis_ = new pbc::RepeatedField(); + /// + /// Defines a weighted landmark basis for running the Procrustes solver + /// algorithm inside the geometry pipeline. + /// + /// A good basis sets face landmark weights in way to distinguish a head pose + /// change from a facial expression change and to only respond to the former. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ProcrustesLandmarkBasis { + get { return procrustesLandmarkBasis_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GeometryPipelineMetadata); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GeometryPipelineMetadata other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InputSource != other.InputSource) return false; + if (!object.Equals(CanonicalMesh, other.CanonicalMesh)) return false; + if(!procrustesLandmarkBasis_.Equals(other.procrustesLandmarkBasis_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasInputSource) hash ^= InputSource.GetHashCode(); + if (canonicalMesh_ != null) hash ^= CanonicalMesh.GetHashCode(); + hash ^= procrustesLandmarkBasis_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (canonicalMesh_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CanonicalMesh); + } + procrustesLandmarkBasis_.WriteTo(output, _repeated_procrustesLandmarkBasis_codec); + if (HasInputSource) { + output.WriteRawTag(24); + output.WriteEnum((int) InputSource); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (canonicalMesh_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CanonicalMesh); + } + procrustesLandmarkBasis_.WriteTo(ref output, _repeated_procrustesLandmarkBasis_codec); + if (HasInputSource) { + output.WriteRawTag(24); + output.WriteEnum((int) InputSource); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasInputSource) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) InputSource); + } + if (canonicalMesh_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CanonicalMesh); + } + size += procrustesLandmarkBasis_.CalculateSize(_repeated_procrustesLandmarkBasis_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GeometryPipelineMetadata other) { + if (other == null) { + return; + } + if (other.HasInputSource) { + InputSource = other.InputSource; + } + if (other.canonicalMesh_ != null) { + if (canonicalMesh_ == null) { + CanonicalMesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + CanonicalMesh.MergeFrom(other.CanonicalMesh); + } + procrustesLandmarkBasis_.Add(other.procrustesLandmarkBasis_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (canonicalMesh_ == null) { + CanonicalMesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + input.ReadMessage(CanonicalMesh); + break; + } + case 18: { + procrustesLandmarkBasis_.AddEntriesFrom(input, _repeated_procrustesLandmarkBasis_codec); + break; + } + case 24: { + InputSource = (global::Mediapipe.FaceGeometry.InputSource) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (canonicalMesh_ == null) { + CanonicalMesh = new global::Mediapipe.FaceGeometry.Mesh3d(); + } + input.ReadMessage(CanonicalMesh); + break; + } + case 18: { + procrustesLandmarkBasis_.AddEntriesFrom(ref input, _repeated_procrustesLandmarkBasis_codec); + break; + } + case 24: { + InputSource = (global::Mediapipe.FaceGeometry.InputSource) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs.meta new file mode 100644 index 0000000..bec76dd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/GeometryPipelineMetadata.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ee83bbf21893b0698762553487f5dba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs new file mode 100644 index 0000000..0ad035a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs @@ -0,0 +1,394 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/face_geometry/protos/mesh_3d.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe.FaceGeometry { + + /// Holder for reflection information generated from mediapipe/modules/face_geometry/protos/mesh_3d.proto + public static partial class Mesh3DReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/face_geometry/protos/mesh_3d.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Mesh3DReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjRtZWRpYXBpcGUvbW9kdWxlcy9mYWNlX2dlb21ldHJ5L3Byb3Rvcy9tZXNo", + "XzNkLnByb3RvEhdtZWRpYXBpcGUuZmFjZV9nZW9tZXRyeSL5AQoGTWVzaDNk", + "Ej8KC3ZlcnRleF90eXBlGAEgASgOMioubWVkaWFwaXBlLmZhY2VfZ2VvbWV0", + "cnkuTWVzaDNkLlZlcnRleFR5cGUSRQoOcHJpbWl0aXZlX3R5cGUYAiABKA4y", + "LS5tZWRpYXBpcGUuZmFjZV9nZW9tZXRyeS5NZXNoM2QuUHJpbWl0aXZlVHlw", + "ZRIVCg12ZXJ0ZXhfYnVmZmVyGAMgAygCEhQKDGluZGV4X2J1ZmZlchgEIAMo", + "DSIbCgpWZXJ0ZXhUeXBlEg0KCVZFUlRFWF9QVBAAIh0KDVByaW1pdGl2ZVR5", + "cGUSDAoIVFJJQU5HTEUQAEI4Ciljb20uZ29vZ2xlLm1lZGlhcGlwZS5tb2R1", + "bGVzLmZhY2VnZW9tZXRyeUILTWVzaDNkUHJvdG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FaceGeometry.Mesh3d), global::Mediapipe.FaceGeometry.Mesh3d.Parser, new[]{ "VertexType", "PrimitiveType", "VertexBuffer", "IndexBuffer" }, null, new[]{ typeof(global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType), typeof(global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType) }, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Mesh3d : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mesh3d()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FaceGeometry.Mesh3DReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Mesh3d() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Mesh3d(Mesh3d other) : this() { + _hasBits0 = other._hasBits0; + vertexType_ = other.vertexType_; + primitiveType_ = other.primitiveType_; + vertexBuffer_ = other.vertexBuffer_.Clone(); + indexBuffer_ = other.indexBuffer_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Mesh3d Clone() { + return new Mesh3d(this); + } + + /// Field number for the "vertex_type" field. + public const int VertexTypeFieldNumber = 1; + private readonly static global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType VertexTypeDefaultValue = global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType.VertexPt; + + private global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType vertexType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType VertexType { + get { if ((_hasBits0 & 1) != 0) { return vertexType_; } else { return VertexTypeDefaultValue; } } + set { + _hasBits0 |= 1; + vertexType_ = value; + } + } + /// Gets whether the "vertex_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVertexType { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "vertex_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVertexType() { + _hasBits0 &= ~1; + } + + /// Field number for the "primitive_type" field. + public const int PrimitiveTypeFieldNumber = 2; + private readonly static global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType PrimitiveTypeDefaultValue = global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType.Triangle; + + private global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType primitiveType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType PrimitiveType { + get { if ((_hasBits0 & 2) != 0) { return primitiveType_; } else { return PrimitiveTypeDefaultValue; } } + set { + _hasBits0 |= 2; + primitiveType_ = value; + } + } + /// Gets whether the "primitive_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPrimitiveType { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "primitive_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPrimitiveType() { + _hasBits0 &= ~2; + } + + /// Field number for the "vertex_buffer" field. + public const int VertexBufferFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_vertexBuffer_codec + = pb::FieldCodec.ForFloat(29); + private readonly pbc::RepeatedField vertexBuffer_ = new pbc::RepeatedField(); + /// + /// Vertex buffer size is a multiple of the vertex size (e.g., 5 for + /// VERTEX_PT). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VertexBuffer { + get { return vertexBuffer_; } + } + + /// Field number for the "index_buffer" field. + public const int IndexBufferFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_indexBuffer_codec + = pb::FieldCodec.ForUInt32(32); + private readonly pbc::RepeatedField indexBuffer_ = new pbc::RepeatedField(); + /// + /// Index buffer size is a multiple of the primitive size (e.g., 3 for + /// TRIANGLE). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IndexBuffer { + get { return indexBuffer_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Mesh3d); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Mesh3d other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (VertexType != other.VertexType) return false; + if (PrimitiveType != other.PrimitiveType) return false; + if(!vertexBuffer_.Equals(other.vertexBuffer_)) return false; + if(!indexBuffer_.Equals(other.indexBuffer_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasVertexType) hash ^= VertexType.GetHashCode(); + if (HasPrimitiveType) hash ^= PrimitiveType.GetHashCode(); + hash ^= vertexBuffer_.GetHashCode(); + hash ^= indexBuffer_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasVertexType) { + output.WriteRawTag(8); + output.WriteEnum((int) VertexType); + } + if (HasPrimitiveType) { + output.WriteRawTag(16); + output.WriteEnum((int) PrimitiveType); + } + vertexBuffer_.WriteTo(output, _repeated_vertexBuffer_codec); + indexBuffer_.WriteTo(output, _repeated_indexBuffer_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasVertexType) { + output.WriteRawTag(8); + output.WriteEnum((int) VertexType); + } + if (HasPrimitiveType) { + output.WriteRawTag(16); + output.WriteEnum((int) PrimitiveType); + } + vertexBuffer_.WriteTo(ref output, _repeated_vertexBuffer_codec); + indexBuffer_.WriteTo(ref output, _repeated_indexBuffer_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasVertexType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) VertexType); + } + if (HasPrimitiveType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PrimitiveType); + } + size += vertexBuffer_.CalculateSize(_repeated_vertexBuffer_codec); + size += indexBuffer_.CalculateSize(_repeated_indexBuffer_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Mesh3d other) { + if (other == null) { + return; + } + if (other.HasVertexType) { + VertexType = other.VertexType; + } + if (other.HasPrimitiveType) { + PrimitiveType = other.PrimitiveType; + } + vertexBuffer_.Add(other.vertexBuffer_); + indexBuffer_.Add(other.indexBuffer_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + VertexType = (global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType) input.ReadEnum(); + break; + } + case 16: { + PrimitiveType = (global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType) input.ReadEnum(); + break; + } + case 26: + case 29: { + vertexBuffer_.AddEntriesFrom(input, _repeated_vertexBuffer_codec); + break; + } + case 34: + case 32: { + indexBuffer_.AddEntriesFrom(input, _repeated_indexBuffer_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + VertexType = (global::Mediapipe.FaceGeometry.Mesh3d.Types.VertexType) input.ReadEnum(); + break; + } + case 16: { + PrimitiveType = (global::Mediapipe.FaceGeometry.Mesh3d.Types.PrimitiveType) input.ReadEnum(); + break; + } + case 26: + case 29: { + vertexBuffer_.AddEntriesFrom(ref input, _repeated_vertexBuffer_codec); + break; + } + case 34: + case 32: { + indexBuffer_.AddEntriesFrom(ref input, _repeated_indexBuffer_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Mesh3d message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum VertexType { + /// + /// Is defined by 5 coordinates: Position (XYZ) + Texture coordinate (UV). + /// + [pbr::OriginalName("VERTEX_PT")] VertexPt = 0, + } + + public enum PrimitiveType { + /// + /// Is defined by 3 indices: triangle vertex IDs. + /// + [pbr::OriginalName("TRIANGLE")] Triangle = 0, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs.meta new file mode 100644 index 0000000..b9993b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/FaceGeometry/Protos/Mesh3D.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 263876dc23a587949869ee40a64e2988 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark.meta new file mode 100644 index 0000000..c224d7b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70a1861119876fb489670207ec611137 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators.meta new file mode 100644 index 0000000..a573de3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c065a06a9970f95448988ea7599fb8bc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs new file mode 100644 index 0000000..cc26ffe --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs @@ -0,0 +1,1115 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/holistic_landmark/calculators/roi_tracking_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/holistic_landmark/calculators/roi_tracking_calculator.proto + public static partial class RoiTrackingCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/holistic_landmark/calculators/roi_tracking_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RoiTrackingCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ck1tZWRpYXBpcGUvbW9kdWxlcy9ob2xpc3RpY19sYW5kbWFyay9jYWxjdWxh", + "dG9ycy9yb2lfdHJhY2tpbmdfY2FsY3VsYXRvci5wcm90bxIJbWVkaWFwaXBl", + "GiRtZWRpYXBpcGUvZnJhbWV3b3JrL2NhbGN1bGF0b3IucHJvdG8ivgQKHFJv", + "aVRyYWNraW5nQ2FsY3VsYXRvck9wdGlvbnMSUQoQaW91X3JlcXVpcmVtZW50", + "cxgBIAEoCzI3Lm1lZGlhcGlwZS5Sb2lUcmFja2luZ0NhbGN1bGF0b3JPcHRp", + "b25zLklvdVJlcXVpcmVtZW50cxJTChFyZWN0X3JlcXVpcmVtZW50cxgCIAEo", + "CzI4Lm1lZGlhcGlwZS5Sb2lUcmFja2luZ0NhbGN1bGF0b3JPcHRpb25zLlJl", + "Y3RSZXF1aXJlbWVudHMSXQoWbGFuZG1hcmtzX3JlcXVpcmVtZW50cxgDIAEo", + "CzI9Lm1lZGlhcGlwZS5Sb2lUcmFja2luZ0NhbGN1bGF0b3JPcHRpb25zLkxh", + "bmRtYXJrc1JlcXVpcmVtZW50cxonCg9Jb3VSZXF1aXJlbWVudHMSFAoHbWlu", + "X2lvdRgBIAEoAjoDMC41Gl4KEFJlY3RSZXF1aXJlbWVudHMSHAoQcm90YXRp", + "b25fZGVncmVlcxgBIAEoAjoCMTASGAoLdHJhbnNsYXRpb24YAiABKAI6AzAu", + "MRISCgVzY2FsZRgDIAEoAjoDMC4xGjYKFUxhbmRtYXJrc1JlcXVpcmVtZW50", + "cxIdChJyZWNyb3BfcmVjdF9tYXJnaW4YASABKAI6ATAyVgoDZXh0EhwubWVk", + "aWFwaXBlLkNhbGN1bGF0b3JPcHRpb25zGIajrZ0BIAEoCzInLm1lZGlhcGlw", + "ZS5Sb2lUcmFja2luZ0NhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RoiTrackingCalculatorOptions), global::Mediapipe.RoiTrackingCalculatorOptions.Parser, new[]{ "IouRequirements", "RectRequirements", "LandmarksRequirements" }, null, null, new pb::Extension[] { global::Mediapipe.RoiTrackingCalculatorOptions.Extensions.Ext }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements), global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements.Parser, new[]{ "MinIou" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements), global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements.Parser, new[]{ "RotationDegrees", "Translation", "Scale" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements), global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements.Parser, new[]{ "RecropRectMargin" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + public sealed partial class RoiTrackingCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RoiTrackingCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RoiTrackingCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoiTrackingCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoiTrackingCalculatorOptions(RoiTrackingCalculatorOptions other) : this() { + iouRequirements_ = other.iouRequirements_ != null ? other.iouRequirements_.Clone() : null; + rectRequirements_ = other.rectRequirements_ != null ? other.rectRequirements_.Clone() : null; + landmarksRequirements_ = other.landmarksRequirements_ != null ? other.landmarksRequirements_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoiTrackingCalculatorOptions Clone() { + return new RoiTrackingCalculatorOptions(this); + } + + /// Field number for the "iou_requirements" field. + public const int IouRequirementsFieldNumber = 1; + private global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements iouRequirements_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements IouRequirements { + get { return iouRequirements_; } + set { + iouRequirements_ = value; + } + } + + /// Field number for the "rect_requirements" field. + public const int RectRequirementsFieldNumber = 2; + private global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements rectRequirements_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements RectRequirements { + get { return rectRequirements_; } + set { + rectRequirements_ = value; + } + } + + /// Field number for the "landmarks_requirements" field. + public const int LandmarksRequirementsFieldNumber = 3; + private global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements landmarksRequirements_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements LandmarksRequirements { + get { return landmarksRequirements_; } + set { + landmarksRequirements_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RoiTrackingCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RoiTrackingCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(IouRequirements, other.IouRequirements)) return false; + if (!object.Equals(RectRequirements, other.RectRequirements)) return false; + if (!object.Equals(LandmarksRequirements, other.LandmarksRequirements)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (iouRequirements_ != null) hash ^= IouRequirements.GetHashCode(); + if (rectRequirements_ != null) hash ^= RectRequirements.GetHashCode(); + if (landmarksRequirements_ != null) hash ^= LandmarksRequirements.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (iouRequirements_ != null) { + output.WriteRawTag(10); + output.WriteMessage(IouRequirements); + } + if (rectRequirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(RectRequirements); + } + if (landmarksRequirements_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LandmarksRequirements); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (iouRequirements_ != null) { + output.WriteRawTag(10); + output.WriteMessage(IouRequirements); + } + if (rectRequirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(RectRequirements); + } + if (landmarksRequirements_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LandmarksRequirements); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (iouRequirements_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IouRequirements); + } + if (rectRequirements_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RectRequirements); + } + if (landmarksRequirements_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LandmarksRequirements); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RoiTrackingCalculatorOptions other) { + if (other == null) { + return; + } + if (other.iouRequirements_ != null) { + if (iouRequirements_ == null) { + IouRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements(); + } + IouRequirements.MergeFrom(other.IouRequirements); + } + if (other.rectRequirements_ != null) { + if (rectRequirements_ == null) { + RectRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements(); + } + RectRequirements.MergeFrom(other.RectRequirements); + } + if (other.landmarksRequirements_ != null) { + if (landmarksRequirements_ == null) { + LandmarksRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements(); + } + LandmarksRequirements.MergeFrom(other.LandmarksRequirements); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (iouRequirements_ == null) { + IouRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements(); + } + input.ReadMessage(IouRequirements); + break; + } + case 18: { + if (rectRequirements_ == null) { + RectRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements(); + } + input.ReadMessage(RectRequirements); + break; + } + case 26: { + if (landmarksRequirements_ == null) { + LandmarksRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements(); + } + input.ReadMessage(LandmarksRequirements); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (iouRequirements_ == null) { + IouRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.IouRequirements(); + } + input.ReadMessage(IouRequirements); + break; + } + case 18: { + if (rectRequirements_ == null) { + RectRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.RectRequirements(); + } + input.ReadMessage(RectRequirements); + break; + } + case 26: { + if (landmarksRequirements_ == null) { + LandmarksRequirements = new global::Mediapipe.RoiTrackingCalculatorOptions.Types.LandmarksRequirements(); + } + input.ReadMessage(LandmarksRequirements); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RoiTrackingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Verifies that Intersection over Union of previous frame rect and current + /// frame re-crop rect is less than threshold. + /// + public sealed partial class IouRequirements : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IouRequirements()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RoiTrackingCalculatorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IouRequirements() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IouRequirements(IouRequirements other) : this() { + _hasBits0 = other._hasBits0; + minIou_ = other.minIou_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IouRequirements Clone() { + return new IouRequirements(this); + } + + /// Field number for the "min_iou" field. + public const int MinIouFieldNumber = 1; + private readonly static float MinIouDefaultValue = 0.5F; + + private float minIou_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinIou { + get { if ((_hasBits0 & 1) != 0) { return minIou_; } else { return MinIouDefaultValue; } } + set { + _hasBits0 |= 1; + minIou_ = value; + } + } + /// Gets whether the "min_iou" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinIou { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_iou" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinIou() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IouRequirements); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IouRequirements other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinIou, other.MinIou)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinIou) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinIou); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinIou) { + output.WriteRawTag(13); + output.WriteFloat(MinIou); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinIou) { + output.WriteRawTag(13); + output.WriteFloat(MinIou); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinIou) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IouRequirements other) { + if (other == null) { + return; + } + if (other.HasMinIou) { + MinIou = other.MinIou; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinIou = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinIou = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Verifies that current frame re-crop rect rotation/translation/scale didn't + /// change much comparing to the previous frame rect. + /// + public sealed partial class RectRequirements : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RectRequirements()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RoiTrackingCalculatorOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectRequirements() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectRequirements(RectRequirements other) : this() { + _hasBits0 = other._hasBits0; + rotationDegrees_ = other.rotationDegrees_; + translation_ = other.translation_; + scale_ = other.scale_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RectRequirements Clone() { + return new RectRequirements(this); + } + + /// Field number for the "rotation_degrees" field. + public const int RotationDegreesFieldNumber = 1; + private readonly static float RotationDegreesDefaultValue = 10F; + + private float rotationDegrees_; + /// + /// Allowed rotation change defined in degrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RotationDegrees { + get { if ((_hasBits0 & 1) != 0) { return rotationDegrees_; } else { return RotationDegreesDefaultValue; } } + set { + _hasBits0 |= 1; + rotationDegrees_ = value; + } + } + /// Gets whether the "rotation_degrees" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotationDegrees { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "rotation_degrees" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotationDegrees() { + _hasBits0 &= ~1; + } + + /// Field number for the "translation" field. + public const int TranslationFieldNumber = 2; + private readonly static float TranslationDefaultValue = 0.1F; + + private float translation_; + /// + /// Allowed translation change defined as absolute translation normalized by + /// re-crop rectangle size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Translation { + get { if ((_hasBits0 & 2) != 0) { return translation_; } else { return TranslationDefaultValue; } } + set { + _hasBits0 |= 2; + translation_ = value; + } + } + /// Gets whether the "translation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTranslation { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "translation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTranslation() { + _hasBits0 &= ~2; + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 3; + private readonly static float ScaleDefaultValue = 0.1F; + + private float scale_; + /// + /// Allowed scale change defined as absolute translation normalized by + /// re-crop rectangle size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Scale { + get { if ((_hasBits0 & 4) != 0) { return scale_; } else { return ScaleDefaultValue; } } + set { + _hasBits0 |= 4; + scale_ = value; + } + } + /// Gets whether the "scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScale() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RectRequirements); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RectRequirements other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RotationDegrees, other.RotationDegrees)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Translation, other.Translation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Scale, other.Scale)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRotationDegrees) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RotationDegrees); + if (HasTranslation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Translation); + if (HasScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Scale); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRotationDegrees) { + output.WriteRawTag(13); + output.WriteFloat(RotationDegrees); + } + if (HasTranslation) { + output.WriteRawTag(21); + output.WriteFloat(Translation); + } + if (HasScale) { + output.WriteRawTag(29); + output.WriteFloat(Scale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRotationDegrees) { + output.WriteRawTag(13); + output.WriteFloat(RotationDegrees); + } + if (HasTranslation) { + output.WriteRawTag(21); + output.WriteFloat(Translation); + } + if (HasScale) { + output.WriteRawTag(29); + output.WriteFloat(Scale); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRotationDegrees) { + size += 1 + 4; + } + if (HasTranslation) { + size += 1 + 4; + } + if (HasScale) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RectRequirements other) { + if (other == null) { + return; + } + if (other.HasRotationDegrees) { + RotationDegrees = other.RotationDegrees; + } + if (other.HasTranslation) { + Translation = other.Translation; + } + if (other.HasScale) { + Scale = other.Scale; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + RotationDegrees = input.ReadFloat(); + break; + } + case 21: { + Translation = input.ReadFloat(); + break; + } + case 29: { + Scale = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + RotationDegrees = input.ReadFloat(); + break; + } + case 21: { + Translation = input.ReadFloat(); + break; + } + case 29: { + Scale = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Verifies that landmarks from the previous frame are within re-crop + /// rectangle bounds on the current frame. + /// + public sealed partial class LandmarksRequirements : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LandmarksRequirements()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RoiTrackingCalculatorOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksRequirements() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksRequirements(LandmarksRequirements other) : this() { + _hasBits0 = other._hasBits0; + recropRectMargin_ = other.recropRectMargin_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LandmarksRequirements Clone() { + return new LandmarksRequirements(this); + } + + /// Field number for the "recrop_rect_margin" field. + public const int RecropRectMarginFieldNumber = 1; + private readonly static float RecropRectMarginDefaultValue = 0F; + + private float recropRectMargin_; + /// + /// Margin to apply to re-crop rectangle before checking verifing landmarks. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RecropRectMargin { + get { if ((_hasBits0 & 1) != 0) { return recropRectMargin_; } else { return RecropRectMarginDefaultValue; } } + set { + _hasBits0 |= 1; + recropRectMargin_ = value; + } + } + /// Gets whether the "recrop_rect_margin" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRecropRectMargin { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "recrop_rect_margin" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRecropRectMargin() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LandmarksRequirements); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LandmarksRequirements other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RecropRectMargin, other.RecropRectMargin)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRecropRectMargin) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RecropRectMargin); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRecropRectMargin) { + output.WriteRawTag(13); + output.WriteFloat(RecropRectMargin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRecropRectMargin) { + output.WriteRawTag(13); + output.WriteFloat(RecropRectMargin); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRecropRectMargin) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LandmarksRequirements other) { + if (other == null) { + return; + } + if (other.HasRecropRectMargin) { + RecropRectMargin = other.RecropRectMargin; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + RecropRectMargin = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + RecropRectMargin = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + #region Extensions + /// Container for extensions for other messages declared in the RoiTrackingCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(329994630, pb::FieldCodec.ForMessage(2639957042, global::Mediapipe.RoiTrackingCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs.meta new file mode 100644 index 0000000..5fe9983 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/HolisticLandmark/Calculators/RoiTrackingCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 725c12e3d35ecc9349b5d14043fbe9a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron.meta new file mode 100644 index 0000000..e3affca --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca1559f36eb12e849ae14f324c7fbec5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators.meta new file mode 100644 index 0000000..b3ed775 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2f0eac5ef5fa2a24698ac8d2ef43ee70 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs new file mode 100644 index 0000000..379140d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs @@ -0,0 +1,8236 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/a_r_capture_metadata.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/a_r_capture_metadata.proto + public static partial class ARCaptureMetadataReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/a_r_capture_metadata.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ARCaptureMetadataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkJtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvYV9y", + "X2NhcHR1cmVfbWV0YWRhdGEucHJvdG8SCW1lZGlhcGlwZSL0AgoXQVZDYW1l", + "cmFDYWxpYnJhdGlvbkRhdGESHAoQaW50cmluc2ljX21hdHJpeBgBIAMoAkIC", + "EAESMgoqaW50cmluc2ljX21hdHJpeF9yZWZlcmVuY2VfZGltZW5zaW9uX3dp", + "ZHRoGAIgASgCEjMKK2ludHJpbnNpY19tYXRyaXhfcmVmZXJlbmNlX2RpbWVu", + "c2lvbl9oZWlnaHQYAyABKAISHAoQZXh0cmluc2ljX21hdHJpeBgEIAMoAkIC", + "EAESEgoKcGl4ZWxfc2l6ZRgFIAEoAhIpCh1sZW5zX2Rpc3RvcnRpb25fbG9v", + "a3VwX3ZhbHVlcxgGIAMoAkICEAESMQolaW52ZXJzZV9sZW5zX2Rpc3RvcnRp", + "b25fbG9va3VwX3ZhbHVlcxgHIAMoAkICEAESIAoYbGVuc19kaXN0b3J0aW9u", + "X2NlbnRlcl94GAggASgCEiAKGGxlbnNfZGlzdG9ydGlvbl9jZW50ZXJfeRgJ", + "IAEoAiLXBAoLQVZEZXB0aERhdGESFgoOZGVwdGhfZGF0YV9tYXAYASABKAwS", + "FwoPZGVwdGhfZGF0YV90eXBlGAIgASgJEkYKE2RlcHRoX2RhdGFfYWNjdXJh", + "Y3kYAyABKA4yHy5tZWRpYXBpcGUuQVZEZXB0aERhdGEuQWNjdXJhY3k6CFJF", + "TEFUSVZFEhsKE2RlcHRoX2RhdGFfZmlsdGVyZWQYBCABKAgSOgoSZGVwdGhf", + "ZGF0YV9xdWFsaXR5GAUgASgOMh4ubWVkaWFwaXBlLkFWRGVwdGhEYXRhLlF1", + "YWxpdHkSQwoXY2FtZXJhX2NhbGlicmF0aW9uX2RhdGEYBiABKAsyIi5tZWRp", + "YXBpcGUuQVZDYW1lcmFDYWxpYnJhdGlvbkRhdGESLQolZGVwdGhfZGF0YV9t", + "YXBfb3JpZ2luYWxfbWluaW11bV92YWx1ZRgHIAEoAhItCiVkZXB0aF9kYXRh", + "X21hcF9vcmlnaW5hbF9tYXhpbXVtX3ZhbHVlGAggASgCEhwKFGRlcHRoX2Rh", + "dGFfbWFwX3dpZHRoGAkgASgFEh0KFWRlcHRoX2RhdGFfbWFwX2hlaWdodBgK", + "IAEoBRIhChlkZXB0aF9kYXRhX21hcF9yYXdfdmFsdWVzGAsgASgMIj4KCEFj", + "Y3VyYWN5EhYKElVOREVGSU5FRF9BQ0NVUkFDWRAAEgwKCFJFTEFUSVZFEAES", + "DAoIQUJTT0xVVEUQAiIzCgdRdWFsaXR5EhUKEVVOREVGSU5FRF9RVUFMSVRZ", + "EAASCAoESElHSBABEgcKA0xPVxACIp8CCg9BUkxpZ2h0RXN0aW1hdGUSGQoR", + "YW1iaWVudF9pbnRlbnNpdHkYASABKAESIQoZYW1iaWVudF9jb2xvcl90ZW1w", + "ZXJhdHVyZRgCIAEoARIsCiBzcGhlcmljYWxfaGFybW9uaWNzX2NvZWZmaWNp", + "ZW50cxgDIAMoAkICEAESSwoXcHJpbWFyeV9saWdodF9kaXJlY3Rpb24YBCAB", + "KAsyKi5tZWRpYXBpcGUuQVJMaWdodEVzdGltYXRlLkRpcmVjdGlvblZlY3Rv", + "chIfChdwcmltYXJ5X2xpZ2h0X2ludGVuc2l0eRgFIAEoAhoyCg9EaXJlY3Rp", + "b25WZWN0b3ISCQoBeBgBIAEoAhIJCgF5GAIgASgCEgkKAXoYAyABKAIirQUK", + "CEFSQ2FtZXJhEkYKDnRyYWNraW5nX3N0YXRlGAEgASgOMiEubWVkaWFwaXBl", + "LkFSQ2FtZXJhLlRyYWNraW5nU3RhdGU6C1VOQVZBSUxBQkxFEkwKFXRyYWNr", + "aW5nX3N0YXRlX3JlYXNvbhgCIAEoDjInLm1lZGlhcGlwZS5BUkNhbWVyYS5U", + "cmFja2luZ1N0YXRlUmVhc29uOgROT05FEhUKCXRyYW5zZm9ybRgDIAMoAkIC", + "EAESNQoMZXVsZXJfYW5nbGVzGAQgASgLMh8ubWVkaWFwaXBlLkFSQ2FtZXJh", + "LkV1bGVyQW5nbGVzEh4KFmltYWdlX3Jlc29sdXRpb25fd2lkdGgYBSABKAUS", + "HwoXaW1hZ2VfcmVzb2x1dGlvbl9oZWlnaHQYBiABKAUSFgoKaW50cmluc2lj", + "cxgHIAMoAkICEAESHQoRcHJvamVjdGlvbl9tYXRyaXgYCCADKAJCAhABEhcK", + "C3ZpZXdfbWF0cml4GAkgAygCQgIQARo3CgtFdWxlckFuZ2xlcxIMCgRyb2xs", + "GAEgASgCEg0KBXBpdGNoGAIgASgCEgsKA3lhdxgDIAEoAiJXCg1UcmFja2lu", + "Z1N0YXRlEhwKGFVOREVGSU5FRF9UUkFDS0lOR19TVEFURRAAEg8KC1VOQVZB", + "SUxBQkxFEAESCwoHTElNSVRFRBACEgoKBk5PUk1BTBADIpkBChNUcmFja2lu", + "Z1N0YXRlUmVhc29uEiMKH1VOREVGSU5FRF9UUkFDS0lOR19TVEFURV9SRUFT", + "T04QABIICgROT05FEAESEAoMSU5JVElBTElaSU5HEAISFAoQRVhDRVNTSVZF", + "X01PVElPThADEhkKFUlOU1VGRklDSUVOVF9GRUFUVVJFUxAEEhAKDFJFTE9D", + "QUxJWklORxAFItICCg5BUkZhY2VHZW9tZXRyeRIyCgh2ZXJ0aWNlcxgBIAMo", + "CzIgLm1lZGlhcGlwZS5BUkZhY2VHZW9tZXRyeS5WZXJ0ZXgSFAoMdmVydGV4", + "X2NvdW50GAIgASgFEkgKE3RleHR1cmVfY29vcmRpbmF0ZXMYAyADKAsyKy5t", + "ZWRpYXBpcGUuQVJGYWNlR2VvbWV0cnkuVGV4dHVyZUNvb3JkaW5hdGUSIAoY", + "dGV4dHVyZV9jb29yZGluYXRlX2NvdW50GAQgASgFEhwKEHRyaWFuZ2xlX2lu", + "ZGljZXMYBSADKAVCAhABEhYKDnRyaWFuZ2xlX2NvdW50GAYgASgFGikKBlZl", + "cnRleBIJCgF4GAEgASgCEgkKAXkYAiABKAISCQoBehgDIAEoAhopChFUZXh0", + "dXJlQ29vcmRpbmF0ZRIJCgF1GAEgASgCEgkKAXYYAiABKAIikgEKD0FSQmxl", + "bmRTaGFwZU1hcBI0CgdlbnRyaWVzGAEgAygLMiMubWVkaWFwaXBlLkFSQmxl", + "bmRTaGFwZU1hcC5NYXBFbnRyeRpJCghNYXBFbnRyeRIcChRibGVuZF9zaGFw", + "ZV9sb2NhdGlvbhgBIAEoCRIfChdibGVuZF9zaGFwZV9jb2VmZmljaWVudBgC", + "IAEoAiKUAQoMQVJGYWNlQW5jaG9yEisKCGdlb21ldHJ5GAEgASgLMhkubWVk", + "aWFwaXBlLkFSRmFjZUdlb21ldHJ5EjAKDGJsZW5kX3NoYXBlcxgCIAEoCzIa", + "Lm1lZGlhcGlwZS5BUkJsZW5kU2hhcGVNYXASEQoJdHJhbnNmb3JtGAMgAygC", + "EhIKCmlzX3RyYWNrZWQYBCABKAgisgMKD0FSUGxhbmVHZW9tZXRyeRIzCgh2", + "ZXJ0aWNlcxgBIAMoCzIhLm1lZGlhcGlwZS5BUlBsYW5lR2VvbWV0cnkuVmVy", + "dGV4EhQKDHZlcnRleF9jb3VudBgCIAEoBRJJChN0ZXh0dXJlX2Nvb3JkaW5h", + "dGVzGAMgAygLMiwubWVkaWFwaXBlLkFSUGxhbmVHZW9tZXRyeS5UZXh0dXJl", + "Q29vcmRpbmF0ZRIgChh0ZXh0dXJlX2Nvb3JkaW5hdGVfY291bnQYBCABKAUS", + "HAoQdHJpYW5nbGVfaW5kaWNlcxgFIAMoBUICEAESFgoOdHJpYW5nbGVfY291", + "bnQYBiABKAUSPAoRYm91bmRhcnlfdmVydGljZXMYByADKAsyIS5tZWRpYXBp", + "cGUuQVJQbGFuZUdlb21ldHJ5LlZlcnRleBIdChVib3VuZGFyeV92ZXJ0ZXhf", + "Y291bnQYCCABKAUaKQoGVmVydGV4EgkKAXgYASABKAISCQoBeRgCIAEoAhIJ", + "CgF6GAMgASgCGikKEVRleHR1cmVDb29yZGluYXRlEgkKAXUYASABKAISCQoB", + "dhgCIAEoAiLcBQoNQVJQbGFuZUFuY2hvchISCgppZGVudGlmaWVyGAEgASgJ", + "EhEKCXRyYW5zZm9ybRgCIAMoAhI1CglhbGlnbm1lbnQYAyABKA4yIi5tZWRp", + "YXBpcGUuQVJQbGFuZUFuY2hvci5BbGlnbm1lbnQSLAoIZ2VvbWV0cnkYBCAB", + "KAsyGi5tZWRpYXBpcGUuQVJQbGFuZUdlb21ldHJ5EjQKBmNlbnRlchgFIAEo", + "CzIkLm1lZGlhcGlwZS5BUlBsYW5lQW5jaG9yLlBsYW5lVmVjdG9yEjQKBmV4", + "dGVudBgGIAEoCzIkLm1lZGlhcGlwZS5BUlBsYW5lQW5jaG9yLlBsYW5lVmVj", + "dG9yEiAKGGNsYXNzaWZpY2F0aW9uX3N1cHBvcnRlZBgHIAEoCBJECg5jbGFz", + "c2lmaWNhdGlvbhgIIAEoDjIsLm1lZGlhcGlwZS5BUlBsYW5lQW5jaG9yLlBs", + "YW5lQ2xhc3NpZmljYXRpb24SUQoVY2xhc3NpZmljYXRpb25fc3RhdHVzGAkg", + "ASgOMjIubWVkaWFwaXBlLkFSUGxhbmVBbmNob3IuUGxhbmVDbGFzc2lmaWNh", + "dGlvblN0YXR1cxouCgtQbGFuZVZlY3RvchIJCgF4GAEgASgCEgkKAXkYAiAB", + "KAISCQoBehgDIAEoAiI4CglBbGlnbm1lbnQSDQoJVU5ERUZJTkVEEAASDgoK", + "SE9SSVpPTlRBTBABEgwKCFZFUlRJQ0FMEAIiVgoTUGxhbmVDbGFzc2lmaWNh", + "dGlvbhIICgROT05FEAASCAoEV0FMTBABEgkKBUZMT09SEAISCwoHQ0VJTElO", + "RxADEgkKBVRBQkxFEAQSCAoEU0VBVBAFIlYKGVBsYW5lQ2xhc3NpZmljYXRp", + "b25TdGF0dXMSCwoHVU5LTk9XThAAEg8KC1VOQVZBSUxBQkxFEAESEAoMVU5E", + "RVRFUk1JTkVEEAISCQoFS05PV04QAyKNAQoMQVJQb2ludENsb3VkEg0KBWNv", + "dW50GAEgASgFEiwKBXBvaW50GAIgAygLMh0ubWVkaWFwaXBlLkFSUG9pbnRD", + "bG91ZC5Qb2ludBIWCgppZGVudGlmaWVyGAMgAygDQgIQARooCgVQb2ludBIJ", + "CgF4GAEgASgCEgkKAXkYAiABKAISCQoBehgDIAEoAiLSAgoHQVJGcmFtZRIR", + "Cgl0aW1lc3RhbXAYASABKAESKgoKZGVwdGhfZGF0YRgCIAEoCzIWLm1lZGlh", + "cGlwZS5BVkRlcHRoRGF0YRIcChRkZXB0aF9kYXRhX3RpbWVzdGFtcBgDIAEo", + "ARIjCgZjYW1lcmEYBCABKAsyEy5tZWRpYXBpcGUuQVJDYW1lcmESMgoObGln", + "aHRfZXN0aW1hdGUYBSABKAsyGi5tZWRpYXBpcGUuQVJMaWdodEVzdGltYXRl", + "EiwKC2ZhY2VfYW5jaG9yGAYgASgLMhcubWVkaWFwaXBlLkFSRmFjZUFuY2hv", + "chIuCgxwbGFuZV9hbmNob3IYByADKAsyGC5tZWRpYXBpcGUuQVJQbGFuZUFu", + "Y2hvchIzChJyYXdfZmVhdHVyZV9wb2ludHMYCCABKAsyFy5tZWRpYXBpcGUu", + "QVJQb2ludENsb3Vk")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AVCameraCalibrationData), global::Mediapipe.AVCameraCalibrationData.Parser, new[]{ "IntrinsicMatrix", "IntrinsicMatrixReferenceDimensionWidth", "IntrinsicMatrixReferenceDimensionHeight", "ExtrinsicMatrix", "PixelSize", "LensDistortionLookupValues", "InverseLensDistortionLookupValues", "LensDistortionCenterX", "LensDistortionCenterY" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AVDepthData), global::Mediapipe.AVDepthData.Parser, new[]{ "DepthDataMap", "DepthDataType", "DepthDataAccuracy", "DepthDataFiltered", "DepthDataQuality", "CameraCalibrationData", "DepthDataMapOriginalMinimumValue", "DepthDataMapOriginalMaximumValue", "DepthDataMapWidth", "DepthDataMapHeight", "DepthDataMapRawValues" }, null, new[]{ typeof(global::Mediapipe.AVDepthData.Types.Accuracy), typeof(global::Mediapipe.AVDepthData.Types.Quality) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARLightEstimate), global::Mediapipe.ARLightEstimate.Parser, new[]{ "AmbientIntensity", "AmbientColorTemperature", "SphericalHarmonicsCoefficients", "PrimaryLightDirection", "PrimaryLightIntensity" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARLightEstimate.Types.DirectionVector), global::Mediapipe.ARLightEstimate.Types.DirectionVector.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARCamera), global::Mediapipe.ARCamera.Parser, new[]{ "TrackingState", "TrackingStateReason", "Transform", "EulerAngles", "ImageResolutionWidth", "ImageResolutionHeight", "Intrinsics", "ProjectionMatrix", "ViewMatrix" }, null, new[]{ typeof(global::Mediapipe.ARCamera.Types.TrackingState), typeof(global::Mediapipe.ARCamera.Types.TrackingStateReason) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARCamera.Types.EulerAngles), global::Mediapipe.ARCamera.Types.EulerAngles.Parser, new[]{ "Roll", "Pitch", "Yaw" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARFaceGeometry), global::Mediapipe.ARFaceGeometry.Parser, new[]{ "Vertices", "VertexCount", "TextureCoordinates", "TextureCoordinateCount", "TriangleIndices", "TriangleCount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARFaceGeometry.Types.Vertex), global::Mediapipe.ARFaceGeometry.Types.Vertex.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARFaceGeometry.Types.TextureCoordinate), global::Mediapipe.ARFaceGeometry.Types.TextureCoordinate.Parser, new[]{ "U", "V" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARBlendShapeMap), global::Mediapipe.ARBlendShapeMap.Parser, new[]{ "Entries" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARBlendShapeMap.Types.MapEntry), global::Mediapipe.ARBlendShapeMap.Types.MapEntry.Parser, new[]{ "BlendShapeLocation", "BlendShapeCoefficient" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARFaceAnchor), global::Mediapipe.ARFaceAnchor.Parser, new[]{ "Geometry", "BlendShapes", "Transform", "IsTracked" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPlaneGeometry), global::Mediapipe.ARPlaneGeometry.Parser, new[]{ "Vertices", "VertexCount", "TextureCoordinates", "TextureCoordinateCount", "TriangleIndices", "TriangleCount", "BoundaryVertices", "BoundaryVertexCount" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPlaneGeometry.Types.Vertex), global::Mediapipe.ARPlaneGeometry.Types.Vertex.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPlaneGeometry.Types.TextureCoordinate), global::Mediapipe.ARPlaneGeometry.Types.TextureCoordinate.Parser, new[]{ "U", "V" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPlaneAnchor), global::Mediapipe.ARPlaneAnchor.Parser, new[]{ "Identifier", "Transform", "Alignment", "Geometry", "Center", "Extent", "ClassificationSupported", "Classification", "ClassificationStatus" }, null, new[]{ typeof(global::Mediapipe.ARPlaneAnchor.Types.Alignment), typeof(global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification), typeof(global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPlaneAnchor.Types.PlaneVector), global::Mediapipe.ARPlaneAnchor.Types.PlaneVector.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPointCloud), global::Mediapipe.ARPointCloud.Parser, new[]{ "Count", "Point", "Identifier" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARPointCloud.Types.Point), global::Mediapipe.ARPointCloud.Types.Point.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ARFrame), global::Mediapipe.ARFrame.Parser, new[]{ "Timestamp", "DepthData", "DepthDataTimestamp", "Camera", "LightEstimate", "FaceAnchor", "PlaneAnchor", "RawFeaturePoints" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Info about the camera characteristics used to capture images and depth data. + /// See developer.apple.com/documentation/avfoundation/avcameracalibrationdata + /// for more information. + /// + public sealed partial class AVCameraCalibrationData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AVCameraCalibrationData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVCameraCalibrationData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVCameraCalibrationData(AVCameraCalibrationData other) : this() { + _hasBits0 = other._hasBits0; + intrinsicMatrix_ = other.intrinsicMatrix_.Clone(); + intrinsicMatrixReferenceDimensionWidth_ = other.intrinsicMatrixReferenceDimensionWidth_; + intrinsicMatrixReferenceDimensionHeight_ = other.intrinsicMatrixReferenceDimensionHeight_; + extrinsicMatrix_ = other.extrinsicMatrix_.Clone(); + pixelSize_ = other.pixelSize_; + lensDistortionLookupValues_ = other.lensDistortionLookupValues_.Clone(); + inverseLensDistortionLookupValues_ = other.inverseLensDistortionLookupValues_.Clone(); + lensDistortionCenterX_ = other.lensDistortionCenterX_; + lensDistortionCenterY_ = other.lensDistortionCenterY_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVCameraCalibrationData Clone() { + return new AVCameraCalibrationData(this); + } + + /// Field number for the "intrinsic_matrix" field. + public const int IntrinsicMatrixFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_intrinsicMatrix_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField intrinsicMatrix_ = new pbc::RepeatedField(); + /// + /// 3x3 row-major matrix relating a camera's internal properties to an ideal + /// pinhole-camera model. + /// See + /// developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881135-intrinsicmatrix + /// for detailed usage information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField IntrinsicMatrix { + get { return intrinsicMatrix_; } + } + + /// Field number for the "intrinsic_matrix_reference_dimension_width" field. + public const int IntrinsicMatrixReferenceDimensionWidthFieldNumber = 2; + private readonly static float IntrinsicMatrixReferenceDimensionWidthDefaultValue = 0F; + + private float intrinsicMatrixReferenceDimensionWidth_; + /// + /// The image dimensions to which the intrinsic_matrix values are relative. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IntrinsicMatrixReferenceDimensionWidth { + get { if ((_hasBits0 & 1) != 0) { return intrinsicMatrixReferenceDimensionWidth_; } else { return IntrinsicMatrixReferenceDimensionWidthDefaultValue; } } + set { + _hasBits0 |= 1; + intrinsicMatrixReferenceDimensionWidth_ = value; + } + } + /// Gets whether the "intrinsic_matrix_reference_dimension_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntrinsicMatrixReferenceDimensionWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "intrinsic_matrix_reference_dimension_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntrinsicMatrixReferenceDimensionWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "intrinsic_matrix_reference_dimension_height" field. + public const int IntrinsicMatrixReferenceDimensionHeightFieldNumber = 3; + private readonly static float IntrinsicMatrixReferenceDimensionHeightDefaultValue = 0F; + + private float intrinsicMatrixReferenceDimensionHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IntrinsicMatrixReferenceDimensionHeight { + get { if ((_hasBits0 & 2) != 0) { return intrinsicMatrixReferenceDimensionHeight_; } else { return IntrinsicMatrixReferenceDimensionHeightDefaultValue; } } + set { + _hasBits0 |= 2; + intrinsicMatrixReferenceDimensionHeight_ = value; + } + } + /// Gets whether the "intrinsic_matrix_reference_dimension_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntrinsicMatrixReferenceDimensionHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "intrinsic_matrix_reference_dimension_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntrinsicMatrixReferenceDimensionHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "extrinsic_matrix" field. + public const int ExtrinsicMatrixFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_extrinsicMatrix_codec + = pb::FieldCodec.ForFloat(34); + private readonly pbc::RepeatedField extrinsicMatrix_ = new pbc::RepeatedField(); + /// + /// 3x4 row-major matrix relating a camera's position and orientation to a + /// world or scene coordinate system. Consists of a unitless 3x3 rotation + /// matrix (R) on the left and a translation (t) 3x1 vector on the right. The + /// translation vector's units are millimeters. For example: + /// + /// |r1,1 r2,1 r3,1 | t1| + /// [R | t] = |r1,2 r2,2 r3,2 | t2| + /// |r1,3 r2,3 r3,3 | t3| + /// + /// is stored as [r11, r21, r31, t1, r12, r22, r32, t2, ...] + /// + /// See + /// developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881130-extrinsicmatrix?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ExtrinsicMatrix { + get { return extrinsicMatrix_; } + } + + /// Field number for the "pixel_size" field. + public const int PixelSizeFieldNumber = 5; + private readonly static float PixelSizeDefaultValue = 0F; + + private float pixelSize_; + /// + /// The size, in millimeters, of one image pixel. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PixelSize { + get { if ((_hasBits0 & 4) != 0) { return pixelSize_; } else { return PixelSizeDefaultValue; } } + set { + _hasBits0 |= 4; + pixelSize_ = value; + } + } + /// Gets whether the "pixel_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPixelSize { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "pixel_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPixelSize() { + _hasBits0 &= ~4; + } + + /// Field number for the "lens_distortion_lookup_values" field. + public const int LensDistortionLookupValuesFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_lensDistortionLookupValues_codec + = pb::FieldCodec.ForFloat(50); + private readonly pbc::RepeatedField lensDistortionLookupValues_ = new pbc::RepeatedField(); + /// + /// A list of floating-point values describing radial distortions imparted by + /// the camera lens, for use in rectifying camera images. + /// See + /// developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881129-lensdistortionlookuptable?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LensDistortionLookupValues { + get { return lensDistortionLookupValues_; } + } + + /// Field number for the "inverse_lens_distortion_lookup_values" field. + public const int InverseLensDistortionLookupValuesFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_inverseLensDistortionLookupValues_codec + = pb::FieldCodec.ForFloat(58); + private readonly pbc::RepeatedField inverseLensDistortionLookupValues_ = new pbc::RepeatedField(); + /// + /// A list of floating-point values describing radial distortions for use in + /// reapplying camera geometry to a rectified image. + /// See + /// developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881132-inverselensdistortionlookuptable?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InverseLensDistortionLookupValues { + get { return inverseLensDistortionLookupValues_; } + } + + /// Field number for the "lens_distortion_center_x" field. + public const int LensDistortionCenterXFieldNumber = 8; + private readonly static float LensDistortionCenterXDefaultValue = 0F; + + private float lensDistortionCenterX_; + /// + /// The offset of the distortion center of the camera lens from the top-left + /// corner of the image. + /// See + /// developer.apple.com/documentation/avfoundation/avcameracalibrationdata/2881131-lensdistortioncenter?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LensDistortionCenterX { + get { if ((_hasBits0 & 8) != 0) { return lensDistortionCenterX_; } else { return LensDistortionCenterXDefaultValue; } } + set { + _hasBits0 |= 8; + lensDistortionCenterX_ = value; + } + } + /// Gets whether the "lens_distortion_center_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLensDistortionCenterX { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "lens_distortion_center_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLensDistortionCenterX() { + _hasBits0 &= ~8; + } + + /// Field number for the "lens_distortion_center_y" field. + public const int LensDistortionCenterYFieldNumber = 9; + private readonly static float LensDistortionCenterYDefaultValue = 0F; + + private float lensDistortionCenterY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LensDistortionCenterY { + get { if ((_hasBits0 & 16) != 0) { return lensDistortionCenterY_; } else { return LensDistortionCenterYDefaultValue; } } + set { + _hasBits0 |= 16; + lensDistortionCenterY_ = value; + } + } + /// Gets whether the "lens_distortion_center_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLensDistortionCenterY { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "lens_distortion_center_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLensDistortionCenterY() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AVCameraCalibrationData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AVCameraCalibrationData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!intrinsicMatrix_.Equals(other.intrinsicMatrix_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IntrinsicMatrixReferenceDimensionWidth, other.IntrinsicMatrixReferenceDimensionWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IntrinsicMatrixReferenceDimensionHeight, other.IntrinsicMatrixReferenceDimensionHeight)) return false; + if(!extrinsicMatrix_.Equals(other.extrinsicMatrix_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PixelSize, other.PixelSize)) return false; + if(!lensDistortionLookupValues_.Equals(other.lensDistortionLookupValues_)) return false; + if(!inverseLensDistortionLookupValues_.Equals(other.inverseLensDistortionLookupValues_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LensDistortionCenterX, other.LensDistortionCenterX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LensDistortionCenterY, other.LensDistortionCenterY)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= intrinsicMatrix_.GetHashCode(); + if (HasIntrinsicMatrixReferenceDimensionWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IntrinsicMatrixReferenceDimensionWidth); + if (HasIntrinsicMatrixReferenceDimensionHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IntrinsicMatrixReferenceDimensionHeight); + hash ^= extrinsicMatrix_.GetHashCode(); + if (HasPixelSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PixelSize); + hash ^= lensDistortionLookupValues_.GetHashCode(); + hash ^= inverseLensDistortionLookupValues_.GetHashCode(); + if (HasLensDistortionCenterX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LensDistortionCenterX); + if (HasLensDistortionCenterY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LensDistortionCenterY); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + intrinsicMatrix_.WriteTo(output, _repeated_intrinsicMatrix_codec); + if (HasIntrinsicMatrixReferenceDimensionWidth) { + output.WriteRawTag(21); + output.WriteFloat(IntrinsicMatrixReferenceDimensionWidth); + } + if (HasIntrinsicMatrixReferenceDimensionHeight) { + output.WriteRawTag(29); + output.WriteFloat(IntrinsicMatrixReferenceDimensionHeight); + } + extrinsicMatrix_.WriteTo(output, _repeated_extrinsicMatrix_codec); + if (HasPixelSize) { + output.WriteRawTag(45); + output.WriteFloat(PixelSize); + } + lensDistortionLookupValues_.WriteTo(output, _repeated_lensDistortionLookupValues_codec); + inverseLensDistortionLookupValues_.WriteTo(output, _repeated_inverseLensDistortionLookupValues_codec); + if (HasLensDistortionCenterX) { + output.WriteRawTag(69); + output.WriteFloat(LensDistortionCenterX); + } + if (HasLensDistortionCenterY) { + output.WriteRawTag(77); + output.WriteFloat(LensDistortionCenterY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + intrinsicMatrix_.WriteTo(ref output, _repeated_intrinsicMatrix_codec); + if (HasIntrinsicMatrixReferenceDimensionWidth) { + output.WriteRawTag(21); + output.WriteFloat(IntrinsicMatrixReferenceDimensionWidth); + } + if (HasIntrinsicMatrixReferenceDimensionHeight) { + output.WriteRawTag(29); + output.WriteFloat(IntrinsicMatrixReferenceDimensionHeight); + } + extrinsicMatrix_.WriteTo(ref output, _repeated_extrinsicMatrix_codec); + if (HasPixelSize) { + output.WriteRawTag(45); + output.WriteFloat(PixelSize); + } + lensDistortionLookupValues_.WriteTo(ref output, _repeated_lensDistortionLookupValues_codec); + inverseLensDistortionLookupValues_.WriteTo(ref output, _repeated_inverseLensDistortionLookupValues_codec); + if (HasLensDistortionCenterX) { + output.WriteRawTag(69); + output.WriteFloat(LensDistortionCenterX); + } + if (HasLensDistortionCenterY) { + output.WriteRawTag(77); + output.WriteFloat(LensDistortionCenterY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += intrinsicMatrix_.CalculateSize(_repeated_intrinsicMatrix_codec); + if (HasIntrinsicMatrixReferenceDimensionWidth) { + size += 1 + 4; + } + if (HasIntrinsicMatrixReferenceDimensionHeight) { + size += 1 + 4; + } + size += extrinsicMatrix_.CalculateSize(_repeated_extrinsicMatrix_codec); + if (HasPixelSize) { + size += 1 + 4; + } + size += lensDistortionLookupValues_.CalculateSize(_repeated_lensDistortionLookupValues_codec); + size += inverseLensDistortionLookupValues_.CalculateSize(_repeated_inverseLensDistortionLookupValues_codec); + if (HasLensDistortionCenterX) { + size += 1 + 4; + } + if (HasLensDistortionCenterY) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AVCameraCalibrationData other) { + if (other == null) { + return; + } + intrinsicMatrix_.Add(other.intrinsicMatrix_); + if (other.HasIntrinsicMatrixReferenceDimensionWidth) { + IntrinsicMatrixReferenceDimensionWidth = other.IntrinsicMatrixReferenceDimensionWidth; + } + if (other.HasIntrinsicMatrixReferenceDimensionHeight) { + IntrinsicMatrixReferenceDimensionHeight = other.IntrinsicMatrixReferenceDimensionHeight; + } + extrinsicMatrix_.Add(other.extrinsicMatrix_); + if (other.HasPixelSize) { + PixelSize = other.PixelSize; + } + lensDistortionLookupValues_.Add(other.lensDistortionLookupValues_); + inverseLensDistortionLookupValues_.Add(other.inverseLensDistortionLookupValues_); + if (other.HasLensDistortionCenterX) { + LensDistortionCenterX = other.LensDistortionCenterX; + } + if (other.HasLensDistortionCenterY) { + LensDistortionCenterY = other.LensDistortionCenterY; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + intrinsicMatrix_.AddEntriesFrom(input, _repeated_intrinsicMatrix_codec); + break; + } + case 21: { + IntrinsicMatrixReferenceDimensionWidth = input.ReadFloat(); + break; + } + case 29: { + IntrinsicMatrixReferenceDimensionHeight = input.ReadFloat(); + break; + } + case 34: + case 37: { + extrinsicMatrix_.AddEntriesFrom(input, _repeated_extrinsicMatrix_codec); + break; + } + case 45: { + PixelSize = input.ReadFloat(); + break; + } + case 50: + case 53: { + lensDistortionLookupValues_.AddEntriesFrom(input, _repeated_lensDistortionLookupValues_codec); + break; + } + case 58: + case 61: { + inverseLensDistortionLookupValues_.AddEntriesFrom(input, _repeated_inverseLensDistortionLookupValues_codec); + break; + } + case 69: { + LensDistortionCenterX = input.ReadFloat(); + break; + } + case 77: { + LensDistortionCenterY = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + intrinsicMatrix_.AddEntriesFrom(ref input, _repeated_intrinsicMatrix_codec); + break; + } + case 21: { + IntrinsicMatrixReferenceDimensionWidth = input.ReadFloat(); + break; + } + case 29: { + IntrinsicMatrixReferenceDimensionHeight = input.ReadFloat(); + break; + } + case 34: + case 37: { + extrinsicMatrix_.AddEntriesFrom(ref input, _repeated_extrinsicMatrix_codec); + break; + } + case 45: { + PixelSize = input.ReadFloat(); + break; + } + case 50: + case 53: { + lensDistortionLookupValues_.AddEntriesFrom(ref input, _repeated_lensDistortionLookupValues_codec); + break; + } + case 58: + case 61: { + inverseLensDistortionLookupValues_.AddEntriesFrom(ref input, _repeated_inverseLensDistortionLookupValues_codec); + break; + } + case 69: { + LensDistortionCenterX = input.ReadFloat(); + break; + } + case 77: { + LensDistortionCenterY = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Container for depth data information. + /// See developer.apple.com/documentation/avfoundation/avdepthdata for more info. + /// + public sealed partial class AVDepthData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AVDepthData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVDepthData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVDepthData(AVDepthData other) : this() { + _hasBits0 = other._hasBits0; + depthDataMap_ = other.depthDataMap_; + depthDataType_ = other.depthDataType_; + depthDataAccuracy_ = other.depthDataAccuracy_; + depthDataFiltered_ = other.depthDataFiltered_; + depthDataQuality_ = other.depthDataQuality_; + cameraCalibrationData_ = other.cameraCalibrationData_ != null ? other.cameraCalibrationData_.Clone() : null; + depthDataMapOriginalMinimumValue_ = other.depthDataMapOriginalMinimumValue_; + depthDataMapOriginalMaximumValue_ = other.depthDataMapOriginalMaximumValue_; + depthDataMapWidth_ = other.depthDataMapWidth_; + depthDataMapHeight_ = other.depthDataMapHeight_; + depthDataMapRawValues_ = other.depthDataMapRawValues_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AVDepthData Clone() { + return new AVDepthData(this); + } + + /// Field number for the "depth_data_map" field. + public const int DepthDataMapFieldNumber = 1; + private readonly static pb::ByteString DepthDataMapDefaultValue = pb::ByteString.Empty; + + private pb::ByteString depthDataMap_; + /// + /// PNG representation of the grayscale depth data map. See discussion about + /// depth_data_map_original_minimum_value, below, for information about how + /// to interpret the pixel values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString DepthDataMap { + get { return depthDataMap_ ?? DepthDataMapDefaultValue; } + set { + depthDataMap_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "depth_data_map" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMap { + get { return depthDataMap_ != null; } + } + /// Clears the value of the "depth_data_map" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMap() { + depthDataMap_ = null; + } + + /// Field number for the "depth_data_type" field. + public const int DepthDataTypeFieldNumber = 2; + private readonly static string DepthDataTypeDefaultValue = ""; + + private string depthDataType_; + /// + /// Pixel format type of the original captured depth data. + /// See + /// developer.apple.com/documentation/corevideo/1563591-pixel_format_identifiers?language=objc + /// for the complete list of possible pixel format types. This value represents + /// a string for the associated OSType/FourCharCode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DepthDataType { + get { return depthDataType_ ?? DepthDataTypeDefaultValue; } + set { + depthDataType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "depth_data_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataType { + get { return depthDataType_ != null; } + } + /// Clears the value of the "depth_data_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataType() { + depthDataType_ = null; + } + + /// Field number for the "depth_data_accuracy" field. + public const int DepthDataAccuracyFieldNumber = 3; + private readonly static global::Mediapipe.AVDepthData.Types.Accuracy DepthDataAccuracyDefaultValue = global::Mediapipe.AVDepthData.Types.Accuracy.Relative; + + private global::Mediapipe.AVDepthData.Types.Accuracy depthDataAccuracy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AVDepthData.Types.Accuracy DepthDataAccuracy { + get { if ((_hasBits0 & 1) != 0) { return depthDataAccuracy_; } else { return DepthDataAccuracyDefaultValue; } } + set { + _hasBits0 |= 1; + depthDataAccuracy_ = value; + } + } + /// Gets whether the "depth_data_accuracy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataAccuracy { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "depth_data_accuracy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataAccuracy() { + _hasBits0 &= ~1; + } + + /// Field number for the "depth_data_filtered" field. + public const int DepthDataFilteredFieldNumber = 4; + private readonly static bool DepthDataFilteredDefaultValue = false; + + private bool depthDataFiltered_; + /// + /// Indicates whether the depth_data_map contains temporally smoothed data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DepthDataFiltered { + get { if ((_hasBits0 & 2) != 0) { return depthDataFiltered_; } else { return DepthDataFilteredDefaultValue; } } + set { + _hasBits0 |= 2; + depthDataFiltered_ = value; + } + } + /// Gets whether the "depth_data_filtered" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataFiltered { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "depth_data_filtered" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataFiltered() { + _hasBits0 &= ~2; + } + + /// Field number for the "depth_data_quality" field. + public const int DepthDataQualityFieldNumber = 5; + private readonly static global::Mediapipe.AVDepthData.Types.Quality DepthDataQualityDefaultValue = global::Mediapipe.AVDepthData.Types.Quality.UndefinedQuality; + + private global::Mediapipe.AVDepthData.Types.Quality depthDataQuality_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AVDepthData.Types.Quality DepthDataQuality { + get { if ((_hasBits0 & 4) != 0) { return depthDataQuality_; } else { return DepthDataQualityDefaultValue; } } + set { + _hasBits0 |= 4; + depthDataQuality_ = value; + } + } + /// Gets whether the "depth_data_quality" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataQuality { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "depth_data_quality" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataQuality() { + _hasBits0 &= ~4; + } + + /// Field number for the "camera_calibration_data" field. + public const int CameraCalibrationDataFieldNumber = 6; + private global::Mediapipe.AVCameraCalibrationData cameraCalibrationData_; + /// + /// Associated calibration data for the depth_data_map. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AVCameraCalibrationData CameraCalibrationData { + get { return cameraCalibrationData_; } + set { + cameraCalibrationData_ = value; + } + } + + /// Field number for the "depth_data_map_original_minimum_value" field. + public const int DepthDataMapOriginalMinimumValueFieldNumber = 7; + private readonly static float DepthDataMapOriginalMinimumValueDefaultValue = 0F; + + private float depthDataMapOriginalMinimumValue_; + /// + /// The original range of values expressed by the depth_data_map, before + /// grayscale normalization. For example, if the minimum and maximum values + /// indicate a range of [0.5, 2.2], and the depth_data_type value indicates + /// it was a depth map, then white pixels (255, 255, 255) will map to 0.5 and + /// black pixels (0, 0, 0) will map to 2.2 with the grayscale range linearly + /// interpolated inbetween. Conversely, if the depth_data_type value indicates + /// it was a disparity map, then white pixels will map to 2.2 and black pixels + /// will map to 0.5. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DepthDataMapOriginalMinimumValue { + get { if ((_hasBits0 & 8) != 0) { return depthDataMapOriginalMinimumValue_; } else { return DepthDataMapOriginalMinimumValueDefaultValue; } } + set { + _hasBits0 |= 8; + depthDataMapOriginalMinimumValue_ = value; + } + } + /// Gets whether the "depth_data_map_original_minimum_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMapOriginalMinimumValue { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "depth_data_map_original_minimum_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMapOriginalMinimumValue() { + _hasBits0 &= ~8; + } + + /// Field number for the "depth_data_map_original_maximum_value" field. + public const int DepthDataMapOriginalMaximumValueFieldNumber = 8; + private readonly static float DepthDataMapOriginalMaximumValueDefaultValue = 0F; + + private float depthDataMapOriginalMaximumValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DepthDataMapOriginalMaximumValue { + get { if ((_hasBits0 & 16) != 0) { return depthDataMapOriginalMaximumValue_; } else { return DepthDataMapOriginalMaximumValueDefaultValue; } } + set { + _hasBits0 |= 16; + depthDataMapOriginalMaximumValue_ = value; + } + } + /// Gets whether the "depth_data_map_original_maximum_value" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMapOriginalMaximumValue { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "depth_data_map_original_maximum_value" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMapOriginalMaximumValue() { + _hasBits0 &= ~16; + } + + /// Field number for the "depth_data_map_width" field. + public const int DepthDataMapWidthFieldNumber = 9; + private readonly static int DepthDataMapWidthDefaultValue = 0; + + private int depthDataMapWidth_; + /// + /// The width of the depth buffer map. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DepthDataMapWidth { + get { if ((_hasBits0 & 32) != 0) { return depthDataMapWidth_; } else { return DepthDataMapWidthDefaultValue; } } + set { + _hasBits0 |= 32; + depthDataMapWidth_ = value; + } + } + /// Gets whether the "depth_data_map_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMapWidth { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "depth_data_map_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMapWidth() { + _hasBits0 &= ~32; + } + + /// Field number for the "depth_data_map_height" field. + public const int DepthDataMapHeightFieldNumber = 10; + private readonly static int DepthDataMapHeightDefaultValue = 0; + + private int depthDataMapHeight_; + /// + /// The height of the depth buffer map. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DepthDataMapHeight { + get { if ((_hasBits0 & 64) != 0) { return depthDataMapHeight_; } else { return DepthDataMapHeightDefaultValue; } } + set { + _hasBits0 |= 64; + depthDataMapHeight_ = value; + } + } + /// Gets whether the "depth_data_map_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMapHeight { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "depth_data_map_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMapHeight() { + _hasBits0 &= ~64; + } + + /// Field number for the "depth_data_map_raw_values" field. + public const int DepthDataMapRawValuesFieldNumber = 11; + private readonly static pb::ByteString DepthDataMapRawValuesDefaultValue = pb::ByteString.Empty; + + private pb::ByteString depthDataMapRawValues_; + /// + /// The row-major flattened array of the depth buffer map pixels. This will be + /// either a float32 or float16 byte array, depending on 'depth_data_type'. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString DepthDataMapRawValues { + get { return depthDataMapRawValues_ ?? DepthDataMapRawValuesDefaultValue; } + set { + depthDataMapRawValues_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "depth_data_map_raw_values" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataMapRawValues { + get { return depthDataMapRawValues_ != null; } + } + /// Clears the value of the "depth_data_map_raw_values" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataMapRawValues() { + depthDataMapRawValues_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AVDepthData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AVDepthData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DepthDataMap != other.DepthDataMap) return false; + if (DepthDataType != other.DepthDataType) return false; + if (DepthDataAccuracy != other.DepthDataAccuracy) return false; + if (DepthDataFiltered != other.DepthDataFiltered) return false; + if (DepthDataQuality != other.DepthDataQuality) return false; + if (!object.Equals(CameraCalibrationData, other.CameraCalibrationData)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DepthDataMapOriginalMinimumValue, other.DepthDataMapOriginalMinimumValue)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DepthDataMapOriginalMaximumValue, other.DepthDataMapOriginalMaximumValue)) return false; + if (DepthDataMapWidth != other.DepthDataMapWidth) return false; + if (DepthDataMapHeight != other.DepthDataMapHeight) return false; + if (DepthDataMapRawValues != other.DepthDataMapRawValues) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDepthDataMap) hash ^= DepthDataMap.GetHashCode(); + if (HasDepthDataType) hash ^= DepthDataType.GetHashCode(); + if (HasDepthDataAccuracy) hash ^= DepthDataAccuracy.GetHashCode(); + if (HasDepthDataFiltered) hash ^= DepthDataFiltered.GetHashCode(); + if (HasDepthDataQuality) hash ^= DepthDataQuality.GetHashCode(); + if (cameraCalibrationData_ != null) hash ^= CameraCalibrationData.GetHashCode(); + if (HasDepthDataMapOriginalMinimumValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DepthDataMapOriginalMinimumValue); + if (HasDepthDataMapOriginalMaximumValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DepthDataMapOriginalMaximumValue); + if (HasDepthDataMapWidth) hash ^= DepthDataMapWidth.GetHashCode(); + if (HasDepthDataMapHeight) hash ^= DepthDataMapHeight.GetHashCode(); + if (HasDepthDataMapRawValues) hash ^= DepthDataMapRawValues.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDepthDataMap) { + output.WriteRawTag(10); + output.WriteBytes(DepthDataMap); + } + if (HasDepthDataType) { + output.WriteRawTag(18); + output.WriteString(DepthDataType); + } + if (HasDepthDataAccuracy) { + output.WriteRawTag(24); + output.WriteEnum((int) DepthDataAccuracy); + } + if (HasDepthDataFiltered) { + output.WriteRawTag(32); + output.WriteBool(DepthDataFiltered); + } + if (HasDepthDataQuality) { + output.WriteRawTag(40); + output.WriteEnum((int) DepthDataQuality); + } + if (cameraCalibrationData_ != null) { + output.WriteRawTag(50); + output.WriteMessage(CameraCalibrationData); + } + if (HasDepthDataMapOriginalMinimumValue) { + output.WriteRawTag(61); + output.WriteFloat(DepthDataMapOriginalMinimumValue); + } + if (HasDepthDataMapOriginalMaximumValue) { + output.WriteRawTag(69); + output.WriteFloat(DepthDataMapOriginalMaximumValue); + } + if (HasDepthDataMapWidth) { + output.WriteRawTag(72); + output.WriteInt32(DepthDataMapWidth); + } + if (HasDepthDataMapHeight) { + output.WriteRawTag(80); + output.WriteInt32(DepthDataMapHeight); + } + if (HasDepthDataMapRawValues) { + output.WriteRawTag(90); + output.WriteBytes(DepthDataMapRawValues); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDepthDataMap) { + output.WriteRawTag(10); + output.WriteBytes(DepthDataMap); + } + if (HasDepthDataType) { + output.WriteRawTag(18); + output.WriteString(DepthDataType); + } + if (HasDepthDataAccuracy) { + output.WriteRawTag(24); + output.WriteEnum((int) DepthDataAccuracy); + } + if (HasDepthDataFiltered) { + output.WriteRawTag(32); + output.WriteBool(DepthDataFiltered); + } + if (HasDepthDataQuality) { + output.WriteRawTag(40); + output.WriteEnum((int) DepthDataQuality); + } + if (cameraCalibrationData_ != null) { + output.WriteRawTag(50); + output.WriteMessage(CameraCalibrationData); + } + if (HasDepthDataMapOriginalMinimumValue) { + output.WriteRawTag(61); + output.WriteFloat(DepthDataMapOriginalMinimumValue); + } + if (HasDepthDataMapOriginalMaximumValue) { + output.WriteRawTag(69); + output.WriteFloat(DepthDataMapOriginalMaximumValue); + } + if (HasDepthDataMapWidth) { + output.WriteRawTag(72); + output.WriteInt32(DepthDataMapWidth); + } + if (HasDepthDataMapHeight) { + output.WriteRawTag(80); + output.WriteInt32(DepthDataMapHeight); + } + if (HasDepthDataMapRawValues) { + output.WriteRawTag(90); + output.WriteBytes(DepthDataMapRawValues); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDepthDataMap) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthDataMap); + } + if (HasDepthDataType) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DepthDataType); + } + if (HasDepthDataAccuracy) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DepthDataAccuracy); + } + if (HasDepthDataFiltered) { + size += 1 + 1; + } + if (HasDepthDataQuality) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DepthDataQuality); + } + if (cameraCalibrationData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CameraCalibrationData); + } + if (HasDepthDataMapOriginalMinimumValue) { + size += 1 + 4; + } + if (HasDepthDataMapOriginalMaximumValue) { + size += 1 + 4; + } + if (HasDepthDataMapWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DepthDataMapWidth); + } + if (HasDepthDataMapHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DepthDataMapHeight); + } + if (HasDepthDataMapRawValues) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthDataMapRawValues); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AVDepthData other) { + if (other == null) { + return; + } + if (other.HasDepthDataMap) { + DepthDataMap = other.DepthDataMap; + } + if (other.HasDepthDataType) { + DepthDataType = other.DepthDataType; + } + if (other.HasDepthDataAccuracy) { + DepthDataAccuracy = other.DepthDataAccuracy; + } + if (other.HasDepthDataFiltered) { + DepthDataFiltered = other.DepthDataFiltered; + } + if (other.HasDepthDataQuality) { + DepthDataQuality = other.DepthDataQuality; + } + if (other.cameraCalibrationData_ != null) { + if (cameraCalibrationData_ == null) { + CameraCalibrationData = new global::Mediapipe.AVCameraCalibrationData(); + } + CameraCalibrationData.MergeFrom(other.CameraCalibrationData); + } + if (other.HasDepthDataMapOriginalMinimumValue) { + DepthDataMapOriginalMinimumValue = other.DepthDataMapOriginalMinimumValue; + } + if (other.HasDepthDataMapOriginalMaximumValue) { + DepthDataMapOriginalMaximumValue = other.DepthDataMapOriginalMaximumValue; + } + if (other.HasDepthDataMapWidth) { + DepthDataMapWidth = other.DepthDataMapWidth; + } + if (other.HasDepthDataMapHeight) { + DepthDataMapHeight = other.DepthDataMapHeight; + } + if (other.HasDepthDataMapRawValues) { + DepthDataMapRawValues = other.DepthDataMapRawValues; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + DepthDataMap = input.ReadBytes(); + break; + } + case 18: { + DepthDataType = input.ReadString(); + break; + } + case 24: { + DepthDataAccuracy = (global::Mediapipe.AVDepthData.Types.Accuracy) input.ReadEnum(); + break; + } + case 32: { + DepthDataFiltered = input.ReadBool(); + break; + } + case 40: { + DepthDataQuality = (global::Mediapipe.AVDepthData.Types.Quality) input.ReadEnum(); + break; + } + case 50: { + if (cameraCalibrationData_ == null) { + CameraCalibrationData = new global::Mediapipe.AVCameraCalibrationData(); + } + input.ReadMessage(CameraCalibrationData); + break; + } + case 61: { + DepthDataMapOriginalMinimumValue = input.ReadFloat(); + break; + } + case 69: { + DepthDataMapOriginalMaximumValue = input.ReadFloat(); + break; + } + case 72: { + DepthDataMapWidth = input.ReadInt32(); + break; + } + case 80: { + DepthDataMapHeight = input.ReadInt32(); + break; + } + case 90: { + DepthDataMapRawValues = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + DepthDataMap = input.ReadBytes(); + break; + } + case 18: { + DepthDataType = input.ReadString(); + break; + } + case 24: { + DepthDataAccuracy = (global::Mediapipe.AVDepthData.Types.Accuracy) input.ReadEnum(); + break; + } + case 32: { + DepthDataFiltered = input.ReadBool(); + break; + } + case 40: { + DepthDataQuality = (global::Mediapipe.AVDepthData.Types.Quality) input.ReadEnum(); + break; + } + case 50: { + if (cameraCalibrationData_ == null) { + CameraCalibrationData = new global::Mediapipe.AVCameraCalibrationData(); + } + input.ReadMessage(CameraCalibrationData); + break; + } + case 61: { + DepthDataMapOriginalMinimumValue = input.ReadFloat(); + break; + } + case 69: { + DepthDataMapOriginalMaximumValue = input.ReadFloat(); + break; + } + case 72: { + DepthDataMapWidth = input.ReadInt32(); + break; + } + case 80: { + DepthDataMapHeight = input.ReadInt32(); + break; + } + case 90: { + DepthDataMapRawValues = input.ReadBytes(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the AVDepthData message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Indicates the general accuracy of the depth_data_map. + /// See developer.apple.com/documentation/avfoundation/avdepthdataaccuracy for + /// more information. + /// + public enum Accuracy { + [pbr::OriginalName("UNDEFINED_ACCURACY")] UndefinedAccuracy = 0, + /// + /// Values in the depth map are usable for foreground/background separation + /// but are not absolutely accurate in the physical world. + /// + [pbr::OriginalName("RELATIVE")] Relative = 1, + /// + /// Values in the depth map are absolutely accurate in the physical world. + /// + [pbr::OriginalName("ABSOLUTE")] Absolute = 2, + } + + /// + /// Quality of the depth_data_map. + /// + public enum Quality { + [pbr::OriginalName("UNDEFINED_QUALITY")] UndefinedQuality = 0, + [pbr::OriginalName("HIGH")] High = 1, + [pbr::OriginalName("LOW")] Low = 2, + } + + } + #endregion + + } + + /// + /// Estimated scene lighting information associated with a captured video frame. + /// See developer.apple.com/documentation/arkit/arlightestimate for more info. + /// + public sealed partial class ARLightEstimate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARLightEstimate()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARLightEstimate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARLightEstimate(ARLightEstimate other) : this() { + _hasBits0 = other._hasBits0; + ambientIntensity_ = other.ambientIntensity_; + ambientColorTemperature_ = other.ambientColorTemperature_; + sphericalHarmonicsCoefficients_ = other.sphericalHarmonicsCoefficients_.Clone(); + primaryLightDirection_ = other.primaryLightDirection_ != null ? other.primaryLightDirection_.Clone() : null; + primaryLightIntensity_ = other.primaryLightIntensity_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARLightEstimate Clone() { + return new ARLightEstimate(this); + } + + /// Field number for the "ambient_intensity" field. + public const int AmbientIntensityFieldNumber = 1; + private readonly static double AmbientIntensityDefaultValue = 0D; + + private double ambientIntensity_; + /// + /// The estimated intensity, in lumens, of ambient light throughout the scene. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double AmbientIntensity { + get { if ((_hasBits0 & 1) != 0) { return ambientIntensity_; } else { return AmbientIntensityDefaultValue; } } + set { + _hasBits0 |= 1; + ambientIntensity_ = value; + } + } + /// Gets whether the "ambient_intensity" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAmbientIntensity { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "ambient_intensity" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAmbientIntensity() { + _hasBits0 &= ~1; + } + + /// Field number for the "ambient_color_temperature" field. + public const int AmbientColorTemperatureFieldNumber = 2; + private readonly static double AmbientColorTemperatureDefaultValue = 0D; + + private double ambientColorTemperature_; + /// + /// The estimated color temperature, in degrees Kelvin, of ambient light + /// throughout the scene. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double AmbientColorTemperature { + get { if ((_hasBits0 & 2) != 0) { return ambientColorTemperature_; } else { return AmbientColorTemperatureDefaultValue; } } + set { + _hasBits0 |= 2; + ambientColorTemperature_ = value; + } + } + /// Gets whether the "ambient_color_temperature" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAmbientColorTemperature { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "ambient_color_temperature" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAmbientColorTemperature() { + _hasBits0 &= ~2; + } + + /// Field number for the "spherical_harmonics_coefficients" field. + public const int SphericalHarmonicsCoefficientsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_sphericalHarmonicsCoefficients_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField sphericalHarmonicsCoefficients_ = new pbc::RepeatedField(); + /// + /// Data describing the estimated lighting environment in all directions. + /// Second-level spherical harmonics in separate red, green, and blue data + /// planes. Thus, this buffer contains 3 sets of 9 coefficients, or a total of + /// 27 values. + /// See + /// https://developer.apple.com/documentation/arkit/ardirectionallightestimate/2928222-sphericalharmonicscoefficients?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SphericalHarmonicsCoefficients { + get { return sphericalHarmonicsCoefficients_; } + } + + /// Field number for the "primary_light_direction" field. + public const int PrimaryLightDirectionFieldNumber = 4; + private global::Mediapipe.ARLightEstimate.Types.DirectionVector primaryLightDirection_; + /// + /// A vector indicating the orientation of the strongest directional light + /// source, normalized in the world-coordinate space. + /// See + /// https://developer.apple.com/documentation/arkit/ardirectionallightestimate/2928221-primarylightdirection?language=objc + /// for more information; + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARLightEstimate.Types.DirectionVector PrimaryLightDirection { + get { return primaryLightDirection_; } + set { + primaryLightDirection_ = value; + } + } + + /// Field number for the "primary_light_intensity" field. + public const int PrimaryLightIntensityFieldNumber = 5; + private readonly static float PrimaryLightIntensityDefaultValue = 0F; + + private float primaryLightIntensity_; + /// + /// The estimated intensity, in lumens, of the strongest directional light + /// source in the scene. + /// See + /// https://developer.apple.com/documentation/arkit/ardirectionallightestimate/2928219-primarylightintensity?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PrimaryLightIntensity { + get { if ((_hasBits0 & 4) != 0) { return primaryLightIntensity_; } else { return PrimaryLightIntensityDefaultValue; } } + set { + _hasBits0 |= 4; + primaryLightIntensity_ = value; + } + } + /// Gets whether the "primary_light_intensity" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPrimaryLightIntensity { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "primary_light_intensity" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPrimaryLightIntensity() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARLightEstimate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARLightEstimate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(AmbientIntensity, other.AmbientIntensity)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(AmbientColorTemperature, other.AmbientColorTemperature)) return false; + if(!sphericalHarmonicsCoefficients_.Equals(other.sphericalHarmonicsCoefficients_)) return false; + if (!object.Equals(PrimaryLightDirection, other.PrimaryLightDirection)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PrimaryLightIntensity, other.PrimaryLightIntensity)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasAmbientIntensity) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AmbientIntensity); + if (HasAmbientColorTemperature) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AmbientColorTemperature); + hash ^= sphericalHarmonicsCoefficients_.GetHashCode(); + if (primaryLightDirection_ != null) hash ^= PrimaryLightDirection.GetHashCode(); + if (HasPrimaryLightIntensity) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PrimaryLightIntensity); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasAmbientIntensity) { + output.WriteRawTag(9); + output.WriteDouble(AmbientIntensity); + } + if (HasAmbientColorTemperature) { + output.WriteRawTag(17); + output.WriteDouble(AmbientColorTemperature); + } + sphericalHarmonicsCoefficients_.WriteTo(output, _repeated_sphericalHarmonicsCoefficients_codec); + if (primaryLightDirection_ != null) { + output.WriteRawTag(34); + output.WriteMessage(PrimaryLightDirection); + } + if (HasPrimaryLightIntensity) { + output.WriteRawTag(45); + output.WriteFloat(PrimaryLightIntensity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAmbientIntensity) { + output.WriteRawTag(9); + output.WriteDouble(AmbientIntensity); + } + if (HasAmbientColorTemperature) { + output.WriteRawTag(17); + output.WriteDouble(AmbientColorTemperature); + } + sphericalHarmonicsCoefficients_.WriteTo(ref output, _repeated_sphericalHarmonicsCoefficients_codec); + if (primaryLightDirection_ != null) { + output.WriteRawTag(34); + output.WriteMessage(PrimaryLightDirection); + } + if (HasPrimaryLightIntensity) { + output.WriteRawTag(45); + output.WriteFloat(PrimaryLightIntensity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasAmbientIntensity) { + size += 1 + 8; + } + if (HasAmbientColorTemperature) { + size += 1 + 8; + } + size += sphericalHarmonicsCoefficients_.CalculateSize(_repeated_sphericalHarmonicsCoefficients_codec); + if (primaryLightDirection_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(PrimaryLightDirection); + } + if (HasPrimaryLightIntensity) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARLightEstimate other) { + if (other == null) { + return; + } + if (other.HasAmbientIntensity) { + AmbientIntensity = other.AmbientIntensity; + } + if (other.HasAmbientColorTemperature) { + AmbientColorTemperature = other.AmbientColorTemperature; + } + sphericalHarmonicsCoefficients_.Add(other.sphericalHarmonicsCoefficients_); + if (other.primaryLightDirection_ != null) { + if (primaryLightDirection_ == null) { + PrimaryLightDirection = new global::Mediapipe.ARLightEstimate.Types.DirectionVector(); + } + PrimaryLightDirection.MergeFrom(other.PrimaryLightDirection); + } + if (other.HasPrimaryLightIntensity) { + PrimaryLightIntensity = other.PrimaryLightIntensity; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + AmbientIntensity = input.ReadDouble(); + break; + } + case 17: { + AmbientColorTemperature = input.ReadDouble(); + break; + } + case 26: + case 29: { + sphericalHarmonicsCoefficients_.AddEntriesFrom(input, _repeated_sphericalHarmonicsCoefficients_codec); + break; + } + case 34: { + if (primaryLightDirection_ == null) { + PrimaryLightDirection = new global::Mediapipe.ARLightEstimate.Types.DirectionVector(); + } + input.ReadMessage(PrimaryLightDirection); + break; + } + case 45: { + PrimaryLightIntensity = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + AmbientIntensity = input.ReadDouble(); + break; + } + case 17: { + AmbientColorTemperature = input.ReadDouble(); + break; + } + case 26: + case 29: { + sphericalHarmonicsCoefficients_.AddEntriesFrom(ref input, _repeated_sphericalHarmonicsCoefficients_codec); + break; + } + case 34: { + if (primaryLightDirection_ == null) { + PrimaryLightDirection = new global::Mediapipe.ARLightEstimate.Types.DirectionVector(); + } + input.ReadMessage(PrimaryLightDirection); + break; + } + case 45: { + PrimaryLightIntensity = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARLightEstimate message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class DirectionVector : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DirectionVector()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARLightEstimate.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DirectionVector() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DirectionVector(DirectionVector other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DirectionVector Clone() { + return new DirectionVector(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DirectionVector); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DirectionVector other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DirectionVector other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Information about the camera position and imaging characteristics for a + /// captured video frame. + /// See developer.apple.com/documentation/arkit/arcamera for more information. + /// + public sealed partial class ARCamera : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARCamera()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARCamera() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARCamera(ARCamera other) : this() { + _hasBits0 = other._hasBits0; + trackingState_ = other.trackingState_; + trackingStateReason_ = other.trackingStateReason_; + transform_ = other.transform_.Clone(); + eulerAngles_ = other.eulerAngles_ != null ? other.eulerAngles_.Clone() : null; + imageResolutionWidth_ = other.imageResolutionWidth_; + imageResolutionHeight_ = other.imageResolutionHeight_; + intrinsics_ = other.intrinsics_.Clone(); + projectionMatrix_ = other.projectionMatrix_.Clone(); + viewMatrix_ = other.viewMatrix_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARCamera Clone() { + return new ARCamera(this); + } + + /// Field number for the "tracking_state" field. + public const int TrackingStateFieldNumber = 1; + private readonly static global::Mediapipe.ARCamera.Types.TrackingState TrackingStateDefaultValue = global::Mediapipe.ARCamera.Types.TrackingState.Unavailable; + + private global::Mediapipe.ARCamera.Types.TrackingState trackingState_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARCamera.Types.TrackingState TrackingState { + get { if ((_hasBits0 & 1) != 0) { return trackingState_; } else { return TrackingStateDefaultValue; } } + set { + _hasBits0 |= 1; + trackingState_ = value; + } + } + /// Gets whether the "tracking_state" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingState { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "tracking_state" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingState() { + _hasBits0 &= ~1; + } + + /// Field number for the "tracking_state_reason" field. + public const int TrackingStateReasonFieldNumber = 2; + private readonly static global::Mediapipe.ARCamera.Types.TrackingStateReason TrackingStateReasonDefaultValue = global::Mediapipe.ARCamera.Types.TrackingStateReason.None; + + private global::Mediapipe.ARCamera.Types.TrackingStateReason trackingStateReason_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARCamera.Types.TrackingStateReason TrackingStateReason { + get { if ((_hasBits0 & 2) != 0) { return trackingStateReason_; } else { return TrackingStateReasonDefaultValue; } } + set { + _hasBits0 |= 2; + trackingStateReason_ = value; + } + } + /// Gets whether the "tracking_state_reason" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingStateReason { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "tracking_state_reason" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingStateReason() { + _hasBits0 &= ~2; + } + + /// Field number for the "transform" field. + public const int TransformFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_transform_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField transform_ = new pbc::RepeatedField(); + /// + /// 4x4 row-major matrix expressing position and orientation of the camera in + /// world coordinate space. + /// See developer.apple.com/documentation/arkit/arcamera/2866108-transform for + /// more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Transform { + get { return transform_; } + } + + /// Field number for the "euler_angles" field. + public const int EulerAnglesFieldNumber = 4; + private global::Mediapipe.ARCamera.Types.EulerAngles eulerAngles_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARCamera.Types.EulerAngles EulerAngles { + get { return eulerAngles_; } + set { + eulerAngles_ = value; + } + } + + /// Field number for the "image_resolution_width" field. + public const int ImageResolutionWidthFieldNumber = 5; + private readonly static int ImageResolutionWidthDefaultValue = 0; + + private int imageResolutionWidth_; + /// + /// The width and height, in pixels, of the captured camera image. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ImageResolutionWidth { + get { if ((_hasBits0 & 4) != 0) { return imageResolutionWidth_; } else { return ImageResolutionWidthDefaultValue; } } + set { + _hasBits0 |= 4; + imageResolutionWidth_ = value; + } + } + /// Gets whether the "image_resolution_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageResolutionWidth { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "image_resolution_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageResolutionWidth() { + _hasBits0 &= ~4; + } + + /// Field number for the "image_resolution_height" field. + public const int ImageResolutionHeightFieldNumber = 6; + private readonly static int ImageResolutionHeightDefaultValue = 0; + + private int imageResolutionHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ImageResolutionHeight { + get { if ((_hasBits0 & 8) != 0) { return imageResolutionHeight_; } else { return ImageResolutionHeightDefaultValue; } } + set { + _hasBits0 |= 8; + imageResolutionHeight_ = value; + } + } + /// Gets whether the "image_resolution_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageResolutionHeight { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "image_resolution_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageResolutionHeight() { + _hasBits0 &= ~8; + } + + /// Field number for the "intrinsics" field. + public const int IntrinsicsFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_intrinsics_codec + = pb::FieldCodec.ForFloat(58); + private readonly pbc::RepeatedField intrinsics_ = new pbc::RepeatedField(); + /// + /// 3x3 row-major matrix that converts between the 2D camera plane and 3D world + /// coordinate space. + /// See developer.apple.com/documentation/arkit/arcamera/2875730-intrinsics for + /// usage information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Intrinsics { + get { return intrinsics_; } + } + + /// Field number for the "projection_matrix" field. + public const int ProjectionMatrixFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_projectionMatrix_codec + = pb::FieldCodec.ForFloat(66); + private readonly pbc::RepeatedField projectionMatrix_ = new pbc::RepeatedField(); + /// + /// 4x4 row-major transform matrix appropriate for rendering 3D content to + /// match the image captured by the camera. + /// See + /// developer.apple.com/documentation/arkit/arcamera/2887458-projectionmatrix + /// for usage information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ProjectionMatrix { + get { return projectionMatrix_; } + } + + /// Field number for the "view_matrix" field. + public const int ViewMatrixFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_viewMatrix_codec + = pb::FieldCodec.ForFloat(74); + private readonly pbc::RepeatedField viewMatrix_ = new pbc::RepeatedField(); + /// + /// 4x4 row-major transform matrix appropriate for converting from world-space + /// to camera space. Relativized for the captured_image orientation (i.e. + /// UILandscapeOrientationRight). + /// See + /// https://developer.apple.com/documentation/arkit/arcamera/2921672-viewmatrixfororientation?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ViewMatrix { + get { return viewMatrix_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARCamera); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARCamera other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TrackingState != other.TrackingState) return false; + if (TrackingStateReason != other.TrackingStateReason) return false; + if(!transform_.Equals(other.transform_)) return false; + if (!object.Equals(EulerAngles, other.EulerAngles)) return false; + if (ImageResolutionWidth != other.ImageResolutionWidth) return false; + if (ImageResolutionHeight != other.ImageResolutionHeight) return false; + if(!intrinsics_.Equals(other.intrinsics_)) return false; + if(!projectionMatrix_.Equals(other.projectionMatrix_)) return false; + if(!viewMatrix_.Equals(other.viewMatrix_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTrackingState) hash ^= TrackingState.GetHashCode(); + if (HasTrackingStateReason) hash ^= TrackingStateReason.GetHashCode(); + hash ^= transform_.GetHashCode(); + if (eulerAngles_ != null) hash ^= EulerAngles.GetHashCode(); + if (HasImageResolutionWidth) hash ^= ImageResolutionWidth.GetHashCode(); + if (HasImageResolutionHeight) hash ^= ImageResolutionHeight.GetHashCode(); + hash ^= intrinsics_.GetHashCode(); + hash ^= projectionMatrix_.GetHashCode(); + hash ^= viewMatrix_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTrackingState) { + output.WriteRawTag(8); + output.WriteEnum((int) TrackingState); + } + if (HasTrackingStateReason) { + output.WriteRawTag(16); + output.WriteEnum((int) TrackingStateReason); + } + transform_.WriteTo(output, _repeated_transform_codec); + if (eulerAngles_ != null) { + output.WriteRawTag(34); + output.WriteMessage(EulerAngles); + } + if (HasImageResolutionWidth) { + output.WriteRawTag(40); + output.WriteInt32(ImageResolutionWidth); + } + if (HasImageResolutionHeight) { + output.WriteRawTag(48); + output.WriteInt32(ImageResolutionHeight); + } + intrinsics_.WriteTo(output, _repeated_intrinsics_codec); + projectionMatrix_.WriteTo(output, _repeated_projectionMatrix_codec); + viewMatrix_.WriteTo(output, _repeated_viewMatrix_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTrackingState) { + output.WriteRawTag(8); + output.WriteEnum((int) TrackingState); + } + if (HasTrackingStateReason) { + output.WriteRawTag(16); + output.WriteEnum((int) TrackingStateReason); + } + transform_.WriteTo(ref output, _repeated_transform_codec); + if (eulerAngles_ != null) { + output.WriteRawTag(34); + output.WriteMessage(EulerAngles); + } + if (HasImageResolutionWidth) { + output.WriteRawTag(40); + output.WriteInt32(ImageResolutionWidth); + } + if (HasImageResolutionHeight) { + output.WriteRawTag(48); + output.WriteInt32(ImageResolutionHeight); + } + intrinsics_.WriteTo(ref output, _repeated_intrinsics_codec); + projectionMatrix_.WriteTo(ref output, _repeated_projectionMatrix_codec); + viewMatrix_.WriteTo(ref output, _repeated_viewMatrix_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTrackingState) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TrackingState); + } + if (HasTrackingStateReason) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TrackingStateReason); + } + size += transform_.CalculateSize(_repeated_transform_codec); + if (eulerAngles_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(EulerAngles); + } + if (HasImageResolutionWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ImageResolutionWidth); + } + if (HasImageResolutionHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ImageResolutionHeight); + } + size += intrinsics_.CalculateSize(_repeated_intrinsics_codec); + size += projectionMatrix_.CalculateSize(_repeated_projectionMatrix_codec); + size += viewMatrix_.CalculateSize(_repeated_viewMatrix_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARCamera other) { + if (other == null) { + return; + } + if (other.HasTrackingState) { + TrackingState = other.TrackingState; + } + if (other.HasTrackingStateReason) { + TrackingStateReason = other.TrackingStateReason; + } + transform_.Add(other.transform_); + if (other.eulerAngles_ != null) { + if (eulerAngles_ == null) { + EulerAngles = new global::Mediapipe.ARCamera.Types.EulerAngles(); + } + EulerAngles.MergeFrom(other.EulerAngles); + } + if (other.HasImageResolutionWidth) { + ImageResolutionWidth = other.ImageResolutionWidth; + } + if (other.HasImageResolutionHeight) { + ImageResolutionHeight = other.ImageResolutionHeight; + } + intrinsics_.Add(other.intrinsics_); + projectionMatrix_.Add(other.projectionMatrix_); + viewMatrix_.Add(other.viewMatrix_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TrackingState = (global::Mediapipe.ARCamera.Types.TrackingState) input.ReadEnum(); + break; + } + case 16: { + TrackingStateReason = (global::Mediapipe.ARCamera.Types.TrackingStateReason) input.ReadEnum(); + break; + } + case 26: + case 29: { + transform_.AddEntriesFrom(input, _repeated_transform_codec); + break; + } + case 34: { + if (eulerAngles_ == null) { + EulerAngles = new global::Mediapipe.ARCamera.Types.EulerAngles(); + } + input.ReadMessage(EulerAngles); + break; + } + case 40: { + ImageResolutionWidth = input.ReadInt32(); + break; + } + case 48: { + ImageResolutionHeight = input.ReadInt32(); + break; + } + case 58: + case 61: { + intrinsics_.AddEntriesFrom(input, _repeated_intrinsics_codec); + break; + } + case 66: + case 69: { + projectionMatrix_.AddEntriesFrom(input, _repeated_projectionMatrix_codec); + break; + } + case 74: + case 77: { + viewMatrix_.AddEntriesFrom(input, _repeated_viewMatrix_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TrackingState = (global::Mediapipe.ARCamera.Types.TrackingState) input.ReadEnum(); + break; + } + case 16: { + TrackingStateReason = (global::Mediapipe.ARCamera.Types.TrackingStateReason) input.ReadEnum(); + break; + } + case 26: + case 29: { + transform_.AddEntriesFrom(ref input, _repeated_transform_codec); + break; + } + case 34: { + if (eulerAngles_ == null) { + EulerAngles = new global::Mediapipe.ARCamera.Types.EulerAngles(); + } + input.ReadMessage(EulerAngles); + break; + } + case 40: { + ImageResolutionWidth = input.ReadInt32(); + break; + } + case 48: { + ImageResolutionHeight = input.ReadInt32(); + break; + } + case 58: + case 61: { + intrinsics_.AddEntriesFrom(ref input, _repeated_intrinsics_codec); + break; + } + case 66: + case 69: { + projectionMatrix_.AddEntriesFrom(ref input, _repeated_projectionMatrix_codec); + break; + } + case 74: + case 77: { + viewMatrix_.AddEntriesFrom(ref input, _repeated_viewMatrix_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARCamera message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// The general quality of position tracking available when the camera captured + /// a frame. + /// + public enum TrackingState { + [pbr::OriginalName("UNDEFINED_TRACKING_STATE")] UndefinedTrackingState = 0, + /// + /// Camera position tracking is not available. + /// + [pbr::OriginalName("UNAVAILABLE")] Unavailable = 1, + /// + /// Tracking is available, but the quality of results is questionable. + /// + [pbr::OriginalName("LIMITED")] Limited = 2, + /// + /// Camera position tracking is providing optimal results. + /// + [pbr::OriginalName("NORMAL")] Normal = 3, + } + + /// + /// A possible diagnosis for limited position tracking quality as of when the + /// frame was captured. + /// + public enum TrackingStateReason { + [pbr::OriginalName("UNDEFINED_TRACKING_STATE_REASON")] UndefinedTrackingStateReason = 0, + /// + /// The current tracking state is not limited. + /// + [pbr::OriginalName("NONE")] None = 1, + /// + /// Not yet enough camera or motion data to provide tracking information. + /// + [pbr::OriginalName("INITIALIZING")] Initializing = 2, + /// + /// The device is moving too fast for accurate image-based position tracking. + /// + [pbr::OriginalName("EXCESSIVE_MOTION")] ExcessiveMotion = 3, + /// + /// Not enough distinguishable features for image-based position tracking. + /// + [pbr::OriginalName("INSUFFICIENT_FEATURES")] InsufficientFeatures = 4, + /// + /// Tracking is limited due to a relocalization in progress. + /// + [pbr::OriginalName("RELOCALIZING")] Relocalizing = 5, + } + + /// + /// The orientation of the camera, expressed as roll, pitch, and yaw values. + /// + public sealed partial class EulerAngles : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EulerAngles()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCamera.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public EulerAngles() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public EulerAngles(EulerAngles other) : this() { + _hasBits0 = other._hasBits0; + roll_ = other.roll_; + pitch_ = other.pitch_; + yaw_ = other.yaw_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public EulerAngles Clone() { + return new EulerAngles(this); + } + + /// Field number for the "roll" field. + public const int RollFieldNumber = 1; + private readonly static float RollDefaultValue = 0F; + + private float roll_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Roll { + get { if ((_hasBits0 & 1) != 0) { return roll_; } else { return RollDefaultValue; } } + set { + _hasBits0 |= 1; + roll_ = value; + } + } + /// Gets whether the "roll" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRoll { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "roll" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRoll() { + _hasBits0 &= ~1; + } + + /// Field number for the "pitch" field. + public const int PitchFieldNumber = 2; + private readonly static float PitchDefaultValue = 0F; + + private float pitch_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Pitch { + get { if ((_hasBits0 & 2) != 0) { return pitch_; } else { return PitchDefaultValue; } } + set { + _hasBits0 |= 2; + pitch_ = value; + } + } + /// Gets whether the "pitch" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPitch { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "pitch" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPitch() { + _hasBits0 &= ~2; + } + + /// Field number for the "yaw" field. + public const int YawFieldNumber = 3; + private readonly static float YawDefaultValue = 0F; + + private float yaw_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Yaw { + get { if ((_hasBits0 & 4) != 0) { return yaw_; } else { return YawDefaultValue; } } + set { + _hasBits0 |= 4; + yaw_ = value; + } + } + /// Gets whether the "yaw" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYaw { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "yaw" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYaw() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as EulerAngles); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(EulerAngles other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Roll, other.Roll)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Pitch, other.Pitch)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Yaw, other.Yaw)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRoll) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Roll); + if (HasPitch) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Pitch); + if (HasYaw) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Yaw); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRoll) { + output.WriteRawTag(13); + output.WriteFloat(Roll); + } + if (HasPitch) { + output.WriteRawTag(21); + output.WriteFloat(Pitch); + } + if (HasYaw) { + output.WriteRawTag(29); + output.WriteFloat(Yaw); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRoll) { + output.WriteRawTag(13); + output.WriteFloat(Roll); + } + if (HasPitch) { + output.WriteRawTag(21); + output.WriteFloat(Pitch); + } + if (HasYaw) { + output.WriteRawTag(29); + output.WriteFloat(Yaw); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRoll) { + size += 1 + 4; + } + if (HasPitch) { + size += 1 + 4; + } + if (HasYaw) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(EulerAngles other) { + if (other == null) { + return; + } + if (other.HasRoll) { + Roll = other.Roll; + } + if (other.HasPitch) { + Pitch = other.Pitch; + } + if (other.HasYaw) { + Yaw = other.Yaw; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Roll = input.ReadFloat(); + break; + } + case 21: { + Pitch = input.ReadFloat(); + break; + } + case 29: { + Yaw = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Roll = input.ReadFloat(); + break; + } + case 21: { + Pitch = input.ReadFloat(); + break; + } + case 29: { + Yaw = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Container for a 3D mesh describing face topology. + /// + public sealed partial class ARFaceGeometry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARFaceGeometry()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceGeometry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceGeometry(ARFaceGeometry other) : this() { + _hasBits0 = other._hasBits0; + vertices_ = other.vertices_.Clone(); + vertexCount_ = other.vertexCount_; + textureCoordinates_ = other.textureCoordinates_.Clone(); + textureCoordinateCount_ = other.textureCoordinateCount_; + triangleIndices_ = other.triangleIndices_.Clone(); + triangleCount_ = other.triangleCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceGeometry Clone() { + return new ARFaceGeometry(this); + } + + /// Field number for the "vertices" field. + public const int VerticesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_vertices_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ARFaceGeometry.Types.Vertex.Parser); + private readonly pbc::RepeatedField vertices_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Vertices { + get { return vertices_; } + } + + /// Field number for the "vertex_count" field. + public const int VertexCountFieldNumber = 2; + private readonly static int VertexCountDefaultValue = 0; + + private int vertexCount_; + /// + /// The number of elements in the vertices list. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int VertexCount { + get { if ((_hasBits0 & 1) != 0) { return vertexCount_; } else { return VertexCountDefaultValue; } } + set { + _hasBits0 |= 1; + vertexCount_ = value; + } + } + /// Gets whether the "vertex_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVertexCount { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "vertex_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVertexCount() { + _hasBits0 &= ~1; + } + + /// Field number for the "texture_coordinates" field. + public const int TextureCoordinatesFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_textureCoordinates_codec + = pb::FieldCodec.ForMessage(26, global::Mediapipe.ARFaceGeometry.Types.TextureCoordinate.Parser); + private readonly pbc::RepeatedField textureCoordinates_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TextureCoordinates { + get { return textureCoordinates_; } + } + + /// Field number for the "texture_coordinate_count" field. + public const int TextureCoordinateCountFieldNumber = 4; + private readonly static int TextureCoordinateCountDefaultValue = 0; + + private int textureCoordinateCount_; + /// + /// The number of elements in the texture_coordinates list. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TextureCoordinateCount { + get { if ((_hasBits0 & 2) != 0) { return textureCoordinateCount_; } else { return TextureCoordinateCountDefaultValue; } } + set { + _hasBits0 |= 2; + textureCoordinateCount_ = value; + } + } + /// Gets whether the "texture_coordinate_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTextureCoordinateCount { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "texture_coordinate_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTextureCoordinateCount() { + _hasBits0 &= ~2; + } + + /// Field number for the "triangle_indices" field. + public const int TriangleIndicesFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_triangleIndices_codec + = pb::FieldCodec.ForInt32(42); + private readonly pbc::RepeatedField triangleIndices_ = new pbc::RepeatedField(); + /// + /// Each integer value in this ordered list represents an index into the + /// vertices and texture_coordinates lists. Each set of three indices + /// identifies the vertices comprising a single triangle in the mesh. Each set + /// of three indices forms a triangle, so the number of indices in the + /// triangle_indices buffer is three times the triangle_count value. + /// See + /// developer.apple.com/documentation/arkit/arfacegeometry/2928199-triangleindices + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TriangleIndices { + get { return triangleIndices_; } + } + + /// Field number for the "triangle_count" field. + public const int TriangleCountFieldNumber = 6; + private readonly static int TriangleCountDefaultValue = 0; + + private int triangleCount_; + /// + /// The number of triangles described by the triangle_indices buffer. + /// See + /// developer.apple.com/documentation/arkit/arfacegeometry/2928207-trianglecount + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TriangleCount { + get { if ((_hasBits0 & 4) != 0) { return triangleCount_; } else { return TriangleCountDefaultValue; } } + set { + _hasBits0 |= 4; + triangleCount_ = value; + } + } + /// Gets whether the "triangle_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTriangleCount { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "triangle_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTriangleCount() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARFaceGeometry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARFaceGeometry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!vertices_.Equals(other.vertices_)) return false; + if (VertexCount != other.VertexCount) return false; + if(!textureCoordinates_.Equals(other.textureCoordinates_)) return false; + if (TextureCoordinateCount != other.TextureCoordinateCount) return false; + if(!triangleIndices_.Equals(other.triangleIndices_)) return false; + if (TriangleCount != other.TriangleCount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= vertices_.GetHashCode(); + if (HasVertexCount) hash ^= VertexCount.GetHashCode(); + hash ^= textureCoordinates_.GetHashCode(); + if (HasTextureCoordinateCount) hash ^= TextureCoordinateCount.GetHashCode(); + hash ^= triangleIndices_.GetHashCode(); + if (HasTriangleCount) hash ^= TriangleCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + vertices_.WriteTo(output, _repeated_vertices_codec); + if (HasVertexCount) { + output.WriteRawTag(16); + output.WriteInt32(VertexCount); + } + textureCoordinates_.WriteTo(output, _repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + output.WriteRawTag(32); + output.WriteInt32(TextureCoordinateCount); + } + triangleIndices_.WriteTo(output, _repeated_triangleIndices_codec); + if (HasTriangleCount) { + output.WriteRawTag(48); + output.WriteInt32(TriangleCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + vertices_.WriteTo(ref output, _repeated_vertices_codec); + if (HasVertexCount) { + output.WriteRawTag(16); + output.WriteInt32(VertexCount); + } + textureCoordinates_.WriteTo(ref output, _repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + output.WriteRawTag(32); + output.WriteInt32(TextureCoordinateCount); + } + triangleIndices_.WriteTo(ref output, _repeated_triangleIndices_codec); + if (HasTriangleCount) { + output.WriteRawTag(48); + output.WriteInt32(TriangleCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += vertices_.CalculateSize(_repeated_vertices_codec); + if (HasVertexCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VertexCount); + } + size += textureCoordinates_.CalculateSize(_repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TextureCoordinateCount); + } + size += triangleIndices_.CalculateSize(_repeated_triangleIndices_codec); + if (HasTriangleCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TriangleCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARFaceGeometry other) { + if (other == null) { + return; + } + vertices_.Add(other.vertices_); + if (other.HasVertexCount) { + VertexCount = other.VertexCount; + } + textureCoordinates_.Add(other.textureCoordinates_); + if (other.HasTextureCoordinateCount) { + TextureCoordinateCount = other.TextureCoordinateCount; + } + triangleIndices_.Add(other.triangleIndices_); + if (other.HasTriangleCount) { + TriangleCount = other.TriangleCount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + vertices_.AddEntriesFrom(input, _repeated_vertices_codec); + break; + } + case 16: { + VertexCount = input.ReadInt32(); + break; + } + case 26: { + textureCoordinates_.AddEntriesFrom(input, _repeated_textureCoordinates_codec); + break; + } + case 32: { + TextureCoordinateCount = input.ReadInt32(); + break; + } + case 42: + case 40: { + triangleIndices_.AddEntriesFrom(input, _repeated_triangleIndices_codec); + break; + } + case 48: { + TriangleCount = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + vertices_.AddEntriesFrom(ref input, _repeated_vertices_codec); + break; + } + case 16: { + VertexCount = input.ReadInt32(); + break; + } + case 26: { + textureCoordinates_.AddEntriesFrom(ref input, _repeated_textureCoordinates_codec); + break; + } + case 32: { + TextureCoordinateCount = input.ReadInt32(); + break; + } + case 42: + case 40: { + triangleIndices_.AddEntriesFrom(ref input, _repeated_triangleIndices_codec); + break; + } + case 48: { + TriangleCount = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARFaceGeometry message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Each vertex represents a 3D point in the face mesh, in the face coordinate + /// space. + /// See developer.apple.com/documentation/arkit/arfacegeometry/2928201-vertices + /// for more information. + /// + public sealed partial class Vertex : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vertex()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARFaceGeometry.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex(Vertex other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex Clone() { + return new Vertex(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Vertex); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Vertex other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Vertex other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Each texture coordinate represents UV texture coordinates for the vertex at + /// the corresponding index in the vertices buffer. + /// See + /// developer.apple.com/documentation/arkit/arfacegeometry/2928203-texturecoordinates + /// for more information. + /// + public sealed partial class TextureCoordinate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TextureCoordinate()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARFaceGeometry.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate(TextureCoordinate other) : this() { + _hasBits0 = other._hasBits0; + u_ = other.u_; + v_ = other.v_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate Clone() { + return new TextureCoordinate(this); + } + + /// Field number for the "u" field. + public const int UFieldNumber = 1; + private readonly static float UDefaultValue = 0F; + + private float u_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float U { + get { if ((_hasBits0 & 1) != 0) { return u_; } else { return UDefaultValue; } } + set { + _hasBits0 |= 1; + u_ = value; + } + } + /// Gets whether the "u" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasU { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "u" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearU() { + _hasBits0 &= ~1; + } + + /// Field number for the "v" field. + public const int VFieldNumber = 2; + private readonly static float VDefaultValue = 0F; + + private float v_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float V { + get { if ((_hasBits0 & 2) != 0) { return v_; } else { return VDefaultValue; } } + set { + _hasBits0 |= 2; + v_ = value; + } + } + /// Gets whether the "v" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasV { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "v" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearV() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TextureCoordinate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TextureCoordinate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(U, other.U)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(V, other.V)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasU) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(U); + if (HasV) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(V); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasU) { + output.WriteRawTag(13); + output.WriteFloat(U); + } + if (HasV) { + output.WriteRawTag(21); + output.WriteFloat(V); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasU) { + output.WriteRawTag(13); + output.WriteFloat(U); + } + if (HasV) { + output.WriteRawTag(21); + output.WriteFloat(V); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasU) { + size += 1 + 4; + } + if (HasV) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TextureCoordinate other) { + if (other == null) { + return; + } + if (other.HasU) { + U = other.U; + } + if (other.HasV) { + V = other.V; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + U = input.ReadFloat(); + break; + } + case 21: { + V = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + U = input.ReadFloat(); + break; + } + case 21: { + V = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Contains a list of blend shape entries wherein each item maps a specific + /// blend shape location to its associated coefficient. + /// + public sealed partial class ARBlendShapeMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARBlendShapeMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARBlendShapeMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARBlendShapeMap(ARBlendShapeMap other) : this() { + entries_ = other.entries_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARBlendShapeMap Clone() { + return new ARBlendShapeMap(this); + } + + /// Field number for the "entries" field. + public const int EntriesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_entries_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ARBlendShapeMap.Types.MapEntry.Parser); + private readonly pbc::RepeatedField entries_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Entries { + get { return entries_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARBlendShapeMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARBlendShapeMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!entries_.Equals(other.entries_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= entries_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + entries_.WriteTo(output, _repeated_entries_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + entries_.WriteTo(ref output, _repeated_entries_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += entries_.CalculateSize(_repeated_entries_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARBlendShapeMap other) { + if (other == null) { + return; + } + entries_.Add(other.entries_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + entries_.AddEntriesFrom(input, _repeated_entries_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + entries_.AddEntriesFrom(ref input, _repeated_entries_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARBlendShapeMap message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class MapEntry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapEntry()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARBlendShapeMap.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MapEntry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MapEntry(MapEntry other) : this() { + _hasBits0 = other._hasBits0; + blendShapeLocation_ = other.blendShapeLocation_; + blendShapeCoefficient_ = other.blendShapeCoefficient_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MapEntry Clone() { + return new MapEntry(this); + } + + /// Field number for the "blend_shape_location" field. + public const int BlendShapeLocationFieldNumber = 1; + private readonly static string BlendShapeLocationDefaultValue = ""; + + private string blendShapeLocation_; + /// + /// Identifier for the specific facial feature. + /// See developer.apple.com/documentation/arkit/arblendshapelocation for a + /// complete list of identifiers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string BlendShapeLocation { + get { return blendShapeLocation_ ?? BlendShapeLocationDefaultValue; } + set { + blendShapeLocation_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "blend_shape_location" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlendShapeLocation { + get { return blendShapeLocation_ != null; } + } + /// Clears the value of the "blend_shape_location" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlendShapeLocation() { + blendShapeLocation_ = null; + } + + /// Field number for the "blend_shape_coefficient" field. + public const int BlendShapeCoefficientFieldNumber = 2; + private readonly static float BlendShapeCoefficientDefaultValue = 0F; + + private float blendShapeCoefficient_; + /// + /// Indicates the current position of the feature relative to its neutral + /// configuration, ranging from 0.0 (neutral) to 1.0 (maximum movement). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BlendShapeCoefficient { + get { if ((_hasBits0 & 1) != 0) { return blendShapeCoefficient_; } else { return BlendShapeCoefficientDefaultValue; } } + set { + _hasBits0 |= 1; + blendShapeCoefficient_ = value; + } + } + /// Gets whether the "blend_shape_coefficient" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlendShapeCoefficient { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "blend_shape_coefficient" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlendShapeCoefficient() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MapEntry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MapEntry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BlendShapeLocation != other.BlendShapeLocation) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BlendShapeCoefficient, other.BlendShapeCoefficient)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBlendShapeLocation) hash ^= BlendShapeLocation.GetHashCode(); + if (HasBlendShapeCoefficient) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BlendShapeCoefficient); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBlendShapeLocation) { + output.WriteRawTag(10); + output.WriteString(BlendShapeLocation); + } + if (HasBlendShapeCoefficient) { + output.WriteRawTag(21); + output.WriteFloat(BlendShapeCoefficient); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBlendShapeLocation) { + output.WriteRawTag(10); + output.WriteString(BlendShapeLocation); + } + if (HasBlendShapeCoefficient) { + output.WriteRawTag(21); + output.WriteFloat(BlendShapeCoefficient); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBlendShapeLocation) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BlendShapeLocation); + } + if (HasBlendShapeCoefficient) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MapEntry other) { + if (other == null) { + return; + } + if (other.HasBlendShapeLocation) { + BlendShapeLocation = other.BlendShapeLocation; + } + if (other.HasBlendShapeCoefficient) { + BlendShapeCoefficient = other.BlendShapeCoefficient; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BlendShapeLocation = input.ReadString(); + break; + } + case 21: { + BlendShapeCoefficient = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BlendShapeLocation = input.ReadString(); + break; + } + case 21: { + BlendShapeCoefficient = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Information about the pose, topology, and expression of a detected face. + /// See developer.apple.com/documentation/arkit/arfaceanchor for more info. + /// + public sealed partial class ARFaceAnchor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARFaceAnchor()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceAnchor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceAnchor(ARFaceAnchor other) : this() { + _hasBits0 = other._hasBits0; + geometry_ = other.geometry_ != null ? other.geometry_.Clone() : null; + blendShapes_ = other.blendShapes_ != null ? other.blendShapes_.Clone() : null; + transform_ = other.transform_.Clone(); + isTracked_ = other.isTracked_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFaceAnchor Clone() { + return new ARFaceAnchor(this); + } + + /// Field number for the "geometry" field. + public const int GeometryFieldNumber = 1; + private global::Mediapipe.ARFaceGeometry geometry_; + /// + /// A coarse triangle mesh representing the topology of the detected face. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARFaceGeometry Geometry { + get { return geometry_; } + set { + geometry_ = value; + } + } + + /// Field number for the "blend_shapes" field. + public const int BlendShapesFieldNumber = 2; + private global::Mediapipe.ARBlendShapeMap blendShapes_; + /// + /// A map of named coefficients representing the detected facial expression in + /// terms of the movement of specific facial features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARBlendShapeMap BlendShapes { + get { return blendShapes_; } + set { + blendShapes_ = value; + } + } + + /// Field number for the "transform" field. + public const int TransformFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_transform_codec + = pb::FieldCodec.ForFloat(29); + private readonly pbc::RepeatedField transform_ = new pbc::RepeatedField(); + /// + /// 4x4 row-major matrix encoding the position, orientation, and scale of the + /// anchor relative to the world coordinate space. + /// See + /// https://developer.apple.com/documentation/arkit/aranchor/2867981-transform?language=objc + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Transform { + get { return transform_; } + } + + /// Field number for the "is_tracked" field. + public const int IsTrackedFieldNumber = 4; + private readonly static bool IsTrackedDefaultValue = false; + + private bool isTracked_; + /// + /// Indicates whether the anchor's transform is valid. Frames that have a face + /// anchor with this value set to NO should probably be ignored. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsTracked { + get { if ((_hasBits0 & 1) != 0) { return isTracked_; } else { return IsTrackedDefaultValue; } } + set { + _hasBits0 |= 1; + isTracked_ = value; + } + } + /// Gets whether the "is_tracked" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIsTracked { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "is_tracked" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIsTracked() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARFaceAnchor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARFaceAnchor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Geometry, other.Geometry)) return false; + if (!object.Equals(BlendShapes, other.BlendShapes)) return false; + if(!transform_.Equals(other.transform_)) return false; + if (IsTracked != other.IsTracked) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (geometry_ != null) hash ^= Geometry.GetHashCode(); + if (blendShapes_ != null) hash ^= BlendShapes.GetHashCode(); + hash ^= transform_.GetHashCode(); + if (HasIsTracked) hash ^= IsTracked.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (geometry_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Geometry); + } + if (blendShapes_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BlendShapes); + } + transform_.WriteTo(output, _repeated_transform_codec); + if (HasIsTracked) { + output.WriteRawTag(32); + output.WriteBool(IsTracked); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (geometry_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Geometry); + } + if (blendShapes_ != null) { + output.WriteRawTag(18); + output.WriteMessage(BlendShapes); + } + transform_.WriteTo(ref output, _repeated_transform_codec); + if (HasIsTracked) { + output.WriteRawTag(32); + output.WriteBool(IsTracked); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (geometry_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Geometry); + } + if (blendShapes_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlendShapes); + } + size += transform_.CalculateSize(_repeated_transform_codec); + if (HasIsTracked) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARFaceAnchor other) { + if (other == null) { + return; + } + if (other.geometry_ != null) { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARFaceGeometry(); + } + Geometry.MergeFrom(other.Geometry); + } + if (other.blendShapes_ != null) { + if (blendShapes_ == null) { + BlendShapes = new global::Mediapipe.ARBlendShapeMap(); + } + BlendShapes.MergeFrom(other.BlendShapes); + } + transform_.Add(other.transform_); + if (other.HasIsTracked) { + IsTracked = other.IsTracked; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARFaceGeometry(); + } + input.ReadMessage(Geometry); + break; + } + case 18: { + if (blendShapes_ == null) { + BlendShapes = new global::Mediapipe.ARBlendShapeMap(); + } + input.ReadMessage(BlendShapes); + break; + } + case 26: + case 29: { + transform_.AddEntriesFrom(input, _repeated_transform_codec); + break; + } + case 32: { + IsTracked = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARFaceGeometry(); + } + input.ReadMessage(Geometry); + break; + } + case 18: { + if (blendShapes_ == null) { + BlendShapes = new global::Mediapipe.ARBlendShapeMap(); + } + input.ReadMessage(BlendShapes); + break; + } + case 26: + case 29: { + transform_.AddEntriesFrom(ref input, _repeated_transform_codec); + break; + } + case 32: { + IsTracked = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// Container for a 3D mesh. + /// + public sealed partial class ARPlaneGeometry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARPlaneGeometry()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneGeometry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneGeometry(ARPlaneGeometry other) : this() { + _hasBits0 = other._hasBits0; + vertices_ = other.vertices_.Clone(); + vertexCount_ = other.vertexCount_; + textureCoordinates_ = other.textureCoordinates_.Clone(); + textureCoordinateCount_ = other.textureCoordinateCount_; + triangleIndices_ = other.triangleIndices_.Clone(); + triangleCount_ = other.triangleCount_; + boundaryVertices_ = other.boundaryVertices_.Clone(); + boundaryVertexCount_ = other.boundaryVertexCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneGeometry Clone() { + return new ARPlaneGeometry(this); + } + + /// Field number for the "vertices" field. + public const int VerticesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_vertices_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ARPlaneGeometry.Types.Vertex.Parser); + private readonly pbc::RepeatedField vertices_ = new pbc::RepeatedField(); + /// + /// A buffer of vertex positions for each point in the plane mesh. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Vertices { + get { return vertices_; } + } + + /// Field number for the "vertex_count" field. + public const int VertexCountFieldNumber = 2; + private readonly static int VertexCountDefaultValue = 0; + + private int vertexCount_; + /// + /// The number of elements in the vertices buffer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int VertexCount { + get { if ((_hasBits0 & 1) != 0) { return vertexCount_; } else { return VertexCountDefaultValue; } } + set { + _hasBits0 |= 1; + vertexCount_ = value; + } + } + /// Gets whether the "vertex_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVertexCount { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "vertex_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVertexCount() { + _hasBits0 &= ~1; + } + + /// Field number for the "texture_coordinates" field. + public const int TextureCoordinatesFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_textureCoordinates_codec + = pb::FieldCodec.ForMessage(26, global::Mediapipe.ARPlaneGeometry.Types.TextureCoordinate.Parser); + private readonly pbc::RepeatedField textureCoordinates_ = new pbc::RepeatedField(); + /// + /// A buffer of texture coordinate values for each point in the plane mesh. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TextureCoordinates { + get { return textureCoordinates_; } + } + + /// Field number for the "texture_coordinate_count" field. + public const int TextureCoordinateCountFieldNumber = 4; + private readonly static int TextureCoordinateCountDefaultValue = 0; + + private int textureCoordinateCount_; + /// + /// The number of elements in the texture_coordinates buffer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TextureCoordinateCount { + get { if ((_hasBits0 & 2) != 0) { return textureCoordinateCount_; } else { return TextureCoordinateCountDefaultValue; } } + set { + _hasBits0 |= 2; + textureCoordinateCount_ = value; + } + } + /// Gets whether the "texture_coordinate_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTextureCoordinateCount { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "texture_coordinate_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTextureCoordinateCount() { + _hasBits0 &= ~2; + } + + /// Field number for the "triangle_indices" field. + public const int TriangleIndicesFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_triangleIndices_codec + = pb::FieldCodec.ForInt32(42); + private readonly pbc::RepeatedField triangleIndices_ = new pbc::RepeatedField(); + /// + /// Each integer value in this ordered list represents an index into the + /// vertices and texture_coordinates lists. Each set of three indices + /// identifies the vertices comprising a single triangle in the mesh. Each set + /// of three indices forms a triangle, so the number of indices in the + /// triangle_indices buffer is three times the triangle_count value. + /// See + /// https://developer.apple.com/documentation/arkit/arplanegeometry/2941051-triangleindices + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TriangleIndices { + get { return triangleIndices_; } + } + + /// Field number for the "triangle_count" field. + public const int TriangleCountFieldNumber = 6; + private readonly static int TriangleCountDefaultValue = 0; + + private int triangleCount_; + /// + /// Each set of three indices forms a triangle, so the number of indices in the + /// triangle_indices buffer is three times the triangle_count value. + /// See + /// https://developer.apple.com/documentation/arkit/arplanegeometry/2941058-trianglecount + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TriangleCount { + get { if ((_hasBits0 & 4) != 0) { return triangleCount_; } else { return TriangleCountDefaultValue; } } + set { + _hasBits0 |= 4; + triangleCount_ = value; + } + } + /// Gets whether the "triangle_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTriangleCount { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "triangle_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTriangleCount() { + _hasBits0 &= ~4; + } + + /// Field number for the "boundary_vertices" field. + public const int BoundaryVerticesFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_boundaryVertices_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.ARPlaneGeometry.Types.Vertex.Parser); + private readonly pbc::RepeatedField boundaryVertices_ = new pbc::RepeatedField(); + /// + /// Each value in this buffer represents the position of a vertex along the + /// boundary polygon of the estimated plane. The owning plane anchor's + /// transform matrix defines the coordinate system for these points. + /// See + /// https://developer.apple.com/documentation/arkit/arplanegeometry/2941052-boundaryvertices + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField BoundaryVertices { + get { return boundaryVertices_; } + } + + /// Field number for the "boundary_vertex_count" field. + public const int BoundaryVertexCountFieldNumber = 8; + private readonly static int BoundaryVertexCountDefaultValue = 0; + + private int boundaryVertexCount_; + /// + /// The number of elements in the boundary_vertices buffer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BoundaryVertexCount { + get { if ((_hasBits0 & 8) != 0) { return boundaryVertexCount_; } else { return BoundaryVertexCountDefaultValue; } } + set { + _hasBits0 |= 8; + boundaryVertexCount_ = value; + } + } + /// Gets whether the "boundary_vertex_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoundaryVertexCount { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "boundary_vertex_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoundaryVertexCount() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARPlaneGeometry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARPlaneGeometry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!vertices_.Equals(other.vertices_)) return false; + if (VertexCount != other.VertexCount) return false; + if(!textureCoordinates_.Equals(other.textureCoordinates_)) return false; + if (TextureCoordinateCount != other.TextureCoordinateCount) return false; + if(!triangleIndices_.Equals(other.triangleIndices_)) return false; + if (TriangleCount != other.TriangleCount) return false; + if(!boundaryVertices_.Equals(other.boundaryVertices_)) return false; + if (BoundaryVertexCount != other.BoundaryVertexCount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= vertices_.GetHashCode(); + if (HasVertexCount) hash ^= VertexCount.GetHashCode(); + hash ^= textureCoordinates_.GetHashCode(); + if (HasTextureCoordinateCount) hash ^= TextureCoordinateCount.GetHashCode(); + hash ^= triangleIndices_.GetHashCode(); + if (HasTriangleCount) hash ^= TriangleCount.GetHashCode(); + hash ^= boundaryVertices_.GetHashCode(); + if (HasBoundaryVertexCount) hash ^= BoundaryVertexCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + vertices_.WriteTo(output, _repeated_vertices_codec); + if (HasVertexCount) { + output.WriteRawTag(16); + output.WriteInt32(VertexCount); + } + textureCoordinates_.WriteTo(output, _repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + output.WriteRawTag(32); + output.WriteInt32(TextureCoordinateCount); + } + triangleIndices_.WriteTo(output, _repeated_triangleIndices_codec); + if (HasTriangleCount) { + output.WriteRawTag(48); + output.WriteInt32(TriangleCount); + } + boundaryVertices_.WriteTo(output, _repeated_boundaryVertices_codec); + if (HasBoundaryVertexCount) { + output.WriteRawTag(64); + output.WriteInt32(BoundaryVertexCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + vertices_.WriteTo(ref output, _repeated_vertices_codec); + if (HasVertexCount) { + output.WriteRawTag(16); + output.WriteInt32(VertexCount); + } + textureCoordinates_.WriteTo(ref output, _repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + output.WriteRawTag(32); + output.WriteInt32(TextureCoordinateCount); + } + triangleIndices_.WriteTo(ref output, _repeated_triangleIndices_codec); + if (HasTriangleCount) { + output.WriteRawTag(48); + output.WriteInt32(TriangleCount); + } + boundaryVertices_.WriteTo(ref output, _repeated_boundaryVertices_codec); + if (HasBoundaryVertexCount) { + output.WriteRawTag(64); + output.WriteInt32(BoundaryVertexCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += vertices_.CalculateSize(_repeated_vertices_codec); + if (HasVertexCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VertexCount); + } + size += textureCoordinates_.CalculateSize(_repeated_textureCoordinates_codec); + if (HasTextureCoordinateCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TextureCoordinateCount); + } + size += triangleIndices_.CalculateSize(_repeated_triangleIndices_codec); + if (HasTriangleCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TriangleCount); + } + size += boundaryVertices_.CalculateSize(_repeated_boundaryVertices_codec); + if (HasBoundaryVertexCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoundaryVertexCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARPlaneGeometry other) { + if (other == null) { + return; + } + vertices_.Add(other.vertices_); + if (other.HasVertexCount) { + VertexCount = other.VertexCount; + } + textureCoordinates_.Add(other.textureCoordinates_); + if (other.HasTextureCoordinateCount) { + TextureCoordinateCount = other.TextureCoordinateCount; + } + triangleIndices_.Add(other.triangleIndices_); + if (other.HasTriangleCount) { + TriangleCount = other.TriangleCount; + } + boundaryVertices_.Add(other.boundaryVertices_); + if (other.HasBoundaryVertexCount) { + BoundaryVertexCount = other.BoundaryVertexCount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + vertices_.AddEntriesFrom(input, _repeated_vertices_codec); + break; + } + case 16: { + VertexCount = input.ReadInt32(); + break; + } + case 26: { + textureCoordinates_.AddEntriesFrom(input, _repeated_textureCoordinates_codec); + break; + } + case 32: { + TextureCoordinateCount = input.ReadInt32(); + break; + } + case 42: + case 40: { + triangleIndices_.AddEntriesFrom(input, _repeated_triangleIndices_codec); + break; + } + case 48: { + TriangleCount = input.ReadInt32(); + break; + } + case 58: { + boundaryVertices_.AddEntriesFrom(input, _repeated_boundaryVertices_codec); + break; + } + case 64: { + BoundaryVertexCount = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + vertices_.AddEntriesFrom(ref input, _repeated_vertices_codec); + break; + } + case 16: { + VertexCount = input.ReadInt32(); + break; + } + case 26: { + textureCoordinates_.AddEntriesFrom(ref input, _repeated_textureCoordinates_codec); + break; + } + case 32: { + TextureCoordinateCount = input.ReadInt32(); + break; + } + case 42: + case 40: { + triangleIndices_.AddEntriesFrom(ref input, _repeated_triangleIndices_codec); + break; + } + case 48: { + TriangleCount = input.ReadInt32(); + break; + } + case 58: { + boundaryVertices_.AddEntriesFrom(ref input, _repeated_boundaryVertices_codec); + break; + } + case 64: { + BoundaryVertexCount = input.ReadInt32(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARPlaneGeometry message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Vertex : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vertex()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARPlaneGeometry.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex(Vertex other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vertex Clone() { + return new Vertex(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Vertex); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Vertex other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Vertex other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Each texture coordinate represents UV texture coordinates for the vertex at + /// the corresponding index in the vertices buffer. + /// See + /// https://developer.apple.com/documentation/arkit/arfacegeometry/2928203-texturecoordinates + /// for more information. + /// + public sealed partial class TextureCoordinate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TextureCoordinate()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARPlaneGeometry.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate(TextureCoordinate other) : this() { + _hasBits0 = other._hasBits0; + u_ = other.u_; + v_ = other.v_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TextureCoordinate Clone() { + return new TextureCoordinate(this); + } + + /// Field number for the "u" field. + public const int UFieldNumber = 1; + private readonly static float UDefaultValue = 0F; + + private float u_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float U { + get { if ((_hasBits0 & 1) != 0) { return u_; } else { return UDefaultValue; } } + set { + _hasBits0 |= 1; + u_ = value; + } + } + /// Gets whether the "u" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasU { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "u" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearU() { + _hasBits0 &= ~1; + } + + /// Field number for the "v" field. + public const int VFieldNumber = 2; + private readonly static float VDefaultValue = 0F; + + private float v_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float V { + get { if ((_hasBits0 & 2) != 0) { return v_; } else { return VDefaultValue; } } + set { + _hasBits0 |= 2; + v_ = value; + } + } + /// Gets whether the "v" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasV { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "v" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearV() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TextureCoordinate); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TextureCoordinate other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(U, other.U)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(V, other.V)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasU) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(U); + if (HasV) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(V); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasU) { + output.WriteRawTag(13); + output.WriteFloat(U); + } + if (HasV) { + output.WriteRawTag(21); + output.WriteFloat(V); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasU) { + output.WriteRawTag(13); + output.WriteFloat(U); + } + if (HasV) { + output.WriteRawTag(21); + output.WriteFloat(V); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasU) { + size += 1 + 4; + } + if (HasV) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TextureCoordinate other) { + if (other == null) { + return; + } + if (other.HasU) { + U = other.U; + } + if (other.HasV) { + V = other.V; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + U = input.ReadFloat(); + break; + } + case 21: { + V = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + U = input.ReadFloat(); + break; + } + case 21: { + V = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Information about the position and orientation of a real-world flat surface. + /// See https://developer.apple.com/documentation/arkit/arplaneanchor for more + /// information. + /// + public sealed partial class ARPlaneAnchor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARPlaneAnchor()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneAnchor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneAnchor(ARPlaneAnchor other) : this() { + _hasBits0 = other._hasBits0; + identifier_ = other.identifier_; + transform_ = other.transform_.Clone(); + alignment_ = other.alignment_; + geometry_ = other.geometry_ != null ? other.geometry_.Clone() : null; + center_ = other.center_ != null ? other.center_.Clone() : null; + extent_ = other.extent_ != null ? other.extent_.Clone() : null; + classificationSupported_ = other.classificationSupported_; + classification_ = other.classification_; + classificationStatus_ = other.classificationStatus_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPlaneAnchor Clone() { + return new ARPlaneAnchor(this); + } + + /// Field number for the "identifier" field. + public const int IdentifierFieldNumber = 1; + private readonly static string IdentifierDefaultValue = ""; + + private string identifier_; + /// + /// The ID of the plane. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Identifier { + get { return identifier_ ?? IdentifierDefaultValue; } + set { + identifier_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "identifier" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIdentifier { + get { return identifier_ != null; } + } + /// Clears the value of the "identifier" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIdentifier() { + identifier_ = null; + } + + /// Field number for the "transform" field. + public const int TransformFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_transform_codec + = pb::FieldCodec.ForFloat(21); + private readonly pbc::RepeatedField transform_ = new pbc::RepeatedField(); + /// + /// 4x4 row-major matrix encoding the position, orientation, and scale of the + /// anchor relative to the world coordinate space. + /// See + /// https://developer.apple.com/documentation/arkit/aranchor/2867981-transform + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Transform { + get { return transform_; } + } + + /// Field number for the "alignment" field. + public const int AlignmentFieldNumber = 3; + private readonly static global::Mediapipe.ARPlaneAnchor.Types.Alignment AlignmentDefaultValue = global::Mediapipe.ARPlaneAnchor.Types.Alignment.Undefined; + + private global::Mediapipe.ARPlaneAnchor.Types.Alignment alignment_; + /// + /// The general orientation of the detected plane with respect to gravity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneAnchor.Types.Alignment Alignment { + get { if ((_hasBits0 & 1) != 0) { return alignment_; } else { return AlignmentDefaultValue; } } + set { + _hasBits0 |= 1; + alignment_ = value; + } + } + /// Gets whether the "alignment" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAlignment { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "alignment" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAlignment() { + _hasBits0 &= ~1; + } + + /// Field number for the "geometry" field. + public const int GeometryFieldNumber = 4; + private global::Mediapipe.ARPlaneGeometry geometry_; + /// + /// A coarse triangle mesh representing the general shape of the detected + /// plane. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneGeometry Geometry { + get { return geometry_; } + set { + geometry_ = value; + } + } + + /// Field number for the "center" field. + public const int CenterFieldNumber = 5; + private global::Mediapipe.ARPlaneAnchor.Types.PlaneVector center_; + /// + /// The center point of the plane relative to its anchor position. + /// Although the type of this property is a 3D vector, a plane anchor is always + /// two-dimensional, and is always positioned in only the x and z directions + /// relative to its transform position. (That is, the y-component of this + /// vector is always zero.) + /// See + /// https://developer.apple.com/documentation/arkit/arplaneanchor/2882056-center + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneAnchor.Types.PlaneVector Center { + get { return center_; } + set { + center_ = value; + } + } + + /// Field number for the "extent" field. + public const int ExtentFieldNumber = 6; + private global::Mediapipe.ARPlaneAnchor.Types.PlaneVector extent_; + /// + /// The estimated width and length of the detected plane. + /// See + /// https://developer.apple.com/documentation/arkit/arplaneanchor/2882055-extent + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneAnchor.Types.PlaneVector Extent { + get { return extent_; } + set { + extent_ = value; + } + } + + /// Field number for the "classification_supported" field. + public const int ClassificationSupportedFieldNumber = 7; + private readonly static bool ClassificationSupportedDefaultValue = false; + + private bool classificationSupported_; + /// + /// A Boolean value that indicates whether plane classification is available on + /// the current device. On devices without plane classification support, all + /// plane anchors report a classification value of NONE + /// and a classification_status value of UNAVAILABLE. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ClassificationSupported { + get { if ((_hasBits0 & 2) != 0) { return classificationSupported_; } else { return ClassificationSupportedDefaultValue; } } + set { + _hasBits0 |= 2; + classificationSupported_ = value; + } + } + /// Gets whether the "classification_supported" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClassificationSupported { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "classification_supported" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClassificationSupported() { + _hasBits0 &= ~2; + } + + /// Field number for the "classification" field. + public const int ClassificationFieldNumber = 8; + private readonly static global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification ClassificationDefaultValue = global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification.None; + + private global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification classification_; + /// + /// A general characterization of what kind of real-world surface the plane + /// anchor represents. + /// See + /// https://developer.apple.com/documentation/arkit/arplaneanchor/2990936-classification + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification Classification { + get { if ((_hasBits0 & 4) != 0) { return classification_; } else { return ClassificationDefaultValue; } } + set { + _hasBits0 |= 4; + classification_ = value; + } + } + /// Gets whether the "classification" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClassification { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "classification" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClassification() { + _hasBits0 &= ~4; + } + + /// Field number for the "classification_status" field. + public const int ClassificationStatusFieldNumber = 9; + private readonly static global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus ClassificationStatusDefaultValue = global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus.Unknown; + + private global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus classificationStatus_; + /// + /// The current state of ARKit's process for classifying the plane anchor. + /// When this property's value is KNOWN, the classification property represents + /// ARKit's characterization of the real-world surface corresponding to the + /// plane anchor. + /// See + /// https://developer.apple.com/documentation/arkit/arplaneanchor/2990937-classificationstatus + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus ClassificationStatus { + get { if ((_hasBits0 & 8) != 0) { return classificationStatus_; } else { return ClassificationStatusDefaultValue; } } + set { + _hasBits0 |= 8; + classificationStatus_ = value; + } + } + /// Gets whether the "classification_status" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClassificationStatus { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "classification_status" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClassificationStatus() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARPlaneAnchor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARPlaneAnchor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Identifier != other.Identifier) return false; + if(!transform_.Equals(other.transform_)) return false; + if (Alignment != other.Alignment) return false; + if (!object.Equals(Geometry, other.Geometry)) return false; + if (!object.Equals(Center, other.Center)) return false; + if (!object.Equals(Extent, other.Extent)) return false; + if (ClassificationSupported != other.ClassificationSupported) return false; + if (Classification != other.Classification) return false; + if (ClassificationStatus != other.ClassificationStatus) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIdentifier) hash ^= Identifier.GetHashCode(); + hash ^= transform_.GetHashCode(); + if (HasAlignment) hash ^= Alignment.GetHashCode(); + if (geometry_ != null) hash ^= Geometry.GetHashCode(); + if (center_ != null) hash ^= Center.GetHashCode(); + if (extent_ != null) hash ^= Extent.GetHashCode(); + if (HasClassificationSupported) hash ^= ClassificationSupported.GetHashCode(); + if (HasClassification) hash ^= Classification.GetHashCode(); + if (HasClassificationStatus) hash ^= ClassificationStatus.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIdentifier) { + output.WriteRawTag(10); + output.WriteString(Identifier); + } + transform_.WriteTo(output, _repeated_transform_codec); + if (HasAlignment) { + output.WriteRawTag(24); + output.WriteEnum((int) Alignment); + } + if (geometry_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Geometry); + } + if (center_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Center); + } + if (extent_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Extent); + } + if (HasClassificationSupported) { + output.WriteRawTag(56); + output.WriteBool(ClassificationSupported); + } + if (HasClassification) { + output.WriteRawTag(64); + output.WriteEnum((int) Classification); + } + if (HasClassificationStatus) { + output.WriteRawTag(72); + output.WriteEnum((int) ClassificationStatus); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIdentifier) { + output.WriteRawTag(10); + output.WriteString(Identifier); + } + transform_.WriteTo(ref output, _repeated_transform_codec); + if (HasAlignment) { + output.WriteRawTag(24); + output.WriteEnum((int) Alignment); + } + if (geometry_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Geometry); + } + if (center_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Center); + } + if (extent_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Extent); + } + if (HasClassificationSupported) { + output.WriteRawTag(56); + output.WriteBool(ClassificationSupported); + } + if (HasClassification) { + output.WriteRawTag(64); + output.WriteEnum((int) Classification); + } + if (HasClassificationStatus) { + output.WriteRawTag(72); + output.WriteEnum((int) ClassificationStatus); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIdentifier) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Identifier); + } + size += transform_.CalculateSize(_repeated_transform_codec); + if (HasAlignment) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Alignment); + } + if (geometry_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Geometry); + } + if (center_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Center); + } + if (extent_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Extent); + } + if (HasClassificationSupported) { + size += 1 + 1; + } + if (HasClassification) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Classification); + } + if (HasClassificationStatus) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ClassificationStatus); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARPlaneAnchor other) { + if (other == null) { + return; + } + if (other.HasIdentifier) { + Identifier = other.Identifier; + } + transform_.Add(other.transform_); + if (other.HasAlignment) { + Alignment = other.Alignment; + } + if (other.geometry_ != null) { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARPlaneGeometry(); + } + Geometry.MergeFrom(other.Geometry); + } + if (other.center_ != null) { + if (center_ == null) { + Center = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + Center.MergeFrom(other.Center); + } + if (other.extent_ != null) { + if (extent_ == null) { + Extent = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + Extent.MergeFrom(other.Extent); + } + if (other.HasClassificationSupported) { + ClassificationSupported = other.ClassificationSupported; + } + if (other.HasClassification) { + Classification = other.Classification; + } + if (other.HasClassificationStatus) { + ClassificationStatus = other.ClassificationStatus; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Identifier = input.ReadString(); + break; + } + case 18: + case 21: { + transform_.AddEntriesFrom(input, _repeated_transform_codec); + break; + } + case 24: { + Alignment = (global::Mediapipe.ARPlaneAnchor.Types.Alignment) input.ReadEnum(); + break; + } + case 34: { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARPlaneGeometry(); + } + input.ReadMessage(Geometry); + break; + } + case 42: { + if (center_ == null) { + Center = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + input.ReadMessage(Center); + break; + } + case 50: { + if (extent_ == null) { + Extent = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + input.ReadMessage(Extent); + break; + } + case 56: { + ClassificationSupported = input.ReadBool(); + break; + } + case 64: { + Classification = (global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification) input.ReadEnum(); + break; + } + case 72: { + ClassificationStatus = (global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Identifier = input.ReadString(); + break; + } + case 18: + case 21: { + transform_.AddEntriesFrom(ref input, _repeated_transform_codec); + break; + } + case 24: { + Alignment = (global::Mediapipe.ARPlaneAnchor.Types.Alignment) input.ReadEnum(); + break; + } + case 34: { + if (geometry_ == null) { + Geometry = new global::Mediapipe.ARPlaneGeometry(); + } + input.ReadMessage(Geometry); + break; + } + case 42: { + if (center_ == null) { + Center = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + input.ReadMessage(Center); + break; + } + case 50: { + if (extent_ == null) { + Extent = new global::Mediapipe.ARPlaneAnchor.Types.PlaneVector(); + } + input.ReadMessage(Extent); + break; + } + case 56: { + ClassificationSupported = input.ReadBool(); + break; + } + case 64: { + Classification = (global::Mediapipe.ARPlaneAnchor.Types.PlaneClassification) input.ReadEnum(); + break; + } + case 72: { + ClassificationStatus = (global::Mediapipe.ARPlaneAnchor.Types.PlaneClassificationStatus) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARPlaneAnchor message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Alignment { + [pbr::OriginalName("UNDEFINED")] Undefined = 0, + /// + /// The plane is perpendicular to gravity. + /// + [pbr::OriginalName("HORIZONTAL")] Horizontal = 1, + /// + /// The plane is parallel to gravity. + /// + [pbr::OriginalName("VERTICAL")] Vertical = 2, + } + + public enum PlaneClassification { + [pbr::OriginalName("NONE")] None = 0, + [pbr::OriginalName("WALL")] Wall = 1, + [pbr::OriginalName("FLOOR")] Floor = 2, + [pbr::OriginalName("CEILING")] Ceiling = 3, + [pbr::OriginalName("TABLE")] Table = 4, + [pbr::OriginalName("SEAT")] Seat = 5, + } + + /// + /// The classification status for the plane. + /// + public enum PlaneClassificationStatus { + /// + /// The classfication process for the plane anchor has completed but the + /// result is inconclusive. + /// + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + /// + /// No classication information can be provided (set on error or if the + /// device does not support plane classification). + /// + [pbr::OriginalName("UNAVAILABLE")] Unavailable = 1, + /// + /// The classification process has not completed. + /// + [pbr::OriginalName("UNDETERMINED")] Undetermined = 2, + /// + /// The classfication process for the plane anchor has completed. + /// + [pbr::OriginalName("KNOWN")] Known = 3, + } + + /// + /// Wrapper for a 3D point / vector within the plane. See extent and center + /// values for more information. + /// + public sealed partial class PlaneVector : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlaneVector()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARPlaneAnchor.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PlaneVector() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PlaneVector(PlaneVector other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PlaneVector Clone() { + return new PlaneVector(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PlaneVector); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PlaneVector other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PlaneVector other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// A collection of points in the world coordinate space. + /// See https://developer.apple.com/documentation/arkit/arpointcloud for more + /// information. + /// + public sealed partial class ARPointCloud : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARPointCloud()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPointCloud() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPointCloud(ARPointCloud other) : this() { + _hasBits0 = other._hasBits0; + count_ = other.count_; + point_ = other.point_.Clone(); + identifier_ = other.identifier_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARPointCloud Clone() { + return new ARPointCloud(this); + } + + /// Field number for the "count" field. + public const int CountFieldNumber = 1; + private readonly static int CountDefaultValue = 0; + + private int count_; + /// + /// The number of points in the cloud. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Count { + get { if ((_hasBits0 & 1) != 0) { return count_; } else { return CountDefaultValue; } } + set { + _hasBits0 |= 1; + count_ = value; + } + } + /// Gets whether the "count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCount { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCount() { + _hasBits0 &= ~1; + } + + /// Field number for the "point" field. + public const int PointFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_point_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.ARPointCloud.Types.Point.Parser); + private readonly pbc::RepeatedField point_ = new pbc::RepeatedField(); + /// + /// The list of detected points. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Point { + get { return point_; } + } + + /// Field number for the "identifier" field. + public const int IdentifierFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_identifier_codec + = pb::FieldCodec.ForInt64(26); + private readonly pbc::RepeatedField identifier_ = new pbc::RepeatedField(); + /// + /// A list of unique identifiers corresponding to detected feature points. + /// Each identifier in this list corresponds to the point at the same index + /// in the points array. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Identifier { + get { return identifier_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARPointCloud); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARPointCloud other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Count != other.Count) return false; + if(!point_.Equals(other.point_)) return false; + if(!identifier_.Equals(other.identifier_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCount) hash ^= Count.GetHashCode(); + hash ^= point_.GetHashCode(); + hash ^= identifier_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCount) { + output.WriteRawTag(8); + output.WriteInt32(Count); + } + point_.WriteTo(output, _repeated_point_codec); + identifier_.WriteTo(output, _repeated_identifier_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCount) { + output.WriteRawTag(8); + output.WriteInt32(Count); + } + point_.WriteTo(ref output, _repeated_point_codec); + identifier_.WriteTo(ref output, _repeated_identifier_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCount) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Count); + } + size += point_.CalculateSize(_repeated_point_codec); + size += identifier_.CalculateSize(_repeated_identifier_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARPointCloud other) { + if (other == null) { + return; + } + if (other.HasCount) { + Count = other.Count; + } + point_.Add(other.point_); + identifier_.Add(other.identifier_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Count = input.ReadInt32(); + break; + } + case 18: { + point_.AddEntriesFrom(input, _repeated_point_codec); + break; + } + case 26: + case 24: { + identifier_.AddEntriesFrom(input, _repeated_identifier_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Count = input.ReadInt32(); + break; + } + case 18: { + point_.AddEntriesFrom(ref input, _repeated_point_codec); + break; + } + case 26: + case 24: { + identifier_.AddEntriesFrom(ref input, _repeated_identifier_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ARPointCloud message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Point : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Point()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARPointCloud.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point(Point other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point Clone() { + return new Point(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private readonly static float ZDefaultValue = 0F; + + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { if ((_hasBits0 & 4) != 0) { return z_; } else { return ZDefaultValue; } } + set { + _hasBits0 |= 4; + z_ = value; + } + } + /// Gets whether the "z" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasZ { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "z" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearZ() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Point); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Point other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasZ) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasZ) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasZ) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Point other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasZ) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Video image and face position tracking information. + /// See developer.apple.com/documentation/arkit/arframe for more information. + /// + public sealed partial class ARFrame : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ARFrame()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ARCaptureMetadataReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFrame() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFrame(ARFrame other) : this() { + _hasBits0 = other._hasBits0; + timestamp_ = other.timestamp_; + depthData_ = other.depthData_ != null ? other.depthData_.Clone() : null; + depthDataTimestamp_ = other.depthDataTimestamp_; + camera_ = other.camera_ != null ? other.camera_.Clone() : null; + lightEstimate_ = other.lightEstimate_ != null ? other.lightEstimate_.Clone() : null; + faceAnchor_ = other.faceAnchor_ != null ? other.faceAnchor_.Clone() : null; + planeAnchor_ = other.planeAnchor_.Clone(); + rawFeaturePoints_ = other.rawFeaturePoints_ != null ? other.rawFeaturePoints_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ARFrame Clone() { + return new ARFrame(this); + } + + /// Field number for the "timestamp" field. + public const int TimestampFieldNumber = 1; + private readonly static double TimestampDefaultValue = 0D; + + private double timestamp_; + /// + /// The timestamp for the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Timestamp { + get { if ((_hasBits0 & 1) != 0) { return timestamp_; } else { return TimestampDefaultValue; } } + set { + _hasBits0 |= 1; + timestamp_ = value; + } + } + /// Gets whether the "timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestamp { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestamp() { + _hasBits0 &= ~1; + } + + /// Field number for the "depth_data" field. + public const int DepthDataFieldNumber = 2; + private global::Mediapipe.AVDepthData depthData_; + /// + /// The depth data associated with the frame. Not all frames have depth data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AVDepthData DepthData { + get { return depthData_; } + set { + depthData_ = value; + } + } + + /// Field number for the "depth_data_timestamp" field. + public const int DepthDataTimestampFieldNumber = 3; + private readonly static double DepthDataTimestampDefaultValue = 0D; + + private double depthDataTimestamp_; + /// + /// The depth data object timestamp associated with the frame. May differ from + /// the frame timestamp value. Is only set when the frame has depth_data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DepthDataTimestamp { + get { if ((_hasBits0 & 2) != 0) { return depthDataTimestamp_; } else { return DepthDataTimestampDefaultValue; } } + set { + _hasBits0 |= 2; + depthDataTimestamp_ = value; + } + } + /// Gets whether the "depth_data_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDepthDataTimestamp { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "depth_data_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDepthDataTimestamp() { + _hasBits0 &= ~2; + } + + /// Field number for the "camera" field. + public const int CameraFieldNumber = 4; + private global::Mediapipe.ARCamera camera_; + /// + /// Camera information associated with the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARCamera Camera { + get { return camera_; } + set { + camera_ = value; + } + } + + /// Field number for the "light_estimate" field. + public const int LightEstimateFieldNumber = 5; + private global::Mediapipe.ARLightEstimate lightEstimate_; + /// + /// Light information associated with the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARLightEstimate LightEstimate { + get { return lightEstimate_; } + set { + lightEstimate_ = value; + } + } + + /// Field number for the "face_anchor" field. + public const int FaceAnchorFieldNumber = 6; + private global::Mediapipe.ARFaceAnchor faceAnchor_; + /// + /// Face anchor information associated with the frame. Not all frames have an + /// active face anchor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARFaceAnchor FaceAnchor { + get { return faceAnchor_; } + set { + faceAnchor_ = value; + } + } + + /// Field number for the "plane_anchor" field. + public const int PlaneAnchorFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_planeAnchor_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.ARPlaneAnchor.Parser); + private readonly pbc::RepeatedField planeAnchor_ = new pbc::RepeatedField(); + /// + /// Plane anchors associated with the frame. Not all frames have a plane + /// anchor. Plane anchors and face anchors are mutually exclusive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PlaneAnchor { + get { return planeAnchor_; } + } + + /// Field number for the "raw_feature_points" field. + public const int RawFeaturePointsFieldNumber = 8; + private global::Mediapipe.ARPointCloud rawFeaturePoints_; + /// + /// The current intermediate results of the scene analysis used to perform + /// world tracking. + /// See + /// https://developer.apple.com/documentation/arkit/arframe/2887449-rawfeaturepoints + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARPointCloud RawFeaturePoints { + get { return rawFeaturePoints_; } + set { + rawFeaturePoints_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ARFrame); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ARFrame other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Timestamp, other.Timestamp)) return false; + if (!object.Equals(DepthData, other.DepthData)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DepthDataTimestamp, other.DepthDataTimestamp)) return false; + if (!object.Equals(Camera, other.Camera)) return false; + if (!object.Equals(LightEstimate, other.LightEstimate)) return false; + if (!object.Equals(FaceAnchor, other.FaceAnchor)) return false; + if(!planeAnchor_.Equals(other.planeAnchor_)) return false; + if (!object.Equals(RawFeaturePoints, other.RawFeaturePoints)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTimestamp) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Timestamp); + if (depthData_ != null) hash ^= DepthData.GetHashCode(); + if (HasDepthDataTimestamp) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DepthDataTimestamp); + if (camera_ != null) hash ^= Camera.GetHashCode(); + if (lightEstimate_ != null) hash ^= LightEstimate.GetHashCode(); + if (faceAnchor_ != null) hash ^= FaceAnchor.GetHashCode(); + hash ^= planeAnchor_.GetHashCode(); + if (rawFeaturePoints_ != null) hash ^= RawFeaturePoints.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTimestamp) { + output.WriteRawTag(9); + output.WriteDouble(Timestamp); + } + if (depthData_ != null) { + output.WriteRawTag(18); + output.WriteMessage(DepthData); + } + if (HasDepthDataTimestamp) { + output.WriteRawTag(25); + output.WriteDouble(DepthDataTimestamp); + } + if (camera_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Camera); + } + if (lightEstimate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(LightEstimate); + } + if (faceAnchor_ != null) { + output.WriteRawTag(50); + output.WriteMessage(FaceAnchor); + } + planeAnchor_.WriteTo(output, _repeated_planeAnchor_codec); + if (rawFeaturePoints_ != null) { + output.WriteRawTag(66); + output.WriteMessage(RawFeaturePoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTimestamp) { + output.WriteRawTag(9); + output.WriteDouble(Timestamp); + } + if (depthData_ != null) { + output.WriteRawTag(18); + output.WriteMessage(DepthData); + } + if (HasDepthDataTimestamp) { + output.WriteRawTag(25); + output.WriteDouble(DepthDataTimestamp); + } + if (camera_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Camera); + } + if (lightEstimate_ != null) { + output.WriteRawTag(42); + output.WriteMessage(LightEstimate); + } + if (faceAnchor_ != null) { + output.WriteRawTag(50); + output.WriteMessage(FaceAnchor); + } + planeAnchor_.WriteTo(ref output, _repeated_planeAnchor_codec); + if (rawFeaturePoints_ != null) { + output.WriteRawTag(66); + output.WriteMessage(RawFeaturePoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTimestamp) { + size += 1 + 8; + } + if (depthData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DepthData); + } + if (HasDepthDataTimestamp) { + size += 1 + 8; + } + if (camera_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Camera); + } + if (lightEstimate_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LightEstimate); + } + if (faceAnchor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FaceAnchor); + } + size += planeAnchor_.CalculateSize(_repeated_planeAnchor_codec); + if (rawFeaturePoints_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RawFeaturePoints); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ARFrame other) { + if (other == null) { + return; + } + if (other.HasTimestamp) { + Timestamp = other.Timestamp; + } + if (other.depthData_ != null) { + if (depthData_ == null) { + DepthData = new global::Mediapipe.AVDepthData(); + } + DepthData.MergeFrom(other.DepthData); + } + if (other.HasDepthDataTimestamp) { + DepthDataTimestamp = other.DepthDataTimestamp; + } + if (other.camera_ != null) { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + Camera.MergeFrom(other.Camera); + } + if (other.lightEstimate_ != null) { + if (lightEstimate_ == null) { + LightEstimate = new global::Mediapipe.ARLightEstimate(); + } + LightEstimate.MergeFrom(other.LightEstimate); + } + if (other.faceAnchor_ != null) { + if (faceAnchor_ == null) { + FaceAnchor = new global::Mediapipe.ARFaceAnchor(); + } + FaceAnchor.MergeFrom(other.FaceAnchor); + } + planeAnchor_.Add(other.planeAnchor_); + if (other.rawFeaturePoints_ != null) { + if (rawFeaturePoints_ == null) { + RawFeaturePoints = new global::Mediapipe.ARPointCloud(); + } + RawFeaturePoints.MergeFrom(other.RawFeaturePoints); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + Timestamp = input.ReadDouble(); + break; + } + case 18: { + if (depthData_ == null) { + DepthData = new global::Mediapipe.AVDepthData(); + } + input.ReadMessage(DepthData); + break; + } + case 25: { + DepthDataTimestamp = input.ReadDouble(); + break; + } + case 34: { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + input.ReadMessage(Camera); + break; + } + case 42: { + if (lightEstimate_ == null) { + LightEstimate = new global::Mediapipe.ARLightEstimate(); + } + input.ReadMessage(LightEstimate); + break; + } + case 50: { + if (faceAnchor_ == null) { + FaceAnchor = new global::Mediapipe.ARFaceAnchor(); + } + input.ReadMessage(FaceAnchor); + break; + } + case 58: { + planeAnchor_.AddEntriesFrom(input, _repeated_planeAnchor_codec); + break; + } + case 66: { + if (rawFeaturePoints_ == null) { + RawFeaturePoints = new global::Mediapipe.ARPointCloud(); + } + input.ReadMessage(RawFeaturePoints); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Timestamp = input.ReadDouble(); + break; + } + case 18: { + if (depthData_ == null) { + DepthData = new global::Mediapipe.AVDepthData(); + } + input.ReadMessage(DepthData); + break; + } + case 25: { + DepthDataTimestamp = input.ReadDouble(); + break; + } + case 34: { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + input.ReadMessage(Camera); + break; + } + case 42: { + if (lightEstimate_ == null) { + LightEstimate = new global::Mediapipe.ARLightEstimate(); + } + input.ReadMessage(LightEstimate); + break; + } + case 50: { + if (faceAnchor_ == null) { + FaceAnchor = new global::Mediapipe.ARFaceAnchor(); + } + input.ReadMessage(FaceAnchor); + break; + } + case 58: { + planeAnchor_.AddEntriesFrom(ref input, _repeated_planeAnchor_codec); + break; + } + case 66: { + if (rawFeaturePoints_ == null) { + RawFeaturePoints = new global::Mediapipe.ARPointCloud(); + } + input.ReadMessage(RawFeaturePoints); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs.meta new file mode 100644 index 0000000..034c35d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/ARCaptureMetadata.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4facbf66687417bca38efde0cd05615 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs new file mode 100644 index 0000000..a05e639 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs @@ -0,0 +1,1877 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/annotation_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/annotation_data.proto + public static partial class AnnotationDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/annotation_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AnnotationDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj1tZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvYW5u", + "b3RhdGlvbl9kYXRhLnByb3RvEgltZWRpYXBpcGUaQm1lZGlhcGlwZS9tb2R1", + "bGVzL29iamVjdHJvbi9jYWxjdWxhdG9ycy9hX3JfY2FwdHVyZV9tZXRhZGF0", + "YS5wcm90bxo0bWVkaWFwaXBlL21vZHVsZXMvb2JqZWN0cm9uL2NhbGN1bGF0", + "b3JzL29iamVjdC5wcm90byI4ChFOb3JtYWxpemVkUG9pbnQyRBIJCgF4GAEg", + "ASgCEgkKAXkYAiABKAISDQoFZGVwdGgYAyABKAIiKgoHUG9pbnQzRBIJCgF4", + "GAEgASgCEgkKAXkYAiABKAISCQoBehgDIAEoAiKFAQoRQW5ub3RhdGVkS2V5", + "UG9pbnQSCgoCaWQYASABKAUSJAoIcG9pbnRfM2QYAiABKAsyEi5tZWRpYXBp", + "cGUuUG9pbnQzRBIuCghwb2ludF8yZBgDIAEoCzIcLm1lZGlhcGlwZS5Ob3Jt", + "YWxpemVkUG9pbnQyRBIOCgZoaWRkZW4YBCABKAgioAEKEE9iamVjdEFubm90", + "YXRpb24SEQoJb2JqZWN0X2lkGAEgASgFEi8KCWtleXBvaW50cxgCIAMoCzIc", + "Lm1lZGlhcGlwZS5Bbm5vdGF0ZWRLZXlQb2ludBISCgp2aXNpYmlsaXR5GAMg", + "ASgCEhAKCHJvdGF0aW9uGAQgAygCEhMKC3RyYW5zbGF0aW9uGAUgAygCEg0K", + "BXNjYWxlGAYgAygCIrkBCg9GcmFtZUFubm90YXRpb24SEAoIZnJhbWVfaWQY", + "ASABKAUSMAoLYW5ub3RhdGlvbnMYAiADKAsyGy5tZWRpYXBpcGUuT2JqZWN0", + "QW5ub3RhdGlvbhIjCgZjYW1lcmEYAyABKAsyEy5tZWRpYXBpcGUuQVJDYW1l", + "cmESEQoJdGltZXN0YW1wGAQgASgBEhQKDHBsYW5lX2NlbnRlchgFIAMoAhIU", + "CgxwbGFuZV9ub3JtYWwYBiADKAIiZQoIU2VxdWVuY2USIgoHb2JqZWN0cxgB", + "IAMoCzIRLm1lZGlhcGlwZS5PYmplY3QSNQoRZnJhbWVfYW5ub3RhdGlvbnMY", + "AiADKAsyGi5tZWRpYXBpcGUuRnJhbWVBbm5vdGF0aW9uYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.ARCaptureMetadataReflection.Descriptor, global::Mediapipe.ObjectReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.NormalizedPoint2D), global::Mediapipe.NormalizedPoint2D.Parser, new[]{ "X", "Y", "Depth" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Point3D), global::Mediapipe.Point3D.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AnnotatedKeyPoint), global::Mediapipe.AnnotatedKeyPoint.Parser, new[]{ "Id", "Point3D", "Point2D", "Hidden" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ObjectAnnotation), global::Mediapipe.ObjectAnnotation.Parser, new[]{ "ObjectId", "Keypoints", "Visibility", "Rotation", "Translation", "Scale" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameAnnotation), global::Mediapipe.FrameAnnotation.Parser, new[]{ "FrameId", "Annotations", "Camera", "Timestamp", "PlaneCenter", "PlaneNormal" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Sequence), global::Mediapipe.Sequence.Parser, new[]{ "Objects", "FrameAnnotations" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Projection of a 3D point on an image, and its metric depth. + /// + public sealed partial class NormalizedPoint2D : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizedPoint2D()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedPoint2D() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedPoint2D(NormalizedPoint2D other) : this() { + x_ = other.x_; + y_ = other.y_; + depth_ = other.depth_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NormalizedPoint2D Clone() { + return new NormalizedPoint2D(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private float x_; + /// + /// x-y position of the 2d keypoint in the image coordinate system. + /// u,v \in [0, 1], where top left corner is (0, 0) and the bottom-right corner + /// is (1, 1). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { return x_; } + set { + x_ = value; + } + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { return y_; } + set { + y_ = value; + } + } + + /// Field number for the "depth" field. + public const int DepthFieldNumber = 3; + private float depth_; + /// + /// The depth of the point in the camera coordinate system (in meters). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Depth { + get { return depth_; } + set { + depth_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NormalizedPoint2D); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NormalizedPoint2D other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Depth, other.Depth)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (Depth != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Depth); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Depth != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Depth); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Depth != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Depth); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (X != 0F) { + size += 1 + 4; + } + if (Y != 0F) { + size += 1 + 4; + } + if (Depth != 0F) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NormalizedPoint2D other) { + if (other == null) { + return; + } + if (other.X != 0F) { + X = other.X; + } + if (other.Y != 0F) { + Y = other.Y; + } + if (other.Depth != 0F) { + Depth = other.Depth; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Depth = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Depth = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// The 3D point in the camera coordinate system, the scales are in meters. + /// + public sealed partial class Point3D : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Point3D()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point3D() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point3D(Point3D other) : this() { + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point3D Clone() { + return new Point3D(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { return x_; } + set { + x_ = value; + } + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { return y_; } + set { + y_ = value; + } + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { return z_; } + set { + z_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Point3D); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Point3D other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (Z != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Z != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Z != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (X != 0F) { + size += 1 + 4; + } + if (Y != 0F) { + size += 1 + 4; + } + if (Z != 0F) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Point3D other) { + if (other == null) { + return; + } + if (other.X != 0F) { + X = other.X; + } + if (other.Y != 0F) { + Y = other.Y; + } + if (other.Z != 0F) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class AnnotatedKeyPoint : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AnnotatedKeyPoint()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotatedKeyPoint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotatedKeyPoint(AnnotatedKeyPoint other) : this() { + id_ = other.id_; + point3D_ = other.point3D_ != null ? other.point3D_.Clone() : null; + point2D_ = other.point2D_ != null ? other.point2D_.Clone() : null; + hidden_ = other.hidden_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AnnotatedKeyPoint Clone() { + return new AnnotatedKeyPoint(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private int id_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "point_3d" field. + public const int Point3DFieldNumber = 2; + private global::Mediapipe.Point3D point3D_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Point3D Point3D { + get { return point3D_; } + set { + point3D_ = value; + } + } + + /// Field number for the "point_2d" field. + public const int Point2DFieldNumber = 3; + private global::Mediapipe.NormalizedPoint2D point2D_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.NormalizedPoint2D Point2D { + get { return point2D_; } + set { + point2D_ = value; + } + } + + /// Field number for the "hidden" field. + public const int HiddenFieldNumber = 4; + private bool hidden_; + /// + /// Indicates whether this keypoint is hidden or not. The hidden attribute is + /// determined from the object's skeleton. For box model, none of the keypoints + /// are hidden. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Hidden { + get { return hidden_; } + set { + hidden_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AnnotatedKeyPoint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AnnotatedKeyPoint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(Point3D, other.Point3D)) return false; + if (!object.Equals(Point2D, other.Point2D)) return false; + if (Hidden != other.Hidden) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Id != 0) hash ^= Id.GetHashCode(); + if (point3D_ != null) hash ^= Point3D.GetHashCode(); + if (point2D_ != null) hash ^= Point2D.GetHashCode(); + if (Hidden != false) hash ^= Hidden.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id != 0) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (point3D_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Point3D); + } + if (point2D_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Point2D); + } + if (Hidden != false) { + output.WriteRawTag(32); + output.WriteBool(Hidden); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id != 0) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (point3D_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Point3D); + } + if (point2D_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Point2D); + } + if (Hidden != false) { + output.WriteRawTag(32); + output.WriteBool(Hidden); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Id != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (point3D_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Point3D); + } + if (point2D_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Point2D); + } + if (Hidden != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AnnotatedKeyPoint other) { + if (other == null) { + return; + } + if (other.Id != 0) { + Id = other.Id; + } + if (other.point3D_ != null) { + if (point3D_ == null) { + Point3D = new global::Mediapipe.Point3D(); + } + Point3D.MergeFrom(other.Point3D); + } + if (other.point2D_ != null) { + if (point2D_ == null) { + Point2D = new global::Mediapipe.NormalizedPoint2D(); + } + Point2D.MergeFrom(other.Point2D); + } + if (other.Hidden != false) { + Hidden = other.Hidden; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + if (point3D_ == null) { + Point3D = new global::Mediapipe.Point3D(); + } + input.ReadMessage(Point3D); + break; + } + case 26: { + if (point2D_ == null) { + Point2D = new global::Mediapipe.NormalizedPoint2D(); + } + input.ReadMessage(Point2D); + break; + } + case 32: { + Hidden = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + if (point3D_ == null) { + Point3D = new global::Mediapipe.Point3D(); + } + input.ReadMessage(Point3D); + break; + } + case 26: { + if (point2D_ == null) { + Point2D = new global::Mediapipe.NormalizedPoint2D(); + } + input.ReadMessage(Point2D); + break; + } + case 32: { + Hidden = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ObjectAnnotation : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ObjectAnnotation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ObjectAnnotation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ObjectAnnotation(ObjectAnnotation other) : this() { + objectId_ = other.objectId_; + keypoints_ = other.keypoints_.Clone(); + visibility_ = other.visibility_; + rotation_ = other.rotation_.Clone(); + translation_ = other.translation_.Clone(); + scale_ = other.scale_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ObjectAnnotation Clone() { + return new ObjectAnnotation(this); + } + + /// Field number for the "object_id" field. + public const int ObjectIdFieldNumber = 1; + private int objectId_; + /// + /// Reference to the object identifier in ObjectInstance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ObjectId { + get { return objectId_; } + set { + objectId_ = value; + } + } + + /// Field number for the "keypoints" field. + public const int KeypointsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_keypoints_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.AnnotatedKeyPoint.Parser); + private readonly pbc::RepeatedField keypoints_ = new pbc::RepeatedField(); + /// + /// For each objects, list all the annotated keypoints here. + /// E.g. for bounding-boxes, we have 8 keypoints, hands = 21 keypoints, etc. + /// These normalized points are the projection of the Object's 3D keypoint + /// on the current frame's camera poses. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Keypoints { + get { return keypoints_; } + } + + /// Field number for the "visibility" field. + public const int VisibilityFieldNumber = 3; + private float visibility_; + /// + /// Visibiity of this annotation in a frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Visibility { + get { return visibility_; } + set { + visibility_ = value; + } + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_rotation_codec + = pb::FieldCodec.ForFloat(34); + private readonly pbc::RepeatedField rotation_ = new pbc::RepeatedField(); + /// + /// 3x3 row-major rotation matrix describing the orientation of the rigid + /// object's frame of reference in the camera-coordinate system. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Rotation { + get { return rotation_; } + } + + /// Field number for the "translation" field. + public const int TranslationFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_translation_codec + = pb::FieldCodec.ForFloat(42); + private readonly pbc::RepeatedField translation_ = new pbc::RepeatedField(); + /// + /// 3x1 vector describing the translation of the rigid object's frame of + /// reference in the camera-coordinate system in meters. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Translation { + get { return translation_; } + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_scale_codec + = pb::FieldCodec.ForFloat(50); + private readonly pbc::RepeatedField scale_ = new pbc::RepeatedField(); + /// + /// 3x1 vector describing the scale of the rigid object's frame of reference in + /// the camera-coordinate system. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Scale { + get { return scale_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ObjectAnnotation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ObjectAnnotation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ObjectId != other.ObjectId) return false; + if(!keypoints_.Equals(other.keypoints_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Visibility, other.Visibility)) return false; + if(!rotation_.Equals(other.rotation_)) return false; + if(!translation_.Equals(other.translation_)) return false; + if(!scale_.Equals(other.scale_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ObjectId != 0) hash ^= ObjectId.GetHashCode(); + hash ^= keypoints_.GetHashCode(); + if (Visibility != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Visibility); + hash ^= rotation_.GetHashCode(); + hash ^= translation_.GetHashCode(); + hash ^= scale_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ObjectId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ObjectId); + } + keypoints_.WriteTo(output, _repeated_keypoints_codec); + if (Visibility != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Visibility); + } + rotation_.WriteTo(output, _repeated_rotation_codec); + translation_.WriteTo(output, _repeated_translation_codec); + scale_.WriteTo(output, _repeated_scale_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ObjectId != 0) { + output.WriteRawTag(8); + output.WriteInt32(ObjectId); + } + keypoints_.WriteTo(ref output, _repeated_keypoints_codec); + if (Visibility != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Visibility); + } + rotation_.WriteTo(ref output, _repeated_rotation_codec); + translation_.WriteTo(ref output, _repeated_translation_codec); + scale_.WriteTo(ref output, _repeated_scale_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ObjectId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ObjectId); + } + size += keypoints_.CalculateSize(_repeated_keypoints_codec); + if (Visibility != 0F) { + size += 1 + 4; + } + size += rotation_.CalculateSize(_repeated_rotation_codec); + size += translation_.CalculateSize(_repeated_translation_codec); + size += scale_.CalculateSize(_repeated_scale_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ObjectAnnotation other) { + if (other == null) { + return; + } + if (other.ObjectId != 0) { + ObjectId = other.ObjectId; + } + keypoints_.Add(other.keypoints_); + if (other.Visibility != 0F) { + Visibility = other.Visibility; + } + rotation_.Add(other.rotation_); + translation_.Add(other.translation_); + scale_.Add(other.scale_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ObjectId = input.ReadInt32(); + break; + } + case 18: { + keypoints_.AddEntriesFrom(input, _repeated_keypoints_codec); + break; + } + case 29: { + Visibility = input.ReadFloat(); + break; + } + case 34: + case 37: { + rotation_.AddEntriesFrom(input, _repeated_rotation_codec); + break; + } + case 42: + case 45: { + translation_.AddEntriesFrom(input, _repeated_translation_codec); + break; + } + case 50: + case 53: { + scale_.AddEntriesFrom(input, _repeated_scale_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ObjectId = input.ReadInt32(); + break; + } + case 18: { + keypoints_.AddEntriesFrom(ref input, _repeated_keypoints_codec); + break; + } + case 29: { + Visibility = input.ReadFloat(); + break; + } + case 34: + case 37: { + rotation_.AddEntriesFrom(ref input, _repeated_rotation_codec); + break; + } + case 42: + case 45: { + translation_.AddEntriesFrom(ref input, _repeated_translation_codec); + break; + } + case 50: + case 53: { + scale_.AddEntriesFrom(ref input, _repeated_scale_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class FrameAnnotation : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameAnnotation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotation(FrameAnnotation other) : this() { + frameId_ = other.frameId_; + annotations_ = other.annotations_.Clone(); + camera_ = other.camera_ != null ? other.camera_.Clone() : null; + timestamp_ = other.timestamp_; + planeCenter_ = other.planeCenter_.Clone(); + planeNormal_ = other.planeNormal_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotation Clone() { + return new FrameAnnotation(this); + } + + /// Field number for the "frame_id" field. + public const int FrameIdFieldNumber = 1; + private int frameId_; + /// + /// Unique frame id, corresponds to images. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameId { + get { return frameId_; } + set { + frameId_ = value; + } + } + + /// Field number for the "annotations" field. + public const int AnnotationsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_annotations_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.ObjectAnnotation.Parser); + private readonly pbc::RepeatedField annotations_ = new pbc::RepeatedField(); + /// + /// List of the annotated objects in this frame. Depending on how many object + /// are observable in this frame, we might have non or as much as + /// sequence.objects_size() annotations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Annotations { + get { return annotations_; } + } + + /// Field number for the "camera" field. + public const int CameraFieldNumber = 3; + private global::Mediapipe.ARCamera camera_; + /// + /// Information about the camera transformation (in the world coordinate) and + /// imaging characteristics for a captured video frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ARCamera Camera { + get { return camera_; } + set { + camera_ = value; + } + } + + /// Field number for the "timestamp" field. + public const int TimestampFieldNumber = 4; + private double timestamp_; + /// + /// The timestamp for the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Timestamp { + get { return timestamp_; } + set { + timestamp_ = value; + } + } + + /// Field number for the "plane_center" field. + public const int PlaneCenterFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_planeCenter_codec + = pb::FieldCodec.ForFloat(42); + private readonly pbc::RepeatedField planeCenter_ = new pbc::RepeatedField(); + /// + /// Plane center and normal in camera frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PlaneCenter { + get { return planeCenter_; } + } + + /// Field number for the "plane_normal" field. + public const int PlaneNormalFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_planeNormal_codec + = pb::FieldCodec.ForFloat(50); + private readonly pbc::RepeatedField planeNormal_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PlaneNormal { + get { return planeNormal_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameAnnotation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameAnnotation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FrameId != other.FrameId) return false; + if(!annotations_.Equals(other.annotations_)) return false; + if (!object.Equals(Camera, other.Camera)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Timestamp, other.Timestamp)) return false; + if(!planeCenter_.Equals(other.planeCenter_)) return false; + if(!planeNormal_.Equals(other.planeNormal_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (FrameId != 0) hash ^= FrameId.GetHashCode(); + hash ^= annotations_.GetHashCode(); + if (camera_ != null) hash ^= Camera.GetHashCode(); + if (Timestamp != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Timestamp); + hash ^= planeCenter_.GetHashCode(); + hash ^= planeNormal_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FrameId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FrameId); + } + annotations_.WriteTo(output, _repeated_annotations_codec); + if (camera_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Camera); + } + if (Timestamp != 0D) { + output.WriteRawTag(33); + output.WriteDouble(Timestamp); + } + planeCenter_.WriteTo(output, _repeated_planeCenter_codec); + planeNormal_.WriteTo(output, _repeated_planeNormal_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FrameId != 0) { + output.WriteRawTag(8); + output.WriteInt32(FrameId); + } + annotations_.WriteTo(ref output, _repeated_annotations_codec); + if (camera_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Camera); + } + if (Timestamp != 0D) { + output.WriteRawTag(33); + output.WriteDouble(Timestamp); + } + planeCenter_.WriteTo(ref output, _repeated_planeCenter_codec); + planeNormal_.WriteTo(ref output, _repeated_planeNormal_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (FrameId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameId); + } + size += annotations_.CalculateSize(_repeated_annotations_codec); + if (camera_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Camera); + } + if (Timestamp != 0D) { + size += 1 + 8; + } + size += planeCenter_.CalculateSize(_repeated_planeCenter_codec); + size += planeNormal_.CalculateSize(_repeated_planeNormal_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameAnnotation other) { + if (other == null) { + return; + } + if (other.FrameId != 0) { + FrameId = other.FrameId; + } + annotations_.Add(other.annotations_); + if (other.camera_ != null) { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + Camera.MergeFrom(other.Camera); + } + if (other.Timestamp != 0D) { + Timestamp = other.Timestamp; + } + planeCenter_.Add(other.planeCenter_); + planeNormal_.Add(other.planeNormal_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FrameId = input.ReadInt32(); + break; + } + case 18: { + annotations_.AddEntriesFrom(input, _repeated_annotations_codec); + break; + } + case 26: { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + input.ReadMessage(Camera); + break; + } + case 33: { + Timestamp = input.ReadDouble(); + break; + } + case 42: + case 45: { + planeCenter_.AddEntriesFrom(input, _repeated_planeCenter_codec); + break; + } + case 50: + case 53: { + planeNormal_.AddEntriesFrom(input, _repeated_planeNormal_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FrameId = input.ReadInt32(); + break; + } + case 18: { + annotations_.AddEntriesFrom(ref input, _repeated_annotations_codec); + break; + } + case 26: { + if (camera_ == null) { + Camera = new global::Mediapipe.ARCamera(); + } + input.ReadMessage(Camera); + break; + } + case 33: { + Timestamp = input.ReadDouble(); + break; + } + case 42: + case 45: { + planeCenter_.AddEntriesFrom(ref input, _repeated_planeCenter_codec); + break; + } + case 50: + case 53: { + planeNormal_.AddEntriesFrom(ref input, _repeated_planeNormal_codec); + break; + } + } + } + } + #endif + + } + + /// + /// The sequence protocol contains the annotation data for the entire video clip. + /// + public sealed partial class Sequence : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Sequence()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AnnotationDataReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sequence() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sequence(Sequence other) : this() { + objects_ = other.objects_.Clone(); + frameAnnotations_ = other.frameAnnotations_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sequence Clone() { + return new Sequence(this); + } + + /// Field number for the "objects" field. + public const int ObjectsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_objects_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Object.Parser); + private readonly pbc::RepeatedField objects_ = new pbc::RepeatedField(); + /// + /// List of all the annotated 3D objects in this sequence in the world + /// Coordinate system. Given the camera poses of each frame (also in the + /// world-coordinate) these objects bounding boxes can be projected to each + /// frame to get the per-frame annotation (i.e. image_annotation below). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Objects { + get { return objects_; } + } + + /// Field number for the "frame_annotations" field. + public const int FrameAnnotationsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_frameAnnotations_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.FrameAnnotation.Parser); + private readonly pbc::RepeatedField frameAnnotations_ = new pbc::RepeatedField(); + /// + /// List of annotated data per each frame in sequence + frame information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField FrameAnnotations { + get { return frameAnnotations_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Sequence); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Sequence other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!objects_.Equals(other.objects_)) return false; + if(!frameAnnotations_.Equals(other.frameAnnotations_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= objects_.GetHashCode(); + hash ^= frameAnnotations_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + objects_.WriteTo(output, _repeated_objects_codec); + frameAnnotations_.WriteTo(output, _repeated_frameAnnotations_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + objects_.WriteTo(ref output, _repeated_objects_codec); + frameAnnotations_.WriteTo(ref output, _repeated_frameAnnotations_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += objects_.CalculateSize(_repeated_objects_codec); + size += frameAnnotations_.CalculateSize(_repeated_frameAnnotations_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Sequence other) { + if (other == null) { + return; + } + objects_.Add(other.objects_); + frameAnnotations_.Add(other.frameAnnotations_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + objects_.AddEntriesFrom(input, _repeated_objects_codec); + break; + } + case 18: { + frameAnnotations_.AddEntriesFrom(input, _repeated_frameAnnotations_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + objects_.AddEntriesFrom(ref input, _repeated_objects_codec); + break; + } + case 18: { + frameAnnotations_.AddEntriesFrom(ref input, _repeated_frameAnnotations_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs.meta new file mode 100644 index 0000000..77c0e97 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/AnnotationData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4f57edd5720360c5b5f915972c86488 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs new file mode 100644 index 0000000..6984816 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs @@ -0,0 +1,536 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/belief_decoder_config.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/belief_decoder_config.proto + public static partial class BeliefDecoderConfigReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/belief_decoder_config.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BeliefDecoderConfigReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkNtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvYmVs", + "aWVmX2RlY29kZXJfY29uZmlnLnByb3RvEgltZWRpYXBpcGUixAEKE0JlbGll", + "ZkRlY29kZXJDb25maWcSHgoRaGVhdG1hcF90aHJlc2hvbGQYASABKAI6AzAu", + "ORIeChJsb2NhbF9tYXhfZGlzdGFuY2UYAiABKAI6AjEwEiIKEW9mZnNldF9z", + "Y2FsZV9jb2VmGAMgASgCOgMwLjVCAhgBEhUKDXZvdGluZ19yYWRpdXMYBCAB", + "KAUSGAoQdm90aW5nX2FsbG93YW5jZRgFIAEoBRIYChB2b3RpbmdfdGhyZXNo", + "b2xkGAYgASgC")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BeliefDecoderConfig), global::Mediapipe.BeliefDecoderConfig.Parser, new[]{ "HeatmapThreshold", "LocalMaxDistance", "OffsetScaleCoef", "VotingRadius", "VotingAllowance", "VotingThreshold" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class BeliefDecoderConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BeliefDecoderConfig()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BeliefDecoderConfigReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BeliefDecoderConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BeliefDecoderConfig(BeliefDecoderConfig other) : this() { + _hasBits0 = other._hasBits0; + heatmapThreshold_ = other.heatmapThreshold_; + localMaxDistance_ = other.localMaxDistance_; + offsetScaleCoef_ = other.offsetScaleCoef_; + votingRadius_ = other.votingRadius_; + votingAllowance_ = other.votingAllowance_; + votingThreshold_ = other.votingThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BeliefDecoderConfig Clone() { + return new BeliefDecoderConfig(this); + } + + /// Field number for the "heatmap_threshold" field. + public const int HeatmapThresholdFieldNumber = 1; + private readonly static float HeatmapThresholdDefaultValue = 0.9F; + + private float heatmapThreshold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HeatmapThreshold { + get { if ((_hasBits0 & 1) != 0) { return heatmapThreshold_; } else { return HeatmapThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + heatmapThreshold_ = value; + } + } + /// Gets whether the "heatmap_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeatmapThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "heatmap_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeatmapThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "local_max_distance" field. + public const int LocalMaxDistanceFieldNumber = 2; + private readonly static float LocalMaxDistanceDefaultValue = 10F; + + private float localMaxDistance_; + /// + /// Maximum distance in pixels between two local max heatmap values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LocalMaxDistance { + get { if ((_hasBits0 & 2) != 0) { return localMaxDistance_; } else { return LocalMaxDistanceDefaultValue; } } + set { + _hasBits0 |= 2; + localMaxDistance_ = value; + } + } + /// Gets whether the "local_max_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLocalMaxDistance { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "local_max_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLocalMaxDistance() { + _hasBits0 &= ~2; + } + + /// Field number for the "offset_scale_coef" field. + public const int OffsetScaleCoefFieldNumber = 3; + private readonly static float OffsetScaleCoefDefaultValue = 0.5F; + + private float offsetScaleCoef_; + /// + /// Coefficient of offset_scale. + /// offset_scale = offset_scale_coef * min(rows, cols). + /// offset_scale is used to multiply the offset predictions from the network. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OffsetScaleCoef { + get { if ((_hasBits0 & 4) != 0) { return offsetScaleCoef_; } else { return OffsetScaleCoefDefaultValue; } } + set { + _hasBits0 |= 4; + offsetScaleCoef_ = value; + } + } + /// Gets whether the "offset_scale_coef" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOffsetScaleCoef { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "offset_scale_coef" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOffsetScaleCoef() { + _hasBits0 &= ~4; + } + + /// Field number for the "voting_radius" field. + public const int VotingRadiusFieldNumber = 4; + private readonly static int VotingRadiusDefaultValue = 0; + + private int votingRadius_; + /// + /// The radius for vertex voting. Use no voting if the radius is less than or + /// euqal to 1. Example: 10. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int VotingRadius { + get { if ((_hasBits0 & 8) != 0) { return votingRadius_; } else { return VotingRadiusDefaultValue; } } + set { + _hasBits0 |= 8; + votingRadius_ = value; + } + } + /// Gets whether the "voting_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVotingRadius { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "voting_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVotingRadius() { + _hasBits0 &= ~8; + } + + /// Field number for the "voting_allowance" field. + public const int VotingAllowanceFieldNumber = 5; + private readonly static int VotingAllowanceDefaultValue = 0; + + private int votingAllowance_; + /// + /// The number of pixels to determine whether two points are the same. + /// Example: 5 (voting_radius / 2). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int VotingAllowance { + get { if ((_hasBits0 & 16) != 0) { return votingAllowance_; } else { return VotingAllowanceDefaultValue; } } + set { + _hasBits0 |= 16; + votingAllowance_ = value; + } + } + /// Gets whether the "voting_allowance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVotingAllowance { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "voting_allowance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVotingAllowance() { + _hasBits0 &= ~16; + } + + /// Field number for the "voting_threshold" field. + public const int VotingThresholdFieldNumber = 6; + private readonly static float VotingThresholdDefaultValue = 0F; + + private float votingThreshold_; + /// + /// The threshold of beliefs, with which the points can vote. Example: 0.2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VotingThreshold { + get { if ((_hasBits0 & 32) != 0) { return votingThreshold_; } else { return VotingThresholdDefaultValue; } } + set { + _hasBits0 |= 32; + votingThreshold_ = value; + } + } + /// Gets whether the "voting_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVotingThreshold { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "voting_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVotingThreshold() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BeliefDecoderConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BeliefDecoderConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HeatmapThreshold, other.HeatmapThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LocalMaxDistance, other.LocalMaxDistance)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OffsetScaleCoef, other.OffsetScaleCoef)) return false; + if (VotingRadius != other.VotingRadius) return false; + if (VotingAllowance != other.VotingAllowance) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VotingThreshold, other.VotingThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasHeatmapThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HeatmapThreshold); + if (HasLocalMaxDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LocalMaxDistance); + if (HasOffsetScaleCoef) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OffsetScaleCoef); + if (HasVotingRadius) hash ^= VotingRadius.GetHashCode(); + if (HasVotingAllowance) hash ^= VotingAllowance.GetHashCode(); + if (HasVotingThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VotingThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasHeatmapThreshold) { + output.WriteRawTag(13); + output.WriteFloat(HeatmapThreshold); + } + if (HasLocalMaxDistance) { + output.WriteRawTag(21); + output.WriteFloat(LocalMaxDistance); + } + if (HasOffsetScaleCoef) { + output.WriteRawTag(29); + output.WriteFloat(OffsetScaleCoef); + } + if (HasVotingRadius) { + output.WriteRawTag(32); + output.WriteInt32(VotingRadius); + } + if (HasVotingAllowance) { + output.WriteRawTag(40); + output.WriteInt32(VotingAllowance); + } + if (HasVotingThreshold) { + output.WriteRawTag(53); + output.WriteFloat(VotingThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasHeatmapThreshold) { + output.WriteRawTag(13); + output.WriteFloat(HeatmapThreshold); + } + if (HasLocalMaxDistance) { + output.WriteRawTag(21); + output.WriteFloat(LocalMaxDistance); + } + if (HasOffsetScaleCoef) { + output.WriteRawTag(29); + output.WriteFloat(OffsetScaleCoef); + } + if (HasVotingRadius) { + output.WriteRawTag(32); + output.WriteInt32(VotingRadius); + } + if (HasVotingAllowance) { + output.WriteRawTag(40); + output.WriteInt32(VotingAllowance); + } + if (HasVotingThreshold) { + output.WriteRawTag(53); + output.WriteFloat(VotingThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasHeatmapThreshold) { + size += 1 + 4; + } + if (HasLocalMaxDistance) { + size += 1 + 4; + } + if (HasOffsetScaleCoef) { + size += 1 + 4; + } + if (HasVotingRadius) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VotingRadius); + } + if (HasVotingAllowance) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(VotingAllowance); + } + if (HasVotingThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BeliefDecoderConfig other) { + if (other == null) { + return; + } + if (other.HasHeatmapThreshold) { + HeatmapThreshold = other.HeatmapThreshold; + } + if (other.HasLocalMaxDistance) { + LocalMaxDistance = other.LocalMaxDistance; + } + if (other.HasOffsetScaleCoef) { + OffsetScaleCoef = other.OffsetScaleCoef; + } + if (other.HasVotingRadius) { + VotingRadius = other.VotingRadius; + } + if (other.HasVotingAllowance) { + VotingAllowance = other.VotingAllowance; + } + if (other.HasVotingThreshold) { + VotingThreshold = other.VotingThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + HeatmapThreshold = input.ReadFloat(); + break; + } + case 21: { + LocalMaxDistance = input.ReadFloat(); + break; + } + case 29: { + OffsetScaleCoef = input.ReadFloat(); + break; + } + case 32: { + VotingRadius = input.ReadInt32(); + break; + } + case 40: { + VotingAllowance = input.ReadInt32(); + break; + } + case 53: { + VotingThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + HeatmapThreshold = input.ReadFloat(); + break; + } + case 21: { + LocalMaxDistance = input.ReadFloat(); + break; + } + case 29: { + OffsetScaleCoef = input.ReadFloat(); + break; + } + case 32: { + VotingRadius = input.ReadInt32(); + break; + } + case 40: { + VotingAllowance = input.ReadInt32(); + break; + } + case 53: { + VotingThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs.meta new file mode 100644 index 0000000..45bd899 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/BeliefDecoderConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c57c54bc05f78c9f790236220a85e6c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs new file mode 100644 index 0000000..b2e12a5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs @@ -0,0 +1,565 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/camera_parameters.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/camera_parameters.proto + public static partial class CameraParametersReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/camera_parameters.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CameraParametersReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9tZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvY2Ft", + "ZXJhX3BhcmFtZXRlcnMucHJvdG8SCW1lZGlhcGlwZSLnAwoVQ2FtZXJhUGFy", + "YW1ldGVyc1Byb3RvEiAKE2hlaWdodF9hYm92ZV9ncm91bmQYASABKAI6AzEw", + "MBIeCg5wb3J0cmFpdF93aWR0aBgCIAEoAjoGMS4wMTAzEh8KD3BvcnRyYWl0", + "X2hlaWdodBgDIAEoAjoGMS4zNDM1EmIKEWltYWdlX29yaWVudGF0aW9uGAQg", + "ASgOMjEubWVkaWFwaXBlLkNhbWVyYVBhcmFtZXRlcnNQcm90by5JbWFnZU9y", + "aWVudGF0aW9uOhRQT1JUUkFJVF9PUklFTlRBVElPThJWCg9wcm9qZWN0aW9u", + "X21vZGUYBSABKA4yLy5tZWRpYXBpcGUuQ2FtZXJhUGFyYW1ldGVyc1Byb3Rv", + "LlByb2plY3Rpb25Nb2RlOgxHUk9VTkRfUExBTkUSJQoYcHJvamVjdGlvbl9z", + "cGhlcmVfcmFkaXVzGAYgASgCOgMxMDAiRwoQSW1hZ2VPcmllbnRhdGlvbhIY", + "ChRQT1JUUkFJVF9PUklFTlRBVElPThAAEhkKFUxBTkRTQ0FQRV9PUklFTlRB", + "VElPThABIj8KDlByb2plY3Rpb25Nb2RlEg8KC1VOU1BFQ0lGSUVEEAASEAoM", + "R1JPVU5EX1BMQU5FEAESCgoGU1BIRVJFEAI=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CameraParametersProto), global::Mediapipe.CameraParametersProto.Parser, new[]{ "HeightAboveGround", "PortraitWidth", "PortraitHeight", "ImageOrientation", "ProjectionMode", "ProjectionSphereRadius" }, null, new[]{ typeof(global::Mediapipe.CameraParametersProto.Types.ImageOrientation), typeof(global::Mediapipe.CameraParametersProto.Types.ProjectionMode) }, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class CameraParametersProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CameraParametersProto()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CameraParametersReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraParametersProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraParametersProto(CameraParametersProto other) : this() { + _hasBits0 = other._hasBits0; + heightAboveGround_ = other.heightAboveGround_; + portraitWidth_ = other.portraitWidth_; + portraitHeight_ = other.portraitHeight_; + imageOrientation_ = other.imageOrientation_; + projectionMode_ = other.projectionMode_; + projectionSphereRadius_ = other.projectionSphereRadius_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraParametersProto Clone() { + return new CameraParametersProto(this); + } + + /// Field number for the "height_above_ground" field. + public const int HeightAboveGroundFieldNumber = 1; + private readonly static float HeightAboveGroundDefaultValue = 100F; + + private float heightAboveGround_; + /// + /// This number is non-negative, it represents camera height above ground + /// normalized by focal length. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HeightAboveGround { + get { if ((_hasBits0 & 1) != 0) { return heightAboveGround_; } else { return HeightAboveGroundDefaultValue; } } + set { + _hasBits0 |= 1; + heightAboveGround_ = value; + } + } + /// Gets whether the "height_above_ground" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeightAboveGround { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "height_above_ground" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeightAboveGround() { + _hasBits0 &= ~1; + } + + /// Field number for the "portrait_width" field. + public const int PortraitWidthFieldNumber = 2; + private readonly static float PortraitWidthDefaultValue = 1.0103F; + + private float portraitWidth_; + /// + /// Width of image in portrait orientation normalized by focal length + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PortraitWidth { + get { if ((_hasBits0 & 2) != 0) { return portraitWidth_; } else { return PortraitWidthDefaultValue; } } + set { + _hasBits0 |= 2; + portraitWidth_ = value; + } + } + /// Gets whether the "portrait_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPortraitWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "portrait_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPortraitWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "portrait_height" field. + public const int PortraitHeightFieldNumber = 3; + private readonly static float PortraitHeightDefaultValue = 1.3435F; + + private float portraitHeight_; + /// + /// Height of image in portrait orientation normalized by focal length + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PortraitHeight { + get { if ((_hasBits0 & 4) != 0) { return portraitHeight_; } else { return PortraitHeightDefaultValue; } } + set { + _hasBits0 |= 4; + portraitHeight_ = value; + } + } + /// Gets whether the "portrait_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPortraitHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "portrait_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPortraitHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "image_orientation" field. + public const int ImageOrientationFieldNumber = 4; + private readonly static global::Mediapipe.CameraParametersProto.Types.ImageOrientation ImageOrientationDefaultValue = global::Mediapipe.CameraParametersProto.Types.ImageOrientation.PortraitOrientation; + + private global::Mediapipe.CameraParametersProto.Types.ImageOrientation imageOrientation_; + /// + /// The input image orientation + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CameraParametersProto.Types.ImageOrientation ImageOrientation { + get { if ((_hasBits0 & 8) != 0) { return imageOrientation_; } else { return ImageOrientationDefaultValue; } } + set { + _hasBits0 |= 8; + imageOrientation_ = value; + } + } + /// Gets whether the "image_orientation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageOrientation { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "image_orientation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageOrientation() { + _hasBits0 &= ~8; + } + + /// Field number for the "projection_mode" field. + public const int ProjectionModeFieldNumber = 5; + private readonly static global::Mediapipe.CameraParametersProto.Types.ProjectionMode ProjectionModeDefaultValue = global::Mediapipe.CameraParametersProto.Types.ProjectionMode.GroundPlane; + + private global::Mediapipe.CameraParametersProto.Types.ProjectionMode projectionMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CameraParametersProto.Types.ProjectionMode ProjectionMode { + get { if ((_hasBits0 & 16) != 0) { return projectionMode_; } else { return ProjectionModeDefaultValue; } } + set { + _hasBits0 |= 16; + projectionMode_ = value; + } + } + /// Gets whether the "projection_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProjectionMode { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "projection_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProjectionMode() { + _hasBits0 &= ~16; + } + + /// Field number for the "projection_sphere_radius" field. + public const int ProjectionSphereRadiusFieldNumber = 6; + private readonly static float ProjectionSphereRadiusDefaultValue = 100F; + + private float projectionSphereRadius_; + /// + /// Radius of sphere when using the SPHERE projection mode above. + /// The value is normalized by focal length. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ProjectionSphereRadius { + get { if ((_hasBits0 & 32) != 0) { return projectionSphereRadius_; } else { return ProjectionSphereRadiusDefaultValue; } } + set { + _hasBits0 |= 32; + projectionSphereRadius_ = value; + } + } + /// Gets whether the "projection_sphere_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProjectionSphereRadius { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "projection_sphere_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProjectionSphereRadius() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CameraParametersProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CameraParametersProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HeightAboveGround, other.HeightAboveGround)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PortraitWidth, other.PortraitWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PortraitHeight, other.PortraitHeight)) return false; + if (ImageOrientation != other.ImageOrientation) return false; + if (ProjectionMode != other.ProjectionMode) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ProjectionSphereRadius, other.ProjectionSphereRadius)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasHeightAboveGround) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HeightAboveGround); + if (HasPortraitWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PortraitWidth); + if (HasPortraitHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PortraitHeight); + if (HasImageOrientation) hash ^= ImageOrientation.GetHashCode(); + if (HasProjectionMode) hash ^= ProjectionMode.GetHashCode(); + if (HasProjectionSphereRadius) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ProjectionSphereRadius); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasHeightAboveGround) { + output.WriteRawTag(13); + output.WriteFloat(HeightAboveGround); + } + if (HasPortraitWidth) { + output.WriteRawTag(21); + output.WriteFloat(PortraitWidth); + } + if (HasPortraitHeight) { + output.WriteRawTag(29); + output.WriteFloat(PortraitHeight); + } + if (HasImageOrientation) { + output.WriteRawTag(32); + output.WriteEnum((int) ImageOrientation); + } + if (HasProjectionMode) { + output.WriteRawTag(40); + output.WriteEnum((int) ProjectionMode); + } + if (HasProjectionSphereRadius) { + output.WriteRawTag(53); + output.WriteFloat(ProjectionSphereRadius); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasHeightAboveGround) { + output.WriteRawTag(13); + output.WriteFloat(HeightAboveGround); + } + if (HasPortraitWidth) { + output.WriteRawTag(21); + output.WriteFloat(PortraitWidth); + } + if (HasPortraitHeight) { + output.WriteRawTag(29); + output.WriteFloat(PortraitHeight); + } + if (HasImageOrientation) { + output.WriteRawTag(32); + output.WriteEnum((int) ImageOrientation); + } + if (HasProjectionMode) { + output.WriteRawTag(40); + output.WriteEnum((int) ProjectionMode); + } + if (HasProjectionSphereRadius) { + output.WriteRawTag(53); + output.WriteFloat(ProjectionSphereRadius); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasHeightAboveGround) { + size += 1 + 4; + } + if (HasPortraitWidth) { + size += 1 + 4; + } + if (HasPortraitHeight) { + size += 1 + 4; + } + if (HasImageOrientation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ImageOrientation); + } + if (HasProjectionMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ProjectionMode); + } + if (HasProjectionSphereRadius) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CameraParametersProto other) { + if (other == null) { + return; + } + if (other.HasHeightAboveGround) { + HeightAboveGround = other.HeightAboveGround; + } + if (other.HasPortraitWidth) { + PortraitWidth = other.PortraitWidth; + } + if (other.HasPortraitHeight) { + PortraitHeight = other.PortraitHeight; + } + if (other.HasImageOrientation) { + ImageOrientation = other.ImageOrientation; + } + if (other.HasProjectionMode) { + ProjectionMode = other.ProjectionMode; + } + if (other.HasProjectionSphereRadius) { + ProjectionSphereRadius = other.ProjectionSphereRadius; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + HeightAboveGround = input.ReadFloat(); + break; + } + case 21: { + PortraitWidth = input.ReadFloat(); + break; + } + case 29: { + PortraitHeight = input.ReadFloat(); + break; + } + case 32: { + ImageOrientation = (global::Mediapipe.CameraParametersProto.Types.ImageOrientation) input.ReadEnum(); + break; + } + case 40: { + ProjectionMode = (global::Mediapipe.CameraParametersProto.Types.ProjectionMode) input.ReadEnum(); + break; + } + case 53: { + ProjectionSphereRadius = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + HeightAboveGround = input.ReadFloat(); + break; + } + case 21: { + PortraitWidth = input.ReadFloat(); + break; + } + case 29: { + PortraitHeight = input.ReadFloat(); + break; + } + case 32: { + ImageOrientation = (global::Mediapipe.CameraParametersProto.Types.ImageOrientation) input.ReadEnum(); + break; + } + case 40: { + ProjectionMode = (global::Mediapipe.CameraParametersProto.Types.ProjectionMode) input.ReadEnum(); + break; + } + case 53: { + ProjectionSphereRadius = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the CameraParametersProto message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum ImageOrientation { + [pbr::OriginalName("PORTRAIT_ORIENTATION")] PortraitOrientation = 0, + [pbr::OriginalName("LANDSCAPE_ORIENTATION")] LandscapeOrientation = 1, + } + + /// + /// This defines the projection method from 2D screen to 3D. + /// + public enum ProjectionMode { + [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, + /// + /// Projects 2D point to ground plane (horizontal plane). + /// + [pbr::OriginalName("GROUND_PLANE")] GroundPlane = 1, + /// + /// Projects 2D point to sphere. + /// + [pbr::OriginalName("SPHERE")] Sphere = 2, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs.meta new file mode 100644 index 0000000..8877aca --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/CameraParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65114f967c1dc73d7a03428ebded1761 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs new file mode 100644 index 0000000..fbb8f1e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs @@ -0,0 +1,555 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/filter_detection_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/filter_detection_calculator.proto + public static partial class FilterDetectionCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/filter_detection_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FilterDetectionCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkltZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvZmls", + "dGVyX2RldGVjdGlvbl9jYWxjdWxhdG9yLnByb3RvEgltZWRpYXBpcGUaJG1l", + "ZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byLLAgogRmlsdGVy", + "RGV0ZWN0aW9uQ2FsY3VsYXRvck9wdGlvbnMSEQoJbWluX3Njb3JlGAEgASgC", + "EhEKCW1heF9zY29yZRgCIAEoAhIjChRmYWlsX29uX2VtcHR5X2xhYmVscxgD", + "IAEoCDoFZmFsc2USOgorZW1wdHlfYWxsb3dlZF9sYWJlbHNfbWVhbnNfYWxs", + "b3dfZXZlcnl0aGluZxgGIAEoCDoFZmFsc2USIAoUdXNlX2RldGVjdGlvbl92", + "ZWN0b3IYBCABKAhCAhgBEiIKFnVzZV9hbGxvd2VkX2xhYmVsc19jc3YYBSAB", + "KAhCAhgBMloKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiL", + "wPahASABKAsyKy5tZWRpYXBpcGUuRmlsdGVyRGV0ZWN0aW9uQ2FsY3VsYXRv", + "ck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FilterDetectionCalculatorOptions), global::Mediapipe.FilterDetectionCalculatorOptions.Parser, new[]{ "MinScore", "MaxScore", "FailOnEmptyLabels", "EmptyAllowedLabelsMeansAllowEverything", "UseDetectionVector", "UseAllowedLabelsCsv" }, null, null, new pb::Extension[] { global::Mediapipe.FilterDetectionCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FilterDetectionCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilterDetectionCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FilterDetectionCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionCalculatorOptions(FilterDetectionCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + minScore_ = other.minScore_; + maxScore_ = other.maxScore_; + failOnEmptyLabels_ = other.failOnEmptyLabels_; + emptyAllowedLabelsMeansAllowEverything_ = other.emptyAllowedLabelsMeansAllowEverything_; + useDetectionVector_ = other.useDetectionVector_; + useAllowedLabelsCsv_ = other.useAllowedLabelsCsv_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilterDetectionCalculatorOptions Clone() { + return new FilterDetectionCalculatorOptions(this); + } + + /// Field number for the "min_score" field. + public const int MinScoreFieldNumber = 1; + private readonly static float MinScoreDefaultValue = 0F; + + private float minScore_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinScore { + get { if ((_hasBits0 & 1) != 0) { return minScore_; } else { return MinScoreDefaultValue; } } + set { + _hasBits0 |= 1; + minScore_ = value; + } + } + /// Gets whether the "min_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinScore { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinScore() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_score" field. + public const int MaxScoreFieldNumber = 2; + private readonly static float MaxScoreDefaultValue = 0F; + + private float maxScore_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxScore { + get { if ((_hasBits0 & 2) != 0) { return maxScore_; } else { return MaxScoreDefaultValue; } } + set { + _hasBits0 |= 2; + maxScore_ = value; + } + } + /// Gets whether the "max_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxScore { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxScore() { + _hasBits0 &= ~2; + } + + /// Field number for the "fail_on_empty_labels" field. + public const int FailOnEmptyLabelsFieldNumber = 3; + private readonly static bool FailOnEmptyLabelsDefaultValue = false; + + private bool failOnEmptyLabels_; + /// + /// Setting fail_on_empty_labels to true will cause the calculator to return a + /// failure status on Open() if an empty list is provided on the external + /// input, immediately terminating the graph run. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FailOnEmptyLabels { + get { if ((_hasBits0 & 4) != 0) { return failOnEmptyLabels_; } else { return FailOnEmptyLabelsDefaultValue; } } + set { + _hasBits0 |= 4; + failOnEmptyLabels_ = value; + } + } + /// Gets whether the "fail_on_empty_labels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFailOnEmptyLabels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "fail_on_empty_labels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFailOnEmptyLabels() { + _hasBits0 &= ~4; + } + + /// Field number for the "empty_allowed_labels_means_allow_everything" field. + public const int EmptyAllowedLabelsMeansAllowEverythingFieldNumber = 6; + private readonly static bool EmptyAllowedLabelsMeansAllowEverythingDefaultValue = false; + + private bool emptyAllowedLabelsMeansAllowEverything_; + /// + /// If fail_on_empty_labels is set to false setting + /// empty_allowed_labels_means_allow_everything to + /// false will cause the calculator to close output stream and ignore remaining + /// inputs if an empty list is provided. If + /// empty_allowed_labels_means_allow_everything is set to true this will force + /// calculator to pass all labels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EmptyAllowedLabelsMeansAllowEverything { + get { if ((_hasBits0 & 32) != 0) { return emptyAllowedLabelsMeansAllowEverything_; } else { return EmptyAllowedLabelsMeansAllowEverythingDefaultValue; } } + set { + _hasBits0 |= 32; + emptyAllowedLabelsMeansAllowEverything_ = value; + } + } + /// Gets whether the "empty_allowed_labels_means_allow_everything" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEmptyAllowedLabelsMeansAllowEverything { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "empty_allowed_labels_means_allow_everything" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEmptyAllowedLabelsMeansAllowEverything() { + _hasBits0 &= ~32; + } + + /// Field number for the "use_detection_vector" field. + public const int UseDetectionVectorFieldNumber = 4; + private readonly static bool UseDetectionVectorDefaultValue = false; + + private bool useDetectionVector_; + /// + /// Determines whether the input format is a vector<Detection> (use-case object + /// detectors) or Detection (use-case classifiers). + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseDetectionVector { + get { if ((_hasBits0 & 8) != 0) { return useDetectionVector_; } else { return UseDetectionVectorDefaultValue; } } + set { + _hasBits0 |= 8; + useDetectionVector_ = value; + } + } + /// Gets whether the "use_detection_vector" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseDetectionVector { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "use_detection_vector" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseDetectionVector() { + _hasBits0 &= ~8; + } + + /// Field number for the "use_allowed_labels_csv" field. + public const int UseAllowedLabelsCsvFieldNumber = 5; + private readonly static bool UseAllowedLabelsCsvDefaultValue = false; + + private bool useAllowedLabelsCsv_; + /// + /// Determines whether the input side packet format is a vector of labels, or + /// a string with comma separated labels. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseAllowedLabelsCsv { + get { if ((_hasBits0 & 16) != 0) { return useAllowedLabelsCsv_; } else { return UseAllowedLabelsCsvDefaultValue; } } + set { + _hasBits0 |= 16; + useAllowedLabelsCsv_ = value; + } + } + /// Gets whether the "use_allowed_labels_csv" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseAllowedLabelsCsv { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "use_allowed_labels_csv" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseAllowedLabelsCsv() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FilterDetectionCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FilterDetectionCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScore, other.MinScore)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxScore, other.MaxScore)) return false; + if (FailOnEmptyLabels != other.FailOnEmptyLabels) return false; + if (EmptyAllowedLabelsMeansAllowEverything != other.EmptyAllowedLabelsMeansAllowEverything) return false; + if (UseDetectionVector != other.UseDetectionVector) return false; + if (UseAllowedLabelsCsv != other.UseAllowedLabelsCsv) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScore); + if (HasMaxScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxScore); + if (HasFailOnEmptyLabels) hash ^= FailOnEmptyLabels.GetHashCode(); + if (HasEmptyAllowedLabelsMeansAllowEverything) hash ^= EmptyAllowedLabelsMeansAllowEverything.GetHashCode(); + if (HasUseDetectionVector) hash ^= UseDetectionVector.GetHashCode(); + if (HasUseAllowedLabelsCsv) hash ^= UseAllowedLabelsCsv.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinScore) { + output.WriteRawTag(13); + output.WriteFloat(MinScore); + } + if (HasMaxScore) { + output.WriteRawTag(21); + output.WriteFloat(MaxScore); + } + if (HasFailOnEmptyLabels) { + output.WriteRawTag(24); + output.WriteBool(FailOnEmptyLabels); + } + if (HasUseDetectionVector) { + output.WriteRawTag(32); + output.WriteBool(UseDetectionVector); + } + if (HasUseAllowedLabelsCsv) { + output.WriteRawTag(40); + output.WriteBool(UseAllowedLabelsCsv); + } + if (HasEmptyAllowedLabelsMeansAllowEverything) { + output.WriteRawTag(48); + output.WriteBool(EmptyAllowedLabelsMeansAllowEverything); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinScore) { + output.WriteRawTag(13); + output.WriteFloat(MinScore); + } + if (HasMaxScore) { + output.WriteRawTag(21); + output.WriteFloat(MaxScore); + } + if (HasFailOnEmptyLabels) { + output.WriteRawTag(24); + output.WriteBool(FailOnEmptyLabels); + } + if (HasUseDetectionVector) { + output.WriteRawTag(32); + output.WriteBool(UseDetectionVector); + } + if (HasUseAllowedLabelsCsv) { + output.WriteRawTag(40); + output.WriteBool(UseAllowedLabelsCsv); + } + if (HasEmptyAllowedLabelsMeansAllowEverything) { + output.WriteRawTag(48); + output.WriteBool(EmptyAllowedLabelsMeansAllowEverything); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinScore) { + size += 1 + 4; + } + if (HasMaxScore) { + size += 1 + 4; + } + if (HasFailOnEmptyLabels) { + size += 1 + 1; + } + if (HasEmptyAllowedLabelsMeansAllowEverything) { + size += 1 + 1; + } + if (HasUseDetectionVector) { + size += 1 + 1; + } + if (HasUseAllowedLabelsCsv) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FilterDetectionCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasMinScore) { + MinScore = other.MinScore; + } + if (other.HasMaxScore) { + MaxScore = other.MaxScore; + } + if (other.HasFailOnEmptyLabels) { + FailOnEmptyLabels = other.FailOnEmptyLabels; + } + if (other.HasEmptyAllowedLabelsMeansAllowEverything) { + EmptyAllowedLabelsMeansAllowEverything = other.EmptyAllowedLabelsMeansAllowEverything; + } + if (other.HasUseDetectionVector) { + UseDetectionVector = other.UseDetectionVector; + } + if (other.HasUseAllowedLabelsCsv) { + UseAllowedLabelsCsv = other.UseAllowedLabelsCsv; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinScore = input.ReadFloat(); + break; + } + case 21: { + MaxScore = input.ReadFloat(); + break; + } + case 24: { + FailOnEmptyLabels = input.ReadBool(); + break; + } + case 32: { + UseDetectionVector = input.ReadBool(); + break; + } + case 40: { + UseAllowedLabelsCsv = input.ReadBool(); + break; + } + case 48: { + EmptyAllowedLabelsMeansAllowEverything = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinScore = input.ReadFloat(); + break; + } + case 21: { + MaxScore = input.ReadFloat(); + break; + } + case 24: { + FailOnEmptyLabels = input.ReadBool(); + break; + } + case 32: { + UseDetectionVector = input.ReadBool(); + break; + } + case 40: { + UseAllowedLabelsCsv = input.ReadBool(); + break; + } + case 48: { + EmptyAllowedLabelsMeansAllowEverything = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FilterDetectionCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(339582987, pb::FieldCodec.ForMessage(2716663898, global::Mediapipe.FilterDetectionCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs.meta new file mode 100644 index 0000000..f2bd245 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FilterDetectionCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e306cfd433010aeb93bd632be6327bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs new file mode 100644 index 0000000..9a6ba30 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs @@ -0,0 +1,324 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/frame_annotation_to_rect_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/frame_annotation_to_rect_calculator.proto + public static partial class FrameAnnotationToRectCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/frame_annotation_to_rect_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FrameAnnotationToRectCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ClFtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvZnJh", + "bWVfYW5ub3RhdGlvbl90b19yZWN0X2NhbGN1bGF0b3IucHJvdG8SCW1lZGlh", + "cGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIr8B", + "CiZGcmFtZUFubm90YXRpb25Ub1JlY3RDYWxjdWxhdG9yT3B0aW9ucxIZCg1v", + "ZmZfdGhyZXNob2xkGAEgASgCOgI0MBIYCgxvbl90aHJlc2hvbGQYAiABKAI6", + "AjQxMmAKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxibk52h", + "ASABKAsyMS5tZWRpYXBpcGUuRnJhbWVBbm5vdGF0aW9uVG9SZWN0Q2FsY3Vs", + "YXRvck9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameAnnotationToRectCalculatorOptions), global::Mediapipe.FrameAnnotationToRectCalculatorOptions.Parser, new[]{ "OffThreshold", "OnThreshold" }, null, null, new pb::Extension[] { global::Mediapipe.FrameAnnotationToRectCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FrameAnnotationToRectCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameAnnotationToRectCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameAnnotationToRectCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationToRectCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationToRectCalculatorOptions(FrameAnnotationToRectCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + offThreshold_ = other.offThreshold_; + onThreshold_ = other.onThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationToRectCalculatorOptions Clone() { + return new FrameAnnotationToRectCalculatorOptions(this); + } + + /// Field number for the "off_threshold" field. + public const int OffThresholdFieldNumber = 1; + private readonly static float OffThresholdDefaultValue = 40F; + + private float offThreshold_; + /// + /// The threshold to use when top-view is off,to enable hysteresis, + /// It's required that off_threshold <= on_threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OffThreshold { + get { if ((_hasBits0 & 1) != 0) { return offThreshold_; } else { return OffThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + offThreshold_ = value; + } + } + /// Gets whether the "off_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOffThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "off_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOffThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "on_threshold" field. + public const int OnThresholdFieldNumber = 2; + private readonly static float OnThresholdDefaultValue = 41F; + + private float onThreshold_; + /// + /// The threshold to use when top-view is on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OnThreshold { + get { if ((_hasBits0 & 2) != 0) { return onThreshold_; } else { return OnThresholdDefaultValue; } } + set { + _hasBits0 |= 2; + onThreshold_ = value; + } + } + /// Gets whether the "on_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOnThreshold { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "on_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOnThreshold() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameAnnotationToRectCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameAnnotationToRectCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OffThreshold, other.OffThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OnThreshold, other.OnThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOffThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OffThreshold); + if (HasOnThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OnThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOffThreshold) { + output.WriteRawTag(13); + output.WriteFloat(OffThreshold); + } + if (HasOnThreshold) { + output.WriteRawTag(21); + output.WriteFloat(OnThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOffThreshold) { + output.WriteRawTag(13); + output.WriteFloat(OffThreshold); + } + if (HasOnThreshold) { + output.WriteRawTag(21); + output.WriteFloat(OnThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOffThreshold) { + size += 1 + 4; + } + if (HasOnThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameAnnotationToRectCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasOffThreshold) { + OffThreshold = other.OffThreshold; + } + if (other.HasOnThreshold) { + OnThreshold = other.OnThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + OffThreshold = input.ReadFloat(); + break; + } + case 21: { + OnThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + OffThreshold = input.ReadFloat(); + break; + } + case 21: { + OnThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FrameAnnotationToRectCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(338119067, pb::FieldCodec.ForMessage(2704952538, global::Mediapipe.FrameAnnotationToRectCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs.meta new file mode 100644 index 0000000..a1c5301 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationToRectCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 47be4445b6a5eb6bc80d708f90468e2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs new file mode 100644 index 0000000..9ff9812 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs @@ -0,0 +1,376 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/frame_annotation_tracker_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/frame_annotation_tracker_calculator.proto + public static partial class FrameAnnotationTrackerCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/frame_annotation_tracker_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FrameAnnotationTrackerCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ClFtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvZnJh", + "bWVfYW5ub3RhdGlvbl90cmFja2VyX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlh", + "cGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvIs8B", + "CidGcmFtZUFubm90YXRpb25UcmFja2VyQ2FsY3VsYXRvck9wdGlvbnMSGgoN", + "aW91X3RocmVzaG9sZBgBIAEoAjoDMC41EhEKCWltZ193aWR0aBgCIAEoAhIS", + "CgppbWdfaGVpZ2h0GAMgASgCMmEKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxh", + "dG9yT3B0aW9ucxj1gPOKASABKAsyMi5tZWRpYXBpcGUuRnJhbWVBbm5vdGF0", + "aW9uVHJhY2tlckNhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameAnnotationTrackerCalculatorOptions), global::Mediapipe.FrameAnnotationTrackerCalculatorOptions.Parser, new[]{ "IouThreshold", "ImgWidth", "ImgHeight" }, null, null, new pb::Extension[] { global::Mediapipe.FrameAnnotationTrackerCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FrameAnnotationTrackerCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameAnnotationTrackerCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameAnnotationTrackerCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationTrackerCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationTrackerCalculatorOptions(FrameAnnotationTrackerCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + iouThreshold_ = other.iouThreshold_; + imgWidth_ = other.imgWidth_; + imgHeight_ = other.imgHeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameAnnotationTrackerCalculatorOptions Clone() { + return new FrameAnnotationTrackerCalculatorOptions(this); + } + + /// Field number for the "iou_threshold" field. + public const int IouThresholdFieldNumber = 1; + private readonly static float IouThresholdDefaultValue = 0.5F; + + private float iouThreshold_; + /// + /// The threshold on intersection-over-union (IoU). We consider + /// boxes with IoU larger than this threshold to be the duplicates. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IouThreshold { + get { if ((_hasBits0 & 1) != 0) { return iouThreshold_; } else { return IouThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + iouThreshold_ = value; + } + } + /// Gets whether the "iou_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIouThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "iou_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIouThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "img_width" field. + public const int ImgWidthFieldNumber = 2; + private readonly static float ImgWidthDefaultValue = 0F; + + private float imgWidth_; + /// + /// We need image dimension to properly compute annotation locations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ImgWidth { + get { if ((_hasBits0 & 2) != 0) { return imgWidth_; } else { return ImgWidthDefaultValue; } } + set { + _hasBits0 |= 2; + imgWidth_ = value; + } + } + /// Gets whether the "img_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImgWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "img_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImgWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "img_height" field. + public const int ImgHeightFieldNumber = 3; + private readonly static float ImgHeightDefaultValue = 0F; + + private float imgHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ImgHeight { + get { if ((_hasBits0 & 4) != 0) { return imgHeight_; } else { return ImgHeightDefaultValue; } } + set { + _hasBits0 |= 4; + imgHeight_ = value; + } + } + /// Gets whether the "img_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImgHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "img_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImgHeight() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameAnnotationTrackerCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameAnnotationTrackerCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IouThreshold, other.IouThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ImgWidth, other.ImgWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ImgHeight, other.ImgHeight)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIouThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IouThreshold); + if (HasImgWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ImgWidth); + if (HasImgHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ImgHeight); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIouThreshold) { + output.WriteRawTag(13); + output.WriteFloat(IouThreshold); + } + if (HasImgWidth) { + output.WriteRawTag(21); + output.WriteFloat(ImgWidth); + } + if (HasImgHeight) { + output.WriteRawTag(29); + output.WriteFloat(ImgHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIouThreshold) { + output.WriteRawTag(13); + output.WriteFloat(IouThreshold); + } + if (HasImgWidth) { + output.WriteRawTag(21); + output.WriteFloat(ImgWidth); + } + if (HasImgHeight) { + output.WriteRawTag(29); + output.WriteFloat(ImgHeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIouThreshold) { + size += 1 + 4; + } + if (HasImgWidth) { + size += 1 + 4; + } + if (HasImgHeight) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameAnnotationTrackerCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasIouThreshold) { + IouThreshold = other.IouThreshold; + } + if (other.HasImgWidth) { + ImgWidth = other.ImgWidth; + } + if (other.HasImgHeight) { + ImgHeight = other.ImgHeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + IouThreshold = input.ReadFloat(); + break; + } + case 21: { + ImgWidth = input.ReadFloat(); + break; + } + case 29: { + ImgHeight = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + IouThreshold = input.ReadFloat(); + break; + } + case 21: { + ImgWidth = input.ReadFloat(); + break; + } + case 29: { + ImgHeight = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the FrameAnnotationTrackerCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(291291253, pb::FieldCodec.ForMessage(2330330026, global::Mediapipe.FrameAnnotationTrackerCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs.meta new file mode 100644 index 0000000..e0de128 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/FrameAnnotationTrackerCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6a2481a2315da5ebbe78e323ee91b2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs new file mode 100644 index 0000000..1d10021 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs @@ -0,0 +1,484 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/lift_2d_frame_annotation_to_3d_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/lift_2d_frame_annotation_to_3d_calculator.proto + public static partial class Lift2DFrameAnnotationTo3DCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/lift_2d_frame_annotation_to_3d_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Lift2DFrameAnnotationTo3DCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CldtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvbGlm", + "dF8yZF9mcmFtZV9hbm5vdGF0aW9uX3RvXzNkX2NhbGN1bGF0b3IucHJvdG8S", + "CW1lZGlhcGlwZRokbWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnBy", + "b3RvGkNtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMv", + "YmVsaWVmX2RlY29kZXJfY29uZmlnLnByb3RvItoCCipMaWZ0MkRGcmFtZUFu", + "bm90YXRpb25UbzNEQ2FsY3VsYXRvck9wdGlvbnMSNgoOZGVjb2Rlcl9jb25m", + "aWcYASABKAsyHi5tZWRpYXBpcGUuQmVsaWVmRGVjb2RlckNvbmZpZxIdChJu", + "b3JtYWxpemVkX2ZvY2FsX3gYAiABKAI6ATESHQoSbm9ybWFsaXplZF9mb2Nh", + "bF95GAMgASgCOgExEicKHG5vcm1hbGl6ZWRfcHJpbmNpcGFsX3BvaW50X3gY", + "BCABKAI6ATASJwocbm9ybWFsaXplZF9wcmluY2lwYWxfcG9pbnRfeRgFIAEo", + "AjoBMDJkCgNleHQSHC5tZWRpYXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYjKyu", + "igEgASgLMjUubWVkaWFwaXBlLkxpZnQyREZyYW1lQW5ub3RhdGlvblRvM0RD", + "YWxjdWxhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.BeliefDecoderConfigReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Lift2DFrameAnnotationTo3DCalculatorOptions), global::Mediapipe.Lift2DFrameAnnotationTo3DCalculatorOptions.Parser, new[]{ "DecoderConfig", "NormalizedFocalX", "NormalizedFocalY", "NormalizedPrincipalPointX", "NormalizedPrincipalPointY" }, null, null, new pb::Extension[] { global::Mediapipe.Lift2DFrameAnnotationTo3DCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Lift2DFrameAnnotationTo3DCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Lift2DFrameAnnotationTo3DCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.Lift2DFrameAnnotationTo3DCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Lift2DFrameAnnotationTo3DCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Lift2DFrameAnnotationTo3DCalculatorOptions(Lift2DFrameAnnotationTo3DCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + decoderConfig_ = other.decoderConfig_ != null ? other.decoderConfig_.Clone() : null; + normalizedFocalX_ = other.normalizedFocalX_; + normalizedFocalY_ = other.normalizedFocalY_; + normalizedPrincipalPointX_ = other.normalizedPrincipalPointX_; + normalizedPrincipalPointY_ = other.normalizedPrincipalPointY_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Lift2DFrameAnnotationTo3DCalculatorOptions Clone() { + return new Lift2DFrameAnnotationTo3DCalculatorOptions(this); + } + + /// Field number for the "decoder_config" field. + public const int DecoderConfigFieldNumber = 1; + private global::Mediapipe.BeliefDecoderConfig decoderConfig_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BeliefDecoderConfig DecoderConfig { + get { return decoderConfig_; } + set { + decoderConfig_ = value; + } + } + + /// Field number for the "normalized_focal_x" field. + public const int NormalizedFocalXFieldNumber = 2; + private readonly static float NormalizedFocalXDefaultValue = 1F; + + private float normalizedFocalX_; + /// + /// Camera focal length along x, normalized by width/2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedFocalX { + get { if ((_hasBits0 & 1) != 0) { return normalizedFocalX_; } else { return NormalizedFocalXDefaultValue; } } + set { + _hasBits0 |= 1; + normalizedFocalX_ = value; + } + } + /// Gets whether the "normalized_focal_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedFocalX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "normalized_focal_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedFocalX() { + _hasBits0 &= ~1; + } + + /// Field number for the "normalized_focal_y" field. + public const int NormalizedFocalYFieldNumber = 3; + private readonly static float NormalizedFocalYDefaultValue = 1F; + + private float normalizedFocalY_; + /// + /// Camera focal length along y, normalized by height/2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedFocalY { + get { if ((_hasBits0 & 2) != 0) { return normalizedFocalY_; } else { return NormalizedFocalYDefaultValue; } } + set { + _hasBits0 |= 2; + normalizedFocalY_ = value; + } + } + /// Gets whether the "normalized_focal_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedFocalY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "normalized_focal_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedFocalY() { + _hasBits0 &= ~2; + } + + /// Field number for the "normalized_principal_point_x" field. + public const int NormalizedPrincipalPointXFieldNumber = 4; + private readonly static float NormalizedPrincipalPointXDefaultValue = 0F; + + private float normalizedPrincipalPointX_; + /// + /// Camera principle point x, normalized by width/2, origin is image center. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedPrincipalPointX { + get { if ((_hasBits0 & 4) != 0) { return normalizedPrincipalPointX_; } else { return NormalizedPrincipalPointXDefaultValue; } } + set { + _hasBits0 |= 4; + normalizedPrincipalPointX_ = value; + } + } + /// Gets whether the "normalized_principal_point_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedPrincipalPointX { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "normalized_principal_point_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedPrincipalPointX() { + _hasBits0 &= ~4; + } + + /// Field number for the "normalized_principal_point_y" field. + public const int NormalizedPrincipalPointYFieldNumber = 5; + private readonly static float NormalizedPrincipalPointYDefaultValue = 0F; + + private float normalizedPrincipalPointY_; + /// + /// Camera principle point y, normalized by height/2, origin is image center. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedPrincipalPointY { + get { if ((_hasBits0 & 8) != 0) { return normalizedPrincipalPointY_; } else { return NormalizedPrincipalPointYDefaultValue; } } + set { + _hasBits0 |= 8; + normalizedPrincipalPointY_ = value; + } + } + /// Gets whether the "normalized_principal_point_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedPrincipalPointY { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "normalized_principal_point_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedPrincipalPointY() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Lift2DFrameAnnotationTo3DCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Lift2DFrameAnnotationTo3DCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(DecoderConfig, other.DecoderConfig)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedFocalX, other.NormalizedFocalX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedFocalY, other.NormalizedFocalY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedPrincipalPointX, other.NormalizedPrincipalPointX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedPrincipalPointY, other.NormalizedPrincipalPointY)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (decoderConfig_ != null) hash ^= DecoderConfig.GetHashCode(); + if (HasNormalizedFocalX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedFocalX); + if (HasNormalizedFocalY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedFocalY); + if (HasNormalizedPrincipalPointX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedPrincipalPointX); + if (HasNormalizedPrincipalPointY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedPrincipalPointY); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (decoderConfig_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DecoderConfig); + } + if (HasNormalizedFocalX) { + output.WriteRawTag(21); + output.WriteFloat(NormalizedFocalX); + } + if (HasNormalizedFocalY) { + output.WriteRawTag(29); + output.WriteFloat(NormalizedFocalY); + } + if (HasNormalizedPrincipalPointX) { + output.WriteRawTag(37); + output.WriteFloat(NormalizedPrincipalPointX); + } + if (HasNormalizedPrincipalPointY) { + output.WriteRawTag(45); + output.WriteFloat(NormalizedPrincipalPointY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (decoderConfig_ != null) { + output.WriteRawTag(10); + output.WriteMessage(DecoderConfig); + } + if (HasNormalizedFocalX) { + output.WriteRawTag(21); + output.WriteFloat(NormalizedFocalX); + } + if (HasNormalizedFocalY) { + output.WriteRawTag(29); + output.WriteFloat(NormalizedFocalY); + } + if (HasNormalizedPrincipalPointX) { + output.WriteRawTag(37); + output.WriteFloat(NormalizedPrincipalPointX); + } + if (HasNormalizedPrincipalPointY) { + output.WriteRawTag(45); + output.WriteFloat(NormalizedPrincipalPointY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (decoderConfig_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DecoderConfig); + } + if (HasNormalizedFocalX) { + size += 1 + 4; + } + if (HasNormalizedFocalY) { + size += 1 + 4; + } + if (HasNormalizedPrincipalPointX) { + size += 1 + 4; + } + if (HasNormalizedPrincipalPointY) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Lift2DFrameAnnotationTo3DCalculatorOptions other) { + if (other == null) { + return; + } + if (other.decoderConfig_ != null) { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + DecoderConfig.MergeFrom(other.DecoderConfig); + } + if (other.HasNormalizedFocalX) { + NormalizedFocalX = other.NormalizedFocalX; + } + if (other.HasNormalizedFocalY) { + NormalizedFocalY = other.NormalizedFocalY; + } + if (other.HasNormalizedPrincipalPointX) { + NormalizedPrincipalPointX = other.NormalizedPrincipalPointX; + } + if (other.HasNormalizedPrincipalPointY) { + NormalizedPrincipalPointY = other.NormalizedPrincipalPointY; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + case 21: { + NormalizedFocalX = input.ReadFloat(); + break; + } + case 29: { + NormalizedFocalY = input.ReadFloat(); + break; + } + case 37: { + NormalizedPrincipalPointX = input.ReadFloat(); + break; + } + case 45: { + NormalizedPrincipalPointY = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + case 21: { + NormalizedFocalX = input.ReadFloat(); + break; + } + case 29: { + NormalizedFocalY = input.ReadFloat(); + break; + } + case 37: { + NormalizedPrincipalPointX = input.ReadFloat(); + break; + } + case 45: { + NormalizedPrincipalPointY = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the Lift2DFrameAnnotationTo3DCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(290166284, pb::FieldCodec.ForMessage(2321330274, global::Mediapipe.Lift2DFrameAnnotationTo3DCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs.meta new file mode 100644 index 0000000..261ec26 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Lift2DFrameAnnotationTo3DCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cad26e2330ecd4db7b2603dd479b843e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs new file mode 100644 index 0000000..23b13c1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs @@ -0,0 +1,1640 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/object.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/object.proto + public static partial class ObjectReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/object.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ObjectReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjRtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvb2Jq", + "ZWN0LnByb3RvEgltZWRpYXBpcGUiZAoIS2V5UG9pbnQSCQoBeBgBIAEoAhIJ", + "CgF5GAIgASgCEgkKAXoYAyABKAISGQoRY29uZmlkZW5jZV9yYWRpdXMYBCAB", + "KAISDAoEbmFtZRgFIAEoCRIOCgZoaWRkZW4YBiABKAgi0AIKBk9iamVjdBIK", + "CgJpZBgBIAEoBRIQCghjYXRlZ29yeRgCIAEoCRIkCgR0eXBlGAMgASgOMhYu", + "bWVkaWFwaXBlLk9iamVjdC5UeXBlEhAKCHJvdGF0aW9uGAQgAygCEhMKC3Ry", + "YW5zbGF0aW9uGAUgAygCEg0KBXNjYWxlGAYgAygCEiYKCWtleXBvaW50cxgH", + "IAMoCzITLm1lZGlhcGlwZS5LZXlQb2ludBIoCgZtZXRob2QYCCABKA4yGC5t", + "ZWRpYXBpcGUuT2JqZWN0Lk1ldGhvZCI6CgRUeXBlEhIKDlVOREVGSU5FRF9U", + "WVBFEAASEAoMQk9VTkRJTkdfQk9YEAESDAoIU0tFTEVUT04QAiI+CgZNZXRo", + "b2QSEgoOVU5LTk9XTl9NRVRIT0QQABIOCgpBTk5PVEFUSU9OEAESEAoMQVVH", + "TUVOVEFUSU9OEAIiJAoERWRnZRIOCgZzb3VyY2UYASABKAUSDAoEc2luaxgC", + "IAEoBSKAAQoIU2tlbGV0b24SGgoScmVmZXJlbmNlX2tleXBvaW50GAEgASgF", + "EhAKCGNhdGVnb3J5GAIgASgJEiYKCWtleXBvaW50cxgDIAMoCzITLm1lZGlh", + "cGlwZS5LZXlQb2ludBIeCgVlZGdlcxgEIAMoCzIPLm1lZGlhcGlwZS5FZGdl", + "IjAKCVNrZWxldG9ucxIjCgZvYmplY3QYASADKAsyEy5tZWRpYXBpcGUuU2tl", + "bGV0b25iBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.KeyPoint), global::Mediapipe.KeyPoint.Parser, new[]{ "X", "Y", "Z", "ConfidenceRadius", "Name", "Hidden" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Object), global::Mediapipe.Object.Parser, new[]{ "Id", "Category", "Type", "Rotation", "Translation", "Scale", "Keypoints", "Method" }, null, new[]{ typeof(global::Mediapipe.Object.Types.Type), typeof(global::Mediapipe.Object.Types.Method) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Edge), global::Mediapipe.Edge.Parser, new[]{ "Source", "Sink" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Skeleton), global::Mediapipe.Skeleton.Parser, new[]{ "ReferenceKeypoint", "Category", "Keypoints", "Edges" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Skeletons), global::Mediapipe.Skeletons.Parser, new[]{ "Object" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class KeyPoint : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyPoint()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ObjectReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public KeyPoint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public KeyPoint(KeyPoint other) : this() { + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + confidenceRadius_ = other.confidenceRadius_; + name_ = other.name_; + hidden_ = other.hidden_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public KeyPoint Clone() { + return new KeyPoint(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private float x_; + /// + /// The position of the keypoint in the local coordinate system of the rigid + /// object. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { return x_; } + set { + x_ = value; + } + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { return y_; } + set { + y_ = value; + } + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private float z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Z { + get { return z_; } + set { + z_ = value; + } + } + + /// Field number for the "confidence_radius" field. + public const int ConfidenceRadiusFieldNumber = 4; + private float confidenceRadius_; + /// + /// Sphere around the keypoint, indiciating annotator's confidence of the + /// position in meters. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ConfidenceRadius { + get { return confidenceRadius_; } + set { + confidenceRadius_ = value; + } + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 5; + private string name_ = ""; + /// + /// The name of the keypoint (e.g. legs, head, etc.). + /// Does not have to be unique. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "hidden" field. + public const int HiddenFieldNumber = 6; + private bool hidden_; + /// + /// Indicates whether the keypoint is hidden or not. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Hidden { + get { return hidden_; } + set { + hidden_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as KeyPoint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(KeyPoint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ConfidenceRadius, other.ConfidenceRadius)) return false; + if (Name != other.Name) return false; + if (Hidden != other.Hidden) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (Z != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); + if (ConfidenceRadius != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ConfidenceRadius); + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Hidden != false) hash ^= Hidden.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Z != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (ConfidenceRadius != 0F) { + output.WriteRawTag(37); + output.WriteFloat(ConfidenceRadius); + } + if (Name.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Name); + } + if (Hidden != false) { + output.WriteRawTag(48); + output.WriteBool(Hidden); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (X != 0F) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (Y != 0F) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (Z != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Z); + } + if (ConfidenceRadius != 0F) { + output.WriteRawTag(37); + output.WriteFloat(ConfidenceRadius); + } + if (Name.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Name); + } + if (Hidden != false) { + output.WriteRawTag(48); + output.WriteBool(Hidden); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (X != 0F) { + size += 1 + 4; + } + if (Y != 0F) { + size += 1 + 4; + } + if (Z != 0F) { + size += 1 + 4; + } + if (ConfidenceRadius != 0F) { + size += 1 + 4; + } + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Hidden != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(KeyPoint other) { + if (other == null) { + return; + } + if (other.X != 0F) { + X = other.X; + } + if (other.Y != 0F) { + Y = other.Y; + } + if (other.Z != 0F) { + Z = other.Z; + } + if (other.ConfidenceRadius != 0F) { + ConfidenceRadius = other.ConfidenceRadius; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Hidden != false) { + Hidden = other.Hidden; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + ConfidenceRadius = input.ReadFloat(); + break; + } + case 42: { + Name = input.ReadString(); + break; + } + case 48: { + Hidden = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Z = input.ReadFloat(); + break; + } + case 37: { + ConfidenceRadius = input.ReadFloat(); + break; + } + case 42: { + Name = input.ReadString(); + break; + } + case 48: { + Hidden = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Object : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Object()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ObjectReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Object() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Object(Object other) : this() { + id_ = other.id_; + category_ = other.category_; + type_ = other.type_; + rotation_ = other.rotation_.Clone(); + translation_ = other.translation_.Clone(); + scale_ = other.scale_.Clone(); + keypoints_ = other.keypoints_.Clone(); + method_ = other.method_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Object Clone() { + return new Object(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private int id_; + /// + /// Unique object id through a sequence. There might be multiple objects of + /// the same label in this sequence. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 2; + private string category_ = ""; + /// + /// Describes what category an object is. E.g. object class, attribute, + /// instance or person identity. This provides additional context for the + /// object type. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Category { + get { return category_; } + set { + category_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 3; + private global::Mediapipe.Object.Types.Type type_ = global::Mediapipe.Object.Types.Type.UndefinedType; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Object.Types.Type Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_rotation_codec + = pb::FieldCodec.ForFloat(34); + private readonly pbc::RepeatedField rotation_ = new pbc::RepeatedField(); + /// + /// 3x3 row-major rotation matrix describing the orientation of the rigid + /// object's frame of reference in the world-coordinate system. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Rotation { + get { return rotation_; } + } + + /// Field number for the "translation" field. + public const int TranslationFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_translation_codec + = pb::FieldCodec.ForFloat(42); + private readonly pbc::RepeatedField translation_ = new pbc::RepeatedField(); + /// + /// 3x1 vector describing the translation of the rigid object's frame of + /// reference in the world-coordinate system in meters. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Translation { + get { return translation_; } + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_scale_codec + = pb::FieldCodec.ForFloat(50); + private readonly pbc::RepeatedField scale_ = new pbc::RepeatedField(); + /// + /// 3x1 vector describing the scale of the rigid object's frame of reference in + /// the world-coordinate system in meters. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Scale { + get { return scale_; } + } + + /// Field number for the "keypoints" field. + public const int KeypointsFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_keypoints_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.KeyPoint.Parser); + private readonly pbc::RepeatedField keypoints_ = new pbc::RepeatedField(); + /// + /// List of all the key points associated with this object in the object + /// coordinate system. + /// The first keypoint is always the object's frame of reference, + /// e.g. the centroid of the box. + /// E.g. bounding box with its center as frame of reference, the 9 keypoints : + /// {0., 0., 0.}, + /// {-.5, -.5, -.5}, {-.5, -.5, +.5}, {-.5, +.5, -.5}, {-.5, +.5, +.5}, + /// {+.5, -.5, -.5}, {+.5, -.5, +.5}, {+.5, +.5, -.5}, {+.5, +.5, +.5} + /// To get the bounding box in the world-coordinate system, we first scale the + /// box then transform the scaled box. + /// For example, bounding box in the world coordinate system is + /// rotation * scale * keypoints + translation + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Keypoints { + get { return keypoints_; } + } + + /// Field number for the "method" field. + public const int MethodFieldNumber = 8; + private global::Mediapipe.Object.Types.Method method_ = global::Mediapipe.Object.Types.Method.UnknownMethod; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Object.Types.Method Method { + get { return method_; } + set { + method_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Object); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Object other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (Category != other.Category) return false; + if (Type != other.Type) return false; + if(!rotation_.Equals(other.rotation_)) return false; + if(!translation_.Equals(other.translation_)) return false; + if(!scale_.Equals(other.scale_)) return false; + if(!keypoints_.Equals(other.keypoints_)) return false; + if (Method != other.Method) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Id != 0) hash ^= Id.GetHashCode(); + if (Category.Length != 0) hash ^= Category.GetHashCode(); + if (Type != global::Mediapipe.Object.Types.Type.UndefinedType) hash ^= Type.GetHashCode(); + hash ^= rotation_.GetHashCode(); + hash ^= translation_.GetHashCode(); + hash ^= scale_.GetHashCode(); + hash ^= keypoints_.GetHashCode(); + if (Method != global::Mediapipe.Object.Types.Method.UnknownMethod) hash ^= Method.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id != 0) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (Category.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Category); + } + if (Type != global::Mediapipe.Object.Types.Type.UndefinedType) { + output.WriteRawTag(24); + output.WriteEnum((int) Type); + } + rotation_.WriteTo(output, _repeated_rotation_codec); + translation_.WriteTo(output, _repeated_translation_codec); + scale_.WriteTo(output, _repeated_scale_codec); + keypoints_.WriteTo(output, _repeated_keypoints_codec); + if (Method != global::Mediapipe.Object.Types.Method.UnknownMethod) { + output.WriteRawTag(64); + output.WriteEnum((int) Method); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id != 0) { + output.WriteRawTag(8); + output.WriteInt32(Id); + } + if (Category.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Category); + } + if (Type != global::Mediapipe.Object.Types.Type.UndefinedType) { + output.WriteRawTag(24); + output.WriteEnum((int) Type); + } + rotation_.WriteTo(ref output, _repeated_rotation_codec); + translation_.WriteTo(ref output, _repeated_translation_codec); + scale_.WriteTo(ref output, _repeated_scale_codec); + keypoints_.WriteTo(ref output, _repeated_keypoints_codec); + if (Method != global::Mediapipe.Object.Types.Method.UnknownMethod) { + output.WriteRawTag(64); + output.WriteEnum((int) Method); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Id != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (Category.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Category); + } + if (Type != global::Mediapipe.Object.Types.Type.UndefinedType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + size += rotation_.CalculateSize(_repeated_rotation_codec); + size += translation_.CalculateSize(_repeated_translation_codec); + size += scale_.CalculateSize(_repeated_scale_codec); + size += keypoints_.CalculateSize(_repeated_keypoints_codec); + if (Method != global::Mediapipe.Object.Types.Method.UnknownMethod) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Method); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Object other) { + if (other == null) { + return; + } + if (other.Id != 0) { + Id = other.Id; + } + if (other.Category.Length != 0) { + Category = other.Category; + } + if (other.Type != global::Mediapipe.Object.Types.Type.UndefinedType) { + Type = other.Type; + } + rotation_.Add(other.rotation_); + translation_.Add(other.translation_); + scale_.Add(other.scale_); + keypoints_.Add(other.keypoints_); + if (other.Method != global::Mediapipe.Object.Types.Method.UnknownMethod) { + Method = other.Method; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + Category = input.ReadString(); + break; + } + case 24: { + Type = (global::Mediapipe.Object.Types.Type) input.ReadEnum(); + break; + } + case 34: + case 37: { + rotation_.AddEntriesFrom(input, _repeated_rotation_codec); + break; + } + case 42: + case 45: { + translation_.AddEntriesFrom(input, _repeated_translation_codec); + break; + } + case 50: + case 53: { + scale_.AddEntriesFrom(input, _repeated_scale_codec); + break; + } + case 58: { + keypoints_.AddEntriesFrom(input, _repeated_keypoints_codec); + break; + } + case 64: { + Method = (global::Mediapipe.Object.Types.Method) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Id = input.ReadInt32(); + break; + } + case 18: { + Category = input.ReadString(); + break; + } + case 24: { + Type = (global::Mediapipe.Object.Types.Type) input.ReadEnum(); + break; + } + case 34: + case 37: { + rotation_.AddEntriesFrom(ref input, _repeated_rotation_codec); + break; + } + case 42: + case 45: { + translation_.AddEntriesFrom(ref input, _repeated_translation_codec); + break; + } + case 50: + case 53: { + scale_.AddEntriesFrom(ref input, _repeated_scale_codec); + break; + } + case 58: { + keypoints_.AddEntriesFrom(ref input, _repeated_keypoints_codec); + break; + } + case 64: { + Method = (global::Mediapipe.Object.Types.Method) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Object message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Type { + [pbr::OriginalName("UNDEFINED_TYPE")] UndefinedType = 0, + [pbr::OriginalName("BOUNDING_BOX")] BoundingBox = 1, + [pbr::OriginalName("SKELETON")] Skeleton = 2, + } + + /// + /// Enum to reflect how this object is created. + /// + public enum Method { + [pbr::OriginalName("UNKNOWN_METHOD")] UnknownMethod = 0, + /// + /// Created by data annotation. + /// + [pbr::OriginalName("ANNOTATION")] Annotation = 1, + /// + /// Created by data augmentation. + /// + [pbr::OriginalName("AUGMENTATION")] Augmentation = 2, + } + + } + #endregion + + } + + /// + /// The edge connecting two keypoints together + /// + public sealed partial class Edge : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Edge()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ObjectReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Edge() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Edge(Edge other) : this() { + source_ = other.source_; + sink_ = other.sink_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Edge Clone() { + return new Edge(this); + } + + /// Field number for the "source" field. + public const int SourceFieldNumber = 1; + private int source_; + /// + /// keypoint id of the edge's source + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Source { + get { return source_; } + set { + source_ = value; + } + } + + /// Field number for the "sink" field. + public const int SinkFieldNumber = 2; + private int sink_; + /// + /// keypoint id of the edge's sink + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Sink { + get { return sink_; } + set { + sink_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Edge); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Edge other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Source != other.Source) return false; + if (Sink != other.Sink) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Source != 0) hash ^= Source.GetHashCode(); + if (Sink != 0) hash ^= Sink.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Source != 0) { + output.WriteRawTag(8); + output.WriteInt32(Source); + } + if (Sink != 0) { + output.WriteRawTag(16); + output.WriteInt32(Sink); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Source != 0) { + output.WriteRawTag(8); + output.WriteInt32(Source); + } + if (Sink != 0) { + output.WriteRawTag(16); + output.WriteInt32(Sink); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Source != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Source); + } + if (Sink != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Sink); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Edge other) { + if (other == null) { + return; + } + if (other.Source != 0) { + Source = other.Source; + } + if (other.Sink != 0) { + Sink = other.Sink; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Source = input.ReadInt32(); + break; + } + case 16: { + Sink = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Source = input.ReadInt32(); + break; + } + case 16: { + Sink = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// The skeleton template for different objects (e.g. humans, chairs, hands, etc) + /// The annotation tool reads the skeleton template dictionary. + /// + public sealed partial class Skeleton : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Skeleton()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ObjectReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeleton() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeleton(Skeleton other) : this() { + referenceKeypoint_ = other.referenceKeypoint_; + category_ = other.category_; + keypoints_ = other.keypoints_.Clone(); + edges_ = other.edges_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeleton Clone() { + return new Skeleton(this); + } + + /// Field number for the "reference_keypoint" field. + public const int ReferenceKeypointFieldNumber = 1; + private int referenceKeypoint_; + /// + /// The origin keypoint in the object coordinate system. (i.e. Point 0, 0, 0) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ReferenceKeypoint { + get { return referenceKeypoint_; } + set { + referenceKeypoint_ = value; + } + } + + /// Field number for the "category" field. + public const int CategoryFieldNumber = 2; + private string category_ = ""; + /// + /// The skeleton's category (e.g. human, chair, hand.). Should be unique in the + /// dictionary. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Category { + get { return category_; } + set { + category_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "keypoints" field. + public const int KeypointsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_keypoints_codec + = pb::FieldCodec.ForMessage(26, global::Mediapipe.KeyPoint.Parser); + private readonly pbc::RepeatedField keypoints_ = new pbc::RepeatedField(); + /// + /// Initialization value for all the keypoints in the skeleton in the object's + /// local coordinate system. Pursuit will transform these points using object's + /// transformation to get the keypoint in the world-cooridnate. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Keypoints { + get { return keypoints_; } + } + + /// Field number for the "edges" field. + public const int EdgesFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_edges_codec + = pb::FieldCodec.ForMessage(34, global::Mediapipe.Edge.Parser); + private readonly pbc::RepeatedField edges_ = new pbc::RepeatedField(); + /// + /// List of edges connecting keypoints + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Edges { + get { return edges_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Skeleton); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Skeleton other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ReferenceKeypoint != other.ReferenceKeypoint) return false; + if (Category != other.Category) return false; + if(!keypoints_.Equals(other.keypoints_)) return false; + if(!edges_.Equals(other.edges_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ReferenceKeypoint != 0) hash ^= ReferenceKeypoint.GetHashCode(); + if (Category.Length != 0) hash ^= Category.GetHashCode(); + hash ^= keypoints_.GetHashCode(); + hash ^= edges_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ReferenceKeypoint != 0) { + output.WriteRawTag(8); + output.WriteInt32(ReferenceKeypoint); + } + if (Category.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Category); + } + keypoints_.WriteTo(output, _repeated_keypoints_codec); + edges_.WriteTo(output, _repeated_edges_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ReferenceKeypoint != 0) { + output.WriteRawTag(8); + output.WriteInt32(ReferenceKeypoint); + } + if (Category.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Category); + } + keypoints_.WriteTo(ref output, _repeated_keypoints_codec); + edges_.WriteTo(ref output, _repeated_edges_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ReferenceKeypoint != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReferenceKeypoint); + } + if (Category.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Category); + } + size += keypoints_.CalculateSize(_repeated_keypoints_codec); + size += edges_.CalculateSize(_repeated_edges_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Skeleton other) { + if (other == null) { + return; + } + if (other.ReferenceKeypoint != 0) { + ReferenceKeypoint = other.ReferenceKeypoint; + } + if (other.Category.Length != 0) { + Category = other.Category; + } + keypoints_.Add(other.keypoints_); + edges_.Add(other.edges_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ReferenceKeypoint = input.ReadInt32(); + break; + } + case 18: { + Category = input.ReadString(); + break; + } + case 26: { + keypoints_.AddEntriesFrom(input, _repeated_keypoints_codec); + break; + } + case 34: { + edges_.AddEntriesFrom(input, _repeated_edges_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ReferenceKeypoint = input.ReadInt32(); + break; + } + case 18: { + Category = input.ReadString(); + break; + } + case 26: { + keypoints_.AddEntriesFrom(ref input, _repeated_keypoints_codec); + break; + } + case 34: { + edges_.AddEntriesFrom(ref input, _repeated_edges_codec); + break; + } + } + } + } + #endif + + } + + /// + /// The list of all the modeled skeletons in our library. These models can be + /// objects (chairs, desks, etc), humans (full pose, hands, faces, etc), or box. + /// We can have multiple skeletons in the same file. + /// + public sealed partial class Skeletons : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Skeletons()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ObjectReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeletons() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeletons(Skeletons other) : this() { + object_ = other.object_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Skeletons Clone() { + return new Skeletons(this); + } + + /// Field number for the "object" field. + public const int ObjectFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_object_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Skeleton.Parser); + private readonly pbc::RepeatedField object_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Object { + get { return object_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Skeletons); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Skeletons other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!object_.Equals(other.object_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= object_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + object_.WriteTo(output, _repeated_object_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + object_.WriteTo(ref output, _repeated_object_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += object_.CalculateSize(_repeated_object_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Skeletons other) { + if (other == null) { + return; + } + object_.Add(other.object_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + object_.AddEntriesFrom(input, _repeated_object_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + object_.AddEntriesFrom(ref input, _repeated_object_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs.meta new file mode 100644 index 0000000..d7f8e68 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/Object.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7e192bd63a9aefc4818216dbcd906fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs new file mode 100644 index 0000000..de31aaf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs @@ -0,0 +1,428 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/tensors_to_objects_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/tensors_to_objects_calculator.proto + public static partial class TensorsToObjectsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/tensors_to_objects_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorsToObjectsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkttZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvdGVu", + "c29yc190b19vYmplY3RzX2NhbGN1bGF0b3IucHJvdG8SCW1lZGlhcGlwZRok", + "bWVkaWFwaXBlL2ZyYW1ld29yay9jYWxjdWxhdG9yLnByb3RvGkNtZWRpYXBp", + "cGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvYmVsaWVmX2RlY29k", + "ZXJfY29uZmlnLnByb3RvIogCCiFUZW5zb3JzVG9PYmplY3RzQ2FsY3VsYXRv", + "ck9wdGlvbnMSEwoLbnVtX2NsYXNzZXMYASABKAUSFQoNbnVtX2tleXBvaW50", + "cxgCIAEoBRIiChdudW1fdmFsdWVzX3Blcl9rZXlwb2ludBgDIAEoBToBMhI2", + "Cg5kZWNvZGVyX2NvbmZpZxgEIAEoCzIeLm1lZGlhcGlwZS5CZWxpZWZEZWNv", + "ZGVyQ29uZmlnMlsKA2V4dBIcLm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9u", + "cxjU6refASABKAsyLC5tZWRpYXBpcGUuVGVuc29yc1RvT2JqZWN0c0NhbGN1", + "bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.BeliefDecoderConfigReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TensorsToObjectsCalculatorOptions), global::Mediapipe.TensorsToObjectsCalculatorOptions.Parser, new[]{ "NumClasses", "NumKeypoints", "NumValuesPerKeypoint", "DecoderConfig" }, null, null, new pb::Extension[] { global::Mediapipe.TensorsToObjectsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorsToObjectsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorsToObjectsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TensorsToObjectsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToObjectsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToObjectsCalculatorOptions(TensorsToObjectsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numClasses_ = other.numClasses_; + numKeypoints_ = other.numKeypoints_; + numValuesPerKeypoint_ = other.numValuesPerKeypoint_; + decoderConfig_ = other.decoderConfig_ != null ? other.decoderConfig_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TensorsToObjectsCalculatorOptions Clone() { + return new TensorsToObjectsCalculatorOptions(this); + } + + /// Field number for the "num_classes" field. + public const int NumClassesFieldNumber = 1; + private readonly static int NumClassesDefaultValue = 0; + + private int numClasses_; + /// + /// The number of output classes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumClasses { + get { if ((_hasBits0 & 1) != 0) { return numClasses_; } else { return NumClassesDefaultValue; } } + set { + _hasBits0 |= 1; + numClasses_ = value; + } + } + /// Gets whether the "num_classes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumClasses { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_classes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumClasses() { + _hasBits0 &= ~1; + } + + /// Field number for the "num_keypoints" field. + public const int NumKeypointsFieldNumber = 2; + private readonly static int NumKeypointsDefaultValue = 0; + + private int numKeypoints_; + /// + /// The number of predicted keypoints. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumKeypoints { + get { if ((_hasBits0 & 2) != 0) { return numKeypoints_; } else { return NumKeypointsDefaultValue; } } + set { + _hasBits0 |= 2; + numKeypoints_ = value; + } + } + /// Gets whether the "num_keypoints" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumKeypoints { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_keypoints" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumKeypoints() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_values_per_keypoint" field. + public const int NumValuesPerKeypointFieldNumber = 3; + private readonly static int NumValuesPerKeypointDefaultValue = 2; + + private int numValuesPerKeypoint_; + /// + /// The dimension of each keypoint, e.g. number of values predicted for each + /// keypoint. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumValuesPerKeypoint { + get { if ((_hasBits0 & 4) != 0) { return numValuesPerKeypoint_; } else { return NumValuesPerKeypointDefaultValue; } } + set { + _hasBits0 |= 4; + numValuesPerKeypoint_ = value; + } + } + /// Gets whether the "num_values_per_keypoint" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumValuesPerKeypoint { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_values_per_keypoint" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumValuesPerKeypoint() { + _hasBits0 &= ~4; + } + + /// Field number for the "decoder_config" field. + public const int DecoderConfigFieldNumber = 4; + private global::Mediapipe.BeliefDecoderConfig decoderConfig_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BeliefDecoderConfig DecoderConfig { + get { return decoderConfig_; } + set { + decoderConfig_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TensorsToObjectsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TensorsToObjectsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumClasses != other.NumClasses) return false; + if (NumKeypoints != other.NumKeypoints) return false; + if (NumValuesPerKeypoint != other.NumValuesPerKeypoint) return false; + if (!object.Equals(DecoderConfig, other.DecoderConfig)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumClasses) hash ^= NumClasses.GetHashCode(); + if (HasNumKeypoints) hash ^= NumKeypoints.GetHashCode(); + if (HasNumValuesPerKeypoint) hash ^= NumValuesPerKeypoint.GetHashCode(); + if (decoderConfig_ != null) hash ^= DecoderConfig.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumKeypoints) { + output.WriteRawTag(16); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(24); + output.WriteInt32(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + output.WriteRawTag(34); + output.WriteMessage(DecoderConfig); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumKeypoints) { + output.WriteRawTag(16); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(24); + output.WriteInt32(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + output.WriteRawTag(34); + output.WriteMessage(DecoderConfig); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumClasses) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumClasses); + } + if (HasNumKeypoints) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DecoderConfig); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TensorsToObjectsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumClasses) { + NumClasses = other.NumClasses; + } + if (other.HasNumKeypoints) { + NumKeypoints = other.NumKeypoints; + } + if (other.HasNumValuesPerKeypoint) { + NumValuesPerKeypoint = other.NumValuesPerKeypoint; + } + if (other.decoderConfig_ != null) { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + DecoderConfig.MergeFrom(other.DecoderConfig); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumKeypoints = input.ReadInt32(); + break; + } + case 24: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 34: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumKeypoints = input.ReadInt32(); + break; + } + case 24: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 34: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TensorsToObjectsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(334361940, pb::FieldCodec.ForMessage(2674895522, global::Mediapipe.TensorsToObjectsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs.meta new file mode 100644 index 0000000..7304336 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TensorsToObjectsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf360c0e1349e2339bd655d6efaf07bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs new file mode 100644 index 0000000..048eac2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs @@ -0,0 +1,651 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/modules/objectron/calculators/tflite_tensors_to_objects_calculator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/modules/objectron/calculators/tflite_tensors_to_objects_calculator.proto + public static partial class TfliteTensorsToObjectsCalculatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/modules/objectron/calculators/tflite_tensors_to_objects_calculator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TfliteTensorsToObjectsCalculatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ClJtZWRpYXBpcGUvbW9kdWxlcy9vYmplY3Ryb24vY2FsY3VsYXRvcnMvdGZs", + "aXRlX3RlbnNvcnNfdG9fb2JqZWN0c19jYWxjdWxhdG9yLnByb3RvEgltZWRp", + "YXBpcGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90bxpD", + "bWVkaWFwaXBlL21vZHVsZXMvb2JqZWN0cm9uL2NhbGN1bGF0b3JzL2JlbGll", + "Zl9kZWNvZGVyX2NvbmZpZy5wcm90byKjAwonVGZMaXRlVGVuc29yc1RvT2Jq", + "ZWN0c0NhbGN1bGF0b3JPcHRpb25zEhMKC251bV9jbGFzc2VzGAEgASgFEhUK", + "DW51bV9rZXlwb2ludHMYAiABKAUSIgoXbnVtX3ZhbHVlc19wZXJfa2V5cG9p", + "bnQYAyABKAU6ATISNgoOZGVjb2Rlcl9jb25maWcYBCABKAsyHi5tZWRpYXBp", + "cGUuQmVsaWVmRGVjb2RlckNvbmZpZxIdChJub3JtYWxpemVkX2ZvY2FsX3gY", + "BSABKAI6ATESHQoSbm9ybWFsaXplZF9mb2NhbF95GAYgASgCOgExEicKHG5v", + "cm1hbGl6ZWRfcHJpbmNpcGFsX3BvaW50X3gYByABKAI6ATASJwocbm9ybWFs", + "aXplZF9wcmluY2lwYWxfcG9pbnRfeRgIIAEoAjoBMDJgCgNleHQSHC5tZWRp", + "YXBpcGUuQ2FsY3VsYXRvck9wdGlvbnMYvv/cfSABKAsyMi5tZWRpYXBpcGUu", + "VGZMaXRlVGVuc29yc1RvT2JqZWN0c0NhbGN1bGF0b3JPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, global::Mediapipe.BeliefDecoderConfigReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TfLiteTensorsToObjectsCalculatorOptions), global::Mediapipe.TfLiteTensorsToObjectsCalculatorOptions.Parser, new[]{ "NumClasses", "NumKeypoints", "NumValuesPerKeypoint", "DecoderConfig", "NormalizedFocalX", "NormalizedFocalY", "NormalizedPrincipalPointX", "NormalizedPrincipalPointY" }, null, null, new pb::Extension[] { global::Mediapipe.TfLiteTensorsToObjectsCalculatorOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TfLiteTensorsToObjectsCalculatorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TfLiteTensorsToObjectsCalculatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TfliteTensorsToObjectsCalculatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToObjectsCalculatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToObjectsCalculatorOptions(TfLiteTensorsToObjectsCalculatorOptions other) : this() { + _hasBits0 = other._hasBits0; + numClasses_ = other.numClasses_; + numKeypoints_ = other.numKeypoints_; + numValuesPerKeypoint_ = other.numValuesPerKeypoint_; + decoderConfig_ = other.decoderConfig_ != null ? other.decoderConfig_.Clone() : null; + normalizedFocalX_ = other.normalizedFocalX_; + normalizedFocalY_ = other.normalizedFocalY_; + normalizedPrincipalPointX_ = other.normalizedPrincipalPointX_; + normalizedPrincipalPointY_ = other.normalizedPrincipalPointY_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TfLiteTensorsToObjectsCalculatorOptions Clone() { + return new TfLiteTensorsToObjectsCalculatorOptions(this); + } + + /// Field number for the "num_classes" field. + public const int NumClassesFieldNumber = 1; + private readonly static int NumClassesDefaultValue = 0; + + private int numClasses_; + /// + /// The number of output classes predicted by the detection model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumClasses { + get { if ((_hasBits0 & 1) != 0) { return numClasses_; } else { return NumClassesDefaultValue; } } + set { + _hasBits0 |= 1; + numClasses_ = value; + } + } + /// Gets whether the "num_classes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumClasses { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_classes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumClasses() { + _hasBits0 &= ~1; + } + + /// Field number for the "num_keypoints" field. + public const int NumKeypointsFieldNumber = 2; + private readonly static int NumKeypointsDefaultValue = 0; + + private int numKeypoints_; + /// + /// The number of predicted keypoints. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumKeypoints { + get { if ((_hasBits0 & 2) != 0) { return numKeypoints_; } else { return NumKeypointsDefaultValue; } } + set { + _hasBits0 |= 2; + numKeypoints_ = value; + } + } + /// Gets whether the "num_keypoints" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumKeypoints { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_keypoints" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumKeypoints() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_values_per_keypoint" field. + public const int NumValuesPerKeypointFieldNumber = 3; + private readonly static int NumValuesPerKeypointDefaultValue = 2; + + private int numValuesPerKeypoint_; + /// + /// The dimension of each keypoint, e.g. number of values predicted for each + /// keypoint. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumValuesPerKeypoint { + get { if ((_hasBits0 & 4) != 0) { return numValuesPerKeypoint_; } else { return NumValuesPerKeypointDefaultValue; } } + set { + _hasBits0 |= 4; + numValuesPerKeypoint_ = value; + } + } + /// Gets whether the "num_values_per_keypoint" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumValuesPerKeypoint { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_values_per_keypoint" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumValuesPerKeypoint() { + _hasBits0 &= ~4; + } + + /// Field number for the "decoder_config" field. + public const int DecoderConfigFieldNumber = 4; + private global::Mediapipe.BeliefDecoderConfig decoderConfig_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BeliefDecoderConfig DecoderConfig { + get { return decoderConfig_; } + set { + decoderConfig_ = value; + } + } + + /// Field number for the "normalized_focal_x" field. + public const int NormalizedFocalXFieldNumber = 5; + private readonly static float NormalizedFocalXDefaultValue = 1F; + + private float normalizedFocalX_; + /// + /// Camera focal length along x, normalized by width/2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedFocalX { + get { if ((_hasBits0 & 8) != 0) { return normalizedFocalX_; } else { return NormalizedFocalXDefaultValue; } } + set { + _hasBits0 |= 8; + normalizedFocalX_ = value; + } + } + /// Gets whether the "normalized_focal_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedFocalX { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "normalized_focal_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedFocalX() { + _hasBits0 &= ~8; + } + + /// Field number for the "normalized_focal_y" field. + public const int NormalizedFocalYFieldNumber = 6; + private readonly static float NormalizedFocalYDefaultValue = 1F; + + private float normalizedFocalY_; + /// + /// Camera focal length along y, normalized by height/2. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedFocalY { + get { if ((_hasBits0 & 16) != 0) { return normalizedFocalY_; } else { return NormalizedFocalYDefaultValue; } } + set { + _hasBits0 |= 16; + normalizedFocalY_ = value; + } + } + /// Gets whether the "normalized_focal_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedFocalY { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalized_focal_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedFocalY() { + _hasBits0 &= ~16; + } + + /// Field number for the "normalized_principal_point_x" field. + public const int NormalizedPrincipalPointXFieldNumber = 7; + private readonly static float NormalizedPrincipalPointXDefaultValue = 0F; + + private float normalizedPrincipalPointX_; + /// + /// Camera principle point x, normalized by width/2, origin is image center. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedPrincipalPointX { + get { if ((_hasBits0 & 32) != 0) { return normalizedPrincipalPointX_; } else { return NormalizedPrincipalPointXDefaultValue; } } + set { + _hasBits0 |= 32; + normalizedPrincipalPointX_ = value; + } + } + /// Gets whether the "normalized_principal_point_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedPrincipalPointX { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "normalized_principal_point_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedPrincipalPointX() { + _hasBits0 &= ~32; + } + + /// Field number for the "normalized_principal_point_y" field. + public const int NormalizedPrincipalPointYFieldNumber = 8; + private readonly static float NormalizedPrincipalPointYDefaultValue = 0F; + + private float normalizedPrincipalPointY_; + /// + /// Camera principle point y, normalized by height/2, origin is image center. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormalizedPrincipalPointY { + get { if ((_hasBits0 & 64) != 0) { return normalizedPrincipalPointY_; } else { return NormalizedPrincipalPointYDefaultValue; } } + set { + _hasBits0 |= 64; + normalizedPrincipalPointY_ = value; + } + } + /// Gets whether the "normalized_principal_point_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalizedPrincipalPointY { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "normalized_principal_point_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalizedPrincipalPointY() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TfLiteTensorsToObjectsCalculatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TfLiteTensorsToObjectsCalculatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumClasses != other.NumClasses) return false; + if (NumKeypoints != other.NumKeypoints) return false; + if (NumValuesPerKeypoint != other.NumValuesPerKeypoint) return false; + if (!object.Equals(DecoderConfig, other.DecoderConfig)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedFocalX, other.NormalizedFocalX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedFocalY, other.NormalizedFocalY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedPrincipalPointX, other.NormalizedPrincipalPointX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormalizedPrincipalPointY, other.NormalizedPrincipalPointY)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumClasses) hash ^= NumClasses.GetHashCode(); + if (HasNumKeypoints) hash ^= NumKeypoints.GetHashCode(); + if (HasNumValuesPerKeypoint) hash ^= NumValuesPerKeypoint.GetHashCode(); + if (decoderConfig_ != null) hash ^= DecoderConfig.GetHashCode(); + if (HasNormalizedFocalX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedFocalX); + if (HasNormalizedFocalY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedFocalY); + if (HasNormalizedPrincipalPointX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedPrincipalPointX); + if (HasNormalizedPrincipalPointY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormalizedPrincipalPointY); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumKeypoints) { + output.WriteRawTag(16); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(24); + output.WriteInt32(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + output.WriteRawTag(34); + output.WriteMessage(DecoderConfig); + } + if (HasNormalizedFocalX) { + output.WriteRawTag(45); + output.WriteFloat(NormalizedFocalX); + } + if (HasNormalizedFocalY) { + output.WriteRawTag(53); + output.WriteFloat(NormalizedFocalY); + } + if (HasNormalizedPrincipalPointX) { + output.WriteRawTag(61); + output.WriteFloat(NormalizedPrincipalPointX); + } + if (HasNormalizedPrincipalPointY) { + output.WriteRawTag(69); + output.WriteFloat(NormalizedPrincipalPointY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumClasses) { + output.WriteRawTag(8); + output.WriteInt32(NumClasses); + } + if (HasNumKeypoints) { + output.WriteRawTag(16); + output.WriteInt32(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + output.WriteRawTag(24); + output.WriteInt32(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + output.WriteRawTag(34); + output.WriteMessage(DecoderConfig); + } + if (HasNormalizedFocalX) { + output.WriteRawTag(45); + output.WriteFloat(NormalizedFocalX); + } + if (HasNormalizedFocalY) { + output.WriteRawTag(53); + output.WriteFloat(NormalizedFocalY); + } + if (HasNormalizedPrincipalPointX) { + output.WriteRawTag(61); + output.WriteFloat(NormalizedPrincipalPointX); + } + if (HasNormalizedPrincipalPointY) { + output.WriteRawTag(69); + output.WriteFloat(NormalizedPrincipalPointY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumClasses) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumClasses); + } + if (HasNumKeypoints) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumKeypoints); + } + if (HasNumValuesPerKeypoint) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumValuesPerKeypoint); + } + if (decoderConfig_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DecoderConfig); + } + if (HasNormalizedFocalX) { + size += 1 + 4; + } + if (HasNormalizedFocalY) { + size += 1 + 4; + } + if (HasNormalizedPrincipalPointX) { + size += 1 + 4; + } + if (HasNormalizedPrincipalPointY) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TfLiteTensorsToObjectsCalculatorOptions other) { + if (other == null) { + return; + } + if (other.HasNumClasses) { + NumClasses = other.NumClasses; + } + if (other.HasNumKeypoints) { + NumKeypoints = other.NumKeypoints; + } + if (other.HasNumValuesPerKeypoint) { + NumValuesPerKeypoint = other.NumValuesPerKeypoint; + } + if (other.decoderConfig_ != null) { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + DecoderConfig.MergeFrom(other.DecoderConfig); + } + if (other.HasNormalizedFocalX) { + NormalizedFocalX = other.NormalizedFocalX; + } + if (other.HasNormalizedFocalY) { + NormalizedFocalY = other.NormalizedFocalY; + } + if (other.HasNormalizedPrincipalPointX) { + NormalizedPrincipalPointX = other.NormalizedPrincipalPointX; + } + if (other.HasNormalizedPrincipalPointY) { + NormalizedPrincipalPointY = other.NormalizedPrincipalPointY; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumKeypoints = input.ReadInt32(); + break; + } + case 24: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 34: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + case 45: { + NormalizedFocalX = input.ReadFloat(); + break; + } + case 53: { + NormalizedFocalY = input.ReadFloat(); + break; + } + case 61: { + NormalizedPrincipalPointX = input.ReadFloat(); + break; + } + case 69: { + NormalizedPrincipalPointY = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumClasses = input.ReadInt32(); + break; + } + case 16: { + NumKeypoints = input.ReadInt32(); + break; + } + case 24: { + NumValuesPerKeypoint = input.ReadInt32(); + break; + } + case 34: { + if (decoderConfig_ == null) { + DecoderConfig = new global::Mediapipe.BeliefDecoderConfig(); + } + input.ReadMessage(DecoderConfig); + break; + } + case 45: { + NormalizedFocalX = input.ReadFloat(); + break; + } + case 53: { + NormalizedFocalY = input.ReadFloat(); + break; + } + case 61: { + NormalizedPrincipalPointX = input.ReadFloat(); + break; + } + case 69: { + NormalizedPrincipalPointY = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the TfLiteTensorsToObjectsCalculatorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(263667646, pb::FieldCodec.ForMessage(2109341170, global::Mediapipe.TfLiteTensorsToObjectsCalculatorOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs.meta new file mode 100644 index 0000000..bff2e46 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Modules/Objectron/Calculators/TfliteTensorsToObjectsCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fefbc482bc9248f67adbe79ac750595e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util.meta new file mode 100644 index 0000000..badd4f4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa5adaffef11cd14c934f3dcce6016e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs new file mode 100644 index 0000000..852905a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs @@ -0,0 +1,787 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/audio_decoder.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/audio_decoder.proto + public static partial class AudioDecoderReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/audio_decoder.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AudioDecoderReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiJtZWRpYXBpcGUvdXRpbC9hdWRpb19kZWNvZGVyLnByb3RvEgltZWRpYXBp", + "cGUaJG1lZGlhcGlwZS9mcmFtZXdvcmsvY2FsY3VsYXRvci5wcm90byLBAQoS", + "QXVkaW9TdHJlYW1PcHRpb25zEhcKDHN0cmVhbV9pbmRleBgBIAEoAzoBMBIc", + "Cg1hbGxvd19taXNzaW5nGAIgASgIOgVmYWxzZRIlChZpZ25vcmVfZGVjb2Rl", + "X2ZhaWx1cmVzGAMgASgIOgVmYWxzZRIrChxvdXRwdXRfcmVncmVzc2luZ190", + "aW1lc3RhbXBzGAQgASgIOgVmYWxzZRIgChhjb3JyZWN0X3B0c19mb3Jfcm9s", + "bG92ZXIYBSABKAgivgEKE0F1ZGlvRGVjb2Rlck9wdGlvbnMSMwoMYXVkaW9f", + "c3RyZWFtGAEgAygLMh0ubWVkaWFwaXBlLkF1ZGlvU3RyZWFtT3B0aW9ucxIS", + "CgpzdGFydF90aW1lGAIgASgBEhAKCGVuZF90aW1lGAMgASgBMkwKA2V4dBIc", + "Lm1lZGlhcGlwZS5DYWxjdWxhdG9yT3B0aW9ucxiy78p9IAEoCzIeLm1lZGlh", + "cGlwZS5BdWRpb0RlY29kZXJPcHRpb25z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CalculatorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AudioStreamOptions), global::Mediapipe.AudioStreamOptions.Parser, new[]{ "StreamIndex", "AllowMissing", "IgnoreDecodeFailures", "OutputRegressingTimestamps", "CorrectPtsForRollover" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AudioDecoderOptions), global::Mediapipe.AudioDecoderOptions.Parser, new[]{ "AudioStream", "StartTime", "EndTime" }, null, null, new pb::Extension[] { global::Mediapipe.AudioDecoderOptions.Extensions.Ext }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class AudioStreamOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AudioStreamOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AudioDecoderReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioStreamOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioStreamOptions(AudioStreamOptions other) : this() { + _hasBits0 = other._hasBits0; + streamIndex_ = other.streamIndex_; + allowMissing_ = other.allowMissing_; + ignoreDecodeFailures_ = other.ignoreDecodeFailures_; + outputRegressingTimestamps_ = other.outputRegressingTimestamps_; + correctPtsForRollover_ = other.correctPtsForRollover_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioStreamOptions Clone() { + return new AudioStreamOptions(this); + } + + /// Field number for the "stream_index" field. + public const int StreamIndexFieldNumber = 1; + private readonly static long StreamIndexDefaultValue = 0L; + + private long streamIndex_; + /// + /// The stream to decode. Stream indexes start from 0 (audio and video + /// are handled separately). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long StreamIndex { + get { if ((_hasBits0 & 1) != 0) { return streamIndex_; } else { return StreamIndexDefaultValue; } } + set { + _hasBits0 |= 1; + streamIndex_ = value; + } + } + /// Gets whether the "stream_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStreamIndex { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "stream_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStreamIndex() { + _hasBits0 &= ~1; + } + + /// Field number for the "allow_missing" field. + public const int AllowMissingFieldNumber = 2; + private readonly static bool AllowMissingDefaultValue = false; + + private bool allowMissing_; + /// + /// Process the file despite this stream not being present. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AllowMissing { + get { if ((_hasBits0 & 2) != 0) { return allowMissing_; } else { return AllowMissingDefaultValue; } } + set { + _hasBits0 |= 2; + allowMissing_ = value; + } + } + /// Gets whether the "allow_missing" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAllowMissing { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "allow_missing" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAllowMissing() { + _hasBits0 &= ~2; + } + + /// Field number for the "ignore_decode_failures" field. + public const int IgnoreDecodeFailuresFieldNumber = 3; + private readonly static bool IgnoreDecodeFailuresDefaultValue = false; + + private bool ignoreDecodeFailures_; + /// + /// If true, failures to decode a frame of data will be ignored. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IgnoreDecodeFailures { + get { if ((_hasBits0 & 4) != 0) { return ignoreDecodeFailures_; } else { return IgnoreDecodeFailuresDefaultValue; } } + set { + _hasBits0 |= 4; + ignoreDecodeFailures_ = value; + } + } + /// Gets whether the "ignore_decode_failures" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIgnoreDecodeFailures { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "ignore_decode_failures" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIgnoreDecodeFailures() { + _hasBits0 &= ~4; + } + + /// Field number for the "output_regressing_timestamps" field. + public const int OutputRegressingTimestampsFieldNumber = 4; + private readonly static bool OutputRegressingTimestampsDefaultValue = false; + + private bool outputRegressingTimestamps_; + /// + /// Output packets with regressing timestamps. By default those packets are + /// dropped. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputRegressingTimestamps { + get { if ((_hasBits0 & 8) != 0) { return outputRegressingTimestamps_; } else { return OutputRegressingTimestampsDefaultValue; } } + set { + _hasBits0 |= 8; + outputRegressingTimestamps_ = value; + } + } + /// Gets whether the "output_regressing_timestamps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputRegressingTimestamps { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "output_regressing_timestamps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputRegressingTimestamps() { + _hasBits0 &= ~8; + } + + /// Field number for the "correct_pts_for_rollover" field. + public const int CorrectPtsForRolloverFieldNumber = 5; + private readonly static bool CorrectPtsForRolloverDefaultValue = false; + + private bool correctPtsForRollover_; + /// + /// MPEG PTS timestamps roll over back to 0 after 26.5h. If this flag is set + /// we detect any rollover and continue incrementing timestamps past this + /// point. Set this flag if you want non-regressing timestamps for MPEG + /// content where the PTS may roll over. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CorrectPtsForRollover { + get { if ((_hasBits0 & 16) != 0) { return correctPtsForRollover_; } else { return CorrectPtsForRolloverDefaultValue; } } + set { + _hasBits0 |= 16; + correctPtsForRollover_ = value; + } + } + /// Gets whether the "correct_pts_for_rollover" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCorrectPtsForRollover { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "correct_pts_for_rollover" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCorrectPtsForRollover() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AudioStreamOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AudioStreamOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StreamIndex != other.StreamIndex) return false; + if (AllowMissing != other.AllowMissing) return false; + if (IgnoreDecodeFailures != other.IgnoreDecodeFailures) return false; + if (OutputRegressingTimestamps != other.OutputRegressingTimestamps) return false; + if (CorrectPtsForRollover != other.CorrectPtsForRollover) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasStreamIndex) hash ^= StreamIndex.GetHashCode(); + if (HasAllowMissing) hash ^= AllowMissing.GetHashCode(); + if (HasIgnoreDecodeFailures) hash ^= IgnoreDecodeFailures.GetHashCode(); + if (HasOutputRegressingTimestamps) hash ^= OutputRegressingTimestamps.GetHashCode(); + if (HasCorrectPtsForRollover) hash ^= CorrectPtsForRollover.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasStreamIndex) { + output.WriteRawTag(8); + output.WriteInt64(StreamIndex); + } + if (HasAllowMissing) { + output.WriteRawTag(16); + output.WriteBool(AllowMissing); + } + if (HasIgnoreDecodeFailures) { + output.WriteRawTag(24); + output.WriteBool(IgnoreDecodeFailures); + } + if (HasOutputRegressingTimestamps) { + output.WriteRawTag(32); + output.WriteBool(OutputRegressingTimestamps); + } + if (HasCorrectPtsForRollover) { + output.WriteRawTag(40); + output.WriteBool(CorrectPtsForRollover); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStreamIndex) { + output.WriteRawTag(8); + output.WriteInt64(StreamIndex); + } + if (HasAllowMissing) { + output.WriteRawTag(16); + output.WriteBool(AllowMissing); + } + if (HasIgnoreDecodeFailures) { + output.WriteRawTag(24); + output.WriteBool(IgnoreDecodeFailures); + } + if (HasOutputRegressingTimestamps) { + output.WriteRawTag(32); + output.WriteBool(OutputRegressingTimestamps); + } + if (HasCorrectPtsForRollover) { + output.WriteRawTag(40); + output.WriteBool(CorrectPtsForRollover); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasStreamIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StreamIndex); + } + if (HasAllowMissing) { + size += 1 + 1; + } + if (HasIgnoreDecodeFailures) { + size += 1 + 1; + } + if (HasOutputRegressingTimestamps) { + size += 1 + 1; + } + if (HasCorrectPtsForRollover) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AudioStreamOptions other) { + if (other == null) { + return; + } + if (other.HasStreamIndex) { + StreamIndex = other.StreamIndex; + } + if (other.HasAllowMissing) { + AllowMissing = other.AllowMissing; + } + if (other.HasIgnoreDecodeFailures) { + IgnoreDecodeFailures = other.IgnoreDecodeFailures; + } + if (other.HasOutputRegressingTimestamps) { + OutputRegressingTimestamps = other.OutputRegressingTimestamps; + } + if (other.HasCorrectPtsForRollover) { + CorrectPtsForRollover = other.CorrectPtsForRollover; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StreamIndex = input.ReadInt64(); + break; + } + case 16: { + AllowMissing = input.ReadBool(); + break; + } + case 24: { + IgnoreDecodeFailures = input.ReadBool(); + break; + } + case 32: { + OutputRegressingTimestamps = input.ReadBool(); + break; + } + case 40: { + CorrectPtsForRollover = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + StreamIndex = input.ReadInt64(); + break; + } + case 16: { + AllowMissing = input.ReadBool(); + break; + } + case 24: { + IgnoreDecodeFailures = input.ReadBool(); + break; + } + case 32: { + OutputRegressingTimestamps = input.ReadBool(); + break; + } + case 40: { + CorrectPtsForRollover = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class AudioDecoderOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AudioDecoderOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.AudioDecoderReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioDecoderOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioDecoderOptions(AudioDecoderOptions other) : this() { + _hasBits0 = other._hasBits0; + audioStream_ = other.audioStream_.Clone(); + startTime_ = other.startTime_; + endTime_ = other.endTime_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AudioDecoderOptions Clone() { + return new AudioDecoderOptions(this); + } + + /// Field number for the "audio_stream" field. + public const int AudioStreamFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_audioStream_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.AudioStreamOptions.Parser); + private readonly pbc::RepeatedField audioStream_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AudioStream { + get { return audioStream_; } + } + + /// Field number for the "start_time" field. + public const int StartTimeFieldNumber = 2; + private readonly static double StartTimeDefaultValue = 0D; + + private double startTime_; + /// + /// The start time in seconds to decode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double StartTime { + get { if ((_hasBits0 & 1) != 0) { return startTime_; } else { return StartTimeDefaultValue; } } + set { + _hasBits0 |= 1; + startTime_ = value; + } + } + /// Gets whether the "start_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStartTime { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "start_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStartTime() { + _hasBits0 &= ~1; + } + + /// Field number for the "end_time" field. + public const int EndTimeFieldNumber = 3; + private readonly static double EndTimeDefaultValue = 0D; + + private double endTime_; + /// + /// The end time in seconds to decode (inclusive). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double EndTime { + get { if ((_hasBits0 & 2) != 0) { return endTime_; } else { return EndTimeDefaultValue; } } + set { + _hasBits0 |= 2; + endTime_ = value; + } + } + /// Gets whether the "end_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEndTime { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "end_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEndTime() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AudioDecoderOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AudioDecoderOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!audioStream_.Equals(other.audioStream_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(StartTime, other.StartTime)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(EndTime, other.EndTime)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= audioStream_.GetHashCode(); + if (HasStartTime) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(StartTime); + if (HasEndTime) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(EndTime); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + audioStream_.WriteTo(output, _repeated_audioStream_codec); + if (HasStartTime) { + output.WriteRawTag(17); + output.WriteDouble(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(25); + output.WriteDouble(EndTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + audioStream_.WriteTo(ref output, _repeated_audioStream_codec); + if (HasStartTime) { + output.WriteRawTag(17); + output.WriteDouble(StartTime); + } + if (HasEndTime) { + output.WriteRawTag(25); + output.WriteDouble(EndTime); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += audioStream_.CalculateSize(_repeated_audioStream_codec); + if (HasStartTime) { + size += 1 + 8; + } + if (HasEndTime) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AudioDecoderOptions other) { + if (other == null) { + return; + } + audioStream_.Add(other.audioStream_); + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + audioStream_.AddEntriesFrom(input, _repeated_audioStream_codec); + break; + } + case 17: { + StartTime = input.ReadDouble(); + break; + } + case 25: { + EndTime = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + audioStream_.AddEntriesFrom(ref input, _repeated_audioStream_codec); + break; + } + case 17: { + StartTime = input.ReadDouble(); + break; + } + case 25: { + EndTime = input.ReadDouble(); + break; + } + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the AudioDecoderOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension Ext = + new pb::Extension(263370674, pb::FieldCodec.ForMessage(2106965394, global::Mediapipe.AudioDecoderOptions.Parser)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs.meta new file mode 100644 index 0000000..d59525c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/AudioDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0654a376b041dc5cb2e7c5f867e085c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs new file mode 100644 index 0000000..fb400e9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs @@ -0,0 +1,1743 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/box_detector.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/box_detector.proto + public static partial class BoxDetectorReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/box_detector.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BoxDetectorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiptZWRpYXBpcGUvdXRpbC90cmFja2luZy9ib3hfZGV0ZWN0b3IucHJvdG8S", + "CW1lZGlhcGlwZRopbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcvYm94X3RyYWNr", + "ZXIucHJvdG8aKW1lZGlhcGlwZS91dGlsL3RyYWNraW5nL3JlZ2lvbl9mbG93", + "LnByb3RvIuwEChJCb3hEZXRlY3Rvck9wdGlvbnMSRgoKaW5kZXhfdHlwZRgB", + "IAEoDjInLm1lZGlhcGlwZS5Cb3hEZXRlY3Rvck9wdGlvbnMuSW5kZXhUeXBl", + "OglPUEVOQ1ZfQkYSHwoUZGV0ZWN0X2V2ZXJ5X25fZnJhbWUYAiABKAU6ATAS", + "IAoRZGV0ZWN0X291dF9vZl9mb3YYBCABKAg6BWZhbHNlEk4KFGltYWdlX3F1", + "ZXJ5X3NldHRpbmdzGAMgASgLMjAubWVkaWFwaXBlLkJveERldGVjdG9yT3B0", + "aW9ucy5JbWFnZVF1ZXJ5U2V0dGluZ3MSGwoPZGVzY3JpcHRvcl9kaW1zGAUg", + "ASgFOgI0MBIhChZtaW5fbnVtX2NvcnJlc3BvbmRlbmNlGAYgASgFOgE1EiwK", + "HXJhbnNhY19yZXByb2plY3Rpb25fdGhyZXNob2xkGAcgASgCOgUwLjAwNRIf", + "ChJtYXhfbWF0Y2hfZGlzdGFuY2UYCCABKAI6AzAuORIjChZtYXhfcGVyc3Bl", + "Y3RpdmVfZmFjdG9yGAkgASgCOgMwLjEakwEKEkltYWdlUXVlcnlTZXR0aW5n", + "cxIgChNweXJhbWlkX2JvdHRvbV9zaXplGAEgASgFOgM2NDASIQoUcHlyYW1p", + "ZF9zY2FsZV9mYWN0b3IYAiABKAI6AzEuMhIdChJtYXhfcHlyYW1pZF9sZXZl", + "bHMYAyABKAU6ATQSGQoMbWF4X2ZlYXR1cmVzGAQgASgFOgM1MDAiMQoJSW5k", + "ZXhUeXBlEhUKEUlOREVYX1VOU1BFQ0lGSUVEEAASDQoJT1BFTkNWX0JGEAEi", + "nwIKEEJveERldGVjdG9ySW5kZXgSNwoJYm94X2VudHJ5GAEgAygLMiQubWVk", + "aWFwaXBlLkJveERldGVjdG9ySW5kZXguQm94RW50cnka0QEKCEJveEVudHJ5", + "EkQKC2ZyYW1lX2VudHJ5GAEgAygLMi8ubWVkaWFwaXBlLkJveERldGVjdG9y", + "SW5kZXguQm94RW50cnkuRnJhbWVFbnRyeRp/CgpGcmFtZUVudHJ5EiUKA2Jv", + "eBgBIAEoCzIYLm1lZGlhcGlwZS5UaW1lZEJveFByb3RvEhEKCWtleXBvaW50", + "cxgCIAMoAhI3CgtkZXNjcmlwdG9ycxgDIAMoCzIiLm1lZGlhcGlwZS5CaW5h", + "cnlGZWF0dXJlRGVzY3JpcHRvckIxCh1jb20uZ29vZ2xlLm1lZGlhcGlwZS50", + "cmFja2luZ0IQQm94RGV0ZWN0b3JQcm90bw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.BoxTrackerReflection.Descriptor, global::Mediapipe.RegionFlowReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorOptions), global::Mediapipe.BoxDetectorOptions.Parser, new[]{ "IndexType", "DetectEveryNFrame", "DetectOutOfFov", "ImageQuerySettings", "DescriptorDims", "MinNumCorrespondence", "RansacReprojectionThreshold", "MaxMatchDistance", "MaxPerspectiveFactor" }, null, new[]{ typeof(global::Mediapipe.BoxDetectorOptions.Types.IndexType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings), global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings.Parser, new[]{ "PyramidBottomSize", "PyramidScaleFactor", "MaxPyramidLevels", "MaxFeatures" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorIndex), global::Mediapipe.BoxDetectorIndex.Parser, new[]{ "BoxEntry" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorIndex.Types.BoxEntry), global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Parser, new[]{ "FrameEntry" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Types.FrameEntry), global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Types.FrameEntry.Parser, new[]{ "Box", "Keypoints", "Descriptors" }, null, null, null, null)})}) + })); + } + #endregion + + } + #region Messages + public sealed partial class BoxDetectorOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxDetectorOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorOptions(BoxDetectorOptions other) : this() { + _hasBits0 = other._hasBits0; + indexType_ = other.indexType_; + detectEveryNFrame_ = other.detectEveryNFrame_; + detectOutOfFov_ = other.detectOutOfFov_; + imageQuerySettings_ = other.imageQuerySettings_ != null ? other.imageQuerySettings_.Clone() : null; + descriptorDims_ = other.descriptorDims_; + minNumCorrespondence_ = other.minNumCorrespondence_; + ransacReprojectionThreshold_ = other.ransacReprojectionThreshold_; + maxMatchDistance_ = other.maxMatchDistance_; + maxPerspectiveFactor_ = other.maxPerspectiveFactor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorOptions Clone() { + return new BoxDetectorOptions(this); + } + + /// Field number for the "index_type" field. + public const int IndexTypeFieldNumber = 1; + private readonly static global::Mediapipe.BoxDetectorOptions.Types.IndexType IndexTypeDefaultValue = global::Mediapipe.BoxDetectorOptions.Types.IndexType.OpencvBf; + + private global::Mediapipe.BoxDetectorOptions.Types.IndexType indexType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BoxDetectorOptions.Types.IndexType IndexType { + get { if ((_hasBits0 & 1) != 0) { return indexType_; } else { return IndexTypeDefaultValue; } } + set { + _hasBits0 |= 1; + indexType_ = value; + } + } + /// Gets whether the "index_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIndexType { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "index_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIndexType() { + _hasBits0 &= ~1; + } + + /// Field number for the "detect_every_n_frame" field. + public const int DetectEveryNFrameFieldNumber = 2; + private readonly static int DetectEveryNFrameDefaultValue = 0; + + private int detectEveryNFrame_; + /// + /// Decide whether we force detector run every N frame. + /// 0 means detection will never be called. + /// 1 means detect every frame. 2 means detect every other frame. etc.. + /// Currently only applied to image query mode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DetectEveryNFrame { + get { if ((_hasBits0 & 2) != 0) { return detectEveryNFrame_; } else { return DetectEveryNFrameDefaultValue; } } + set { + _hasBits0 |= 2; + detectEveryNFrame_ = value; + } + } + /// Gets whether the "detect_every_n_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDetectEveryNFrame { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "detect_every_n_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDetectEveryNFrame() { + _hasBits0 &= ~2; + } + + /// Field number for the "detect_out_of_fov" field. + public const int DetectOutOfFovFieldNumber = 4; + private readonly static bool DetectOutOfFovDefaultValue = false; + + private bool detectOutOfFov_; + /// + /// Enable box detection when tracked boxes is out of FOV. Detection will be + /// ceased after the detector successfully re-acquire the box. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DetectOutOfFov { + get { if ((_hasBits0 & 4) != 0) { return detectOutOfFov_; } else { return DetectOutOfFovDefaultValue; } } + set { + _hasBits0 |= 4; + detectOutOfFov_ = value; + } + } + /// Gets whether the "detect_out_of_fov" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDetectOutOfFov { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "detect_out_of_fov" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDetectOutOfFov() { + _hasBits0 &= ~4; + } + + /// Field number for the "image_query_settings" field. + public const int ImageQuerySettingsFieldNumber = 3; + private global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings imageQuerySettings_; + /// + /// Options for detection function with image query. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings ImageQuerySettings { + get { return imageQuerySettings_; } + set { + imageQuerySettings_ = value; + } + } + + /// Field number for the "descriptor_dims" field. + public const int DescriptorDimsFieldNumber = 5; + private readonly static int DescriptorDimsDefaultValue = 40; + + private int descriptorDims_; + /// + /// Dimensions (number of elements) for feature descriptor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DescriptorDims { + get { if ((_hasBits0 & 8) != 0) { return descriptorDims_; } else { return DescriptorDimsDefaultValue; } } + set { + _hasBits0 |= 8; + descriptorDims_ = value; + } + } + /// Gets whether the "descriptor_dims" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDescriptorDims { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "descriptor_dims" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDescriptorDims() { + _hasBits0 &= ~8; + } + + /// Field number for the "min_num_correspondence" field. + public const int MinNumCorrespondenceFieldNumber = 6; + private readonly static int MinNumCorrespondenceDefaultValue = 5; + + private int minNumCorrespondence_; + /// + /// Minimum number of correspondence to go through RANSAC. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinNumCorrespondence { + get { if ((_hasBits0 & 16) != 0) { return minNumCorrespondence_; } else { return MinNumCorrespondenceDefaultValue; } } + set { + _hasBits0 |= 16; + minNumCorrespondence_ = value; + } + } + /// Gets whether the "min_num_correspondence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinNumCorrespondence { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "min_num_correspondence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinNumCorrespondence() { + _hasBits0 &= ~16; + } + + /// Field number for the "ransac_reprojection_threshold" field. + public const int RansacReprojectionThresholdFieldNumber = 7; + private readonly static float RansacReprojectionThresholdDefaultValue = 0.005F; + + private float ransacReprojectionThreshold_; + /// + /// Reprojection threshold for RANSAC to find inliers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RansacReprojectionThreshold { + get { if ((_hasBits0 & 32) != 0) { return ransacReprojectionThreshold_; } else { return RansacReprojectionThresholdDefaultValue; } } + set { + _hasBits0 |= 32; + ransacReprojectionThreshold_ = value; + } + } + /// Gets whether the "ransac_reprojection_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRansacReprojectionThreshold { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "ransac_reprojection_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRansacReprojectionThreshold() { + _hasBits0 &= ~32; + } + + /// Field number for the "max_match_distance" field. + public const int MaxMatchDistanceFieldNumber = 8; + private readonly static float MaxMatchDistanceDefaultValue = 0.9F; + + private float maxMatchDistance_; + /// + /// Max distance to match 2 NIMBY features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxMatchDistance { + get { if ((_hasBits0 & 64) != 0) { return maxMatchDistance_; } else { return MaxMatchDistanceDefaultValue; } } + set { + _hasBits0 |= 64; + maxMatchDistance_ = value; + } + } + /// Gets whether the "max_match_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxMatchDistance { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "max_match_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxMatchDistance() { + _hasBits0 &= ~64; + } + + /// Field number for the "max_perspective_factor" field. + public const int MaxPerspectiveFactorFieldNumber = 9; + private readonly static float MaxPerspectiveFactorDefaultValue = 0.1F; + + private float maxPerspectiveFactor_; + /// + /// Max persepective change factor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxPerspectiveFactor { + get { if ((_hasBits0 & 128) != 0) { return maxPerspectiveFactor_; } else { return MaxPerspectiveFactorDefaultValue; } } + set { + _hasBits0 |= 128; + maxPerspectiveFactor_ = value; + } + } + /// Gets whether the "max_perspective_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxPerspectiveFactor { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "max_perspective_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxPerspectiveFactor() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxDetectorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxDetectorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IndexType != other.IndexType) return false; + if (DetectEveryNFrame != other.DetectEveryNFrame) return false; + if (DetectOutOfFov != other.DetectOutOfFov) return false; + if (!object.Equals(ImageQuerySettings, other.ImageQuerySettings)) return false; + if (DescriptorDims != other.DescriptorDims) return false; + if (MinNumCorrespondence != other.MinNumCorrespondence) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RansacReprojectionThreshold, other.RansacReprojectionThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxMatchDistance, other.MaxMatchDistance)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxPerspectiveFactor, other.MaxPerspectiveFactor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIndexType) hash ^= IndexType.GetHashCode(); + if (HasDetectEveryNFrame) hash ^= DetectEveryNFrame.GetHashCode(); + if (HasDetectOutOfFov) hash ^= DetectOutOfFov.GetHashCode(); + if (imageQuerySettings_ != null) hash ^= ImageQuerySettings.GetHashCode(); + if (HasDescriptorDims) hash ^= DescriptorDims.GetHashCode(); + if (HasMinNumCorrespondence) hash ^= MinNumCorrespondence.GetHashCode(); + if (HasRansacReprojectionThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RansacReprojectionThreshold); + if (HasMaxMatchDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxMatchDistance); + if (HasMaxPerspectiveFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxPerspectiveFactor); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIndexType) { + output.WriteRawTag(8); + output.WriteEnum((int) IndexType); + } + if (HasDetectEveryNFrame) { + output.WriteRawTag(16); + output.WriteInt32(DetectEveryNFrame); + } + if (imageQuerySettings_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ImageQuerySettings); + } + if (HasDetectOutOfFov) { + output.WriteRawTag(32); + output.WriteBool(DetectOutOfFov); + } + if (HasDescriptorDims) { + output.WriteRawTag(40); + output.WriteInt32(DescriptorDims); + } + if (HasMinNumCorrespondence) { + output.WriteRawTag(48); + output.WriteInt32(MinNumCorrespondence); + } + if (HasRansacReprojectionThreshold) { + output.WriteRawTag(61); + output.WriteFloat(RansacReprojectionThreshold); + } + if (HasMaxMatchDistance) { + output.WriteRawTag(69); + output.WriteFloat(MaxMatchDistance); + } + if (HasMaxPerspectiveFactor) { + output.WriteRawTag(77); + output.WriteFloat(MaxPerspectiveFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIndexType) { + output.WriteRawTag(8); + output.WriteEnum((int) IndexType); + } + if (HasDetectEveryNFrame) { + output.WriteRawTag(16); + output.WriteInt32(DetectEveryNFrame); + } + if (imageQuerySettings_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ImageQuerySettings); + } + if (HasDetectOutOfFov) { + output.WriteRawTag(32); + output.WriteBool(DetectOutOfFov); + } + if (HasDescriptorDims) { + output.WriteRawTag(40); + output.WriteInt32(DescriptorDims); + } + if (HasMinNumCorrespondence) { + output.WriteRawTag(48); + output.WriteInt32(MinNumCorrespondence); + } + if (HasRansacReprojectionThreshold) { + output.WriteRawTag(61); + output.WriteFloat(RansacReprojectionThreshold); + } + if (HasMaxMatchDistance) { + output.WriteRawTag(69); + output.WriteFloat(MaxMatchDistance); + } + if (HasMaxPerspectiveFactor) { + output.WriteRawTag(77); + output.WriteFloat(MaxPerspectiveFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIndexType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) IndexType); + } + if (HasDetectEveryNFrame) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DetectEveryNFrame); + } + if (HasDetectOutOfFov) { + size += 1 + 1; + } + if (imageQuerySettings_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ImageQuerySettings); + } + if (HasDescriptorDims) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DescriptorDims); + } + if (HasMinNumCorrespondence) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinNumCorrespondence); + } + if (HasRansacReprojectionThreshold) { + size += 1 + 4; + } + if (HasMaxMatchDistance) { + size += 1 + 4; + } + if (HasMaxPerspectiveFactor) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxDetectorOptions other) { + if (other == null) { + return; + } + if (other.HasIndexType) { + IndexType = other.IndexType; + } + if (other.HasDetectEveryNFrame) { + DetectEveryNFrame = other.DetectEveryNFrame; + } + if (other.HasDetectOutOfFov) { + DetectOutOfFov = other.DetectOutOfFov; + } + if (other.imageQuerySettings_ != null) { + if (imageQuerySettings_ == null) { + ImageQuerySettings = new global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings(); + } + ImageQuerySettings.MergeFrom(other.ImageQuerySettings); + } + if (other.HasDescriptorDims) { + DescriptorDims = other.DescriptorDims; + } + if (other.HasMinNumCorrespondence) { + MinNumCorrespondence = other.MinNumCorrespondence; + } + if (other.HasRansacReprojectionThreshold) { + RansacReprojectionThreshold = other.RansacReprojectionThreshold; + } + if (other.HasMaxMatchDistance) { + MaxMatchDistance = other.MaxMatchDistance; + } + if (other.HasMaxPerspectiveFactor) { + MaxPerspectiveFactor = other.MaxPerspectiveFactor; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IndexType = (global::Mediapipe.BoxDetectorOptions.Types.IndexType) input.ReadEnum(); + break; + } + case 16: { + DetectEveryNFrame = input.ReadInt32(); + break; + } + case 26: { + if (imageQuerySettings_ == null) { + ImageQuerySettings = new global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings(); + } + input.ReadMessage(ImageQuerySettings); + break; + } + case 32: { + DetectOutOfFov = input.ReadBool(); + break; + } + case 40: { + DescriptorDims = input.ReadInt32(); + break; + } + case 48: { + MinNumCorrespondence = input.ReadInt32(); + break; + } + case 61: { + RansacReprojectionThreshold = input.ReadFloat(); + break; + } + case 69: { + MaxMatchDistance = input.ReadFloat(); + break; + } + case 77: { + MaxPerspectiveFactor = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IndexType = (global::Mediapipe.BoxDetectorOptions.Types.IndexType) input.ReadEnum(); + break; + } + case 16: { + DetectEveryNFrame = input.ReadInt32(); + break; + } + case 26: { + if (imageQuerySettings_ == null) { + ImageQuerySettings = new global::Mediapipe.BoxDetectorOptions.Types.ImageQuerySettings(); + } + input.ReadMessage(ImageQuerySettings); + break; + } + case 32: { + DetectOutOfFov = input.ReadBool(); + break; + } + case 40: { + DescriptorDims = input.ReadInt32(); + break; + } + case 48: { + MinNumCorrespondence = input.ReadInt32(); + break; + } + case 61: { + RansacReprojectionThreshold = input.ReadFloat(); + break; + } + case 69: { + MaxMatchDistance = input.ReadFloat(); + break; + } + case 77: { + MaxPerspectiveFactor = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the BoxDetectorOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Available types of detector's index and search structure. + /// + public enum IndexType { + [pbr::OriginalName("INDEX_UNSPECIFIED")] IndexUnspecified = 0, + /// + /// BFMatcher from OpenCV + /// + [pbr::OriginalName("OPENCV_BF")] OpencvBf = 1, + } + + /// + /// Options only for detection from image queries. + /// + public sealed partial class ImageQuerySettings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageQuerySettings()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageQuerySettings() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageQuerySettings(ImageQuerySettings other) : this() { + _hasBits0 = other._hasBits0; + pyramidBottomSize_ = other.pyramidBottomSize_; + pyramidScaleFactor_ = other.pyramidScaleFactor_; + maxPyramidLevels_ = other.maxPyramidLevels_; + maxFeatures_ = other.maxFeatures_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ImageQuerySettings Clone() { + return new ImageQuerySettings(this); + } + + /// Field number for the "pyramid_bottom_size" field. + public const int PyramidBottomSizeFieldNumber = 1; + private readonly static int PyramidBottomSizeDefaultValue = 640; + + private int pyramidBottomSize_; + /// + /// Resize the input image's longer edge to this size. Skip resizing if the + /// input size is already smaller than this size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PyramidBottomSize { + get { if ((_hasBits0 & 1) != 0) { return pyramidBottomSize_; } else { return PyramidBottomSizeDefaultValue; } } + set { + _hasBits0 |= 1; + pyramidBottomSize_ = value; + } + } + /// Gets whether the "pyramid_bottom_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPyramidBottomSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "pyramid_bottom_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPyramidBottomSize() { + _hasBits0 &= ~1; + } + + /// Field number for the "pyramid_scale_factor" field. + public const int PyramidScaleFactorFieldNumber = 2; + private readonly static float PyramidScaleFactorDefaultValue = 1.2F; + + private float pyramidScaleFactor_; + /// + /// Scale factor between adjacent pyramid levels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PyramidScaleFactor { + get { if ((_hasBits0 & 2) != 0) { return pyramidScaleFactor_; } else { return PyramidScaleFactorDefaultValue; } } + set { + _hasBits0 |= 2; + pyramidScaleFactor_ = value; + } + } + /// Gets whether the "pyramid_scale_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPyramidScaleFactor { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "pyramid_scale_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPyramidScaleFactor() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_pyramid_levels" field. + public const int MaxPyramidLevelsFieldNumber = 3; + private readonly static int MaxPyramidLevelsDefaultValue = 4; + + private int maxPyramidLevels_; + /// + /// Maximum number of pyramid levels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxPyramidLevels { + get { if ((_hasBits0 & 4) != 0) { return maxPyramidLevels_; } else { return MaxPyramidLevelsDefaultValue; } } + set { + _hasBits0 |= 4; + maxPyramidLevels_ = value; + } + } + /// Gets whether the "max_pyramid_levels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxPyramidLevels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_pyramid_levels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxPyramidLevels() { + _hasBits0 &= ~4; + } + + /// Field number for the "max_features" field. + public const int MaxFeaturesFieldNumber = 4; + private readonly static int MaxFeaturesDefaultValue = 500; + + private int maxFeatures_; + /// + /// Max number of features the detector uses. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxFeatures { + get { if ((_hasBits0 & 8) != 0) { return maxFeatures_; } else { return MaxFeaturesDefaultValue; } } + set { + _hasBits0 |= 8; + maxFeatures_ = value; + } + } + /// Gets whether the "max_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxFeatures { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "max_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxFeatures() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ImageQuerySettings); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ImageQuerySettings other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (PyramidBottomSize != other.PyramidBottomSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PyramidScaleFactor, other.PyramidScaleFactor)) return false; + if (MaxPyramidLevels != other.MaxPyramidLevels) return false; + if (MaxFeatures != other.MaxFeatures) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPyramidBottomSize) hash ^= PyramidBottomSize.GetHashCode(); + if (HasPyramidScaleFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PyramidScaleFactor); + if (HasMaxPyramidLevels) hash ^= MaxPyramidLevels.GetHashCode(); + if (HasMaxFeatures) hash ^= MaxFeatures.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPyramidBottomSize) { + output.WriteRawTag(8); + output.WriteInt32(PyramidBottomSize); + } + if (HasPyramidScaleFactor) { + output.WriteRawTag(21); + output.WriteFloat(PyramidScaleFactor); + } + if (HasMaxPyramidLevels) { + output.WriteRawTag(24); + output.WriteInt32(MaxPyramidLevels); + } + if (HasMaxFeatures) { + output.WriteRawTag(32); + output.WriteInt32(MaxFeatures); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPyramidBottomSize) { + output.WriteRawTag(8); + output.WriteInt32(PyramidBottomSize); + } + if (HasPyramidScaleFactor) { + output.WriteRawTag(21); + output.WriteFloat(PyramidScaleFactor); + } + if (HasMaxPyramidLevels) { + output.WriteRawTag(24); + output.WriteInt32(MaxPyramidLevels); + } + if (HasMaxFeatures) { + output.WriteRawTag(32); + output.WriteInt32(MaxFeatures); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPyramidBottomSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PyramidBottomSize); + } + if (HasPyramidScaleFactor) { + size += 1 + 4; + } + if (HasMaxPyramidLevels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxPyramidLevels); + } + if (HasMaxFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxFeatures); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ImageQuerySettings other) { + if (other == null) { + return; + } + if (other.HasPyramidBottomSize) { + PyramidBottomSize = other.PyramidBottomSize; + } + if (other.HasPyramidScaleFactor) { + PyramidScaleFactor = other.PyramidScaleFactor; + } + if (other.HasMaxPyramidLevels) { + MaxPyramidLevels = other.MaxPyramidLevels; + } + if (other.HasMaxFeatures) { + MaxFeatures = other.MaxFeatures; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PyramidBottomSize = input.ReadInt32(); + break; + } + case 21: { + PyramidScaleFactor = input.ReadFloat(); + break; + } + case 24: { + MaxPyramidLevels = input.ReadInt32(); + break; + } + case 32: { + MaxFeatures = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + PyramidBottomSize = input.ReadInt32(); + break; + } + case 21: { + PyramidScaleFactor = input.ReadFloat(); + break; + } + case 24: { + MaxPyramidLevels = input.ReadInt32(); + break; + } + case 32: { + MaxFeatures = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Proto to hold BoxDetector's internal search index. + /// + public sealed partial class BoxDetectorIndex : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxDetectorIndex()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorIndex() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorIndex(BoxDetectorIndex other) : this() { + boxEntry_ = other.boxEntry_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxDetectorIndex Clone() { + return new BoxDetectorIndex(this); + } + + /// Field number for the "box_entry" field. + public const int BoxEntryFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_boxEntry_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Parser); + private readonly pbc::RepeatedField boxEntry_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField BoxEntry { + get { return boxEntry_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxDetectorIndex); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxDetectorIndex other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!boxEntry_.Equals(other.boxEntry_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= boxEntry_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + boxEntry_.WriteTo(output, _repeated_boxEntry_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + boxEntry_.WriteTo(ref output, _repeated_boxEntry_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += boxEntry_.CalculateSize(_repeated_boxEntry_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxDetectorIndex other) { + if (other == null) { + return; + } + boxEntry_.Add(other.boxEntry_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + boxEntry_.AddEntriesFrom(input, _repeated_boxEntry_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + boxEntry_.AddEntriesFrom(ref input, _repeated_boxEntry_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the BoxDetectorIndex message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Message to hold keypoints and descriptors for each box. + /// + public sealed partial class BoxEntry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxEntry()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorIndex.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxEntry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxEntry(BoxEntry other) : this() { + frameEntry_ = other.frameEntry_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxEntry Clone() { + return new BoxEntry(this); + } + + /// Field number for the "frame_entry" field. + public const int FrameEntryFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_frameEntry_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Types.FrameEntry.Parser); + private readonly pbc::RepeatedField frameEntry_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField FrameEntry { + get { return frameEntry_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxEntry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxEntry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!frameEntry_.Equals(other.frameEntry_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= frameEntry_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + frameEntry_.WriteTo(output, _repeated_frameEntry_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + frameEntry_.WriteTo(ref output, _repeated_frameEntry_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += frameEntry_.CalculateSize(_repeated_frameEntry_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxEntry other) { + if (other == null) { + return; + } + frameEntry_.Add(other.frameEntry_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + frameEntry_.AddEntriesFrom(input, _repeated_frameEntry_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + frameEntry_.AddEntriesFrom(ref input, _repeated_frameEntry_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the BoxEntry message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Message to hold keypoints and descriptors for each appearance. One box + /// could have multiple appearances to account for shape and perspective + /// change, etc.. + /// + public sealed partial class FrameEntry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameEntry()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxDetectorIndex.Types.BoxEntry.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameEntry() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameEntry(FrameEntry other) : this() { + box_ = other.box_ != null ? other.box_.Clone() : null; + keypoints_ = other.keypoints_.Clone(); + descriptors_ = other.descriptors_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameEntry Clone() { + return new FrameEntry(this); + } + + /// Field number for the "box" field. + public const int BoxFieldNumber = 1; + private global::Mediapipe.TimedBoxProto box_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TimedBoxProto Box { + get { return box_; } + set { + box_ = value; + } + } + + /// Field number for the "keypoints" field. + public const int KeypointsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_keypoints_codec + = pb::FieldCodec.ForFloat(21); + private readonly pbc::RepeatedField keypoints_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Keypoints { + get { return keypoints_; } + } + + /// Field number for the "descriptors" field. + public const int DescriptorsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_descriptors_codec + = pb::FieldCodec.ForMessage(26, global::Mediapipe.BinaryFeatureDescriptor.Parser); + private readonly pbc::RepeatedField descriptors_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Descriptors { + get { return descriptors_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameEntry); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameEntry other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Box, other.Box)) return false; + if(!keypoints_.Equals(other.keypoints_)) return false; + if(!descriptors_.Equals(other.descriptors_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (box_ != null) hash ^= Box.GetHashCode(); + hash ^= keypoints_.GetHashCode(); + hash ^= descriptors_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (box_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Box); + } + keypoints_.WriteTo(output, _repeated_keypoints_codec); + descriptors_.WriteTo(output, _repeated_descriptors_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (box_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Box); + } + keypoints_.WriteTo(ref output, _repeated_keypoints_codec); + descriptors_.WriteTo(ref output, _repeated_descriptors_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (box_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Box); + } + size += keypoints_.CalculateSize(_repeated_keypoints_codec); + size += descriptors_.CalculateSize(_repeated_descriptors_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameEntry other) { + if (other == null) { + return; + } + if (other.box_ != null) { + if (box_ == null) { + Box = new global::Mediapipe.TimedBoxProto(); + } + Box.MergeFrom(other.Box); + } + keypoints_.Add(other.keypoints_); + descriptors_.Add(other.descriptors_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (box_ == null) { + Box = new global::Mediapipe.TimedBoxProto(); + } + input.ReadMessage(Box); + break; + } + case 18: + case 21: { + keypoints_.AddEntriesFrom(input, _repeated_keypoints_codec); + break; + } + case 26: { + descriptors_.AddEntriesFrom(input, _repeated_descriptors_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (box_ == null) { + Box = new global::Mediapipe.TimedBoxProto(); + } + input.ReadMessage(Box); + break; + } + case 18: + case 21: { + keypoints_.AddEntriesFrom(ref input, _repeated_keypoints_codec); + break; + } + case 26: { + descriptors_.AddEntriesFrom(ref input, _repeated_descriptors_codec); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs.meta new file mode 100644 index 0000000..1163475 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxDetector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fdc5c49e2bf7c248872bd88c9a22aa4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs new file mode 100644 index 0000000..cbe1cdb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs @@ -0,0 +1,1579 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/box_tracker.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/box_tracker.proto + public static partial class BoxTrackerReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/box_tracker.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BoxTrackerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiltZWRpYXBpcGUvdXRpbC90cmFja2luZy9ib3hfdHJhY2tlci5wcm90bxIJ", + "bWVkaWFwaXBlGiZtZWRpYXBpcGUvdXRpbC90cmFja2luZy90cmFja2luZy5w", + "cm90byKGAgoRQm94VHJhY2tlck9wdGlvbnMSJQoXY2FjaGluZ19jaHVua19z", + "aXplX21zZWMYASABKAU6BDI1MDASJQoRY2FjaGVfZmlsZV9mb3JtYXQYAiAB", + "KAk6CmNodW5rXyUwNGQSHwoUbnVtX3RyYWNraW5nX3dvcmtlcnMYAyABKAU6", + "ATgSJgoXcmVhZF9jaHVua190aW1lb3V0X21zZWMYBCABKAU6BTYwMDAwEiEK", + "EnJlY29yZF9wYXRoX3N0YXRlcxgFIAEoCDoFZmFsc2USNwoSdHJhY2tfc3Rl", + "cF9vcHRpb25zGAYgASgLMhsubWVkaWFwaXBlLlRyYWNrU3RlcE9wdGlvbnMi", + "pwIKDVRpbWVkQm94UHJvdG8SCwoDdG9wGAEgASgCEgwKBGxlZnQYAiABKAIS", + "DgoGYm90dG9tGAMgASgCEg0KBXJpZ2h0GAQgASgCEhAKCHJvdGF0aW9uGAcg", + "ASgCEiwKBHF1YWQYCSABKAsyHi5tZWRpYXBpcGUuTW90aW9uQm94U3RhdGUu", + "UXVhZBIUCgl0aW1lX21zZWMYBSABKAM6ATASDgoCaWQYBiABKAU6Ai0xEg0K", + "BWxhYmVsGA0gASgJEhIKCmNvbmZpZGVuY2UYCCABKAISFAoMYXNwZWN0X3Jh", + "dGlvGAogASgCEhwKDXJlYWNxdWlzaXRpb24YCyABKAg6BWZhbHNlEh8KEHJl", + "cXVlc3RfZ3JvdXBpbmcYDCABKAg6BWZhbHNlIjoKEVRpbWVkQm94UHJvdG9M", + "aXN0EiUKA2JveBgBIAMoCzIYLm1lZGlhcGlwZS5UaW1lZEJveFByb3RvQjAK", + "HWNvbS5nb29nbGUubWVkaWFwaXBlLnRyYWNraW5nQg9Cb3hUcmFja2VyUHJv", + "dG8=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.TrackingReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BoxTrackerOptions), global::Mediapipe.BoxTrackerOptions.Parser, new[]{ "CachingChunkSizeMsec", "CacheFileFormat", "NumTrackingWorkers", "ReadChunkTimeoutMsec", "RecordPathStates", "TrackStepOptions" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedBoxProto), global::Mediapipe.TimedBoxProto.Parser, new[]{ "Top", "Left", "Bottom", "Right", "Rotation", "Quad", "TimeMsec", "Id", "Label", "Confidence", "AspectRatio", "Reacquisition", "RequestGrouping" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TimedBoxProtoList), global::Mediapipe.TimedBoxProtoList.Parser, new[]{ "Box" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class BoxTrackerOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxTrackerOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxTrackerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerOptions(BoxTrackerOptions other) : this() { + _hasBits0 = other._hasBits0; + cachingChunkSizeMsec_ = other.cachingChunkSizeMsec_; + cacheFileFormat_ = other.cacheFileFormat_; + numTrackingWorkers_ = other.numTrackingWorkers_; + readChunkTimeoutMsec_ = other.readChunkTimeoutMsec_; + recordPathStates_ = other.recordPathStates_; + trackStepOptions_ = other.trackStepOptions_ != null ? other.trackStepOptions_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BoxTrackerOptions Clone() { + return new BoxTrackerOptions(this); + } + + /// Field number for the "caching_chunk_size_msec" field. + public const int CachingChunkSizeMsecFieldNumber = 1; + private readonly static int CachingChunkSizeMsecDefaultValue = 2500; + + private int cachingChunkSizeMsec_; + /// + /// Chunk size for caching files. Should be equal to those + /// written by the FlowPackagerCalculator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CachingChunkSizeMsec { + get { if ((_hasBits0 & 1) != 0) { return cachingChunkSizeMsec_; } else { return CachingChunkSizeMsecDefaultValue; } } + set { + _hasBits0 |= 1; + cachingChunkSizeMsec_ = value; + } + } + /// Gets whether the "caching_chunk_size_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCachingChunkSizeMsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "caching_chunk_size_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCachingChunkSizeMsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "cache_file_format" field. + public const int CacheFileFormatFieldNumber = 2; + private readonly static string CacheFileFormatDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Y2h1bmtfJTA0ZA=="), 0, 10); + + private string cacheFileFormat_; + /// + /// Chunk file format. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string CacheFileFormat { + get { return cacheFileFormat_ ?? CacheFileFormatDefaultValue; } + set { + cacheFileFormat_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "cache_file_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCacheFileFormat { + get { return cacheFileFormat_ != null; } + } + /// Clears the value of the "cache_file_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCacheFileFormat() { + cacheFileFormat_ = null; + } + + /// Field number for the "num_tracking_workers" field. + public const int NumTrackingWorkersFieldNumber = 3; + private readonly static int NumTrackingWorkersDefaultValue = 8; + + private int numTrackingWorkers_; + /// + /// Number of simultaneous tracking requests. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumTrackingWorkers { + get { if ((_hasBits0 & 2) != 0) { return numTrackingWorkers_; } else { return NumTrackingWorkersDefaultValue; } } + set { + _hasBits0 |= 2; + numTrackingWorkers_ = value; + } + } + /// Gets whether the "num_tracking_workers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumTrackingWorkers { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "num_tracking_workers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumTrackingWorkers() { + _hasBits0 &= ~2; + } + + /// Field number for the "read_chunk_timeout_msec" field. + public const int ReadChunkTimeoutMsecFieldNumber = 4; + private readonly static int ReadChunkTimeoutMsecDefaultValue = 60000; + + private int readChunkTimeoutMsec_; + /// + /// Maximum waiting time for next chunk, till function times out. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ReadChunkTimeoutMsec { + get { if ((_hasBits0 & 4) != 0) { return readChunkTimeoutMsec_; } else { return ReadChunkTimeoutMsecDefaultValue; } } + set { + _hasBits0 |= 4; + readChunkTimeoutMsec_ = value; + } + } + /// Gets whether the "read_chunk_timeout_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReadChunkTimeoutMsec { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "read_chunk_timeout_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReadChunkTimeoutMsec() { + _hasBits0 &= ~4; + } + + /// Field number for the "record_path_states" field. + public const int RecordPathStatesFieldNumber = 5; + private readonly static bool RecordPathStatesDefaultValue = false; + + private bool recordPathStates_; + /// + /// If set, box tracker will record the state for each computed TimedBox + /// across all paths. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RecordPathStates { + get { if ((_hasBits0 & 8) != 0) { return recordPathStates_; } else { return RecordPathStatesDefaultValue; } } + set { + _hasBits0 |= 8; + recordPathStates_ = value; + } + } + /// Gets whether the "record_path_states" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRecordPathStates { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "record_path_states" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRecordPathStates() { + _hasBits0 &= ~8; + } + + /// Field number for the "track_step_options" field. + public const int TrackStepOptionsFieldNumber = 6; + private global::Mediapipe.TrackStepOptions trackStepOptions_; + /// + /// Actual tracking options to be used for every step. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackStepOptions TrackStepOptions { + get { return trackStepOptions_; } + set { + trackStepOptions_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BoxTrackerOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BoxTrackerOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CachingChunkSizeMsec != other.CachingChunkSizeMsec) return false; + if (CacheFileFormat != other.CacheFileFormat) return false; + if (NumTrackingWorkers != other.NumTrackingWorkers) return false; + if (ReadChunkTimeoutMsec != other.ReadChunkTimeoutMsec) return false; + if (RecordPathStates != other.RecordPathStates) return false; + if (!object.Equals(TrackStepOptions, other.TrackStepOptions)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCachingChunkSizeMsec) hash ^= CachingChunkSizeMsec.GetHashCode(); + if (HasCacheFileFormat) hash ^= CacheFileFormat.GetHashCode(); + if (HasNumTrackingWorkers) hash ^= NumTrackingWorkers.GetHashCode(); + if (HasReadChunkTimeoutMsec) hash ^= ReadChunkTimeoutMsec.GetHashCode(); + if (HasRecordPathStates) hash ^= RecordPathStates.GetHashCode(); + if (trackStepOptions_ != null) hash ^= TrackStepOptions.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCachingChunkSizeMsec) { + output.WriteRawTag(8); + output.WriteInt32(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + output.WriteRawTag(18); + output.WriteString(CacheFileFormat); + } + if (HasNumTrackingWorkers) { + output.WriteRawTag(24); + output.WriteInt32(NumTrackingWorkers); + } + if (HasReadChunkTimeoutMsec) { + output.WriteRawTag(32); + output.WriteInt32(ReadChunkTimeoutMsec); + } + if (HasRecordPathStates) { + output.WriteRawTag(40); + output.WriteBool(RecordPathStates); + } + if (trackStepOptions_ != null) { + output.WriteRawTag(50); + output.WriteMessage(TrackStepOptions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCachingChunkSizeMsec) { + output.WriteRawTag(8); + output.WriteInt32(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + output.WriteRawTag(18); + output.WriteString(CacheFileFormat); + } + if (HasNumTrackingWorkers) { + output.WriteRawTag(24); + output.WriteInt32(NumTrackingWorkers); + } + if (HasReadChunkTimeoutMsec) { + output.WriteRawTag(32); + output.WriteInt32(ReadChunkTimeoutMsec); + } + if (HasRecordPathStates) { + output.WriteRawTag(40); + output.WriteBool(RecordPathStates); + } + if (trackStepOptions_ != null) { + output.WriteRawTag(50); + output.WriteMessage(TrackStepOptions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCachingChunkSizeMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CachingChunkSizeMsec); + } + if (HasCacheFileFormat) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CacheFileFormat); + } + if (HasNumTrackingWorkers) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumTrackingWorkers); + } + if (HasReadChunkTimeoutMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReadChunkTimeoutMsec); + } + if (HasRecordPathStates) { + size += 1 + 1; + } + if (trackStepOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrackStepOptions); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BoxTrackerOptions other) { + if (other == null) { + return; + } + if (other.HasCachingChunkSizeMsec) { + CachingChunkSizeMsec = other.CachingChunkSizeMsec; + } + if (other.HasCacheFileFormat) { + CacheFileFormat = other.CacheFileFormat; + } + if (other.HasNumTrackingWorkers) { + NumTrackingWorkers = other.NumTrackingWorkers; + } + if (other.HasReadChunkTimeoutMsec) { + ReadChunkTimeoutMsec = other.ReadChunkTimeoutMsec; + } + if (other.HasRecordPathStates) { + RecordPathStates = other.RecordPathStates; + } + if (other.trackStepOptions_ != null) { + if (trackStepOptions_ == null) { + TrackStepOptions = new global::Mediapipe.TrackStepOptions(); + } + TrackStepOptions.MergeFrom(other.TrackStepOptions); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + CachingChunkSizeMsec = input.ReadInt32(); + break; + } + case 18: { + CacheFileFormat = input.ReadString(); + break; + } + case 24: { + NumTrackingWorkers = input.ReadInt32(); + break; + } + case 32: { + ReadChunkTimeoutMsec = input.ReadInt32(); + break; + } + case 40: { + RecordPathStates = input.ReadBool(); + break; + } + case 50: { + if (trackStepOptions_ == null) { + TrackStepOptions = new global::Mediapipe.TrackStepOptions(); + } + input.ReadMessage(TrackStepOptions); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + CachingChunkSizeMsec = input.ReadInt32(); + break; + } + case 18: { + CacheFileFormat = input.ReadString(); + break; + } + case 24: { + NumTrackingWorkers = input.ReadInt32(); + break; + } + case 32: { + ReadChunkTimeoutMsec = input.ReadInt32(); + break; + } + case 40: { + RecordPathStates = input.ReadBool(); + break; + } + case 50: { + if (trackStepOptions_ == null) { + TrackStepOptions = new global::Mediapipe.TrackStepOptions(); + } + input.ReadMessage(TrackStepOptions); + break; + } + } + } + } + #endif + + } + + /// + /// Next tag: 14 + /// Proto equivalent of struct TimedBox. + /// + public sealed partial class TimedBoxProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedBoxProto()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxTrackerReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProto(TimedBoxProto other) : this() { + _hasBits0 = other._hasBits0; + top_ = other.top_; + left_ = other.left_; + bottom_ = other.bottom_; + right_ = other.right_; + rotation_ = other.rotation_; + quad_ = other.quad_ != null ? other.quad_.Clone() : null; + timeMsec_ = other.timeMsec_; + id_ = other.id_; + label_ = other.label_; + confidence_ = other.confidence_; + aspectRatio_ = other.aspectRatio_; + reacquisition_ = other.reacquisition_; + requestGrouping_ = other.requestGrouping_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProto Clone() { + return new TimedBoxProto(this); + } + + /// Field number for the "top" field. + public const int TopFieldNumber = 1; + private readonly static float TopDefaultValue = 0F; + + private float top_; + /// + /// Normalized coords - in [0, 1] + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Top { + get { if ((_hasBits0 & 1) != 0) { return top_; } else { return TopDefaultValue; } } + set { + _hasBits0 |= 1; + top_ = value; + } + } + /// Gets whether the "top" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTop { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "top" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTop() { + _hasBits0 &= ~1; + } + + /// Field number for the "left" field. + public const int LeftFieldNumber = 2; + private readonly static float LeftDefaultValue = 0F; + + private float left_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Left { + get { if ((_hasBits0 & 2) != 0) { return left_; } else { return LeftDefaultValue; } } + set { + _hasBits0 |= 2; + left_ = value; + } + } + /// Gets whether the "left" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeft { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "left" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeft() { + _hasBits0 &= ~2; + } + + /// Field number for the "bottom" field. + public const int BottomFieldNumber = 3; + private readonly static float BottomDefaultValue = 0F; + + private float bottom_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Bottom { + get { if ((_hasBits0 & 4) != 0) { return bottom_; } else { return BottomDefaultValue; } } + set { + _hasBits0 |= 4; + bottom_ = value; + } + } + /// Gets whether the "bottom" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBottom { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "bottom" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBottom() { + _hasBits0 &= ~4; + } + + /// Field number for the "right" field. + public const int RightFieldNumber = 4; + private readonly static float RightDefaultValue = 0F; + + private float right_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Right { + get { if ((_hasBits0 & 8) != 0) { return right_; } else { return RightDefaultValue; } } + set { + _hasBits0 |= 8; + right_ = value; + } + } + /// Gets whether the "right" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRight { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "right" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRight() { + _hasBits0 &= ~8; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 7; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// Rotation of box w.r.t. center in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 64) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 64; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~64; + } + + /// Field number for the "quad" field. + public const int QuadFieldNumber = 9; + private global::Mediapipe.MotionBoxState.Types.Quad quad_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionBoxState.Types.Quad Quad { + get { return quad_; } + set { + quad_ = value; + } + } + + /// Field number for the "time_msec" field. + public const int TimeMsecFieldNumber = 5; + private readonly static long TimeMsecDefaultValue = 0L; + + private long timeMsec_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimeMsec { + get { if ((_hasBits0 & 16) != 0) { return timeMsec_; } else { return TimeMsecDefaultValue; } } + set { + _hasBits0 |= 16; + timeMsec_ = value; + } + } + /// Gets whether the "time_msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimeMsec { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "time_msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimeMsec() { + _hasBits0 &= ~16; + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 6; + private readonly static int IdDefaultValue = -1; + + private int id_; + /// + /// Unique per object id to disambiguate boxes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Id { + get { if ((_hasBits0 & 32) != 0) { return id_; } else { return IdDefaultValue; } } + set { + _hasBits0 |= 32; + id_ = value; + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + _hasBits0 &= ~32; + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 13; + private readonly static string LabelDefaultValue = ""; + + private string label_; + /// + /// Box lable name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + /// Field number for the "confidence" field. + public const int ConfidenceFieldNumber = 8; + private readonly static float ConfidenceDefaultValue = 0F; + + private float confidence_; + /// + /// Confidence of box tracked in the range [0, 1], with 0 being least + /// confident, and 1 being most confident. A reasonable threshold is 0.5 + /// to filter out unconfident boxes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Confidence { + get { if ((_hasBits0 & 128) != 0) { return confidence_; } else { return ConfidenceDefaultValue; } } + set { + _hasBits0 |= 128; + confidence_ = value; + } + } + /// Gets whether the "confidence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasConfidence { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "confidence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearConfidence() { + _hasBits0 &= ~128; + } + + /// Field number for the "aspect_ratio" field. + public const int AspectRatioFieldNumber = 10; + private readonly static float AspectRatioDefaultValue = 0F; + + private float aspectRatio_; + /// + /// Aspect ratio (width / height) for the tracked rectangle in physical space. + /// If this field is provided, quad tracking will be performed using + /// 6 degrees of freedom perspective transform between physical rectangle and + /// frame quad. Otherwise, 8 degrees of freedom homography tracking between + /// adjacent frames will be used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AspectRatio { + get { if ((_hasBits0 & 256) != 0) { return aspectRatio_; } else { return AspectRatioDefaultValue; } } + set { + _hasBits0 |= 256; + aspectRatio_ = value; + } + } + /// Gets whether the "aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAspectRatio { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAspectRatio() { + _hasBits0 &= ~256; + } + + /// Field number for the "reacquisition" field. + public const int ReacquisitionFieldNumber = 11; + private readonly static bool ReacquisitionDefaultValue = false; + + private bool reacquisition_; + /// + /// Whether or not to enable reacquisition functionality for this specific box. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Reacquisition { + get { if ((_hasBits0 & 512) != 0) { return reacquisition_; } else { return ReacquisitionDefaultValue; } } + set { + _hasBits0 |= 512; + reacquisition_ = value; + } + } + /// Gets whether the "reacquisition" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReacquisition { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "reacquisition" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReacquisition() { + _hasBits0 &= ~512; + } + + /// Field number for the "request_grouping" field. + public const int RequestGroupingFieldNumber = 12; + private readonly static bool RequestGroupingDefaultValue = false; + + private bool requestGrouping_; + /// + /// Whether we want this box to be potentially grouped with other boxes + /// to track together. This is useful for tracking small boxes that lie + /// on a plane. For example, when we detect a plane, + /// track the plane, then all boxes within the plane can share the same + /// homography transform. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RequestGrouping { + get { if ((_hasBits0 & 1024) != 0) { return requestGrouping_; } else { return RequestGroupingDefaultValue; } } + set { + _hasBits0 |= 1024; + requestGrouping_ = value; + } + } + /// Gets whether the "request_grouping" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRequestGrouping { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "request_grouping" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRequestGrouping() { + _hasBits0 &= ~1024; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedBoxProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedBoxProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Top, other.Top)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Left, other.Left)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Bottom, other.Bottom)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Right, other.Right)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (!object.Equals(Quad, other.Quad)) return false; + if (TimeMsec != other.TimeMsec) return false; + if (Id != other.Id) return false; + if (Label != other.Label) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Confidence, other.Confidence)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AspectRatio, other.AspectRatio)) return false; + if (Reacquisition != other.Reacquisition) return false; + if (RequestGrouping != other.RequestGrouping) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTop) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Top); + if (HasLeft) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Left); + if (HasBottom) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Bottom); + if (HasRight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Right); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (quad_ != null) hash ^= Quad.GetHashCode(); + if (HasTimeMsec) hash ^= TimeMsec.GetHashCode(); + if (HasId) hash ^= Id.GetHashCode(); + if (HasLabel) hash ^= Label.GetHashCode(); + if (HasConfidence) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Confidence); + if (HasAspectRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AspectRatio); + if (HasReacquisition) hash ^= Reacquisition.GetHashCode(); + if (HasRequestGrouping) hash ^= RequestGrouping.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTop) { + output.WriteRawTag(13); + output.WriteFloat(Top); + } + if (HasLeft) { + output.WriteRawTag(21); + output.WriteFloat(Left); + } + if (HasBottom) { + output.WriteRawTag(29); + output.WriteFloat(Bottom); + } + if (HasRight) { + output.WriteRawTag(37); + output.WriteFloat(Right); + } + if (HasTimeMsec) { + output.WriteRawTag(40); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(48); + output.WriteInt32(Id); + } + if (HasRotation) { + output.WriteRawTag(61); + output.WriteFloat(Rotation); + } + if (HasConfidence) { + output.WriteRawTag(69); + output.WriteFloat(Confidence); + } + if (quad_ != null) { + output.WriteRawTag(74); + output.WriteMessage(Quad); + } + if (HasAspectRatio) { + output.WriteRawTag(85); + output.WriteFloat(AspectRatio); + } + if (HasReacquisition) { + output.WriteRawTag(88); + output.WriteBool(Reacquisition); + } + if (HasRequestGrouping) { + output.WriteRawTag(96); + output.WriteBool(RequestGrouping); + } + if (HasLabel) { + output.WriteRawTag(106); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTop) { + output.WriteRawTag(13); + output.WriteFloat(Top); + } + if (HasLeft) { + output.WriteRawTag(21); + output.WriteFloat(Left); + } + if (HasBottom) { + output.WriteRawTag(29); + output.WriteFloat(Bottom); + } + if (HasRight) { + output.WriteRawTag(37); + output.WriteFloat(Right); + } + if (HasTimeMsec) { + output.WriteRawTag(40); + output.WriteInt64(TimeMsec); + } + if (HasId) { + output.WriteRawTag(48); + output.WriteInt32(Id); + } + if (HasRotation) { + output.WriteRawTag(61); + output.WriteFloat(Rotation); + } + if (HasConfidence) { + output.WriteRawTag(69); + output.WriteFloat(Confidence); + } + if (quad_ != null) { + output.WriteRawTag(74); + output.WriteMessage(Quad); + } + if (HasAspectRatio) { + output.WriteRawTag(85); + output.WriteFloat(AspectRatio); + } + if (HasReacquisition) { + output.WriteRawTag(88); + output.WriteBool(Reacquisition); + } + if (HasRequestGrouping) { + output.WriteRawTag(96); + output.WriteBool(RequestGrouping); + } + if (HasLabel) { + output.WriteRawTag(106); + output.WriteString(Label); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTop) { + size += 1 + 4; + } + if (HasLeft) { + size += 1 + 4; + } + if (HasBottom) { + size += 1 + 4; + } + if (HasRight) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + 4; + } + if (quad_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Quad); + } + if (HasTimeMsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimeMsec); + } + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (HasConfidence) { + size += 1 + 4; + } + if (HasAspectRatio) { + size += 1 + 4; + } + if (HasReacquisition) { + size += 1 + 1; + } + if (HasRequestGrouping) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedBoxProto other) { + if (other == null) { + return; + } + if (other.HasTop) { + Top = other.Top; + } + if (other.HasLeft) { + Left = other.Left; + } + if (other.HasBottom) { + Bottom = other.Bottom; + } + if (other.HasRight) { + Right = other.Right; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.quad_ != null) { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + Quad.MergeFrom(other.Quad); + } + if (other.HasTimeMsec) { + TimeMsec = other.TimeMsec; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasConfidence) { + Confidence = other.Confidence; + } + if (other.HasAspectRatio) { + AspectRatio = other.AspectRatio; + } + if (other.HasReacquisition) { + Reacquisition = other.Reacquisition; + } + if (other.HasRequestGrouping) { + RequestGrouping = other.RequestGrouping; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Top = input.ReadFloat(); + break; + } + case 21: { + Left = input.ReadFloat(); + break; + } + case 29: { + Bottom = input.ReadFloat(); + break; + } + case 37: { + Right = input.ReadFloat(); + break; + } + case 40: { + TimeMsec = input.ReadInt64(); + break; + } + case 48: { + Id = input.ReadInt32(); + break; + } + case 61: { + Rotation = input.ReadFloat(); + break; + } + case 69: { + Confidence = input.ReadFloat(); + break; + } + case 74: { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + input.ReadMessage(Quad); + break; + } + case 85: { + AspectRatio = input.ReadFloat(); + break; + } + case 88: { + Reacquisition = input.ReadBool(); + break; + } + case 96: { + RequestGrouping = input.ReadBool(); + break; + } + case 106: { + Label = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Top = input.ReadFloat(); + break; + } + case 21: { + Left = input.ReadFloat(); + break; + } + case 29: { + Bottom = input.ReadFloat(); + break; + } + case 37: { + Right = input.ReadFloat(); + break; + } + case 40: { + TimeMsec = input.ReadInt64(); + break; + } + case 48: { + Id = input.ReadInt32(); + break; + } + case 61: { + Rotation = input.ReadFloat(); + break; + } + case 69: { + Confidence = input.ReadFloat(); + break; + } + case 74: { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + input.ReadMessage(Quad); + break; + } + case 85: { + AspectRatio = input.ReadFloat(); + break; + } + case 88: { + Reacquisition = input.ReadBool(); + break; + } + case 96: { + RequestGrouping = input.ReadBool(); + break; + } + case 106: { + Label = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TimedBoxProtoList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimedBoxProtoList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.BoxTrackerReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProtoList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProtoList(TimedBoxProtoList other) : this() { + box_ = other.box_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TimedBoxProtoList Clone() { + return new TimedBoxProtoList(this); + } + + /// Field number for the "box" field. + public const int BoxFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_box_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.TimedBoxProto.Parser); + private readonly pbc::RepeatedField box_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Box { + get { return box_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TimedBoxProtoList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TimedBoxProtoList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!box_.Equals(other.box_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= box_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + box_.WriteTo(output, _repeated_box_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + box_.WriteTo(ref output, _repeated_box_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += box_.CalculateSize(_repeated_box_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TimedBoxProtoList other) { + if (other == null) { + return; + } + box_.Add(other.box_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + box_.AddEntriesFrom(input, _repeated_box_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + box_.AddEntriesFrom(ref input, _repeated_box_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs.meta new file mode 100644 index 0000000..2d50476 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/BoxTracker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 574c2b0f6cf41dd8398d16cd98ffcc78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs new file mode 100644 index 0000000..0753ce2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs @@ -0,0 +1,1918 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/camera_motion.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/camera_motion.proto + public static partial class CameraMotionReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/camera_motion.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CameraMotionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CittZWRpYXBpcGUvdXRpbC90cmFja2luZy9jYW1lcmFfbW90aW9uLnByb3Rv", + "EgltZWRpYXBpcGUaK21lZGlhcGlwZS91dGlsL3RyYWNraW5nL21vdGlvbl9t", + "b2RlbHMucHJvdG8ihgsKDENhbWVyYU1vdGlvbhIwCgt0cmFuc2xhdGlvbhgB", + "IAEoCzIbLm1lZGlhcGlwZS5UcmFuc2xhdGlvbk1vZGVsEi4KCnNpbWlsYXJp", + "dHkYAiABKAsyGi5tZWRpYXBpcGUuU2ltaWxhcml0eU1vZGVsEjsKEWxpbmVh", + "cl9zaW1pbGFyaXR5GAMgASgLMiAubWVkaWFwaXBlLkxpbmVhclNpbWlsYXJp", + "dHlNb2RlbBImCgZhZmZpbmUYBCABKAsyFi5tZWRpYXBpcGUuQWZmaW5lTW9k", + "ZWwSKQoKaG9tb2dyYXBoeRgFIAEoCzIVLm1lZGlhcGlwZS5Ib21vZ3JhcGh5", + "EjgKEm1peHR1cmVfaG9tb2dyYXBoeRgIIAEoCzIcLm1lZGlhcGlwZS5NaXh0", + "dXJlSG9tb2dyYXBoeRITCgtmcmFtZV93aWR0aBgfIAEoAhIUCgxmcmFtZV9o", + "ZWlnaHQYICABKAISQQobbWl4dHVyZV9ob21vZ3JhcGh5X3NwZWN0cnVtGBcg", + "AygLMhwubWVkaWFwaXBlLk1peHR1cmVIb21vZ3JhcGh5EhkKEW1peHR1cmVf", + "cm93X3NpZ21hGAogASgCEhwKEWF2ZXJhZ2VfbWFnbml0dWRlGBggASgCOgEw", + "Eh8KFHRyYW5zbGF0aW9uX3ZhcmlhbmNlGBkgASgCOgEwEiIKF3NpbWlsYXJp", + "dHlfaW5saWVyX3JhdGlvGB0gASgCOgEwEikKHnNpbWlsYXJpdHlfc3RyaWN0", + "X2lubGllcl9yYXRpbxgeIAEoAjoBMBIgChhhdmVyYWdlX2hvbW9ncmFwaHlf", + "ZXJyb3IYCyABKAISIgoaaG9tb2dyYXBoeV9pbmxpZXJfY292ZXJhZ2UYDCAB", + "KAISKQohaG9tb2dyYXBoeV9zdHJpY3RfaW5saWVyX2NvdmVyYWdlGBYgASgC", + "Eh8KF21peHR1cmVfaW5saWVyX2NvdmVyYWdlGA0gAygCEh0KFXJvbGxpbmdf", + "c2h1dHRlcl9ndWVzcxgOIAEoAhIoChxyb2xsaW5nX3NodXR0ZXJfbW90aW9u", + "X2luZGV4GBAgASgFOgItMRIXCg9vdmVybGF5X2luZGljZXMYESADKAUSGgoO", + "b3ZlcmxheV9kb21haW4YEiABKAU6AjEwEjEKBHR5cGUYBiABKA4yHC5tZWRp", + "YXBpcGUuQ2FtZXJhTW90aW9uLlR5cGU6BVZBTElEEjwKD292ZXJyaWRkZW5f", + "dHlwZRgPIAEoDjIcLm1lZGlhcGlwZS5DYW1lcmFNb3Rpb24uVHlwZToFVkFM", + "SUQSEAoFZmxhZ3MYEyABKAU6ATASEgoKYmx1cl9zY29yZRgUIAEoAhIUCgli", + "bHVyaW5lc3MYFSABKAI6ATASIwobZnJhY19sb25nX2ZlYXR1cmVzX3JlamVj", + "dGVkGBogASgCEhkKDnRpbWVzdGFtcF91c2VjGBsgASgDOgEwEhYKC21hdGNo", + "X2ZyYW1lGBwgASgFOgEwIlIKBFR5cGUSCQoFVkFMSUQQABISCg5VTlNUQUJM", + "RV9IT01PRxABEhAKDFVOU1RBQkxFX1NJTRACEgwKCFVOU1RBQkxFEAMSCwoH", + "SU5WQUxJRBAEIsMBCgVGbGFncxIWChJGTEFHX1NIT1RfQk9VTkRBUlkQARIV", + "ChFGTEFHX0JMVVJSWV9GUkFNRRACEhYKEkZMQUdfTUFKT1JfT1ZFUkxBWRAE", + "EhQKEEZMQUdfU0hBUlBfRlJBTUUQCBIcChhGTEFHX1NJTkdVTEFSX0VTVElN", + "QVRJT04QEBISCg5GTEFHX1NIT1RfRkFERRAgEhMKD0ZMQUdfRFVQTElDQVRF", + "RBBAEhYKEUZMQUdfQ0VOVEVSX0ZSQU1FEIABKgQICRAK")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MotionModelsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.CameraMotion), global::Mediapipe.CameraMotion.Parser, new[]{ "Translation", "Similarity", "LinearSimilarity", "Affine", "Homography", "MixtureHomography", "FrameWidth", "FrameHeight", "MixtureHomographySpectrum", "MixtureRowSigma", "AverageMagnitude", "TranslationVariance", "SimilarityInlierRatio", "SimilarityStrictInlierRatio", "AverageHomographyError", "HomographyInlierCoverage", "HomographyStrictInlierCoverage", "MixtureInlierCoverage", "RollingShutterGuess", "RollingShutterMotionIndex", "OverlayIndices", "OverlayDomain", "Type", "OverriddenType", "Flags", "BlurScore", "Bluriness", "FracLongFeaturesRejected", "TimestampUsec", "MatchFrame" }, null, new[]{ typeof(global::Mediapipe.CameraMotion.Types.Type), typeof(global::Mediapipe.CameraMotion.Types.Flags) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Next tag: 33 + /// + public sealed partial class CameraMotion : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CameraMotion()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.CameraMotionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraMotion() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraMotion(CameraMotion other) : this() { + _hasBits0 = other._hasBits0; + translation_ = other.translation_ != null ? other.translation_.Clone() : null; + similarity_ = other.similarity_ != null ? other.similarity_.Clone() : null; + linearSimilarity_ = other.linearSimilarity_ != null ? other.linearSimilarity_.Clone() : null; + affine_ = other.affine_ != null ? other.affine_.Clone() : null; + homography_ = other.homography_ != null ? other.homography_.Clone() : null; + mixtureHomography_ = other.mixtureHomography_ != null ? other.mixtureHomography_.Clone() : null; + frameWidth_ = other.frameWidth_; + frameHeight_ = other.frameHeight_; + mixtureHomographySpectrum_ = other.mixtureHomographySpectrum_.Clone(); + mixtureRowSigma_ = other.mixtureRowSigma_; + averageMagnitude_ = other.averageMagnitude_; + translationVariance_ = other.translationVariance_; + similarityInlierRatio_ = other.similarityInlierRatio_; + similarityStrictInlierRatio_ = other.similarityStrictInlierRatio_; + averageHomographyError_ = other.averageHomographyError_; + homographyInlierCoverage_ = other.homographyInlierCoverage_; + homographyStrictInlierCoverage_ = other.homographyStrictInlierCoverage_; + mixtureInlierCoverage_ = other.mixtureInlierCoverage_.Clone(); + rollingShutterGuess_ = other.rollingShutterGuess_; + rollingShutterMotionIndex_ = other.rollingShutterMotionIndex_; + overlayIndices_ = other.overlayIndices_.Clone(); + overlayDomain_ = other.overlayDomain_; + type_ = other.type_; + overriddenType_ = other.overriddenType_; + flags_ = other.flags_; + blurScore_ = other.blurScore_; + bluriness_ = other.bluriness_; + fracLongFeaturesRejected_ = other.fracLongFeaturesRejected_; + timestampUsec_ = other.timestampUsec_; + matchFrame_ = other.matchFrame_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraMotion Clone() { + return new CameraMotion(this); + } + + /// Field number for the "translation" field. + public const int TranslationFieldNumber = 1; + private global::Mediapipe.TranslationModel translation_; + /// + /// Background motion expressed in various models. + /// These are per-frame pair motions (from current to previous frame). + /// Models are expressed in the un-normalized domain frame_width x frame_height + /// that is passed to MotionEstimation (storred below). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TranslationModel Translation { + get { return translation_; } + set { + translation_ = value; + } + } + + /// Field number for the "similarity" field. + public const int SimilarityFieldNumber = 2; + private global::Mediapipe.SimilarityModel similarity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.SimilarityModel Similarity { + get { return similarity_; } + set { + similarity_ = value; + } + } + + /// Field number for the "linear_similarity" field. + public const int LinearSimilarityFieldNumber = 3; + private global::Mediapipe.LinearSimilarityModel linearSimilarity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.LinearSimilarityModel LinearSimilarity { + get { return linearSimilarity_; } + set { + linearSimilarity_ = value; + } + } + + /// Field number for the "affine" field. + public const int AffineFieldNumber = 4; + private global::Mediapipe.AffineModel affine_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AffineModel Affine { + get { return affine_; } + set { + affine_ = value; + } + } + + /// Field number for the "homography" field. + public const int HomographyFieldNumber = 5; + private global::Mediapipe.Homography homography_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Homography Homography { + get { return homography_; } + set { + homography_ = value; + } + } + + /// Field number for the "mixture_homography" field. + public const int MixtureHomographyFieldNumber = 8; + private global::Mediapipe.MixtureHomography mixtureHomography_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MixtureHomography MixtureHomography { + get { return mixtureHomography_; } + set { + mixtureHomography_ = value; + } + } + + /// Field number for the "frame_width" field. + public const int FrameWidthFieldNumber = 31; + private readonly static float FrameWidthDefaultValue = 0F; + + private float frameWidth_; + /// + /// Frame dimensions camera motion was computed over. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FrameWidth { + get { if ((_hasBits0 & 524288) != 0) { return frameWidth_; } else { return FrameWidthDefaultValue; } } + set { + _hasBits0 |= 524288; + frameWidth_ = value; + } + } + /// Gets whether the "frame_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameWidth { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "frame_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameWidth() { + _hasBits0 &= ~524288; + } + + /// Field number for the "frame_height" field. + public const int FrameHeightFieldNumber = 32; + private readonly static float FrameHeightDefaultValue = 0F; + + private float frameHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FrameHeight { + get { if ((_hasBits0 & 1048576) != 0) { return frameHeight_; } else { return FrameHeightDefaultValue; } } + set { + _hasBits0 |= 1048576; + frameHeight_ = value; + } + } + /// Gets whether the "frame_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameHeight { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "frame_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameHeight() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "mixture_homography_spectrum" field. + public const int MixtureHomographySpectrumFieldNumber = 23; + private static readonly pb::FieldCodec _repeated_mixtureHomographySpectrum_codec + = pb::FieldCodec.ForMessage(186, global::Mediapipe.MixtureHomography.Parser); + private readonly pbc::RepeatedField mixtureHomographySpectrum_ = new pbc::RepeatedField(); + /// + /// Mixture homographies computed w.r.t. exponentially increasing + /// regularizers. Above mixture_homography member is selected from spectrum + /// based on amount of rolling shutter present in the video. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField MixtureHomographySpectrum { + get { return mixtureHomographySpectrum_; } + } + + /// Field number for the "mixture_row_sigma" field. + public const int MixtureRowSigmaFieldNumber = 10; + private readonly static float MixtureRowSigmaDefaultValue = 0F; + + private float mixtureRowSigma_; + /// + /// Relative row sigma w.r.t. frame_height for mixture models. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureRowSigma { + get { if ((_hasBits0 & 2) != 0) { return mixtureRowSigma_; } else { return MixtureRowSigmaDefaultValue; } } + set { + _hasBits0 |= 2; + mixtureRowSigma_ = value; + } + } + /// Gets whether the "mixture_row_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRowSigma { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "mixture_row_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRowSigma() { + _hasBits0 &= ~2; + } + + /// Field number for the "average_magnitude" field. + public const int AverageMagnitudeFieldNumber = 24; + private readonly static float AverageMagnitudeDefaultValue = 0F; + + private float averageMagnitude_; + /// + /// Average of all motion vector magnitudes (without accounting for any motion + /// model), within 10th to 90th percentile (to remove outliers). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AverageMagnitude { + get { if ((_hasBits0 & 4096) != 0) { return averageMagnitude_; } else { return AverageMagnitudeDefaultValue; } } + set { + _hasBits0 |= 4096; + averageMagnitude_ = value; + } + } + /// Gets whether the "average_magnitude" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAverageMagnitude { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "average_magnitude" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAverageMagnitude() { + _hasBits0 &= ~4096; + } + + /// Field number for the "translation_variance" field. + public const int TranslationVarianceFieldNumber = 25; + private readonly static float TranslationVarianceDefaultValue = 0F; + + private float translationVariance_; + /// + /// Inlier-weighted variance of the translation model. + /// Specified, w.r.t. unnormalized video domain that motion models + /// are computed for. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TranslationVariance { + get { if ((_hasBits0 & 8192) != 0) { return translationVariance_; } else { return TranslationVarianceDefaultValue; } } + set { + _hasBits0 |= 8192; + translationVariance_ = value; + } + } + /// Gets whether the "translation_variance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTranslationVariance { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "translation_variance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTranslationVariance() { + _hasBits0 &= ~8192; + } + + /// Field number for the "similarity_inlier_ratio" field. + public const int SimilarityInlierRatioFieldNumber = 29; + private readonly static float SimilarityInlierRatioDefaultValue = 0F; + + private float similarityInlierRatio_; + /// + /// Ratio of inliers w.r.t. regular and stricter thresholds. In [0, 1]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SimilarityInlierRatio { + get { if ((_hasBits0 & 131072) != 0) { return similarityInlierRatio_; } else { return SimilarityInlierRatioDefaultValue; } } + set { + _hasBits0 |= 131072; + similarityInlierRatio_ = value; + } + } + /// Gets whether the "similarity_inlier_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSimilarityInlierRatio { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "similarity_inlier_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSimilarityInlierRatio() { + _hasBits0 &= ~131072; + } + + /// Field number for the "similarity_strict_inlier_ratio" field. + public const int SimilarityStrictInlierRatioFieldNumber = 30; + private readonly static float SimilarityStrictInlierRatioDefaultValue = 0F; + + private float similarityStrictInlierRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SimilarityStrictInlierRatio { + get { if ((_hasBits0 & 262144) != 0) { return similarityStrictInlierRatio_; } else { return SimilarityStrictInlierRatioDefaultValue; } } + set { + _hasBits0 |= 262144; + similarityStrictInlierRatio_ = value; + } + } + /// Gets whether the "similarity_strict_inlier_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSimilarityStrictInlierRatio { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "similarity_strict_inlier_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSimilarityStrictInlierRatio() { + _hasBits0 &= ~262144; + } + + /// Field number for the "average_homography_error" field. + public const int AverageHomographyErrorFieldNumber = 11; + private readonly static float AverageHomographyErrorDefaultValue = 0F; + + private float averageHomographyError_; + /// + /// Average registration error of homography in pixels. + /// Note: These two parameters default to zero in-case homographies have not + /// been estimated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AverageHomographyError { + get { if ((_hasBits0 & 4) != 0) { return averageHomographyError_; } else { return AverageHomographyErrorDefaultValue; } } + set { + _hasBits0 |= 4; + averageHomographyError_ = value; + } + } + /// Gets whether the "average_homography_error" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAverageHomographyError { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "average_homography_error" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAverageHomographyError() { + _hasBits0 &= ~4; + } + + /// Field number for the "homography_inlier_coverage" field. + public const int HomographyInlierCoverageFieldNumber = 12; + private readonly static float HomographyInlierCoverageDefaultValue = 0F; + + private float homographyInlierCoverage_; + /// + /// Fraction, in [0,1], of homography inliers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HomographyInlierCoverage { + get { if ((_hasBits0 & 8) != 0) { return homographyInlierCoverage_; } else { return HomographyInlierCoverageDefaultValue; } } + set { + _hasBits0 |= 8; + homographyInlierCoverage_ = value; + } + } + /// Gets whether the "homography_inlier_coverage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyInlierCoverage { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "homography_inlier_coverage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyInlierCoverage() { + _hasBits0 &= ~8; + } + + /// Field number for the "homography_strict_inlier_coverage" field. + public const int HomographyStrictInlierCoverageFieldNumber = 22; + private readonly static float HomographyStrictInlierCoverageDefaultValue = 0F; + + private float homographyStrictInlierCoverage_; + /// + /// Same as above but with stricter threshold. + /// (For details, see: MotionEstimationOptions::strict_coverage_scale). + /// Coverage is designed to measure the amount of significant outliers, + /// which can affect the validity of the estimated homography. + /// However, it does not discount small outliers, which occur in case + /// of small rolling shutter wobbles. For this a stricter version of coverage + /// is needed, which is essential for computing the rolling_shutter_guess, + /// i.e. the increase in coverage by using mixtures vs. homographies. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HomographyStrictInlierCoverage { + get { if ((_hasBits0 & 2048) != 0) { return homographyStrictInlierCoverage_; } else { return HomographyStrictInlierCoverageDefaultValue; } } + set { + _hasBits0 |= 2048; + homographyStrictInlierCoverage_ = value; + } + } + /// Gets whether the "homography_strict_inlier_coverage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyStrictInlierCoverage { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "homography_strict_inlier_coverage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyStrictInlierCoverage() { + _hasBits0 &= ~2048; + } + + /// Field number for the "mixture_inlier_coverage" field. + public const int MixtureInlierCoverageFieldNumber = 13; + private static readonly pb::FieldCodec _repeated_mixtureInlierCoverage_codec + = pb::FieldCodec.ForFloat(109); + private readonly pbc::RepeatedField mixtureInlierCoverage_ = new pbc::RepeatedField(); + /// + /// Per-block inlier fraction for mixtures. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField MixtureInlierCoverage { + get { return mixtureInlierCoverage_; } + } + + /// Field number for the "rolling_shutter_guess" field. + public const int RollingShutterGuessFieldNumber = 14; + private readonly static float RollingShutterGuessDefaultValue = 0F; + + private float rollingShutterGuess_; + /// + /// Set based on stability analysis indicating if frame is likely to originate + /// from a rolling shutter camera. (-1 is used to indicate frame was not + /// tested, e.g. due to mixture deemed unstable for analysis). + /// Guess is a scaler indicating by how much the mixture models (suitable for + /// rolling shutter distortions) increased inlier coverage compared to a single + /// homography. For example a value, of 1.3 indicates, that the mixture models + /// increased inlier coverage by 30%. + /// If not -1, range is in [0, inf] (values slightly smaller than 1 are + /// possible due to suppression of noisy feature tracks during estimation). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RollingShutterGuess { + get { if ((_hasBits0 & 16) != 0) { return rollingShutterGuess_; } else { return RollingShutterGuessDefaultValue; } } + set { + _hasBits0 |= 16; + rollingShutterGuess_ = value; + } + } + /// Gets whether the "rolling_shutter_guess" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRollingShutterGuess { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "rolling_shutter_guess" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRollingShutterGuess() { + _hasBits0 &= ~16; + } + + /// Field number for the "rolling_shutter_motion_index" field. + public const int RollingShutterMotionIndexFieldNumber = 16; + private readonly static int RollingShutterMotionIndexDefaultValue = -1; + + private int rollingShutterMotionIndex_; + /// + /// Indicating if CameraMotion is deemed to originate from rolling + /// shutter camera (index >= 0), and if so, denotes the index in the + /// mixture_homography_spectrum, where higher indices correspond to heavier + /// regularized motions. If motion is not deemed to originate from a rolling + /// shutter camera, index is set to -1. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RollingShutterMotionIndex { + get { if ((_hasBits0 & 64) != 0) { return rollingShutterMotionIndex_; } else { return RollingShutterMotionIndexDefaultValue; } } + set { + _hasBits0 |= 64; + rollingShutterMotionIndex_ = value; + } + } + /// Gets whether the "rolling_shutter_motion_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRollingShutterMotionIndex { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "rolling_shutter_motion_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRollingShutterMotionIndex() { + _hasBits0 &= ~64; + } + + /// Field number for the "overlay_indices" field. + public const int OverlayIndicesFieldNumber = 17; + private static readonly pb::FieldCodec _repeated_overlayIndices_codec + = pb::FieldCodec.ForInt32(136); + private readonly pbc::RepeatedField overlayIndices_ = new pbc::RepeatedField(); + /// + /// List of overlay indices (cell locations in column major format) over domain + /// of size overlay_domain x overlay_domain, where + /// overlay_domain is set by MotionEstimation to + /// MotionEstimationOptions::OverlayDetectionOptions::analysis_mask_size. + /// Overlay analysis is performed over chunk of frames, as specified by + /// MotionEstimationOptions::overlay_analysis_chunk_size, with the resulting + /// overlay indices being assigned to each frame of the chunk. + /// Consequently it suffices to store the result only for the first frame + /// of every chunk. Subsequent frames store a single negative index relative + /// to the first chunk frame indicating where to locate the overlay indicies. + /// Specifically if for frame f, overlay_indices(0) == -2, overlay indices for + /// corresponding chunk can be found at frame f - 2. + /// For details about how overlay indices are used to flag a frame to contain + /// an overlay, see MotionFilterOptions::OverlayOptions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OverlayIndices { + get { return overlayIndices_; } + } + + /// Field number for the "overlay_domain" field. + public const int OverlayDomainFieldNumber = 18; + private readonly static int OverlayDomainDefaultValue = 10; + + private int overlayDomain_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OverlayDomain { + get { if ((_hasBits0 & 128) != 0) { return overlayDomain_; } else { return OverlayDomainDefaultValue; } } + set { + _hasBits0 |= 128; + overlayDomain_ = value; + } + } + /// Gets whether the "overlay_domain" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlayDomain { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "overlay_domain" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlayDomain() { + _hasBits0 &= ~128; + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 6; + private readonly static global::Mediapipe.CameraMotion.Types.Type TypeDefaultValue = global::Mediapipe.CameraMotion.Types.Type.Valid; + + private global::Mediapipe.CameraMotion.Types.Type type_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CameraMotion.Types.Type Type { + get { if ((_hasBits0 & 1) != 0) { return type_; } else { return TypeDefaultValue; } } + set { + _hasBits0 |= 1; + type_ = value; + } + } + /// Gets whether the "type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasType { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearType() { + _hasBits0 &= ~1; + } + + /// Field number for the "overridden_type" field. + public const int OverriddenTypeFieldNumber = 15; + private readonly static global::Mediapipe.CameraMotion.Types.Type OverriddenTypeDefaultValue = global::Mediapipe.CameraMotion.Types.Type.Valid; + + private global::Mediapipe.CameraMotion.Types.Type overriddenType_; + /// + /// If set, stores original type in case it was overriden (by filtering + /// functions, etc.). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CameraMotion.Types.Type OverriddenType { + get { if ((_hasBits0 & 32) != 0) { return overriddenType_; } else { return OverriddenTypeDefaultValue; } } + set { + _hasBits0 |= 32; + overriddenType_ = value; + } + } + /// Gets whether the "overridden_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverriddenType { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "overridden_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverriddenType() { + _hasBits0 &= ~32; + } + + /// Field number for the "flags" field. + public const int FlagsFieldNumber = 19; + private readonly static int FlagsDefaultValue = 0; + + private int flags_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Flags { + get { if ((_hasBits0 & 256) != 0) { return flags_; } else { return FlagsDefaultValue; } } + set { + _hasBits0 |= 256; + flags_ = value; + } + } + /// Gets whether the "flags" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlags { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "flags" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlags() { + _hasBits0 &= ~256; + } + + /// Field number for the "blur_score" field. + public const int BlurScoreFieldNumber = 20; + private readonly static float BlurScoreDefaultValue = 0F; + + private float blurScore_; + /// + /// Same as in RegionFlowFeatureList (from region_flow.proto), measures blur + /// as average cornerness over textured areas. As it depends on the image + /// content, should only be used relative. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BlurScore { + get { if ((_hasBits0 & 512) != 0) { return blurScore_; } else { return BlurScoreDefaultValue; } } + set { + _hasBits0 |= 512; + blurScore_ = value; + } + } + /// Gets whether the "blur_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlurScore { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "blur_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlurScore() { + _hasBits0 &= ~512; + } + + /// Field number for the "bluriness" field. + public const int BlurinessFieldNumber = 21; + private readonly static float BlurinessDefaultValue = 0F; + + private float bluriness_; + /// + /// Quanitifies amount of blur. Specified as ratio w.r.t. sharpest matching + /// frame, i.e. 1 indicates no blur, values > 1 amount of blur w.r.t. sharpest + /// frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Bluriness { + get { if ((_hasBits0 & 1024) != 0) { return bluriness_; } else { return BlurinessDefaultValue; } } + set { + _hasBits0 |= 1024; + bluriness_ = value; + } + } + /// Gets whether the "bluriness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBluriness { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "bluriness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBluriness() { + _hasBits0 &= ~1024; + } + + /// Field number for the "frac_long_features_rejected" field. + public const int FracLongFeaturesRejectedFieldNumber = 26; + private readonly static float FracLongFeaturesRejectedDefaultValue = 0F; + + private float fracLongFeaturesRejected_; + /// + /// Same as in RegionFlowFeatureList (from region_flow.proto). Stores fraction + /// of long feature tracks that got rejected for this frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracLongFeaturesRejected { + get { if ((_hasBits0 & 16384) != 0) { return fracLongFeaturesRejected_; } else { return FracLongFeaturesRejectedDefaultValue; } } + set { + _hasBits0 |= 16384; + fracLongFeaturesRejected_ = value; + } + } + /// Gets whether the "frac_long_features_rejected" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracLongFeaturesRejected { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "frac_long_features_rejected" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracLongFeaturesRejected() { + _hasBits0 &= ~16384; + } + + /// Field number for the "timestamp_usec" field. + public const int TimestampUsecFieldNumber = 27; + private readonly static long TimestampUsecDefaultValue = 0L; + + private long timestampUsec_; + /// + /// Same as in RegionFlowFeatureList (from region_flow.proto). + /// Timestamp in micro seconds of the underlying frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimestampUsec { + get { if ((_hasBits0 & 32768) != 0) { return timestampUsec_; } else { return TimestampUsecDefaultValue; } } + set { + _hasBits0 |= 32768; + timestampUsec_ = value; + } + } + /// Gets whether the "timestamp_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestampUsec { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "timestamp_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestampUsec() { + _hasBits0 &= ~32768; + } + + /// Field number for the "match_frame" field. + public const int MatchFrameFieldNumber = 28; + private readonly static int MatchFrameDefaultValue = 0; + + private int matchFrame_; + /// + /// Same as in RegionFlowFeatureList (from region_flow.proto). + /// Denotes frame that motion was computed w.r.t. to, locally to the current + /// frame. Values < 0 indicate backward tracking, while values > 0 indicate + /// forward tracking. For example, match_frame = -1, indicates tracking is + /// from current to previous frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MatchFrame { + get { if ((_hasBits0 & 65536) != 0) { return matchFrame_; } else { return MatchFrameDefaultValue; } } + set { + _hasBits0 |= 65536; + matchFrame_ = value; + } + } + /// Gets whether the "match_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMatchFrame { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "match_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMatchFrame() { + _hasBits0 &= ~65536; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CameraMotion); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CameraMotion other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Translation, other.Translation)) return false; + if (!object.Equals(Similarity, other.Similarity)) return false; + if (!object.Equals(LinearSimilarity, other.LinearSimilarity)) return false; + if (!object.Equals(Affine, other.Affine)) return false; + if (!object.Equals(Homography, other.Homography)) return false; + if (!object.Equals(MixtureHomography, other.MixtureHomography)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FrameWidth, other.FrameWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FrameHeight, other.FrameHeight)) return false; + if(!mixtureHomographySpectrum_.Equals(other.mixtureHomographySpectrum_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureRowSigma, other.MixtureRowSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AverageMagnitude, other.AverageMagnitude)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TranslationVariance, other.TranslationVariance)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SimilarityInlierRatio, other.SimilarityInlierRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SimilarityStrictInlierRatio, other.SimilarityStrictInlierRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AverageHomographyError, other.AverageHomographyError)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HomographyInlierCoverage, other.HomographyInlierCoverage)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HomographyStrictInlierCoverage, other.HomographyStrictInlierCoverage)) return false; + if(!mixtureInlierCoverage_.Equals(other.mixtureInlierCoverage_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RollingShutterGuess, other.RollingShutterGuess)) return false; + if (RollingShutterMotionIndex != other.RollingShutterMotionIndex) return false; + if(!overlayIndices_.Equals(other.overlayIndices_)) return false; + if (OverlayDomain != other.OverlayDomain) return false; + if (Type != other.Type) return false; + if (OverriddenType != other.OverriddenType) return false; + if (Flags != other.Flags) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BlurScore, other.BlurScore)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Bluriness, other.Bluriness)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracLongFeaturesRejected, other.FracLongFeaturesRejected)) return false; + if (TimestampUsec != other.TimestampUsec) return false; + if (MatchFrame != other.MatchFrame) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (translation_ != null) hash ^= Translation.GetHashCode(); + if (similarity_ != null) hash ^= Similarity.GetHashCode(); + if (linearSimilarity_ != null) hash ^= LinearSimilarity.GetHashCode(); + if (affine_ != null) hash ^= Affine.GetHashCode(); + if (homography_ != null) hash ^= Homography.GetHashCode(); + if (mixtureHomography_ != null) hash ^= MixtureHomography.GetHashCode(); + if (HasFrameWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FrameWidth); + if (HasFrameHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FrameHeight); + hash ^= mixtureHomographySpectrum_.GetHashCode(); + if (HasMixtureRowSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureRowSigma); + if (HasAverageMagnitude) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AverageMagnitude); + if (HasTranslationVariance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TranslationVariance); + if (HasSimilarityInlierRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SimilarityInlierRatio); + if (HasSimilarityStrictInlierRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SimilarityStrictInlierRatio); + if (HasAverageHomographyError) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AverageHomographyError); + if (HasHomographyInlierCoverage) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HomographyInlierCoverage); + if (HasHomographyStrictInlierCoverage) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HomographyStrictInlierCoverage); + hash ^= mixtureInlierCoverage_.GetHashCode(); + if (HasRollingShutterGuess) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RollingShutterGuess); + if (HasRollingShutterMotionIndex) hash ^= RollingShutterMotionIndex.GetHashCode(); + hash ^= overlayIndices_.GetHashCode(); + if (HasOverlayDomain) hash ^= OverlayDomain.GetHashCode(); + if (HasType) hash ^= Type.GetHashCode(); + if (HasOverriddenType) hash ^= OverriddenType.GetHashCode(); + if (HasFlags) hash ^= Flags.GetHashCode(); + if (HasBlurScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BlurScore); + if (HasBluriness) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Bluriness); + if (HasFracLongFeaturesRejected) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracLongFeaturesRejected); + if (HasTimestampUsec) hash ^= TimestampUsec.GetHashCode(); + if (HasMatchFrame) hash ^= MatchFrame.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (translation_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Translation); + } + if (similarity_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Similarity); + } + if (linearSimilarity_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LinearSimilarity); + } + if (affine_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Affine); + } + if (homography_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Homography); + } + if (HasType) { + output.WriteRawTag(48); + output.WriteEnum((int) Type); + } + if (mixtureHomography_ != null) { + output.WriteRawTag(66); + output.WriteMessage(MixtureHomography); + } + if (HasMixtureRowSigma) { + output.WriteRawTag(85); + output.WriteFloat(MixtureRowSigma); + } + if (HasAverageHomographyError) { + output.WriteRawTag(93); + output.WriteFloat(AverageHomographyError); + } + if (HasHomographyInlierCoverage) { + output.WriteRawTag(101); + output.WriteFloat(HomographyInlierCoverage); + } + mixtureInlierCoverage_.WriteTo(output, _repeated_mixtureInlierCoverage_codec); + if (HasRollingShutterGuess) { + output.WriteRawTag(117); + output.WriteFloat(RollingShutterGuess); + } + if (HasOverriddenType) { + output.WriteRawTag(120); + output.WriteEnum((int) OverriddenType); + } + if (HasRollingShutterMotionIndex) { + output.WriteRawTag(128, 1); + output.WriteInt32(RollingShutterMotionIndex); + } + overlayIndices_.WriteTo(output, _repeated_overlayIndices_codec); + if (HasOverlayDomain) { + output.WriteRawTag(144, 1); + output.WriteInt32(OverlayDomain); + } + if (HasFlags) { + output.WriteRawTag(152, 1); + output.WriteInt32(Flags); + } + if (HasBlurScore) { + output.WriteRawTag(165, 1); + output.WriteFloat(BlurScore); + } + if (HasBluriness) { + output.WriteRawTag(173, 1); + output.WriteFloat(Bluriness); + } + if (HasHomographyStrictInlierCoverage) { + output.WriteRawTag(181, 1); + output.WriteFloat(HomographyStrictInlierCoverage); + } + mixtureHomographySpectrum_.WriteTo(output, _repeated_mixtureHomographySpectrum_codec); + if (HasAverageMagnitude) { + output.WriteRawTag(197, 1); + output.WriteFloat(AverageMagnitude); + } + if (HasTranslationVariance) { + output.WriteRawTag(205, 1); + output.WriteFloat(TranslationVariance); + } + if (HasFracLongFeaturesRejected) { + output.WriteRawTag(213, 1); + output.WriteFloat(FracLongFeaturesRejected); + } + if (HasTimestampUsec) { + output.WriteRawTag(216, 1); + output.WriteInt64(TimestampUsec); + } + if (HasMatchFrame) { + output.WriteRawTag(224, 1); + output.WriteInt32(MatchFrame); + } + if (HasSimilarityInlierRatio) { + output.WriteRawTag(237, 1); + output.WriteFloat(SimilarityInlierRatio); + } + if (HasSimilarityStrictInlierRatio) { + output.WriteRawTag(245, 1); + output.WriteFloat(SimilarityStrictInlierRatio); + } + if (HasFrameWidth) { + output.WriteRawTag(253, 1); + output.WriteFloat(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(133, 2); + output.WriteFloat(FrameHeight); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (translation_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Translation); + } + if (similarity_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Similarity); + } + if (linearSimilarity_ != null) { + output.WriteRawTag(26); + output.WriteMessage(LinearSimilarity); + } + if (affine_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Affine); + } + if (homography_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Homography); + } + if (HasType) { + output.WriteRawTag(48); + output.WriteEnum((int) Type); + } + if (mixtureHomography_ != null) { + output.WriteRawTag(66); + output.WriteMessage(MixtureHomography); + } + if (HasMixtureRowSigma) { + output.WriteRawTag(85); + output.WriteFloat(MixtureRowSigma); + } + if (HasAverageHomographyError) { + output.WriteRawTag(93); + output.WriteFloat(AverageHomographyError); + } + if (HasHomographyInlierCoverage) { + output.WriteRawTag(101); + output.WriteFloat(HomographyInlierCoverage); + } + mixtureInlierCoverage_.WriteTo(ref output, _repeated_mixtureInlierCoverage_codec); + if (HasRollingShutterGuess) { + output.WriteRawTag(117); + output.WriteFloat(RollingShutterGuess); + } + if (HasOverriddenType) { + output.WriteRawTag(120); + output.WriteEnum((int) OverriddenType); + } + if (HasRollingShutterMotionIndex) { + output.WriteRawTag(128, 1); + output.WriteInt32(RollingShutterMotionIndex); + } + overlayIndices_.WriteTo(ref output, _repeated_overlayIndices_codec); + if (HasOverlayDomain) { + output.WriteRawTag(144, 1); + output.WriteInt32(OverlayDomain); + } + if (HasFlags) { + output.WriteRawTag(152, 1); + output.WriteInt32(Flags); + } + if (HasBlurScore) { + output.WriteRawTag(165, 1); + output.WriteFloat(BlurScore); + } + if (HasBluriness) { + output.WriteRawTag(173, 1); + output.WriteFloat(Bluriness); + } + if (HasHomographyStrictInlierCoverage) { + output.WriteRawTag(181, 1); + output.WriteFloat(HomographyStrictInlierCoverage); + } + mixtureHomographySpectrum_.WriteTo(ref output, _repeated_mixtureHomographySpectrum_codec); + if (HasAverageMagnitude) { + output.WriteRawTag(197, 1); + output.WriteFloat(AverageMagnitude); + } + if (HasTranslationVariance) { + output.WriteRawTag(205, 1); + output.WriteFloat(TranslationVariance); + } + if (HasFracLongFeaturesRejected) { + output.WriteRawTag(213, 1); + output.WriteFloat(FracLongFeaturesRejected); + } + if (HasTimestampUsec) { + output.WriteRawTag(216, 1); + output.WriteInt64(TimestampUsec); + } + if (HasMatchFrame) { + output.WriteRawTag(224, 1); + output.WriteInt32(MatchFrame); + } + if (HasSimilarityInlierRatio) { + output.WriteRawTag(237, 1); + output.WriteFloat(SimilarityInlierRatio); + } + if (HasSimilarityStrictInlierRatio) { + output.WriteRawTag(245, 1); + output.WriteFloat(SimilarityStrictInlierRatio); + } + if (HasFrameWidth) { + output.WriteRawTag(253, 1); + output.WriteFloat(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(133, 2); + output.WriteFloat(FrameHeight); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (translation_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Translation); + } + if (similarity_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Similarity); + } + if (linearSimilarity_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(LinearSimilarity); + } + if (affine_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Affine); + } + if (homography_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Homography); + } + if (mixtureHomography_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MixtureHomography); + } + if (HasFrameWidth) { + size += 2 + 4; + } + if (HasFrameHeight) { + size += 2 + 4; + } + size += mixtureHomographySpectrum_.CalculateSize(_repeated_mixtureHomographySpectrum_codec); + if (HasMixtureRowSigma) { + size += 1 + 4; + } + if (HasAverageMagnitude) { + size += 2 + 4; + } + if (HasTranslationVariance) { + size += 2 + 4; + } + if (HasSimilarityInlierRatio) { + size += 2 + 4; + } + if (HasSimilarityStrictInlierRatio) { + size += 2 + 4; + } + if (HasAverageHomographyError) { + size += 1 + 4; + } + if (HasHomographyInlierCoverage) { + size += 1 + 4; + } + if (HasHomographyStrictInlierCoverage) { + size += 2 + 4; + } + size += mixtureInlierCoverage_.CalculateSize(_repeated_mixtureInlierCoverage_codec); + if (HasRollingShutterGuess) { + size += 1 + 4; + } + if (HasRollingShutterMotionIndex) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(RollingShutterMotionIndex); + } + size += overlayIndices_.CalculateSize(_repeated_overlayIndices_codec); + if (HasOverlayDomain) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(OverlayDomain); + } + if (HasType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (HasOverriddenType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OverriddenType); + } + if (HasFlags) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Flags); + } + if (HasBlurScore) { + size += 2 + 4; + } + if (HasBluriness) { + size += 2 + 4; + } + if (HasFracLongFeaturesRejected) { + size += 2 + 4; + } + if (HasTimestampUsec) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(TimestampUsec); + } + if (HasMatchFrame) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MatchFrame); + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CameraMotion other) { + if (other == null) { + return; + } + if (other.translation_ != null) { + if (translation_ == null) { + Translation = new global::Mediapipe.TranslationModel(); + } + Translation.MergeFrom(other.Translation); + } + if (other.similarity_ != null) { + if (similarity_ == null) { + Similarity = new global::Mediapipe.SimilarityModel(); + } + Similarity.MergeFrom(other.Similarity); + } + if (other.linearSimilarity_ != null) { + if (linearSimilarity_ == null) { + LinearSimilarity = new global::Mediapipe.LinearSimilarityModel(); + } + LinearSimilarity.MergeFrom(other.LinearSimilarity); + } + if (other.affine_ != null) { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineModel(); + } + Affine.MergeFrom(other.Affine); + } + if (other.homography_ != null) { + if (homography_ == null) { + Homography = new global::Mediapipe.Homography(); + } + Homography.MergeFrom(other.Homography); + } + if (other.mixtureHomography_ != null) { + if (mixtureHomography_ == null) { + MixtureHomography = new global::Mediapipe.MixtureHomography(); + } + MixtureHomography.MergeFrom(other.MixtureHomography); + } + if (other.HasFrameWidth) { + FrameWidth = other.FrameWidth; + } + if (other.HasFrameHeight) { + FrameHeight = other.FrameHeight; + } + mixtureHomographySpectrum_.Add(other.mixtureHomographySpectrum_); + if (other.HasMixtureRowSigma) { + MixtureRowSigma = other.MixtureRowSigma; + } + if (other.HasAverageMagnitude) { + AverageMagnitude = other.AverageMagnitude; + } + if (other.HasTranslationVariance) { + TranslationVariance = other.TranslationVariance; + } + if (other.HasSimilarityInlierRatio) { + SimilarityInlierRatio = other.SimilarityInlierRatio; + } + if (other.HasSimilarityStrictInlierRatio) { + SimilarityStrictInlierRatio = other.SimilarityStrictInlierRatio; + } + if (other.HasAverageHomographyError) { + AverageHomographyError = other.AverageHomographyError; + } + if (other.HasHomographyInlierCoverage) { + HomographyInlierCoverage = other.HomographyInlierCoverage; + } + if (other.HasHomographyStrictInlierCoverage) { + HomographyStrictInlierCoverage = other.HomographyStrictInlierCoverage; + } + mixtureInlierCoverage_.Add(other.mixtureInlierCoverage_); + if (other.HasRollingShutterGuess) { + RollingShutterGuess = other.RollingShutterGuess; + } + if (other.HasRollingShutterMotionIndex) { + RollingShutterMotionIndex = other.RollingShutterMotionIndex; + } + overlayIndices_.Add(other.overlayIndices_); + if (other.HasOverlayDomain) { + OverlayDomain = other.OverlayDomain; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasOverriddenType) { + OverriddenType = other.OverriddenType; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasBlurScore) { + BlurScore = other.BlurScore; + } + if (other.HasBluriness) { + Bluriness = other.Bluriness; + } + if (other.HasFracLongFeaturesRejected) { + FracLongFeaturesRejected = other.FracLongFeaturesRejected; + } + if (other.HasTimestampUsec) { + TimestampUsec = other.TimestampUsec; + } + if (other.HasMatchFrame) { + MatchFrame = other.MatchFrame; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + if (translation_ == null) { + Translation = new global::Mediapipe.TranslationModel(); + } + input.ReadMessage(Translation); + break; + } + case 18: { + if (similarity_ == null) { + Similarity = new global::Mediapipe.SimilarityModel(); + } + input.ReadMessage(Similarity); + break; + } + case 26: { + if (linearSimilarity_ == null) { + LinearSimilarity = new global::Mediapipe.LinearSimilarityModel(); + } + input.ReadMessage(LinearSimilarity); + break; + } + case 34: { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineModel(); + } + input.ReadMessage(Affine); + break; + } + case 42: { + if (homography_ == null) { + Homography = new global::Mediapipe.Homography(); + } + input.ReadMessage(Homography); + break; + } + case 48: { + Type = (global::Mediapipe.CameraMotion.Types.Type) input.ReadEnum(); + break; + } + case 66: { + if (mixtureHomography_ == null) { + MixtureHomography = new global::Mediapipe.MixtureHomography(); + } + input.ReadMessage(MixtureHomography); + break; + } + case 85: { + MixtureRowSigma = input.ReadFloat(); + break; + } + case 93: { + AverageHomographyError = input.ReadFloat(); + break; + } + case 101: { + HomographyInlierCoverage = input.ReadFloat(); + break; + } + case 106: + case 109: { + mixtureInlierCoverage_.AddEntriesFrom(input, _repeated_mixtureInlierCoverage_codec); + break; + } + case 117: { + RollingShutterGuess = input.ReadFloat(); + break; + } + case 120: { + OverriddenType = (global::Mediapipe.CameraMotion.Types.Type) input.ReadEnum(); + break; + } + case 128: { + RollingShutterMotionIndex = input.ReadInt32(); + break; + } + case 138: + case 136: { + overlayIndices_.AddEntriesFrom(input, _repeated_overlayIndices_codec); + break; + } + case 144: { + OverlayDomain = input.ReadInt32(); + break; + } + case 152: { + Flags = input.ReadInt32(); + break; + } + case 165: { + BlurScore = input.ReadFloat(); + break; + } + case 173: { + Bluriness = input.ReadFloat(); + break; + } + case 181: { + HomographyStrictInlierCoverage = input.ReadFloat(); + break; + } + case 186: { + mixtureHomographySpectrum_.AddEntriesFrom(input, _repeated_mixtureHomographySpectrum_codec); + break; + } + case 197: { + AverageMagnitude = input.ReadFloat(); + break; + } + case 205: { + TranslationVariance = input.ReadFloat(); + break; + } + case 213: { + FracLongFeaturesRejected = input.ReadFloat(); + break; + } + case 216: { + TimestampUsec = input.ReadInt64(); + break; + } + case 224: { + MatchFrame = input.ReadInt32(); + break; + } + case 237: { + SimilarityInlierRatio = input.ReadFloat(); + break; + } + case 245: { + SimilarityStrictInlierRatio = input.ReadFloat(); + break; + } + case 253: { + FrameWidth = input.ReadFloat(); + break; + } + case 261: { + FrameHeight = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 10: { + if (translation_ == null) { + Translation = new global::Mediapipe.TranslationModel(); + } + input.ReadMessage(Translation); + break; + } + case 18: { + if (similarity_ == null) { + Similarity = new global::Mediapipe.SimilarityModel(); + } + input.ReadMessage(Similarity); + break; + } + case 26: { + if (linearSimilarity_ == null) { + LinearSimilarity = new global::Mediapipe.LinearSimilarityModel(); + } + input.ReadMessage(LinearSimilarity); + break; + } + case 34: { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineModel(); + } + input.ReadMessage(Affine); + break; + } + case 42: { + if (homography_ == null) { + Homography = new global::Mediapipe.Homography(); + } + input.ReadMessage(Homography); + break; + } + case 48: { + Type = (global::Mediapipe.CameraMotion.Types.Type) input.ReadEnum(); + break; + } + case 66: { + if (mixtureHomography_ == null) { + MixtureHomography = new global::Mediapipe.MixtureHomography(); + } + input.ReadMessage(MixtureHomography); + break; + } + case 85: { + MixtureRowSigma = input.ReadFloat(); + break; + } + case 93: { + AverageHomographyError = input.ReadFloat(); + break; + } + case 101: { + HomographyInlierCoverage = input.ReadFloat(); + break; + } + case 106: + case 109: { + mixtureInlierCoverage_.AddEntriesFrom(ref input, _repeated_mixtureInlierCoverage_codec); + break; + } + case 117: { + RollingShutterGuess = input.ReadFloat(); + break; + } + case 120: { + OverriddenType = (global::Mediapipe.CameraMotion.Types.Type) input.ReadEnum(); + break; + } + case 128: { + RollingShutterMotionIndex = input.ReadInt32(); + break; + } + case 138: + case 136: { + overlayIndices_.AddEntriesFrom(ref input, _repeated_overlayIndices_codec); + break; + } + case 144: { + OverlayDomain = input.ReadInt32(); + break; + } + case 152: { + Flags = input.ReadInt32(); + break; + } + case 165: { + BlurScore = input.ReadFloat(); + break; + } + case 173: { + Bluriness = input.ReadFloat(); + break; + } + case 181: { + HomographyStrictInlierCoverage = input.ReadFloat(); + break; + } + case 186: { + mixtureHomographySpectrum_.AddEntriesFrom(ref input, _repeated_mixtureHomographySpectrum_codec); + break; + } + case 197: { + AverageMagnitude = input.ReadFloat(); + break; + } + case 205: { + TranslationVariance = input.ReadFloat(); + break; + } + case 213: { + FracLongFeaturesRejected = input.ReadFloat(); + break; + } + case 216: { + TimestampUsec = input.ReadInt64(); + break; + } + case 224: { + MatchFrame = input.ReadInt32(); + break; + } + case 237: { + SimilarityInlierRatio = input.ReadFloat(); + break; + } + case 245: { + SimilarityStrictInlierRatio = input.ReadFloat(); + break; + } + case 253: { + FrameWidth = input.ReadFloat(); + break; + } + case 261: { + FrameHeight = input.ReadFloat(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the CameraMotion message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// CameraMotion type indicates whether highest degree of freedom (DOF) + /// model estimation was deemed stable, in which case CameraMotion::Type is set + /// to VALID. + /// If a model was deemed not stable (according to *StabilityBounds in + /// MotionEstimationOptions), it is set to the lower dof type which was deemed + /// stable. + /// + public enum Type { + /// + /// All requested motion models estimated reliably. + /// + [pbr::OriginalName("VALID")] Valid = 0, + /// + /// Fallback to homographies, mixture unreliable. + /// + [pbr::OriginalName("UNSTABLE_HOMOG")] UnstableHomog = 1, + /// + /// Fallback to similarity model, homography + /// + [pbr::OriginalName("UNSTABLE_SIM")] UnstableSim = 2, + /// + /// unreliable. + /// + [pbr::OriginalName("UNSTABLE")] Unstable = 3, + /// + /// unreliable, legacy naming. + /// + [pbr::OriginalName("INVALID")] Invalid = 4, + } + + /// + /// Set of optional *bit* flags set for various purposes. + /// + public enum Flags { + /// + /// Set to indicate presence of a + /// + [pbr::OriginalName("FLAG_SHOT_BOUNDARY")] HotBoundary = 1, + /// + /// shot boundary. + /// + [pbr::OriginalName("FLAG_BLURRY_FRAME")] FlagBlurryFrame = 2, + [pbr::OriginalName("FLAG_MAJOR_OVERLAY")] FlagMajorOverlay = 4, + /// + /// Set if frame is considered sharp + /// + [pbr::OriginalName("FLAG_SHARP_FRAME")] HarpFrame = 8, + /// + /// in a neighborhood of frames. + /// + [pbr::OriginalName("FLAG_SINGULAR_ESTIMATION")] IngularEstimation = 16, + /// + /// in singular optimization problem. + /// Used internally by MotionEstimation. + /// Indicates if shot boundary is part of a fade. If so, all frames of the + /// fade will be labeled with the FLAG but only the begin and end of the fade + /// will have the FLAG_SHOT_BOUNDARY set. + /// + [pbr::OriginalName("FLAG_SHOT_FADE")] HotFade = 32, + /// + /// Set if frame is exact duplicate of + /// + [pbr::OriginalName("FLAG_DUPLICATED")] FlagDuplicated = 64, + /// + /// previous frame. + /// + [pbr::OriginalName("FLAG_CENTER_FRAME")] FlagCenterFrame = 128, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs.meta new file mode 100644 index 0000000..b42588f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/CameraMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9621b31e7fed396e6b122e43490a234d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs new file mode 100644 index 0000000..d84929f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs @@ -0,0 +1,539 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/color.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/color.proto + public static partial class ColorReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/color.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ColorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChptZWRpYXBpcGUvdXRpbC9jb2xvci5wcm90bxIJbWVkaWFwaXBlIigKBUNv", + "bG9yEgkKAXIYASABKAUSCQoBZxgCIAEoBRIJCgFiGAMgASgFIpABCghDb2xv", + "ck1hcBI9Cg5sYWJlbF90b19jb2xvchgBIAMoCzIlLm1lZGlhcGlwZS5Db2xv", + "ck1hcC5MYWJlbFRvQ29sb3JFbnRyeRpFChFMYWJlbFRvQ29sb3JFbnRyeRIL", + "CgNrZXkYASABKAkSHwoFdmFsdWUYAiABKAsyEC5tZWRpYXBpcGUuQ29sb3I6", + "AjgB")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Color), global::Mediapipe.Color.Parser, new[]{ "R", "G", "B" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ColorMap), global::Mediapipe.ColorMap.Parser, new[]{ "LabelToColor" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }) + })); + } + #endregion + + } + #region Messages + public sealed partial class Color : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Color()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ColorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Color() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Color(Color other) : this() { + _hasBits0 = other._hasBits0; + r_ = other.r_; + g_ = other.g_; + b_ = other.b_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Color Clone() { + return new Color(this); + } + + /// Field number for the "r" field. + public const int RFieldNumber = 1; + private readonly static int RDefaultValue = 0; + + private int r_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int R { + get { if ((_hasBits0 & 1) != 0) { return r_; } else { return RDefaultValue; } } + set { + _hasBits0 |= 1; + r_ = value; + } + } + /// Gets whether the "r" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasR { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "r" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearR() { + _hasBits0 &= ~1; + } + + /// Field number for the "g" field. + public const int GFieldNumber = 2; + private readonly static int GDefaultValue = 0; + + private int g_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int G { + get { if ((_hasBits0 & 2) != 0) { return g_; } else { return GDefaultValue; } } + set { + _hasBits0 |= 2; + g_ = value; + } + } + /// Gets whether the "g" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "g" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG() { + _hasBits0 &= ~2; + } + + /// Field number for the "b" field. + public const int BFieldNumber = 3; + private readonly static int BDefaultValue = 0; + + private int b_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int B { + get { if ((_hasBits0 & 4) != 0) { return b_; } else { return BDefaultValue; } } + set { + _hasBits0 |= 4; + b_ = value; + } + } + /// Gets whether the "b" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasB { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "b" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearB() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Color); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Color other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (R != other.R) return false; + if (G != other.G) return false; + if (B != other.B) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasR) hash ^= R.GetHashCode(); + if (HasG) hash ^= G.GetHashCode(); + if (HasB) hash ^= B.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasR) { + output.WriteRawTag(8); + output.WriteInt32(R); + } + if (HasG) { + output.WriteRawTag(16); + output.WriteInt32(G); + } + if (HasB) { + output.WriteRawTag(24); + output.WriteInt32(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasR) { + output.WriteRawTag(8); + output.WriteInt32(R); + } + if (HasG) { + output.WriteRawTag(16); + output.WriteInt32(G); + } + if (HasB) { + output.WriteRawTag(24); + output.WriteInt32(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasR) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(R); + } + if (HasG) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(G); + } + if (HasB) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(B); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Color other) { + if (other == null) { + return; + } + if (other.HasR) { + R = other.R; + } + if (other.HasG) { + G = other.G; + } + if (other.HasB) { + B = other.B; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + R = input.ReadInt32(); + break; + } + case 16: { + G = input.ReadInt32(); + break; + } + case 24: { + B = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + R = input.ReadInt32(); + break; + } + case 16: { + G = input.ReadInt32(); + break; + } + case 24: { + B = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// Mapping from string label to a color. + /// + public sealed partial class ColorMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ColorMap()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ColorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ColorMap() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ColorMap(ColorMap other) : this() { + labelToColor_ = other.labelToColor_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ColorMap Clone() { + return new ColorMap(this); + } + + /// Field number for the "label_to_color" field. + public const int LabelToColorFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_labelToColor_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mediapipe.Color.Parser), 10); + private readonly pbc::MapField labelToColor_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::MapField LabelToColor { + get { return labelToColor_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ColorMap); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ColorMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!LabelToColor.Equals(other.LabelToColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= LabelToColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + labelToColor_.WriteTo(output, _map_labelToColor_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + labelToColor_.WriteTo(ref output, _map_labelToColor_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += labelToColor_.CalculateSize(_map_labelToColor_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ColorMap other) { + if (other == null) { + return; + } + labelToColor_.Add(other.labelToColor_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + labelToColor_.AddEntriesFrom(input, _map_labelToColor_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + labelToColor_.AddEntriesFrom(ref input, _map_labelToColor_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs.meta new file mode 100644 index 0000000..ad1a7b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Color.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12843ade4075fb5949f3170be8f1601f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs new file mode 100644 index 0000000..7780ad1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs @@ -0,0 +1,3890 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/flow_packager.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/flow_packager.proto + public static partial class FlowPackagerReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/flow_packager.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FlowPackagerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CittZWRpYXBpcGUvdXRpbC90cmFja2luZy9mbG93X3BhY2thZ2VyLnByb3Rv", + "EgltZWRpYXBpcGUaK21lZGlhcGlwZS91dGlsL3RyYWNraW5nL21vdGlvbl9t", + "b2RlbHMucHJvdG8aKW1lZGlhcGlwZS91dGlsL3RyYWNraW5nL3JlZ2lvbl9m", + "bG93LnByb3RvIrEFCgxUcmFja2luZ0RhdGESFgoLZnJhbWVfZmxhZ3MYASAB", + "KAU6ATASFAoMZG9tYWluX3dpZHRoGAIgASgFEhUKDWRvbWFpbl9oZWlnaHQY", + "AyABKAUSFwoMZnJhbWVfYXNwZWN0GAYgASgCOgExEi8KEGJhY2tncm91bmRf", + "bW9kZWwYBCABKAsyFS5tZWRpYXBpcGUuSG9tb2dyYXBoeRI3Cgttb3Rpb25f", + "ZGF0YRgFIAEoCzIiLm1lZGlhcGlwZS5UcmFja2luZ0RhdGEuTW90aW9uRGF0", + "YRIcChRnbG9iYWxfZmVhdHVyZV9jb3VudBgHIAEoDRIgChhhdmVyYWdlX21v", + "dGlvbl9tYWduaXR1ZGUYCCABKAIa6wEKCk1vdGlvbkRhdGESFAoMbnVtX2Vs", + "ZW1lbnRzGAEgASgFEhcKC3ZlY3Rvcl9kYXRhGAIgAygCQgIQARIUCgh0cmFj", + "a19pZBgDIAMoBUICEAESFwoLcm93X2luZGljZXMYBCADKAVCAhABEhYKCmNv", + "bF9zdGFydHMYBSADKAVCAhABEj8KE2ZlYXR1cmVfZGVzY3JpcHRvcnMYBiAD", + "KAsyIi5tZWRpYXBpcGUuQmluYXJ5RmVhdHVyZURlc2NyaXB0b3ISJgoeYWN0", + "aXZlbHlfZGlzY2FyZGVkX3RyYWNrZWRfaWRzGAcgAygFIqoBCgpGcmFtZUZs", + "YWdzEhkKFUZMQUdfUFJPRklMRV9CQVNFTElORRAAEhUKEUZMQUdfUFJPRklM", + "RV9ISUdIEAESHgoaRkxBR19ISUdIX0ZJREVMSVRZX1ZFQ1RPUlMQAhIcChhG", + "TEFHX0JBQ0tHUk9VTkRfVU5TVEFCTEUQBBITCg9GTEFHX0RVUExJQ0FURUQQ", + "CBIXChNGTEFHX0NIVU5LX0JPVU5EQVJZEBAi+wEKEVRyYWNraW5nRGF0YUNo", + "dW5rEi8KBGl0ZW0YASADKAsyIS5tZWRpYXBpcGUuVHJhY2tpbmdEYXRhQ2h1", + "bmsuSXRlbRIZCgpsYXN0X2NodW5rGAIgASgIOgVmYWxzZRIaCgtmaXJzdF9j", + "aHVuaxgDIAEoCDoFZmFsc2UafgoESXRlbRIuCg10cmFja2luZ19kYXRhGAEg", + "ASgLMhcubWVkaWFwaXBlLlRyYWNraW5nRGF0YRIRCglmcmFtZV9pZHgYAiAB", + "KAUSFgoOdGltZXN0YW1wX3VzZWMYAyABKAMSGwoTcHJldl90aW1lc3RhbXBf", + "dXNlYxgEIAEoAyIiChJCaW5hcnlUcmFja2luZ0RhdGESDAoEZGF0YRgBIAEo", + "DCKKAQoITWV0YURhdGESEgoKbnVtX2ZyYW1lcxgCIAEoBxI2Cg10cmFja19v", + "ZmZzZXRzGAMgAygLMh8ubWVkaWFwaXBlLk1ldGFEYXRhLlRyYWNrT2Zmc2V0", + "GjIKC1RyYWNrT2Zmc2V0EgwKBG1zZWMYASABKAcSFQoNc3RyZWFtX29mZnNl", + "dBgCIAEoByJTChFUcmFja2luZ0NvbnRhaW5lchIOCgZoZWFkZXIYASABKAkS", + "EgoHdmVyc2lvbhgCIAEoBzoBMRIMCgRzaXplGAMgASgHEgwKBGRhdGEYBCAB", + "KAwirQEKF1RyYWNraW5nQ29udGFpbmVyRm9ybWF0Ei8KCW1ldGFfZGF0YRgB", + "IAEoCzIcLm1lZGlhcGlwZS5UcmFja2luZ0NvbnRhaW5lchIwCgp0cmFja19k", + "YXRhGAIgAygLMhwubWVkaWFwaXBlLlRyYWNraW5nQ29udGFpbmVyEi8KCXRl", + "cm1fZGF0YRgDIAEoCzIcLm1lZGlhcGlwZS5UcmFja2luZ0NvbnRhaW5lciJz", + "ChZUcmFja2luZ0NvbnRhaW5lclByb3RvEiYKCW1ldGFfZGF0YRgBIAEoCzIT", + "Lm1lZGlhcGlwZS5NZXRhRGF0YRIxCgp0cmFja19kYXRhGAIgAygLMh0ubWVk", + "aWFwaXBlLkJpbmFyeVRyYWNraW5nRGF0YSLBAgoTRmxvd1BhY2thZ2VyT3B0", + "aW9ucxIZCgxkb21haW5fd2lkdGgYASABKAU6AzI1NhIaCg1kb21haW5faGVp", + "Z2h0GAIgASgFOgMxOTISKgocYmluYXJ5X3RyYWNraW5nX2RhdGFfc3VwcG9y", + "dBgGIAEoCDoEdHJ1ZRIfChB1c2VfaGlnaF9wcm9maWxlGAMgASgIOgVmYWxz", + "ZRIoChpoaWdoX2ZpZGVsaXR5XzE2Yml0X2VuY29kZRgEIAEoCDoEdHJ1ZRIp", + "ChxoaWdoX3Byb2ZpbGVfcmV1c2VfdGhyZXNob2xkGAUgASgCOgMwLjUiUQoT", + "SGlnaFByb2ZpbGVFbmNvZGluZxIRCgxBRFZBTkNFX0ZMQUcQgAESFwoTRE9V", + "QkxFX0lOREVYX0VOQ09ERRBAEg4KCklOREVYX01BU0sQPw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MotionModelsReflection.Descriptor, global::Mediapipe.RegionFlowReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingData), global::Mediapipe.TrackingData.Parser, new[]{ "FrameFlags", "DomainWidth", "DomainHeight", "FrameAspect", "BackgroundModel", "MotionData", "GlobalFeatureCount", "AverageMotionMagnitude" }, null, new[]{ typeof(global::Mediapipe.TrackingData.Types.FrameFlags) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingData.Types.MotionData), global::Mediapipe.TrackingData.Types.MotionData.Parser, new[]{ "NumElements", "VectorData", "TrackId", "RowIndices", "ColStarts", "FeatureDescriptors", "ActivelyDiscardedTrackedIds" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingDataChunk), global::Mediapipe.TrackingDataChunk.Parser, new[]{ "Item", "LastChunk", "FirstChunk" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingDataChunk.Types.Item), global::Mediapipe.TrackingDataChunk.Types.Item.Parser, new[]{ "TrackingData", "FrameIdx", "TimestampUsec", "PrevTimestampUsec" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BinaryTrackingData), global::Mediapipe.BinaryTrackingData.Parser, new[]{ "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MetaData), global::Mediapipe.MetaData.Parser, new[]{ "NumFrames", "TrackOffsets" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MetaData.Types.TrackOffset), global::Mediapipe.MetaData.Types.TrackOffset.Parser, new[]{ "Msec", "StreamOffset" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingContainer), global::Mediapipe.TrackingContainer.Parser, new[]{ "Header", "Version", "Size", "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingContainerFormat), global::Mediapipe.TrackingContainerFormat.Parser, new[]{ "MetaData", "TrackData", "TermData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingContainerProto), global::Mediapipe.TrackingContainerProto.Parser, new[]{ "MetaData", "TrackData" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FlowPackagerOptions), global::Mediapipe.FlowPackagerOptions.Parser, new[]{ "DomainWidth", "DomainHeight", "BinaryTrackingDataSupport", "UseHighProfile", "HighFidelity16BitEncode", "HighProfileReuseThreshold" }, null, new[]{ typeof(global::Mediapipe.FlowPackagerOptions.Types.HighProfileEncoding) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Next flag: 9 + /// + public sealed partial class TrackingData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingData(TrackingData other) : this() { + _hasBits0 = other._hasBits0; + frameFlags_ = other.frameFlags_; + domainWidth_ = other.domainWidth_; + domainHeight_ = other.domainHeight_; + frameAspect_ = other.frameAspect_; + backgroundModel_ = other.backgroundModel_ != null ? other.backgroundModel_.Clone() : null; + motionData_ = other.motionData_ != null ? other.motionData_.Clone() : null; + globalFeatureCount_ = other.globalFeatureCount_; + averageMotionMagnitude_ = other.averageMotionMagnitude_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingData Clone() { + return new TrackingData(this); + } + + /// Field number for the "frame_flags" field. + public const int FrameFlagsFieldNumber = 1; + private readonly static int FrameFlagsDefaultValue = 0; + + private int frameFlags_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameFlags { + get { if ((_hasBits0 & 1) != 0) { return frameFlags_; } else { return FrameFlagsDefaultValue; } } + set { + _hasBits0 |= 1; + frameFlags_ = value; + } + } + /// Gets whether the "frame_flags" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameFlags { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_flags" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameFlags() { + _hasBits0 &= ~1; + } + + /// Field number for the "domain_width" field. + public const int DomainWidthFieldNumber = 2; + private readonly static int DomainWidthDefaultValue = 0; + + private int domainWidth_; + /// + /// Tracking data is resolution independent specified w.r.t. + /// specified domain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DomainWidth { + get { if ((_hasBits0 & 2) != 0) { return domainWidth_; } else { return DomainWidthDefaultValue; } } + set { + _hasBits0 |= 2; + domainWidth_ = value; + } + } + /// Gets whether the "domain_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDomainWidth { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "domain_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDomainWidth() { + _hasBits0 &= ~2; + } + + /// Field number for the "domain_height" field. + public const int DomainHeightFieldNumber = 3; + private readonly static int DomainHeightDefaultValue = 0; + + private int domainHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DomainHeight { + get { if ((_hasBits0 & 4) != 0) { return domainHeight_; } else { return DomainHeightDefaultValue; } } + set { + _hasBits0 |= 4; + domainHeight_ = value; + } + } + /// Gets whether the "domain_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDomainHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "domain_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDomainHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "frame_aspect" field. + public const int FrameAspectFieldNumber = 6; + private readonly static float FrameAspectDefaultValue = 1F; + + private float frameAspect_; + /// + /// Aspect ratio (w/h) of the original frame tracking data was computed from. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FrameAspect { + get { if ((_hasBits0 & 8) != 0) { return frameAspect_; } else { return FrameAspectDefaultValue; } } + set { + _hasBits0 |= 8; + frameAspect_ = value; + } + } + /// Gets whether the "frame_aspect" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameAspect { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "frame_aspect" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameAspect() { + _hasBits0 &= ~8; + } + + /// Field number for the "background_model" field. + public const int BackgroundModelFieldNumber = 4; + private global::Mediapipe.Homography backgroundModel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Homography BackgroundModel { + get { return backgroundModel_; } + set { + backgroundModel_ = value; + } + } + + /// Field number for the "motion_data" field. + public const int MotionDataFieldNumber = 5; + private global::Mediapipe.TrackingData.Types.MotionData motionData_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingData.Types.MotionData MotionData { + get { return motionData_; } + set { + motionData_ = value; + } + } + + /// Field number for the "global_feature_count" field. + public const int GlobalFeatureCountFieldNumber = 7; + private readonly static uint GlobalFeatureCountDefaultValue = 0; + + private uint globalFeatureCount_; + /// + /// Total number of features in our analysis + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint GlobalFeatureCount { + get { if ((_hasBits0 & 16) != 0) { return globalFeatureCount_; } else { return GlobalFeatureCountDefaultValue; } } + set { + _hasBits0 |= 16; + globalFeatureCount_ = value; + } + } + /// Gets whether the "global_feature_count" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGlobalFeatureCount { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "global_feature_count" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGlobalFeatureCount() { + _hasBits0 &= ~16; + } + + /// Field number for the "average_motion_magnitude" field. + public const int AverageMotionMagnitudeFieldNumber = 8; + private readonly static float AverageMotionMagnitudeDefaultValue = 0F; + + private float averageMotionMagnitude_; + /// + /// Average of all motion vector magnitudes (without accounting for any motion + /// model), within 10th to 90th percentile (to remove outliers). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AverageMotionMagnitude { + get { if ((_hasBits0 & 32) != 0) { return averageMotionMagnitude_; } else { return AverageMotionMagnitudeDefaultValue; } } + set { + _hasBits0 |= 32; + averageMotionMagnitude_ = value; + } + } + /// Gets whether the "average_motion_magnitude" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAverageMotionMagnitude { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "average_motion_magnitude" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAverageMotionMagnitude() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FrameFlags != other.FrameFlags) return false; + if (DomainWidth != other.DomainWidth) return false; + if (DomainHeight != other.DomainHeight) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FrameAspect, other.FrameAspect)) return false; + if (!object.Equals(BackgroundModel, other.BackgroundModel)) return false; + if (!object.Equals(MotionData, other.MotionData)) return false; + if (GlobalFeatureCount != other.GlobalFeatureCount) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AverageMotionMagnitude, other.AverageMotionMagnitude)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFrameFlags) hash ^= FrameFlags.GetHashCode(); + if (HasDomainWidth) hash ^= DomainWidth.GetHashCode(); + if (HasDomainHeight) hash ^= DomainHeight.GetHashCode(); + if (HasFrameAspect) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FrameAspect); + if (backgroundModel_ != null) hash ^= BackgroundModel.GetHashCode(); + if (motionData_ != null) hash ^= MotionData.GetHashCode(); + if (HasGlobalFeatureCount) hash ^= GlobalFeatureCount.GetHashCode(); + if (HasAverageMotionMagnitude) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AverageMotionMagnitude); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFrameFlags) { + output.WriteRawTag(8); + output.WriteInt32(FrameFlags); + } + if (HasDomainWidth) { + output.WriteRawTag(16); + output.WriteInt32(DomainWidth); + } + if (HasDomainHeight) { + output.WriteRawTag(24); + output.WriteInt32(DomainHeight); + } + if (backgroundModel_ != null) { + output.WriteRawTag(34); + output.WriteMessage(BackgroundModel); + } + if (motionData_ != null) { + output.WriteRawTag(42); + output.WriteMessage(MotionData); + } + if (HasFrameAspect) { + output.WriteRawTag(53); + output.WriteFloat(FrameAspect); + } + if (HasGlobalFeatureCount) { + output.WriteRawTag(56); + output.WriteUInt32(GlobalFeatureCount); + } + if (HasAverageMotionMagnitude) { + output.WriteRawTag(69); + output.WriteFloat(AverageMotionMagnitude); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFrameFlags) { + output.WriteRawTag(8); + output.WriteInt32(FrameFlags); + } + if (HasDomainWidth) { + output.WriteRawTag(16); + output.WriteInt32(DomainWidth); + } + if (HasDomainHeight) { + output.WriteRawTag(24); + output.WriteInt32(DomainHeight); + } + if (backgroundModel_ != null) { + output.WriteRawTag(34); + output.WriteMessage(BackgroundModel); + } + if (motionData_ != null) { + output.WriteRawTag(42); + output.WriteMessage(MotionData); + } + if (HasFrameAspect) { + output.WriteRawTag(53); + output.WriteFloat(FrameAspect); + } + if (HasGlobalFeatureCount) { + output.WriteRawTag(56); + output.WriteUInt32(GlobalFeatureCount); + } + if (HasAverageMotionMagnitude) { + output.WriteRawTag(69); + output.WriteFloat(AverageMotionMagnitude); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFrameFlags) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameFlags); + } + if (HasDomainWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DomainWidth); + } + if (HasDomainHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DomainHeight); + } + if (HasFrameAspect) { + size += 1 + 4; + } + if (backgroundModel_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BackgroundModel); + } + if (motionData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MotionData); + } + if (HasGlobalFeatureCount) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(GlobalFeatureCount); + } + if (HasAverageMotionMagnitude) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingData other) { + if (other == null) { + return; + } + if (other.HasFrameFlags) { + FrameFlags = other.FrameFlags; + } + if (other.HasDomainWidth) { + DomainWidth = other.DomainWidth; + } + if (other.HasDomainHeight) { + DomainHeight = other.DomainHeight; + } + if (other.HasFrameAspect) { + FrameAspect = other.FrameAspect; + } + if (other.backgroundModel_ != null) { + if (backgroundModel_ == null) { + BackgroundModel = new global::Mediapipe.Homography(); + } + BackgroundModel.MergeFrom(other.BackgroundModel); + } + if (other.motionData_ != null) { + if (motionData_ == null) { + MotionData = new global::Mediapipe.TrackingData.Types.MotionData(); + } + MotionData.MergeFrom(other.MotionData); + } + if (other.HasGlobalFeatureCount) { + GlobalFeatureCount = other.GlobalFeatureCount; + } + if (other.HasAverageMotionMagnitude) { + AverageMotionMagnitude = other.AverageMotionMagnitude; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FrameFlags = input.ReadInt32(); + break; + } + case 16: { + DomainWidth = input.ReadInt32(); + break; + } + case 24: { + DomainHeight = input.ReadInt32(); + break; + } + case 34: { + if (backgroundModel_ == null) { + BackgroundModel = new global::Mediapipe.Homography(); + } + input.ReadMessage(BackgroundModel); + break; + } + case 42: { + if (motionData_ == null) { + MotionData = new global::Mediapipe.TrackingData.Types.MotionData(); + } + input.ReadMessage(MotionData); + break; + } + case 53: { + FrameAspect = input.ReadFloat(); + break; + } + case 56: { + GlobalFeatureCount = input.ReadUInt32(); + break; + } + case 69: { + AverageMotionMagnitude = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FrameFlags = input.ReadInt32(); + break; + } + case 16: { + DomainWidth = input.ReadInt32(); + break; + } + case 24: { + DomainHeight = input.ReadInt32(); + break; + } + case 34: { + if (backgroundModel_ == null) { + BackgroundModel = new global::Mediapipe.Homography(); + } + input.ReadMessage(BackgroundModel); + break; + } + case 42: { + if (motionData_ == null) { + MotionData = new global::Mediapipe.TrackingData.Types.MotionData(); + } + input.ReadMessage(MotionData); + break; + } + case 53: { + FrameAspect = input.ReadFloat(); + break; + } + case 56: { + GlobalFeatureCount = input.ReadUInt32(); + break; + } + case 69: { + AverageMotionMagnitude = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TrackingData message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum FrameFlags { + [pbr::OriginalName("FLAG_PROFILE_BASELINE")] FlagProfileBaseline = 0, + [pbr::OriginalName("FLAG_PROFILE_HIGH")] FlagProfileHigh = 1, + [pbr::OriginalName("FLAG_HIGH_FIDELITY_VECTORS")] FlagHighFidelityVectors = 2, + /// + /// Background model could not be estimated. + /// + [pbr::OriginalName("FLAG_BACKGROUND_UNSTABLE")] FlagBackgroundUnstable = 4, + /// + /// Frame is duplicated, i.e. identical to + /// + [pbr::OriginalName("FLAG_DUPLICATED")] FlagDuplicated = 8, + /// + /// previous one. + /// Indicates the beginning of a new chunk. In this case the track_id's + /// are not compatible w.r.t. previous one. + /// + [pbr::OriginalName("FLAG_CHUNK_BOUNDARY")] FlagChunkBoundary = 16, + } + + /// + /// Stores num_elements vectors of motion data. (x,y) position encoded via + /// row_indices and col_starts, as compressed sparse column matrix storage + /// format: + /// (https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_.28CSC_or_CCS.29), + /// Vector data is stored as (dx, dy) position. Optionally we store the fitting + /// error and track id for each feature. + /// + public sealed partial class MotionData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingData.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionData(MotionData other) : this() { + _hasBits0 = other._hasBits0; + numElements_ = other.numElements_; + vectorData_ = other.vectorData_.Clone(); + trackId_ = other.trackId_.Clone(); + rowIndices_ = other.rowIndices_.Clone(); + colStarts_ = other.colStarts_.Clone(); + featureDescriptors_ = other.featureDescriptors_.Clone(); + activelyDiscardedTrackedIds_ = other.activelyDiscardedTrackedIds_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionData Clone() { + return new MotionData(this); + } + + /// Field number for the "num_elements" field. + public const int NumElementsFieldNumber = 1; + private readonly static int NumElementsDefaultValue = 0; + + private int numElements_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumElements { + get { if ((_hasBits0 & 1) != 0) { return numElements_; } else { return NumElementsDefaultValue; } } + set { + _hasBits0 |= 1; + numElements_ = value; + } + } + /// Gets whether the "num_elements" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumElements { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_elements" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumElements() { + _hasBits0 &= ~1; + } + + /// Field number for the "vector_data" field. + public const int VectorDataFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_vectorData_codec + = pb::FieldCodec.ForFloat(18); + private readonly pbc::RepeatedField vectorData_ = new pbc::RepeatedField(); + /// + /// #num_elements pairs (flow_x, flow_y) densely packed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField VectorData { + get { return vectorData_; } + } + + /// Field number for the "track_id" field. + public const int TrackIdFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_trackId_codec + = pb::FieldCodec.ForInt32(26); + private readonly pbc::RepeatedField trackId_ = new pbc::RepeatedField(); + /// + /// Stores corresponding track index for each feature. Features belonging + /// to the same track over time are assigned the same id. + /// NOTE: Due to size, tracking ids are never stored as compressed binary + /// tracking data. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TrackId { + get { return trackId_; } + } + + /// Field number for the "row_indices" field. + public const int RowIndicesFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_rowIndices_codec + = pb::FieldCodec.ForInt32(34); + private readonly pbc::RepeatedField rowIndices_ = new pbc::RepeatedField(); + /// + /// # num_elements row indices. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField RowIndices { + get { return rowIndices_; } + } + + /// Field number for the "col_starts" field. + public const int ColStartsFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_colStarts_codec + = pb::FieldCodec.ForInt32(42); + private readonly pbc::RepeatedField colStarts_ = new pbc::RepeatedField(); + /// + /// Start index in above array for each column (#domain_width + 1 entries). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ColStarts { + get { return colStarts_; } + } + + /// Field number for the "feature_descriptors" field. + public const int FeatureDescriptorsFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_featureDescriptors_codec + = pb::FieldCodec.ForMessage(50, global::Mediapipe.BinaryFeatureDescriptor.Parser); + private readonly pbc::RepeatedField featureDescriptors_ = new pbc::RepeatedField(); + /// + /// Feature descriptors for num_elements feature points. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField FeatureDescriptors { + get { return featureDescriptors_; } + } + + /// Field number for the "actively_discarded_tracked_ids" field. + public const int ActivelyDiscardedTrackedIdsFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_activelyDiscardedTrackedIds_codec + = pb::FieldCodec.ForInt32(56); + private readonly pbc::RepeatedField activelyDiscardedTrackedIds_ = new pbc::RepeatedField(); + /// + /// Stores all the tracked ids that have been discarded actively. This + /// information will be used by downstreaming to avoid misjudgement on + /// tracking continuity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ActivelyDiscardedTrackedIds { + get { return activelyDiscardedTrackedIds_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumElements != other.NumElements) return false; + if(!vectorData_.Equals(other.vectorData_)) return false; + if(!trackId_.Equals(other.trackId_)) return false; + if(!rowIndices_.Equals(other.rowIndices_)) return false; + if(!colStarts_.Equals(other.colStarts_)) return false; + if(!featureDescriptors_.Equals(other.featureDescriptors_)) return false; + if(!activelyDiscardedTrackedIds_.Equals(other.activelyDiscardedTrackedIds_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumElements) hash ^= NumElements.GetHashCode(); + hash ^= vectorData_.GetHashCode(); + hash ^= trackId_.GetHashCode(); + hash ^= rowIndices_.GetHashCode(); + hash ^= colStarts_.GetHashCode(); + hash ^= featureDescriptors_.GetHashCode(); + hash ^= activelyDiscardedTrackedIds_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumElements) { + output.WriteRawTag(8); + output.WriteInt32(NumElements); + } + vectorData_.WriteTo(output, _repeated_vectorData_codec); + trackId_.WriteTo(output, _repeated_trackId_codec); + rowIndices_.WriteTo(output, _repeated_rowIndices_codec); + colStarts_.WriteTo(output, _repeated_colStarts_codec); + featureDescriptors_.WriteTo(output, _repeated_featureDescriptors_codec); + activelyDiscardedTrackedIds_.WriteTo(output, _repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumElements) { + output.WriteRawTag(8); + output.WriteInt32(NumElements); + } + vectorData_.WriteTo(ref output, _repeated_vectorData_codec); + trackId_.WriteTo(ref output, _repeated_trackId_codec); + rowIndices_.WriteTo(ref output, _repeated_rowIndices_codec); + colStarts_.WriteTo(ref output, _repeated_colStarts_codec); + featureDescriptors_.WriteTo(ref output, _repeated_featureDescriptors_codec); + activelyDiscardedTrackedIds_.WriteTo(ref output, _repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumElements) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumElements); + } + size += vectorData_.CalculateSize(_repeated_vectorData_codec); + size += trackId_.CalculateSize(_repeated_trackId_codec); + size += rowIndices_.CalculateSize(_repeated_rowIndices_codec); + size += colStarts_.CalculateSize(_repeated_colStarts_codec); + size += featureDescriptors_.CalculateSize(_repeated_featureDescriptors_codec); + size += activelyDiscardedTrackedIds_.CalculateSize(_repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionData other) { + if (other == null) { + return; + } + if (other.HasNumElements) { + NumElements = other.NumElements; + } + vectorData_.Add(other.vectorData_); + trackId_.Add(other.trackId_); + rowIndices_.Add(other.rowIndices_); + colStarts_.Add(other.colStarts_); + featureDescriptors_.Add(other.featureDescriptors_); + activelyDiscardedTrackedIds_.Add(other.activelyDiscardedTrackedIds_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumElements = input.ReadInt32(); + break; + } + case 18: + case 21: { + vectorData_.AddEntriesFrom(input, _repeated_vectorData_codec); + break; + } + case 26: + case 24: { + trackId_.AddEntriesFrom(input, _repeated_trackId_codec); + break; + } + case 34: + case 32: { + rowIndices_.AddEntriesFrom(input, _repeated_rowIndices_codec); + break; + } + case 42: + case 40: { + colStarts_.AddEntriesFrom(input, _repeated_colStarts_codec); + break; + } + case 50: { + featureDescriptors_.AddEntriesFrom(input, _repeated_featureDescriptors_codec); + break; + } + case 58: + case 56: { + activelyDiscardedTrackedIds_.AddEntriesFrom(input, _repeated_activelyDiscardedTrackedIds_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumElements = input.ReadInt32(); + break; + } + case 18: + case 21: { + vectorData_.AddEntriesFrom(ref input, _repeated_vectorData_codec); + break; + } + case 26: + case 24: { + trackId_.AddEntriesFrom(ref input, _repeated_trackId_codec); + break; + } + case 34: + case 32: { + rowIndices_.AddEntriesFrom(ref input, _repeated_rowIndices_codec); + break; + } + case 42: + case 40: { + colStarts_.AddEntriesFrom(ref input, _repeated_colStarts_codec); + break; + } + case 50: { + featureDescriptors_.AddEntriesFrom(ref input, _repeated_featureDescriptors_codec); + break; + } + case 58: + case 56: { + activelyDiscardedTrackedIds_.AddEntriesFrom(ref input, _repeated_activelyDiscardedTrackedIds_codec); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + public sealed partial class TrackingDataChunk : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingDataChunk()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingDataChunk() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingDataChunk(TrackingDataChunk other) : this() { + _hasBits0 = other._hasBits0; + item_ = other.item_.Clone(); + lastChunk_ = other.lastChunk_; + firstChunk_ = other.firstChunk_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingDataChunk Clone() { + return new TrackingDataChunk(this); + } + + /// Field number for the "item" field. + public const int ItemFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_item_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.TrackingDataChunk.Types.Item.Parser); + private readonly pbc::RepeatedField item_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Item { + get { return item_; } + } + + /// Field number for the "last_chunk" field. + public const int LastChunkFieldNumber = 2; + private readonly static bool LastChunkDefaultValue = false; + + private bool lastChunk_; + /// + /// Set as marker for last chunk. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool LastChunk { + get { if ((_hasBits0 & 1) != 0) { return lastChunk_; } else { return LastChunkDefaultValue; } } + set { + _hasBits0 |= 1; + lastChunk_ = value; + } + } + /// Gets whether the "last_chunk" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLastChunk { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "last_chunk" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLastChunk() { + _hasBits0 &= ~1; + } + + /// Field number for the "first_chunk" field. + public const int FirstChunkFieldNumber = 3; + private readonly static bool FirstChunkDefaultValue = false; + + private bool firstChunk_; + /// + /// Set as marker for first chunk. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FirstChunk { + get { if ((_hasBits0 & 2) != 0) { return firstChunk_; } else { return FirstChunkDefaultValue; } } + set { + _hasBits0 |= 2; + firstChunk_ = value; + } + } + /// Gets whether the "first_chunk" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFirstChunk { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "first_chunk" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFirstChunk() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingDataChunk); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingDataChunk other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!item_.Equals(other.item_)) return false; + if (LastChunk != other.LastChunk) return false; + if (FirstChunk != other.FirstChunk) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= item_.GetHashCode(); + if (HasLastChunk) hash ^= LastChunk.GetHashCode(); + if (HasFirstChunk) hash ^= FirstChunk.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + item_.WriteTo(output, _repeated_item_codec); + if (HasLastChunk) { + output.WriteRawTag(16); + output.WriteBool(LastChunk); + } + if (HasFirstChunk) { + output.WriteRawTag(24); + output.WriteBool(FirstChunk); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + item_.WriteTo(ref output, _repeated_item_codec); + if (HasLastChunk) { + output.WriteRawTag(16); + output.WriteBool(LastChunk); + } + if (HasFirstChunk) { + output.WriteRawTag(24); + output.WriteBool(FirstChunk); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += item_.CalculateSize(_repeated_item_codec); + if (HasLastChunk) { + size += 1 + 1; + } + if (HasFirstChunk) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingDataChunk other) { + if (other == null) { + return; + } + item_.Add(other.item_); + if (other.HasLastChunk) { + LastChunk = other.LastChunk; + } + if (other.HasFirstChunk) { + FirstChunk = other.FirstChunk; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + item_.AddEntriesFrom(input, _repeated_item_codec); + break; + } + case 16: { + LastChunk = input.ReadBool(); + break; + } + case 24: { + FirstChunk = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + item_.AddEntriesFrom(ref input, _repeated_item_codec); + break; + } + case 16: { + LastChunk = input.ReadBool(); + break; + } + case 24: { + FirstChunk = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TrackingDataChunk message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Item : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Item()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingDataChunk.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item(Item other) : this() { + _hasBits0 = other._hasBits0; + trackingData_ = other.trackingData_ != null ? other.trackingData_.Clone() : null; + frameIdx_ = other.frameIdx_; + timestampUsec_ = other.timestampUsec_; + prevTimestampUsec_ = other.prevTimestampUsec_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item Clone() { + return new Item(this); + } + + /// Field number for the "tracking_data" field. + public const int TrackingDataFieldNumber = 1; + private global::Mediapipe.TrackingData trackingData_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingData TrackingData { + get { return trackingData_; } + set { + trackingData_ = value; + } + } + + /// Field number for the "frame_idx" field. + public const int FrameIdxFieldNumber = 2; + private readonly static int FrameIdxDefaultValue = 0; + + private int frameIdx_; + /// + /// Global frame index. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameIdx { + get { if ((_hasBits0 & 1) != 0) { return frameIdx_; } else { return FrameIdxDefaultValue; } } + set { + _hasBits0 |= 1; + frameIdx_ = value; + } + } + /// Gets whether the "frame_idx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameIdx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_idx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameIdx() { + _hasBits0 &= ~1; + } + + /// Field number for the "timestamp_usec" field. + public const int TimestampUsecFieldNumber = 3; + private readonly static long TimestampUsecDefaultValue = 0L; + + private long timestampUsec_; + /// + /// Corresponding timestamp. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimestampUsec { + get { if ((_hasBits0 & 2) != 0) { return timestampUsec_; } else { return TimestampUsecDefaultValue; } } + set { + _hasBits0 |= 2; + timestampUsec_ = value; + } + } + /// Gets whether the "timestamp_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestampUsec { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "timestamp_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestampUsec() { + _hasBits0 &= ~2; + } + + /// Field number for the "prev_timestamp_usec" field. + public const int PrevTimestampUsecFieldNumber = 4; + private readonly static long PrevTimestampUsecDefaultValue = 0L; + + private long prevTimestampUsec_; + /// + /// Previous frame timestamp. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long PrevTimestampUsec { + get { if ((_hasBits0 & 4) != 0) { return prevTimestampUsec_; } else { return PrevTimestampUsecDefaultValue; } } + set { + _hasBits0 |= 4; + prevTimestampUsec_ = value; + } + } + /// Gets whether the "prev_timestamp_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPrevTimestampUsec { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "prev_timestamp_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPrevTimestampUsec() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Item); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Item other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TrackingData, other.TrackingData)) return false; + if (FrameIdx != other.FrameIdx) return false; + if (TimestampUsec != other.TimestampUsec) return false; + if (PrevTimestampUsec != other.PrevTimestampUsec) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (trackingData_ != null) hash ^= TrackingData.GetHashCode(); + if (HasFrameIdx) hash ^= FrameIdx.GetHashCode(); + if (HasTimestampUsec) hash ^= TimestampUsec.GetHashCode(); + if (HasPrevTimestampUsec) hash ^= PrevTimestampUsec.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (trackingData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackingData); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (HasTimestampUsec) { + output.WriteRawTag(24); + output.WriteInt64(TimestampUsec); + } + if (HasPrevTimestampUsec) { + output.WriteRawTag(32); + output.WriteInt64(PrevTimestampUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (trackingData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackingData); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (HasTimestampUsec) { + output.WriteRawTag(24); + output.WriteInt64(TimestampUsec); + } + if (HasPrevTimestampUsec) { + output.WriteRawTag(32); + output.WriteInt64(PrevTimestampUsec); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (trackingData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrackingData); + } + if (HasFrameIdx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameIdx); + } + if (HasTimestampUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimestampUsec); + } + if (HasPrevTimestampUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PrevTimestampUsec); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Item other) { + if (other == null) { + return; + } + if (other.trackingData_ != null) { + if (trackingData_ == null) { + TrackingData = new global::Mediapipe.TrackingData(); + } + TrackingData.MergeFrom(other.TrackingData); + } + if (other.HasFrameIdx) { + FrameIdx = other.FrameIdx; + } + if (other.HasTimestampUsec) { + TimestampUsec = other.TimestampUsec; + } + if (other.HasPrevTimestampUsec) { + PrevTimestampUsec = other.PrevTimestampUsec; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (trackingData_ == null) { + TrackingData = new global::Mediapipe.TrackingData(); + } + input.ReadMessage(TrackingData); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 24: { + TimestampUsec = input.ReadInt64(); + break; + } + case 32: { + PrevTimestampUsec = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (trackingData_ == null) { + TrackingData = new global::Mediapipe.TrackingData(); + } + input.ReadMessage(TrackingData); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 24: { + TimestampUsec = input.ReadInt64(); + break; + } + case 32: { + PrevTimestampUsec = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// TrackingData in compressed binary format. Obtainable via + /// FlowPackager::EncodeTrackingData. Details of binary encode are below. + /// + public sealed partial class BinaryTrackingData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BinaryTrackingData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryTrackingData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryTrackingData(BinaryTrackingData other) : this() { + data_ = other.data_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryTrackingData Clone() { + return new BinaryTrackingData(this); + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 1; + private readonly static pb::ByteString DataDefaultValue = pb::ByteString.Empty; + + private pb::ByteString data_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Data { + get { return data_ ?? DataDefaultValue; } + set { + data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasData { + get { return data_ != null; } + } + /// Clears the value of the "data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearData() { + data_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BinaryTrackingData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BinaryTrackingData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Data != other.Data) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasData) hash ^= Data.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasData) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasData) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BinaryTrackingData other) { + if (other == null) { + return; + } + if (other.HasData) { + Data = other.Data; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + /// Stores offsets for random seek and time offsets for each frame of + /// TrackingData. Stream offsets are specified relative w.r.t. end of metadata + /// blob. + /// Offsets specify start of the corresponding binary encoded TrackingContainer + /// (for TrackingContainerFormat) or BinaryTrackingData proto (for + /// TrackingContainerProto). + /// + public sealed partial class MetaData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MetaData()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MetaData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MetaData(MetaData other) : this() { + _hasBits0 = other._hasBits0; + numFrames_ = other.numFrames_; + trackOffsets_ = other.trackOffsets_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MetaData Clone() { + return new MetaData(this); + } + + /// Field number for the "num_frames" field. + public const int NumFramesFieldNumber = 2; + private readonly static uint NumFramesDefaultValue = 0; + + private uint numFrames_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint NumFrames { + get { if ((_hasBits0 & 1) != 0) { return numFrames_; } else { return NumFramesDefaultValue; } } + set { + _hasBits0 |= 1; + numFrames_ = value; + } + } + /// Gets whether the "num_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumFrames { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumFrames() { + _hasBits0 &= ~1; + } + + /// Field number for the "track_offsets" field. + public const int TrackOffsetsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_trackOffsets_codec + = pb::FieldCodec.ForMessage(26, global::Mediapipe.MetaData.Types.TrackOffset.Parser); + private readonly pbc::RepeatedField trackOffsets_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TrackOffsets { + get { return trackOffsets_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MetaData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MetaData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumFrames != other.NumFrames) return false; + if(!trackOffsets_.Equals(other.trackOffsets_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumFrames) hash ^= NumFrames.GetHashCode(); + hash ^= trackOffsets_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumFrames) { + output.WriteRawTag(21); + output.WriteFixed32(NumFrames); + } + trackOffsets_.WriteTo(output, _repeated_trackOffsets_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumFrames) { + output.WriteRawTag(21); + output.WriteFixed32(NumFrames); + } + trackOffsets_.WriteTo(ref output, _repeated_trackOffsets_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumFrames) { + size += 1 + 4; + } + size += trackOffsets_.CalculateSize(_repeated_trackOffsets_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MetaData other) { + if (other == null) { + return; + } + if (other.HasNumFrames) { + NumFrames = other.NumFrames; + } + trackOffsets_.Add(other.trackOffsets_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 21: { + NumFrames = input.ReadFixed32(); + break; + } + case 26: { + trackOffsets_.AddEntriesFrom(input, _repeated_trackOffsets_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 21: { + NumFrames = input.ReadFixed32(); + break; + } + case 26: { + trackOffsets_.AddEntriesFrom(ref input, _repeated_trackOffsets_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MetaData message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class TrackOffset : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackOffset()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MetaData.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackOffset() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackOffset(TrackOffset other) : this() { + _hasBits0 = other._hasBits0; + msec_ = other.msec_; + streamOffset_ = other.streamOffset_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackOffset Clone() { + return new TrackOffset(this); + } + + /// Field number for the "msec" field. + public const int MsecFieldNumber = 1; + private readonly static uint MsecDefaultValue = 0; + + private uint msec_; + /// + /// Time offset of the metadata in msec. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Msec { + get { if ((_hasBits0 & 1) != 0) { return msec_; } else { return MsecDefaultValue; } } + set { + _hasBits0 |= 1; + msec_ = value; + } + } + /// Gets whether the "msec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMsec { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "msec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMsec() { + _hasBits0 &= ~1; + } + + /// Field number for the "stream_offset" field. + public const int StreamOffsetFieldNumber = 2; + private readonly static uint StreamOffsetDefaultValue = 0; + + private uint streamOffset_; + /// + /// Offset of TrackingContainer or + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint StreamOffset { + get { if ((_hasBits0 & 2) != 0) { return streamOffset_; } else { return StreamOffsetDefaultValue; } } + set { + _hasBits0 |= 2; + streamOffset_ = value; + } + } + /// Gets whether the "stream_offset" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStreamOffset { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "stream_offset" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStreamOffset() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackOffset); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackOffset other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Msec != other.Msec) return false; + if (StreamOffset != other.StreamOffset) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMsec) hash ^= Msec.GetHashCode(); + if (HasStreamOffset) hash ^= StreamOffset.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMsec) { + output.WriteRawTag(13); + output.WriteFixed32(Msec); + } + if (HasStreamOffset) { + output.WriteRawTag(21); + output.WriteFixed32(StreamOffset); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMsec) { + output.WriteRawTag(13); + output.WriteFixed32(Msec); + } + if (HasStreamOffset) { + output.WriteRawTag(21); + output.WriteFixed32(StreamOffset); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMsec) { + size += 1 + 4; + } + if (HasStreamOffset) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackOffset other) { + if (other == null) { + return; + } + if (other.HasMsec) { + Msec = other.Msec; + } + if (other.HasStreamOffset) { + StreamOffset = other.StreamOffset; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Msec = input.ReadFixed32(); + break; + } + case 21: { + StreamOffset = input.ReadFixed32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Msec = input.ReadFixed32(); + break; + } + case 21: { + StreamOffset = input.ReadFixed32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// TrackingContainer is self-describing container format to store arbitrary + /// chunks of binary data. Each container is typed via its 4 character header, + /// versioned via an int, and followed by the size of the binary data and the + /// actual data. Designed for clients without availability of protobuffer + /// support. + /// Note: This message is mainly used for documentation purposes and uses custom + /// encoding as specified by FlowPackager::TrackingContainerFormatToBinary. + /// Default binary size of a TrackingContainer (DO NOT CHANGE!): + /// header: 4 byte + + /// version: 4 byte + + /// size: 4 byte + + /// data #size + /// SUM: 12 + #size. + /// + public sealed partial class TrackingContainer : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingContainer()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainer() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainer(TrackingContainer other) : this() { + _hasBits0 = other._hasBits0; + header_ = other.header_; + version_ = other.version_; + size_ = other.size_; + data_ = other.data_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainer Clone() { + return new TrackingContainer(this); + } + + /// Field number for the "header" field. + public const int HeaderFieldNumber = 1; + private readonly static string HeaderDefaultValue = ""; + + private string header_; + /// + /// 4 character header. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Header { + get { return header_ ?? HeaderDefaultValue; } + set { + header_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "header" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeader { + get { return header_ != null; } + } + /// Clears the value of the "header" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeader() { + header_ = null; + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 2; + private readonly static uint VersionDefaultValue = 1; + + private uint version_; + /// + /// Version information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Version { + get { if ((_hasBits0 & 1) != 0) { return version_; } else { return VersionDefaultValue; } } + set { + _hasBits0 |= 1; + version_ = value; + } + } + /// Gets whether the "version" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVersion { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "version" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVersion() { + _hasBits0 &= ~1; + } + + /// Field number for the "size" field. + public const int SizeFieldNumber = 3; + private readonly static uint SizeDefaultValue = 0; + + private uint size_; + /// + /// Size of binary data held by container + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Size { + get { if ((_hasBits0 & 2) != 0) { return size_; } else { return SizeDefaultValue; } } + set { + _hasBits0 |= 2; + size_ = value; + } + } + /// Gets whether the "size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSize { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSize() { + _hasBits0 &= ~2; + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 4; + private readonly static pb::ByteString DataDefaultValue = pb::ByteString.Empty; + + private pb::ByteString data_; + /// + /// Binary data encoded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Data { + get { return data_ ?? DataDefaultValue; } + set { + data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasData { + get { return data_ != null; } + } + /// Clears the value of the "data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearData() { + data_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingContainer); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingContainer other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Header != other.Header) return false; + if (Version != other.Version) return false; + if (Size != other.Size) return false; + if (Data != other.Data) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasHeader) hash ^= Header.GetHashCode(); + if (HasVersion) hash ^= Version.GetHashCode(); + if (HasSize) hash ^= Size.GetHashCode(); + if (HasData) hash ^= Data.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasHeader) { + output.WriteRawTag(10); + output.WriteString(Header); + } + if (HasVersion) { + output.WriteRawTag(21); + output.WriteFixed32(Version); + } + if (HasSize) { + output.WriteRawTag(29); + output.WriteFixed32(Size); + } + if (HasData) { + output.WriteRawTag(34); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasHeader) { + output.WriteRawTag(10); + output.WriteString(Header); + } + if (HasVersion) { + output.WriteRawTag(21); + output.WriteFixed32(Version); + } + if (HasSize) { + output.WriteRawTag(29); + output.WriteFixed32(Size); + } + if (HasData) { + output.WriteRawTag(34); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasHeader) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Header); + } + if (HasVersion) { + size += 1 + 4; + } + if (HasSize) { + size += 1 + 4; + } + if (HasData) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingContainer other) { + if (other == null) { + return; + } + if (other.HasHeader) { + Header = other.Header; + } + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasSize) { + Size = other.Size; + } + if (other.HasData) { + Data = other.Data; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Header = input.ReadString(); + break; + } + case 21: { + Version = input.ReadFixed32(); + break; + } + case 29: { + Size = input.ReadFixed32(); + break; + } + case 34: { + Data = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Header = input.ReadString(); + break; + } + case 21: { + Version = input.ReadFixed32(); + break; + } + case 29: { + Size = input.ReadFixed32(); + break; + } + case 34: { + Data = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + /// Container format for clients without proto support (written via + /// FlowPackager::TrackingContainerFormatToBinary and read via + /// FlowPackager::TrackingContainerFormatFromBinary). + /// Proto here is intermediate format for documentationa and internal use. + /// Stores multiple TrackingContainers of different types. + /// Meta data is storred first, to facilitate random seek (via stream offset + /// positions) to arbitrary binary TrackinData. Termination container signals end + /// of stream. + /// + public sealed partial class TrackingContainerFormat : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingContainerFormat()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerFormat() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerFormat(TrackingContainerFormat other) : this() { + metaData_ = other.metaData_ != null ? other.metaData_.Clone() : null; + trackData_ = other.trackData_.Clone(); + termData_ = other.termData_ != null ? other.termData_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerFormat Clone() { + return new TrackingContainerFormat(this); + } + + /// Field number for the "meta_data" field. + public const int MetaDataFieldNumber = 1; + private global::Mediapipe.TrackingContainer metaData_; + /// + /// Wraps binary meta data, via + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingContainer MetaData { + get { return metaData_; } + set { + metaData_ = value; + } + } + + /// Field number for the "track_data" field. + public const int TrackDataFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_trackData_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.TrackingContainer.Parser); + private readonly pbc::RepeatedField trackData_ = new pbc::RepeatedField(); + /// + /// custom encode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TrackData { + get { return trackData_; } + } + + /// Field number for the "term_data" field. + public const int TermDataFieldNumber = 3; + private global::Mediapipe.TrackingContainer termData_; + /// + /// Add new TrackingContainers above before end of stream indicator. + /// Zero sized termination container with TrackingContainer::header = "TERM". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingContainer TermData { + get { return termData_; } + set { + termData_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingContainerFormat); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingContainerFormat other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(MetaData, other.MetaData)) return false; + if(!trackData_.Equals(other.trackData_)) return false; + if (!object.Equals(TermData, other.TermData)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (metaData_ != null) hash ^= MetaData.GetHashCode(); + hash ^= trackData_.GetHashCode(); + if (termData_ != null) hash ^= TermData.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (metaData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MetaData); + } + trackData_.WriteTo(output, _repeated_trackData_codec); + if (termData_ != null) { + output.WriteRawTag(26); + output.WriteMessage(TermData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (metaData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MetaData); + } + trackData_.WriteTo(ref output, _repeated_trackData_codec); + if (termData_ != null) { + output.WriteRawTag(26); + output.WriteMessage(TermData); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (metaData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MetaData); + } + size += trackData_.CalculateSize(_repeated_trackData_codec); + if (termData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TermData); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingContainerFormat other) { + if (other == null) { + return; + } + if (other.metaData_ != null) { + if (metaData_ == null) { + MetaData = new global::Mediapipe.TrackingContainer(); + } + MetaData.MergeFrom(other.MetaData); + } + trackData_.Add(other.trackData_); + if (other.termData_ != null) { + if (termData_ == null) { + TermData = new global::Mediapipe.TrackingContainer(); + } + TermData.MergeFrom(other.TermData); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (metaData_ == null) { + MetaData = new global::Mediapipe.TrackingContainer(); + } + input.ReadMessage(MetaData); + break; + } + case 18: { + trackData_.AddEntriesFrom(input, _repeated_trackData_codec); + break; + } + case 26: { + if (termData_ == null) { + TermData = new global::Mediapipe.TrackingContainer(); + } + input.ReadMessage(TermData); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (metaData_ == null) { + MetaData = new global::Mediapipe.TrackingContainer(); + } + input.ReadMessage(MetaData); + break; + } + case 18: { + trackData_.AddEntriesFrom(ref input, _repeated_trackData_codec); + break; + } + case 26: { + if (termData_ == null) { + TermData = new global::Mediapipe.TrackingContainer(); + } + input.ReadMessage(TermData); + break; + } + } + } + } + #endif + + } + + /// + /// Simplified proto format of above TrackingContainerFormat. Instead of using + /// self-describing TrackingContainer's, we simply use the proto wire format for + /// encoding and decoding (proto format is typed and versioned via ids). + /// + public sealed partial class TrackingContainerProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingContainerProto()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerProto(TrackingContainerProto other) : this() { + metaData_ = other.metaData_ != null ? other.metaData_.Clone() : null; + trackData_ = other.trackData_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingContainerProto Clone() { + return new TrackingContainerProto(this); + } + + /// Field number for the "meta_data" field. + public const int MetaDataFieldNumber = 1; + private global::Mediapipe.MetaData metaData_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MetaData MetaData { + get { return metaData_; } + set { + metaData_ = value; + } + } + + /// Field number for the "track_data" field. + public const int TrackDataFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_trackData_codec + = pb::FieldCodec.ForMessage(18, global::Mediapipe.BinaryTrackingData.Parser); + private readonly pbc::RepeatedField trackData_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TrackData { + get { return trackData_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingContainerProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingContainerProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(MetaData, other.MetaData)) return false; + if(!trackData_.Equals(other.trackData_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (metaData_ != null) hash ^= MetaData.GetHashCode(); + hash ^= trackData_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (metaData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MetaData); + } + trackData_.WriteTo(output, _repeated_trackData_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (metaData_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MetaData); + } + trackData_.WriteTo(ref output, _repeated_trackData_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (metaData_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MetaData); + } + size += trackData_.CalculateSize(_repeated_trackData_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingContainerProto other) { + if (other == null) { + return; + } + if (other.metaData_ != null) { + if (metaData_ == null) { + MetaData = new global::Mediapipe.MetaData(); + } + MetaData.MergeFrom(other.MetaData); + } + trackData_.Add(other.trackData_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (metaData_ == null) { + MetaData = new global::Mediapipe.MetaData(); + } + input.ReadMessage(MetaData); + break; + } + case 18: { + trackData_.AddEntriesFrom(input, _repeated_trackData_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (metaData_ == null) { + MetaData = new global::Mediapipe.MetaData(); + } + input.ReadMessage(MetaData); + break; + } + case 18: { + trackData_.AddEntriesFrom(ref input, _repeated_trackData_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Options controlling compression and encoding. + /// + public sealed partial class FlowPackagerOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FlowPackagerOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FlowPackagerReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerOptions(FlowPackagerOptions other) : this() { + _hasBits0 = other._hasBits0; + domainWidth_ = other.domainWidth_; + domainHeight_ = other.domainHeight_; + binaryTrackingDataSupport_ = other.binaryTrackingDataSupport_; + useHighProfile_ = other.useHighProfile_; + highFidelity16BitEncode_ = other.highFidelity16BitEncode_; + highProfileReuseThreshold_ = other.highProfileReuseThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FlowPackagerOptions Clone() { + return new FlowPackagerOptions(this); + } + + /// Field number for the "domain_width" field. + public const int DomainWidthFieldNumber = 1; + private readonly static int DomainWidthDefaultValue = 256; + + private int domainWidth_; + /// + /// Tracking data is resolution independent specified w.r.t. + /// specified domain. Only values <= 256 are supported if binary tracking data + /// is requested to be supported (see below). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DomainWidth { + get { if ((_hasBits0 & 1) != 0) { return domainWidth_; } else { return DomainWidthDefaultValue; } } + set { + _hasBits0 |= 1; + domainWidth_ = value; + } + } + /// Gets whether the "domain_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDomainWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "domain_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDomainWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "domain_height" field. + public const int DomainHeightFieldNumber = 2; + private readonly static int DomainHeightDefaultValue = 192; + + private int domainHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DomainHeight { + get { if ((_hasBits0 & 2) != 0) { return domainHeight_; } else { return DomainHeightDefaultValue; } } + set { + _hasBits0 |= 2; + domainHeight_ = value; + } + } + /// Gets whether the "domain_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDomainHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "domain_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDomainHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "binary_tracking_data_support" field. + public const int BinaryTrackingDataSupportFieldNumber = 6; + private readonly static bool BinaryTrackingDataSupportDefaultValue = true; + + private bool binaryTrackingDataSupport_; + /// + /// Needs to be set for calls to FlowPackager::EncodeTrackingData. If encoding + /// is not required, can be set to false in which case a higher domain_width + /// can be used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool BinaryTrackingDataSupport { + get { if ((_hasBits0 & 32) != 0) { return binaryTrackingDataSupport_; } else { return BinaryTrackingDataSupportDefaultValue; } } + set { + _hasBits0 |= 32; + binaryTrackingDataSupport_ = value; + } + } + /// Gets whether the "binary_tracking_data_support" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBinaryTrackingDataSupport { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "binary_tracking_data_support" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBinaryTrackingDataSupport() { + _hasBits0 &= ~32; + } + + /// Field number for the "use_high_profile" field. + public const int UseHighProfileFieldNumber = 3; + private readonly static bool UseHighProfileDefaultValue = false; + + private bool useHighProfile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseHighProfile { + get { if ((_hasBits0 & 4) != 0) { return useHighProfile_; } else { return UseHighProfileDefaultValue; } } + set { + _hasBits0 |= 4; + useHighProfile_ = value; + } + } + /// Gets whether the "use_high_profile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseHighProfile { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "use_high_profile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseHighProfile() { + _hasBits0 &= ~4; + } + + /// Field number for the "high_fidelity_16bit_encode" field. + public const int HighFidelity16BitEncodeFieldNumber = 4; + private readonly static bool HighFidelity16BitEncodeDefaultValue = true; + + private bool highFidelity16BitEncode_; + /// + /// If set uses 16 bit encode for vector data, in BinaryTrackingData, + /// otherwise only 8 bits are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HighFidelity16BitEncode { + get { if ((_hasBits0 & 8) != 0) { return highFidelity16BitEncode_; } else { return HighFidelity16BitEncodeDefaultValue; } } + set { + _hasBits0 |= 8; + highFidelity16BitEncode_ = value; + } + } + /// Gets whether the "high_fidelity_16bit_encode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHighFidelity16BitEncode { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "high_fidelity_16bit_encode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHighFidelity16BitEncode() { + _hasBits0 &= ~8; + } + + /// Field number for the "high_profile_reuse_threshold" field. + public const int HighProfileReuseThresholdFieldNumber = 5; + private readonly static float HighProfileReuseThresholdDefaultValue = 0.5F; + + private float highProfileReuseThreshold_; + /// + /// In high profile encode, re-use previously encoded vector when absolute + /// difference to current vector is below threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HighProfileReuseThreshold { + get { if ((_hasBits0 & 16) != 0) { return highProfileReuseThreshold_; } else { return HighProfileReuseThresholdDefaultValue; } } + set { + _hasBits0 |= 16; + highProfileReuseThreshold_ = value; + } + } + /// Gets whether the "high_profile_reuse_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHighProfileReuseThreshold { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "high_profile_reuse_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHighProfileReuseThreshold() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FlowPackagerOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FlowPackagerOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DomainWidth != other.DomainWidth) return false; + if (DomainHeight != other.DomainHeight) return false; + if (BinaryTrackingDataSupport != other.BinaryTrackingDataSupport) return false; + if (UseHighProfile != other.UseHighProfile) return false; + if (HighFidelity16BitEncode != other.HighFidelity16BitEncode) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HighProfileReuseThreshold, other.HighProfileReuseThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDomainWidth) hash ^= DomainWidth.GetHashCode(); + if (HasDomainHeight) hash ^= DomainHeight.GetHashCode(); + if (HasBinaryTrackingDataSupport) hash ^= BinaryTrackingDataSupport.GetHashCode(); + if (HasUseHighProfile) hash ^= UseHighProfile.GetHashCode(); + if (HasHighFidelity16BitEncode) hash ^= HighFidelity16BitEncode.GetHashCode(); + if (HasHighProfileReuseThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HighProfileReuseThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDomainWidth) { + output.WriteRawTag(8); + output.WriteInt32(DomainWidth); + } + if (HasDomainHeight) { + output.WriteRawTag(16); + output.WriteInt32(DomainHeight); + } + if (HasUseHighProfile) { + output.WriteRawTag(24); + output.WriteBool(UseHighProfile); + } + if (HasHighFidelity16BitEncode) { + output.WriteRawTag(32); + output.WriteBool(HighFidelity16BitEncode); + } + if (HasHighProfileReuseThreshold) { + output.WriteRawTag(45); + output.WriteFloat(HighProfileReuseThreshold); + } + if (HasBinaryTrackingDataSupport) { + output.WriteRawTag(48); + output.WriteBool(BinaryTrackingDataSupport); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDomainWidth) { + output.WriteRawTag(8); + output.WriteInt32(DomainWidth); + } + if (HasDomainHeight) { + output.WriteRawTag(16); + output.WriteInt32(DomainHeight); + } + if (HasUseHighProfile) { + output.WriteRawTag(24); + output.WriteBool(UseHighProfile); + } + if (HasHighFidelity16BitEncode) { + output.WriteRawTag(32); + output.WriteBool(HighFidelity16BitEncode); + } + if (HasHighProfileReuseThreshold) { + output.WriteRawTag(45); + output.WriteFloat(HighProfileReuseThreshold); + } + if (HasBinaryTrackingDataSupport) { + output.WriteRawTag(48); + output.WriteBool(BinaryTrackingDataSupport); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDomainWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DomainWidth); + } + if (HasDomainHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DomainHeight); + } + if (HasBinaryTrackingDataSupport) { + size += 1 + 1; + } + if (HasUseHighProfile) { + size += 1 + 1; + } + if (HasHighFidelity16BitEncode) { + size += 1 + 1; + } + if (HasHighProfileReuseThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FlowPackagerOptions other) { + if (other == null) { + return; + } + if (other.HasDomainWidth) { + DomainWidth = other.DomainWidth; + } + if (other.HasDomainHeight) { + DomainHeight = other.DomainHeight; + } + if (other.HasBinaryTrackingDataSupport) { + BinaryTrackingDataSupport = other.BinaryTrackingDataSupport; + } + if (other.HasUseHighProfile) { + UseHighProfile = other.UseHighProfile; + } + if (other.HasHighFidelity16BitEncode) { + HighFidelity16BitEncode = other.HighFidelity16BitEncode; + } + if (other.HasHighProfileReuseThreshold) { + HighProfileReuseThreshold = other.HighProfileReuseThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DomainWidth = input.ReadInt32(); + break; + } + case 16: { + DomainHeight = input.ReadInt32(); + break; + } + case 24: { + UseHighProfile = input.ReadBool(); + break; + } + case 32: { + HighFidelity16BitEncode = input.ReadBool(); + break; + } + case 45: { + HighProfileReuseThreshold = input.ReadFloat(); + break; + } + case 48: { + BinaryTrackingDataSupport = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + DomainWidth = input.ReadInt32(); + break; + } + case 16: { + DomainHeight = input.ReadInt32(); + break; + } + case 24: { + UseHighProfile = input.ReadBool(); + break; + } + case 32: { + HighFidelity16BitEncode = input.ReadBool(); + break; + } + case 45: { + HighProfileReuseThreshold = input.ReadFloat(); + break; + } + case 48: { + BinaryTrackingDataSupport = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the FlowPackagerOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// High profile encoding flags. + /// + public enum HighProfileEncoding { + [pbr::OriginalName("ADVANCE_FLAG")] AdvanceFlag = 128, + [pbr::OriginalName("DOUBLE_INDEX_ENCODE")] DoubleIndexEncode = 64, + [pbr::OriginalName("INDEX_MASK")] IndexMask = 63, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs.meta new file mode 100644 index 0000000..9822d4f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FlowPackager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc3a3160e73db796a98cbc0522750f19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs new file mode 100644 index 0000000..26b90a4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs @@ -0,0 +1,1487 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/frame_selection.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/frame_selection.proto + public static partial class FrameSelectionReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/frame_selection.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FrameSelectionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci1tZWRpYXBpcGUvdXRpbC90cmFja2luZy9mcmFtZV9zZWxlY3Rpb24ucHJv", + "dG8SCW1lZGlhcGlwZRorbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcvY2FtZXJh", + "X21vdGlvbi5wcm90bxpAbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcvZnJhbWVf", + "c2VsZWN0aW9uX3NvbHV0aW9uX2V2YWx1YXRvci5wcm90bxopbWVkaWFwaXBl", + "L3V0aWwvdHJhY2tpbmcvcmVnaW9uX2Zsb3cucHJvdG8iZQoXRnJhbWVTZWxl", + "Y3Rpb25UaW1lc3RhbXASEQoJdGltZXN0YW1wGAEgASgDEhEKCWZyYW1lX2lk", + "eBgCIAEoBRIkChhwcm9jZXNzZWRfZnJvbV90aW1lc3RhbXAYAyABKAM6Ai0x", + "IsYBChRGcmFtZVNlbGVjdGlvblJlc3VsdBIRCgl0aW1lc3RhbXAYASABKAMS", + "EQoJZnJhbWVfaWR4GAIgASgFEi4KDWNhbWVyYV9tb3Rpb24YAyABKAsyFy5t", + "ZWRpYXBpcGUuQ2FtZXJhTW90aW9uEjIKCGZlYXR1cmVzGAQgASgLMiAubWVk", + "aWFwaXBlLlJlZ2lvbkZsb3dGZWF0dXJlTGlzdBIkChhwcm9jZXNzZWRfZnJv", + "bV90aW1lc3RhbXAYBSABKAM6Ai0xItwBChdGcmFtZVNlbGVjdGlvbkNyaXRl", + "cmlvbhIYCg1zYW1wbGluZ19yYXRlGAEgASgFOgEwEhwKEGJhbmR3aWR0aF9m", + "cmFtZXMYAiABKAI6AjUwEh8KFHNlYXJjaF9yYWRpdXNfZnJhbWVzGAMgASgF", + "OgExEkoKEnNvbHV0aW9uX2V2YWx1YXRvchgEIAEoCzIuLm1lZGlhcGlwZS5G", + "cmFtZVNlbGVjdGlvblNvbHV0aW9uRXZhbHVhdG9yVHlwZRIcChFtYXhfb3V0", + "cHV0X2ZyYW1lcxgFIAEoBToBMCJnChVGcmFtZVNlbGVjdGlvbk9wdGlvbnMS", + "NQoJY3JpdGVyaW9uGAEgAygLMiIubWVkaWFwaXBlLkZyYW1lU2VsZWN0aW9u", + "Q3JpdGVyaW9uEhcKCmNodW5rX3NpemUYAiABKAU6AzEwMA==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.CameraMotionReflection.Descriptor, global::Mediapipe.FrameSelectionSolutionEvaluatorReflection.Descriptor, global::Mediapipe.RegionFlowReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionTimestamp), global::Mediapipe.FrameSelectionTimestamp.Parser, new[]{ "Timestamp", "FrameIdx", "ProcessedFromTimestamp" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionResult), global::Mediapipe.FrameSelectionResult.Parser, new[]{ "Timestamp", "FrameIdx", "CameraMotion", "Features", "ProcessedFromTimestamp" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionCriterion), global::Mediapipe.FrameSelectionCriterion.Parser, new[]{ "SamplingRate", "BandwidthFrames", "SearchRadiusFrames", "SolutionEvaluator", "MaxOutputFrames" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionOptions), global::Mediapipe.FrameSelectionOptions.Parser, new[]{ "Criterion", "ChunkSize" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Stores selected timestamps and corresponding frame index. + /// + public sealed partial class FrameSelectionTimestamp : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionTimestamp()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionTimestamp() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionTimestamp(FrameSelectionTimestamp other) : this() { + _hasBits0 = other._hasBits0; + timestamp_ = other.timestamp_; + frameIdx_ = other.frameIdx_; + processedFromTimestamp_ = other.processedFromTimestamp_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionTimestamp Clone() { + return new FrameSelectionTimestamp(this); + } + + /// Field number for the "timestamp" field. + public const int TimestampFieldNumber = 1; + private readonly static long TimestampDefaultValue = 0L; + + private long timestamp_; + /// + /// Timestamp of the selected frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Timestamp { + get { if ((_hasBits0 & 1) != 0) { return timestamp_; } else { return TimestampDefaultValue; } } + set { + _hasBits0 |= 1; + timestamp_ = value; + } + } + /// Gets whether the "timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestamp { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestamp() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_idx" field. + public const int FrameIdxFieldNumber = 2; + private readonly static int FrameIdxDefaultValue = 0; + + private int frameIdx_; + /// + /// Frame index of the selected frame in the initial video stream. If this + /// timestamp was manufactured, this will be the index of the initial frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameIdx { + get { if ((_hasBits0 & 2) != 0) { return frameIdx_; } else { return FrameIdxDefaultValue; } } + set { + _hasBits0 |= 2; + frameIdx_ = value; + } + } + /// Gets whether the "frame_idx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameIdx { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_idx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameIdx() { + _hasBits0 &= ~2; + } + + /// Field number for the "processed_from_timestamp" field. + public const int ProcessedFromTimestampFieldNumber = 3; + private readonly static long ProcessedFromTimestampDefaultValue = -1L; + + private long processedFromTimestamp_; + /// + /// If this timestamp was manufactured, the timestamp of the original frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ProcessedFromTimestamp { + get { if ((_hasBits0 & 4) != 0) { return processedFromTimestamp_; } else { return ProcessedFromTimestampDefaultValue; } } + set { + _hasBits0 |= 4; + processedFromTimestamp_ = value; + } + } + /// Gets whether the "processed_from_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProcessedFromTimestamp { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "processed_from_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProcessedFromTimestamp() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionTimestamp); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionTimestamp other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Timestamp != other.Timestamp) return false; + if (FrameIdx != other.FrameIdx) return false; + if (ProcessedFromTimestamp != other.ProcessedFromTimestamp) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTimestamp) hash ^= Timestamp.GetHashCode(); + if (HasFrameIdx) hash ^= FrameIdx.GetHashCode(); + if (HasProcessedFromTimestamp) hash ^= ProcessedFromTimestamp.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTimestamp) { + output.WriteRawTag(8); + output.WriteInt64(Timestamp); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (HasProcessedFromTimestamp) { + output.WriteRawTag(24); + output.WriteInt64(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTimestamp) { + output.WriteRawTag(8); + output.WriteInt64(Timestamp); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (HasProcessedFromTimestamp) { + output.WriteRawTag(24); + output.WriteInt64(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Timestamp); + } + if (HasFrameIdx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameIdx); + } + if (HasProcessedFromTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionTimestamp other) { + if (other == null) { + return; + } + if (other.HasTimestamp) { + Timestamp = other.Timestamp; + } + if (other.HasFrameIdx) { + FrameIdx = other.FrameIdx; + } + if (other.HasProcessedFromTimestamp) { + ProcessedFromTimestamp = other.ProcessedFromTimestamp; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Timestamp = input.ReadInt64(); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 24: { + ProcessedFromTimestamp = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Timestamp = input.ReadInt64(); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 24: { + ProcessedFromTimestamp = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// Stores the result of the frame selection, with composited features. + /// Next index: 6 + /// + public sealed partial class FrameSelectionResult : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionResult()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionResult(FrameSelectionResult other) : this() { + _hasBits0 = other._hasBits0; + timestamp_ = other.timestamp_; + frameIdx_ = other.frameIdx_; + cameraMotion_ = other.cameraMotion_ != null ? other.cameraMotion_.Clone() : null; + features_ = other.features_ != null ? other.features_.Clone() : null; + processedFromTimestamp_ = other.processedFromTimestamp_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionResult Clone() { + return new FrameSelectionResult(this); + } + + /// Field number for the "timestamp" field. + public const int TimestampFieldNumber = 1; + private readonly static long TimestampDefaultValue = 0L; + + private long timestamp_; + /// + /// Timestamp of the selected frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Timestamp { + get { if ((_hasBits0 & 1) != 0) { return timestamp_; } else { return TimestampDefaultValue; } } + set { + _hasBits0 |= 1; + timestamp_ = value; + } + } + /// Gets whether the "timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestamp { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestamp() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_idx" field. + public const int FrameIdxFieldNumber = 2; + private readonly static int FrameIdxDefaultValue = 0; + + private int frameIdx_; + /// + /// Frame index of the selected frame in the initial video stream. If this + /// timestamp was manufactured, this will be the index of the initial frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameIdx { + get { if ((_hasBits0 & 2) != 0) { return frameIdx_; } else { return FrameIdxDefaultValue; } } + set { + _hasBits0 |= 2; + frameIdx_ = value; + } + } + /// Gets whether the "frame_idx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameIdx { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_idx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameIdx() { + _hasBits0 &= ~2; + } + + /// Field number for the "camera_motion" field. + public const int CameraMotionFieldNumber = 3; + private global::Mediapipe.CameraMotion cameraMotion_; + /// + /// CameraMotion from selected item to previous selected item. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.CameraMotion CameraMotion { + get { return cameraMotion_; } + set { + cameraMotion_ = value; + } + } + + /// Field number for the "features" field. + public const int FeaturesFieldNumber = 4; + private global::Mediapipe.RegionFlowFeatureList features_; + /// + /// Features from selected item to previous selected item. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowFeatureList Features { + get { return features_; } + set { + features_ = value; + } + } + + /// Field number for the "processed_from_timestamp" field. + public const int ProcessedFromTimestampFieldNumber = 5; + private readonly static long ProcessedFromTimestampDefaultValue = -1L; + + private long processedFromTimestamp_; + /// + /// If this FrameSelectionResult was the result of processing a previous one, + /// the timestamp of the original frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ProcessedFromTimestamp { + get { if ((_hasBits0 & 4) != 0) { return processedFromTimestamp_; } else { return ProcessedFromTimestampDefaultValue; } } + set { + _hasBits0 |= 4; + processedFromTimestamp_ = value; + } + } + /// Gets whether the "processed_from_timestamp" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProcessedFromTimestamp { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "processed_from_timestamp" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProcessedFromTimestamp() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Timestamp != other.Timestamp) return false; + if (FrameIdx != other.FrameIdx) return false; + if (!object.Equals(CameraMotion, other.CameraMotion)) return false; + if (!object.Equals(Features, other.Features)) return false; + if (ProcessedFromTimestamp != other.ProcessedFromTimestamp) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTimestamp) hash ^= Timestamp.GetHashCode(); + if (HasFrameIdx) hash ^= FrameIdx.GetHashCode(); + if (cameraMotion_ != null) hash ^= CameraMotion.GetHashCode(); + if (features_ != null) hash ^= Features.GetHashCode(); + if (HasProcessedFromTimestamp) hash ^= ProcessedFromTimestamp.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasTimestamp) { + output.WriteRawTag(8); + output.WriteInt64(Timestamp); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (cameraMotion_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CameraMotion); + } + if (features_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Features); + } + if (HasProcessedFromTimestamp) { + output.WriteRawTag(40); + output.WriteInt64(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasTimestamp) { + output.WriteRawTag(8); + output.WriteInt64(Timestamp); + } + if (HasFrameIdx) { + output.WriteRawTag(16); + output.WriteInt32(FrameIdx); + } + if (cameraMotion_ != null) { + output.WriteRawTag(26); + output.WriteMessage(CameraMotion); + } + if (features_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Features); + } + if (HasProcessedFromTimestamp) { + output.WriteRawTag(40); + output.WriteInt64(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Timestamp); + } + if (HasFrameIdx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameIdx); + } + if (cameraMotion_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CameraMotion); + } + if (features_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); + } + if (HasProcessedFromTimestamp) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ProcessedFromTimestamp); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionResult other) { + if (other == null) { + return; + } + if (other.HasTimestamp) { + Timestamp = other.Timestamp; + } + if (other.HasFrameIdx) { + FrameIdx = other.FrameIdx; + } + if (other.cameraMotion_ != null) { + if (cameraMotion_ == null) { + CameraMotion = new global::Mediapipe.CameraMotion(); + } + CameraMotion.MergeFrom(other.CameraMotion); + } + if (other.features_ != null) { + if (features_ == null) { + Features = new global::Mediapipe.RegionFlowFeatureList(); + } + Features.MergeFrom(other.Features); + } + if (other.HasProcessedFromTimestamp) { + ProcessedFromTimestamp = other.ProcessedFromTimestamp; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Timestamp = input.ReadInt64(); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 26: { + if (cameraMotion_ == null) { + CameraMotion = new global::Mediapipe.CameraMotion(); + } + input.ReadMessage(CameraMotion); + break; + } + case 34: { + if (features_ == null) { + Features = new global::Mediapipe.RegionFlowFeatureList(); + } + input.ReadMessage(Features); + break; + } + case 40: { + ProcessedFromTimestamp = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Timestamp = input.ReadInt64(); + break; + } + case 16: { + FrameIdx = input.ReadInt32(); + break; + } + case 26: { + if (cameraMotion_ == null) { + CameraMotion = new global::Mediapipe.CameraMotion(); + } + input.ReadMessage(CameraMotion); + break; + } + case 34: { + if (features_ == null) { + Features = new global::Mediapipe.RegionFlowFeatureList(); + } + input.ReadMessage(Features); + break; + } + case 40: { + ProcessedFromTimestamp = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// Next index: 7 + /// + public sealed partial class FrameSelectionCriterion : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionCriterion()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionCriterion() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionCriterion(FrameSelectionCriterion other) : this() { + _hasBits0 = other._hasBits0; + samplingRate_ = other.samplingRate_; + bandwidthFrames_ = other.bandwidthFrames_; + searchRadiusFrames_ = other.searchRadiusFrames_; + solutionEvaluator_ = other.solutionEvaluator_ != null ? other.solutionEvaluator_.Clone() : null; + maxOutputFrames_ = other.maxOutputFrames_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionCriterion Clone() { + return new FrameSelectionCriterion(this); + } + + /// Field number for the "sampling_rate" field. + public const int SamplingRateFieldNumber = 1; + private readonly static int SamplingRateDefaultValue = 0; + + private int samplingRate_; + /// + /// Interval at which frames should be sampled; set to zero if sampling should + /// not be enforced (i.e. selection is performed w.r.t. other criteria). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SamplingRate { + get { if ((_hasBits0 & 1) != 0) { return samplingRate_; } else { return SamplingRateDefaultValue; } } + set { + _hasBits0 |= 1; + samplingRate_ = value; + } + } + /// Gets whether the "sampling_rate" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSamplingRate { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "sampling_rate" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSamplingRate() { + _hasBits0 &= ~1; + } + + /// Field number for the "bandwidth_frames" field. + public const int BandwidthFramesFieldNumber = 2; + private readonly static float BandwidthFramesDefaultValue = 50F; + + private float bandwidthFrames_; + /// + /// Bandwidth used during dynamic programming. The larger the bandwidth the + /// more accurate the result w.r.t. the specified sampling rate. Smaller + /// bandwidth's bias the solution suboptimally to center around the mean + /// frame numbers of the sampling rate. + /// If in (0, 1), assumed to specify fraction of total number of input frames, + /// otherwise must be an integer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BandwidthFrames { + get { if ((_hasBits0 & 2) != 0) { return bandwidthFrames_; } else { return BandwidthFramesDefaultValue; } } + set { + _hasBits0 |= 2; + bandwidthFrames_ = value; + } + } + /// Gets whether the "bandwidth_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBandwidthFrames { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "bandwidth_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBandwidthFrames() { + _hasBits0 &= ~2; + } + + /// Field number for the "search_radius_frames" field. + public const int SearchRadiusFramesFieldNumber = 3; + private readonly static int SearchRadiusFramesDefaultValue = 1; + + private int searchRadiusFrames_; + /// + /// Search radius for dynamic programming (how many frames you are allowed to + /// search around the previous frame). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SearchRadiusFrames { + get { if ((_hasBits0 & 4) != 0) { return searchRadiusFrames_; } else { return SearchRadiusFramesDefaultValue; } } + set { + _hasBits0 |= 4; + searchRadiusFrames_ = value; + } + } + /// Gets whether the "search_radius_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSearchRadiusFrames { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "search_radius_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSearchRadiusFrames() { + _hasBits0 &= ~4; + } + + /// Field number for the "solution_evaluator" field. + public const int SolutionEvaluatorFieldNumber = 4; + private global::Mediapipe.FrameSelectionSolutionEvaluatorType solutionEvaluator_; + /// + /// Allows one to specify custom solution selection criteria (i.e. different + /// way to choose the best row of the computed cost matrix). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FrameSelectionSolutionEvaluatorType SolutionEvaluator { + get { return solutionEvaluator_; } + set { + solutionEvaluator_ = value; + } + } + + /// Field number for the "max_output_frames" field. + public const int MaxOutputFramesFieldNumber = 5; + private readonly static int MaxOutputFramesDefaultValue = 0; + + private int maxOutputFrames_; + /// + /// Outputs a fixed number of frames and automatically sets the appropriate + /// sampling rate. Set to 0 by default (i.e. not enabled). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxOutputFrames { + get { if ((_hasBits0 & 8) != 0) { return maxOutputFrames_; } else { return MaxOutputFramesDefaultValue; } } + set { + _hasBits0 |= 8; + maxOutputFrames_ = value; + } + } + /// Gets whether the "max_output_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxOutputFrames { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "max_output_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxOutputFrames() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionCriterion); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionCriterion other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SamplingRate != other.SamplingRate) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BandwidthFrames, other.BandwidthFrames)) return false; + if (SearchRadiusFrames != other.SearchRadiusFrames) return false; + if (!object.Equals(SolutionEvaluator, other.SolutionEvaluator)) return false; + if (MaxOutputFrames != other.MaxOutputFrames) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasSamplingRate) hash ^= SamplingRate.GetHashCode(); + if (HasBandwidthFrames) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BandwidthFrames); + if (HasSearchRadiusFrames) hash ^= SearchRadiusFrames.GetHashCode(); + if (solutionEvaluator_ != null) hash ^= SolutionEvaluator.GetHashCode(); + if (HasMaxOutputFrames) hash ^= MaxOutputFrames.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasSamplingRate) { + output.WriteRawTag(8); + output.WriteInt32(SamplingRate); + } + if (HasBandwidthFrames) { + output.WriteRawTag(21); + output.WriteFloat(BandwidthFrames); + } + if (HasSearchRadiusFrames) { + output.WriteRawTag(24); + output.WriteInt32(SearchRadiusFrames); + } + if (solutionEvaluator_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SolutionEvaluator); + } + if (HasMaxOutputFrames) { + output.WriteRawTag(40); + output.WriteInt32(MaxOutputFrames); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasSamplingRate) { + output.WriteRawTag(8); + output.WriteInt32(SamplingRate); + } + if (HasBandwidthFrames) { + output.WriteRawTag(21); + output.WriteFloat(BandwidthFrames); + } + if (HasSearchRadiusFrames) { + output.WriteRawTag(24); + output.WriteInt32(SearchRadiusFrames); + } + if (solutionEvaluator_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SolutionEvaluator); + } + if (HasMaxOutputFrames) { + output.WriteRawTag(40); + output.WriteInt32(MaxOutputFrames); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasSamplingRate) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SamplingRate); + } + if (HasBandwidthFrames) { + size += 1 + 4; + } + if (HasSearchRadiusFrames) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SearchRadiusFrames); + } + if (solutionEvaluator_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SolutionEvaluator); + } + if (HasMaxOutputFrames) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxOutputFrames); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionCriterion other) { + if (other == null) { + return; + } + if (other.HasSamplingRate) { + SamplingRate = other.SamplingRate; + } + if (other.HasBandwidthFrames) { + BandwidthFrames = other.BandwidthFrames; + } + if (other.HasSearchRadiusFrames) { + SearchRadiusFrames = other.SearchRadiusFrames; + } + if (other.solutionEvaluator_ != null) { + if (solutionEvaluator_ == null) { + SolutionEvaluator = new global::Mediapipe.FrameSelectionSolutionEvaluatorType(); + } + SolutionEvaluator.MergeFrom(other.SolutionEvaluator); + } + if (other.HasMaxOutputFrames) { + MaxOutputFrames = other.MaxOutputFrames; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SamplingRate = input.ReadInt32(); + break; + } + case 21: { + BandwidthFrames = input.ReadFloat(); + break; + } + case 24: { + SearchRadiusFrames = input.ReadInt32(); + break; + } + case 34: { + if (solutionEvaluator_ == null) { + SolutionEvaluator = new global::Mediapipe.FrameSelectionSolutionEvaluatorType(); + } + input.ReadMessage(SolutionEvaluator); + break; + } + case 40: { + MaxOutputFrames = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SamplingRate = input.ReadInt32(); + break; + } + case 21: { + BandwidthFrames = input.ReadFloat(); + break; + } + case 24: { + SearchRadiusFrames = input.ReadInt32(); + break; + } + case 34: { + if (solutionEvaluator_ == null) { + SolutionEvaluator = new global::Mediapipe.FrameSelectionSolutionEvaluatorType(); + } + input.ReadMessage(SolutionEvaluator); + break; + } + case 40: { + MaxOutputFrames = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// Options for computing frame selection. + /// TODO: Support multiple criteria if required. Currently uses only the + /// first one. + /// + public sealed partial class FrameSelectionOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionOptions(FrameSelectionOptions other) : this() { + _hasBits0 = other._hasBits0; + criterion_ = other.criterion_.Clone(); + chunkSize_ = other.chunkSize_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionOptions Clone() { + return new FrameSelectionOptions(this); + } + + /// Field number for the "criterion" field. + public const int CriterionFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_criterion_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.FrameSelectionCriterion.Parser); + private readonly pbc::RepeatedField criterion_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Criterion { + get { return criterion_; } + } + + /// Field number for the "chunk_size" field. + public const int ChunkSizeFieldNumber = 2; + private readonly static int ChunkSizeDefaultValue = 100; + + private int chunkSize_; + /// + /// FrameSelection buffers incoming CameraMotions for specified chunk size + /// and creates cost matrices upon reaching the limit. + /// TODO: Implement if necessary (currently nothing is cleared upon + /// reaching the limit). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ChunkSize { + get { if ((_hasBits0 & 1) != 0) { return chunkSize_; } else { return ChunkSizeDefaultValue; } } + set { + _hasBits0 |= 1; + chunkSize_ = value; + } + } + /// Gets whether the "chunk_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasChunkSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "chunk_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearChunkSize() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!criterion_.Equals(other.criterion_)) return false; + if (ChunkSize != other.ChunkSize) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= criterion_.GetHashCode(); + if (HasChunkSize) hash ^= ChunkSize.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + criterion_.WriteTo(output, _repeated_criterion_codec); + if (HasChunkSize) { + output.WriteRawTag(16); + output.WriteInt32(ChunkSize); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + criterion_.WriteTo(ref output, _repeated_criterion_codec); + if (HasChunkSize) { + output.WriteRawTag(16); + output.WriteInt32(ChunkSize); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += criterion_.CalculateSize(_repeated_criterion_codec); + if (HasChunkSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChunkSize); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionOptions other) { + if (other == null) { + return; + } + criterion_.Add(other.criterion_); + if (other.HasChunkSize) { + ChunkSize = other.ChunkSize; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + criterion_.AddEntriesFrom(input, _repeated_criterion_codec); + break; + } + case 16: { + ChunkSize = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + criterion_.AddEntriesFrom(ref input, _repeated_criterion_codec); + break; + } + case 16: { + ChunkSize = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs.meta new file mode 100644 index 0000000..be7cc1a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 803966a0911513dbdb3d2b3be6bc8e0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs new file mode 100644 index 0000000..bf00d15 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs @@ -0,0 +1,498 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/frame_selection_solution_evaluator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/frame_selection_solution_evaluator.proto + public static partial class FrameSelectionSolutionEvaluatorReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/frame_selection_solution_evaluator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static FrameSelectionSolutionEvaluatorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CkBtZWRpYXBpcGUvdXRpbC90cmFja2luZy9mcmFtZV9zZWxlY3Rpb25fc29s", + "dXRpb25fZXZhbHVhdG9yLnByb3RvEgltZWRpYXBpcGUiNAomRnJhbWVTZWxl", + "Y3Rpb25Tb2x1dGlvbkV2YWx1YXRvck9wdGlvbnMqCgignAEQgICAgAIingEK", + "I0ZyYW1lU2VsZWN0aW9uU29sdXRpb25FdmFsdWF0b3JUeXBlEjMKCmNsYXNz", + "X25hbWUYASABKAk6H0ZyYW1lU2VsZWN0aW9uU29sdXRpb25FdmFsdWF0b3IS", + "QgoHb3B0aW9ucxgCIAEoCzIxLm1lZGlhcGlwZS5GcmFtZVNlbGVjdGlvblNv", + "bHV0aW9uRXZhbHVhdG9yT3B0aW9ucw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionSolutionEvaluatorOptions), global::Mediapipe.FrameSelectionSolutionEvaluatorOptions.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.FrameSelectionSolutionEvaluatorType), global::Mediapipe.FrameSelectionSolutionEvaluatorType.Parser, new[]{ "ClassName", "Options" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class FrameSelectionSolutionEvaluatorOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionSolutionEvaluatorOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionSolutionEvaluatorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorOptions(FrameSelectionSolutionEvaluatorOptions other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorOptions Clone() { + return new FrameSelectionSolutionEvaluatorOptions(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionSolutionEvaluatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionSolutionEvaluatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionSolutionEvaluatorOptions other) { + if (other == null) { + return; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + public sealed partial class FrameSelectionSolutionEvaluatorType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FrameSelectionSolutionEvaluatorType()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.FrameSelectionSolutionEvaluatorReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorType() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorType(FrameSelectionSolutionEvaluatorType other) : this() { + className_ = other.className_; + options_ = other.options_ != null ? other.options_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FrameSelectionSolutionEvaluatorType Clone() { + return new FrameSelectionSolutionEvaluatorType(this); + } + + /// Field number for the "class_name" field. + public const int ClassNameFieldNumber = 1; + private readonly static string ClassNameDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("RnJhbWVTZWxlY3Rpb25Tb2x1dGlvbkV2YWx1YXRvcg=="), 0, 31); + + private string className_; + /// + /// Class of type FrameSelectionSolution that computes the best row. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ClassName { + get { return className_ ?? ClassNameDefaultValue; } + set { + className_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "class_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClassName { + get { return className_ != null; } + } + /// Clears the value of the "class_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClassName() { + className_ = null; + } + + /// Field number for the "options" field. + public const int OptionsFieldNumber = 2; + private global::Mediapipe.FrameSelectionSolutionEvaluatorOptions options_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.FrameSelectionSolutionEvaluatorOptions Options { + get { return options_; } + set { + options_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FrameSelectionSolutionEvaluatorType); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FrameSelectionSolutionEvaluatorType other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ClassName != other.ClassName) return false; + if (!object.Equals(Options, other.Options)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasClassName) hash ^= ClassName.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasClassName) { + output.WriteRawTag(10); + output.WriteString(ClassName); + } + if (options_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasClassName) { + output.WriteRawTag(10); + output.WriteString(ClassName); + } + if (options_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasClassName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ClassName); + } + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FrameSelectionSolutionEvaluatorType other) { + if (other == null) { + return; + } + if (other.HasClassName) { + ClassName = other.ClassName; + } + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Mediapipe.FrameSelectionSolutionEvaluatorOptions(); + } + Options.MergeFrom(other.Options); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ClassName = input.ReadString(); + break; + } + case 18: { + if (options_ == null) { + Options = new global::Mediapipe.FrameSelectionSolutionEvaluatorOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ClassName = input.ReadString(); + break; + } + case 18: { + if (options_ == null) { + Options = new global::Mediapipe.FrameSelectionSolutionEvaluatorOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs.meta new file mode 100644 index 0000000..8c940bf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/FrameSelectionSolutionEvaluator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a2f82e9de1c6a9af96caac8fdfdffa6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs new file mode 100644 index 0000000..bda44de --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs @@ -0,0 +1,342 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/label_map.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/label_map.proto + public static partial class LabelMapReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/label_map.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LabelMapReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch5tZWRpYXBpcGUvdXRpbC9sYWJlbF9tYXAucHJvdG8SCW1lZGlhcGlwZSJG", + "CgxMYWJlbE1hcEl0ZW0SDAoEbmFtZRgBIAEoCRIUCgxkaXNwbGF5X25hbWUY", + "AiABKAkSEgoKY2hpbGRfbmFtZRgDIAMoCQ==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LabelMapItem), global::Mediapipe.LabelMapItem.Parser, new[]{ "Name", "DisplayName", "ChildName" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Mapping a numerical class index output to a Knowledge Graph entity + /// ID or any other string label representing this class. Optionally it is + /// possible to specify an additional display name (in a given language) which is + /// typically used for display purposes. + /// + public sealed partial class LabelMapItem : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LabelMapItem()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.LabelMapReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMapItem() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMapItem(LabelMapItem other) : this() { + name_ = other.name_; + displayName_ = other.displayName_; + childName_ = other.childName_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LabelMapItem Clone() { + return new LabelMapItem(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private readonly static string NameDefaultValue = ""; + + private string name_; + /// + /// Label name. + /// E.g. name = "/m/02xwb" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_ ?? NameDefaultValue; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasName { + get { return name_ != null; } + } + /// Clears the value of the "name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearName() { + name_ = null; + } + + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 2; + private readonly static string DisplayNameDefaultValue = ""; + + private string displayName_; + /// + /// Display name. + /// E.g. display_name = "Fruit" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayName { + get { return displayName_ ?? DisplayNameDefaultValue; } + set { + displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "display_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisplayName { + get { return displayName_ != null; } + } + /// Clears the value of the "display_name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisplayName() { + displayName_ = null; + } + + /// Field number for the "child_name" field. + public const int ChildNameFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_childName_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField childName_ = new pbc::RepeatedField(); + /// + /// Optional list of children (e.g. subcategories) used to represent a + /// hierarchy. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ChildName { + get { return childName_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LabelMapItem); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LabelMapItem other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (DisplayName != other.DisplayName) return false; + if(!childName_.Equals(other.childName_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasName) hash ^= Name.GetHashCode(); + if (HasDisplayName) hash ^= DisplayName.GetHashCode(); + hash ^= childName_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasDisplayName) { + output.WriteRawTag(18); + output.WriteString(DisplayName); + } + childName_.WriteTo(output, _repeated_childName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasDisplayName) { + output.WriteRawTag(18); + output.WriteString(DisplayName); + } + childName_.WriteTo(ref output, _repeated_childName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (HasDisplayName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName); + } + size += childName_.CalculateSize(_repeated_childName_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LabelMapItem other) { + if (other == null) { + return; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasDisplayName) { + DisplayName = other.DisplayName; + } + childName_.Add(other.childName_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + DisplayName = input.ReadString(); + break; + } + case 26: { + childName_.AddEntriesFrom(input, _repeated_childName_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + DisplayName = input.ReadString(); + break; + } + case 26: { + childName_.AddEntriesFrom(ref input, _repeated_childName_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs.meta new file mode 100644 index 0000000..8045fdd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/LabelMap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ba80c98bd33fbabd8c5d441c95fe506 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs new file mode 100644 index 0000000..e1e8ce5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs @@ -0,0 +1,1948 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/motion_analysis.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/motion_analysis.proto + public static partial class MotionAnalysisReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/motion_analysis.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MotionAnalysisReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci1tZWRpYXBpcGUvdXRpbC90cmFja2luZy9tb3Rpb25fYW5hbHlzaXMucHJv", + "dG8SCW1lZGlhcGlwZRovbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcvbW90aW9u", + "X2VzdGltYXRpb24ucHJvdG8aLW1lZGlhcGlwZS91dGlsL3RyYWNraW5nL21v", + "dGlvbl9zYWxpZW5jeS5wcm90bxo1bWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcv", + "cmVnaW9uX2Zsb3dfY29tcHV0YXRpb24ucHJvdG8i+AoKFU1vdGlvbkFuYWx5", + "c2lzT3B0aW9ucxJgCg9hbmFseXNpc19wb2xpY3kYDiABKA4yLy5tZWRpYXBp", + "cGUuTW90aW9uQW5hbHlzaXNPcHRpb25zLkFuYWx5c2lzUG9saWN5OhZBTkFM", + "WVNJU19QT0xJQ1lfTEVHQUNZEj0KDGZsb3dfb3B0aW9ucxgBIAEoCzInLm1l", + "ZGlhcGlwZS5SZWdpb25GbG93Q29tcHV0YXRpb25PcHRpb25zEjoKDm1vdGlv", + "bl9vcHRpb25zGAIgASgLMiIubWVkaWFwaXBlLk1vdGlvbkVzdGltYXRpb25P", + "cHRpb25zEjoKEHNhbGllbmN5X29wdGlvbnMYAyABKAsyIC5tZWRpYXBpcGUu", + "TW90aW9uU2FsaWVuY3lPcHRpb25zEiAKFGVzdGltYXRpb25fY2xpcF9zaXpl", + "GAQgASgFOgIxNhIzCiRzdWJ0cmFjdF9jYW1lcmFfbW90aW9uX2Zyb21fZmVh", + "dHVyZXMYBSABKAg6BWZhbHNlEhYKC3RyYWNrX2luZGV4GAYgASgFOgEwEiYK", + "F2NvbXB1dGVfbW90aW9uX3NhbGllbmN5GAcgASgIOgVmYWxzZRIlChdzZWxl", + "Y3Rfc2FsaWVuY3lfaW5saWVycxgIIAEoCDoEdHJ1ZRIdCg9maWx0ZXJfc2Fs", + "aWVuY3kYCSABKAg6BHRydWUSIgoTcG9zdF9pcmxzX3Ntb290aGluZxgKIAEo", + "CDoFZmFsc2USKQodcmVqZWN0aW9uX3RyYW5zZm9ybV90aHJlc2hvbGQYDSAB", + "KAI6AjIwElQKFXZpc3VhbGl6YXRpb25fb3B0aW9ucxgLIAEoCzI1Lm1lZGlh", + "cGlwZS5Nb3Rpb25BbmFseXNpc09wdGlvbnMuVmlzdWFsaXphdGlvbk9wdGlv", + "bnMSTgoSZm9yZWdyb3VuZF9vcHRpb25zGAwgASgLMjIubWVkaWFwaXBlLk1v", + "dGlvbkFuYWx5c2lzT3B0aW9ucy5Gb3JlZ3JvdW5kT3B0aW9ucxrFAgoUVmlz", + "dWFsaXphdGlvbk9wdGlvbnMSLAoedmlzdWFsaXplX3JlZ2lvbl9mbG93X2Zl", + "YXR1cmVzGAEgASgIOgR0cnVlEicKGHZpc3VhbGl6ZV9zYWxpZW50X3BvaW50", + "cxgCIAEoCDoFZmFsc2USGQoObGluZV90aGlja25lc3MYBSABKAU6ATQSJgoX", + "Zm9yZWdyb3VuZF9qZXRfY29sb3JpbmcYAyABKAg6BWZhbHNlEi0KHnZpc3Vh", + "bGl6ZV9ibHVyX2FuYWx5c2lzX3JlZ2lvbhgEIAEoCDoFZmFsc2USHQoPdmlz", + "dWFsaXplX3N0YXRzGAYgASgIOgR0cnVlEiEKFm1pbl9sb25nX2ZlYXR1cmVf", + "dHJhY2sYByABKAU6ATASIgoXbWF4X2xvbmdfZmVhdHVyZV9wb2ludHMYCCAB", + "KAU6ATAafQoRRm9yZWdyb3VuZE9wdGlvbnMSIQoUZm9yZWdyb3VuZF90aHJl", + "c2hvbGQYASABKAI6AzAuNRIbChBmb3JlZ3JvdW5kX2dhbW1hGAIgASgCOgEx", + "EigKGnRocmVzaG9sZF9jb3ZlcmFnZV9zY2FsaW5nGAMgASgIOgR0cnVlIqwB", + "Cg5BbmFseXNpc1BvbGljeRIaChZBTkFMWVNJU19QT0xJQ1lfTEVHQUNZEAAS", + "GQoVQU5BTFlTSVNfUE9MSUNZX1ZJREVPEAESIAocQU5BTFlTSVNfUE9MSUNZ", + "X1ZJREVPX01PQklMRRACEiEKHUFOQUxZU0lTX1BPTElDWV9DQU1FUkFfTU9C", + "SUxFEAMSHgoaQU5BTFlTSVNfUE9MSUNZX0hZUEVSTEFQU0UQBA==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MotionEstimationReflection.Descriptor, global::Mediapipe.MotionSaliencyReflection.Descriptor, global::Mediapipe.RegionFlowComputationReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionAnalysisOptions), global::Mediapipe.MotionAnalysisOptions.Parser, new[]{ "AnalysisPolicy", "FlowOptions", "MotionOptions", "SaliencyOptions", "EstimationClipSize", "SubtractCameraMotionFromFeatures", "TrackIndex", "ComputeMotionSaliency", "SelectSaliencyInliers", "FilterSaliency", "PostIrlsSmoothing", "RejectionTransformThreshold", "VisualizationOptions", "ForegroundOptions" }, null, new[]{ typeof(global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions), global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions.Parser, new[]{ "VisualizeRegionFlowFeatures", "VisualizeSalientPoints", "LineThickness", "ForegroundJetColoring", "VisualizeBlurAnalysisRegion", "VisualizeStats", "MinLongFeatureTrack", "MaxLongFeaturePoints" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions), global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions.Parser, new[]{ "ForegroundThreshold", "ForegroundGamma", "ThresholdCoverageScaling" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Settings for MotionAnalysis. This class computes sparse, locally consistent + /// flow (referred to as region flow), camera motions, and foreground saliency + /// (i.e. likely foreground objects moving different from the background). + /// Next tag: 16 + /// + public sealed partial class MotionAnalysisOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionAnalysisOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionAnalysisReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisOptions(MotionAnalysisOptions other) : this() { + _hasBits0 = other._hasBits0; + analysisPolicy_ = other.analysisPolicy_; + flowOptions_ = other.flowOptions_ != null ? other.flowOptions_.Clone() : null; + motionOptions_ = other.motionOptions_ != null ? other.motionOptions_.Clone() : null; + saliencyOptions_ = other.saliencyOptions_ != null ? other.saliencyOptions_.Clone() : null; + estimationClipSize_ = other.estimationClipSize_; + subtractCameraMotionFromFeatures_ = other.subtractCameraMotionFromFeatures_; + trackIndex_ = other.trackIndex_; + computeMotionSaliency_ = other.computeMotionSaliency_; + selectSaliencyInliers_ = other.selectSaliencyInliers_; + filterSaliency_ = other.filterSaliency_; + postIrlsSmoothing_ = other.postIrlsSmoothing_; + rejectionTransformThreshold_ = other.rejectionTransformThreshold_; + visualizationOptions_ = other.visualizationOptions_ != null ? other.visualizationOptions_.Clone() : null; + foregroundOptions_ = other.foregroundOptions_ != null ? other.foregroundOptions_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionAnalysisOptions Clone() { + return new MotionAnalysisOptions(this); + } + + /// Field number for the "analysis_policy" field. + public const int AnalysisPolicyFieldNumber = 14; + private readonly static global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy AnalysisPolicyDefaultValue = global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy.Legacy; + + private global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy analysisPolicy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy AnalysisPolicy { + get { if ((_hasBits0 & 256) != 0) { return analysisPolicy_; } else { return AnalysisPolicyDefaultValue; } } + set { + _hasBits0 |= 256; + analysisPolicy_ = value; + } + } + /// Gets whether the "analysis_policy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnalysisPolicy { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "analysis_policy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnalysisPolicy() { + _hasBits0 &= ~256; + } + + /// Field number for the "flow_options" field. + public const int FlowOptionsFieldNumber = 1; + private global::Mediapipe.RegionFlowComputationOptions flowOptions_; + /// + /// Options for the actual motion stabilization + /// (in order of object usage). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions FlowOptions { + get { return flowOptions_; } + set { + flowOptions_ = value; + } + } + + /// Field number for the "motion_options" field. + public const int MotionOptionsFieldNumber = 2; + private global::Mediapipe.MotionEstimationOptions motionOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions MotionOptions { + get { return motionOptions_; } + set { + motionOptions_ = value; + } + } + + /// Field number for the "saliency_options" field. + public const int SaliencyOptionsFieldNumber = 3; + private global::Mediapipe.MotionSaliencyOptions saliencyOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionSaliencyOptions SaliencyOptions { + get { return saliencyOptions_; } + set { + saliencyOptions_ = value; + } + } + + /// Field number for the "estimation_clip_size" field. + public const int EstimationClipSizeFieldNumber = 4; + private readonly static int EstimationClipSizeDefaultValue = 16; + + private int estimationClipSize_; + /// + /// Clip-size used for (parallelized) motion estimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int EstimationClipSize { + get { if ((_hasBits0 & 1) != 0) { return estimationClipSize_; } else { return EstimationClipSizeDefaultValue; } } + set { + _hasBits0 |= 1; + estimationClipSize_ = value; + } + } + /// Gets whether the "estimation_clip_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEstimationClipSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "estimation_clip_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEstimationClipSize() { + _hasBits0 &= ~1; + } + + /// Field number for the "subtract_camera_motion_from_features" field. + public const int SubtractCameraMotionFromFeaturesFieldNumber = 5; + private readonly static bool SubtractCameraMotionFromFeaturesDefaultValue = false; + + private bool subtractCameraMotionFromFeatures_; + /// + /// If set, camera motion is subtracted from features before output. + /// Effectively outputs, residual motion w.r.t. background. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SubtractCameraMotionFromFeatures { + get { if ((_hasBits0 & 2) != 0) { return subtractCameraMotionFromFeatures_; } else { return SubtractCameraMotionFromFeaturesDefaultValue; } } + set { + _hasBits0 |= 2; + subtractCameraMotionFromFeatures_ = value; + } + } + /// Gets whether the "subtract_camera_motion_from_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSubtractCameraMotionFromFeatures { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "subtract_camera_motion_from_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSubtractCameraMotionFromFeatures() { + _hasBits0 &= ~2; + } + + /// Field number for the "track_index" field. + public const int TrackIndexFieldNumber = 6; + private readonly static int TrackIndexDefaultValue = 0; + + private int trackIndex_; + /// + /// If flow_options().tracking_options().tracking_policy() equals + /// POLICY_MULTI_FRAME, this flag indicates which RegionFlowFeatureList to use. + /// Specifically, for frame C, we use the motion from C to C - 1 - track_index. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TrackIndex { + get { if ((_hasBits0 & 4) != 0) { return trackIndex_; } else { return TrackIndexDefaultValue; } } + set { + _hasBits0 |= 4; + trackIndex_ = value; + } + } + /// Gets whether the "track_index" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackIndex { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "track_index" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackIndex() { + _hasBits0 &= ~4; + } + + /// Field number for the "compute_motion_saliency" field. + public const int ComputeMotionSaliencyFieldNumber = 7; + private readonly static bool ComputeMotionSaliencyDefaultValue = false; + + private bool computeMotionSaliency_; + /// + /// If set, compute motion saliency (regions of moving foreground). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComputeMotionSaliency { + get { if ((_hasBits0 & 8) != 0) { return computeMotionSaliency_; } else { return ComputeMotionSaliencyDefaultValue; } } + set { + _hasBits0 |= 8; + computeMotionSaliency_ = value; + } + } + /// Gets whether the "compute_motion_saliency" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComputeMotionSaliency { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "compute_motion_saliency" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComputeMotionSaliency() { + _hasBits0 &= ~8; + } + + /// Field number for the "select_saliency_inliers" field. + public const int SelectSaliencyInliersFieldNumber = 8; + private readonly static bool SelectSaliencyInliersDefaultValue = true; + + private bool selectSaliencyInliers_; + /// + /// Selects saliency inliers (only saliency locations with sufficient + /// spatial and temporal support are kept). + /// Only applied when compute_motion_saliency is set. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SelectSaliencyInliers { + get { if ((_hasBits0 & 16) != 0) { return selectSaliencyInliers_; } else { return SelectSaliencyInliersDefaultValue; } } + set { + _hasBits0 |= 16; + selectSaliencyInliers_ = value; + } + } + /// Gets whether the "select_saliency_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSelectSaliencyInliers { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "select_saliency_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSelectSaliencyInliers() { + _hasBits0 &= ~16; + } + + /// Field number for the "filter_saliency" field. + public const int FilterSaliencyFieldNumber = 9; + private readonly static bool FilterSaliencyDefaultValue = true; + + private bool filterSaliency_; + /// + /// Performs spatio-temporal filtering of extracted foreground saliency. If + /// used with above selection of saliency inliers, filtering is performed + /// *after* inlier selection. + /// Only applied when compute_motion_saliency is set. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FilterSaliency { + get { if ((_hasBits0 & 32) != 0) { return filterSaliency_; } else { return FilterSaliencyDefaultValue; } } + set { + _hasBits0 |= 32; + filterSaliency_ = value; + } + } + /// Gets whether the "filter_saliency" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilterSaliency { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "filter_saliency" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilterSaliency() { + _hasBits0 &= ~32; + } + + /// Field number for the "post_irls_smoothing" field. + public const int PostIrlsSmoothingFieldNumber = 10; + private readonly static bool PostIrlsSmoothingDefaultValue = false; + + private bool postIrlsSmoothing_; + /// + /// If set, irls weights of motion estimation are spatio-temporally smoothed + /// after model estimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool PostIrlsSmoothing { + get { if ((_hasBits0 & 64) != 0) { return postIrlsSmoothing_; } else { return PostIrlsSmoothingDefaultValue; } } + set { + _hasBits0 |= 64; + postIrlsSmoothing_ = value; + } + } + /// Gets whether the "post_irls_smoothing" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPostIrlsSmoothing { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "post_irls_smoothing" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPostIrlsSmoothing() { + _hasBits0 &= ~64; + } + + /// Field number for the "rejection_transform_threshold" field. + public const int RejectionTransformThresholdFieldNumber = 13; + private readonly static float RejectionTransformThresholdDefaultValue = 20F; + + private float rejectionTransformThreshold_; + /// + /// If a rejection_transform is passed to AddFrameGeneric, features that + /// do not agree with the transform within below threshold are removed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RejectionTransformThreshold { + get { if ((_hasBits0 & 128) != 0) { return rejectionTransformThreshold_; } else { return RejectionTransformThresholdDefaultValue; } } + set { + _hasBits0 |= 128; + rejectionTransformThreshold_ = value; + } + } + /// Gets whether the "rejection_transform_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRejectionTransformThreshold { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "rejection_transform_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRejectionTransformThreshold() { + _hasBits0 &= ~128; + } + + /// Field number for the "visualization_options" field. + public const int VisualizationOptionsFieldNumber = 11; + private global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions visualizationOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions VisualizationOptions { + get { return visualizationOptions_; } + set { + visualizationOptions_ = value; + } + } + + /// Field number for the "foreground_options" field. + public const int ForegroundOptionsFieldNumber = 12; + private global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions foregroundOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions ForegroundOptions { + get { return foregroundOptions_; } + set { + foregroundOptions_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionAnalysisOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionAnalysisOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AnalysisPolicy != other.AnalysisPolicy) return false; + if (!object.Equals(FlowOptions, other.FlowOptions)) return false; + if (!object.Equals(MotionOptions, other.MotionOptions)) return false; + if (!object.Equals(SaliencyOptions, other.SaliencyOptions)) return false; + if (EstimationClipSize != other.EstimationClipSize) return false; + if (SubtractCameraMotionFromFeatures != other.SubtractCameraMotionFromFeatures) return false; + if (TrackIndex != other.TrackIndex) return false; + if (ComputeMotionSaliency != other.ComputeMotionSaliency) return false; + if (SelectSaliencyInliers != other.SelectSaliencyInliers) return false; + if (FilterSaliency != other.FilterSaliency) return false; + if (PostIrlsSmoothing != other.PostIrlsSmoothing) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RejectionTransformThreshold, other.RejectionTransformThreshold)) return false; + if (!object.Equals(VisualizationOptions, other.VisualizationOptions)) return false; + if (!object.Equals(ForegroundOptions, other.ForegroundOptions)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasAnalysisPolicy) hash ^= AnalysisPolicy.GetHashCode(); + if (flowOptions_ != null) hash ^= FlowOptions.GetHashCode(); + if (motionOptions_ != null) hash ^= MotionOptions.GetHashCode(); + if (saliencyOptions_ != null) hash ^= SaliencyOptions.GetHashCode(); + if (HasEstimationClipSize) hash ^= EstimationClipSize.GetHashCode(); + if (HasSubtractCameraMotionFromFeatures) hash ^= SubtractCameraMotionFromFeatures.GetHashCode(); + if (HasTrackIndex) hash ^= TrackIndex.GetHashCode(); + if (HasComputeMotionSaliency) hash ^= ComputeMotionSaliency.GetHashCode(); + if (HasSelectSaliencyInliers) hash ^= SelectSaliencyInliers.GetHashCode(); + if (HasFilterSaliency) hash ^= FilterSaliency.GetHashCode(); + if (HasPostIrlsSmoothing) hash ^= PostIrlsSmoothing.GetHashCode(); + if (HasRejectionTransformThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RejectionTransformThreshold); + if (visualizationOptions_ != null) hash ^= VisualizationOptions.GetHashCode(); + if (foregroundOptions_ != null) hash ^= ForegroundOptions.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (flowOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(FlowOptions); + } + if (motionOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(MotionOptions); + } + if (saliencyOptions_ != null) { + output.WriteRawTag(26); + output.WriteMessage(SaliencyOptions); + } + if (HasEstimationClipSize) { + output.WriteRawTag(32); + output.WriteInt32(EstimationClipSize); + } + if (HasSubtractCameraMotionFromFeatures) { + output.WriteRawTag(40); + output.WriteBool(SubtractCameraMotionFromFeatures); + } + if (HasTrackIndex) { + output.WriteRawTag(48); + output.WriteInt32(TrackIndex); + } + if (HasComputeMotionSaliency) { + output.WriteRawTag(56); + output.WriteBool(ComputeMotionSaliency); + } + if (HasSelectSaliencyInliers) { + output.WriteRawTag(64); + output.WriteBool(SelectSaliencyInliers); + } + if (HasFilterSaliency) { + output.WriteRawTag(72); + output.WriteBool(FilterSaliency); + } + if (HasPostIrlsSmoothing) { + output.WriteRawTag(80); + output.WriteBool(PostIrlsSmoothing); + } + if (visualizationOptions_ != null) { + output.WriteRawTag(90); + output.WriteMessage(VisualizationOptions); + } + if (foregroundOptions_ != null) { + output.WriteRawTag(98); + output.WriteMessage(ForegroundOptions); + } + if (HasRejectionTransformThreshold) { + output.WriteRawTag(109); + output.WriteFloat(RejectionTransformThreshold); + } + if (HasAnalysisPolicy) { + output.WriteRawTag(112); + output.WriteEnum((int) AnalysisPolicy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (flowOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(FlowOptions); + } + if (motionOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(MotionOptions); + } + if (saliencyOptions_ != null) { + output.WriteRawTag(26); + output.WriteMessage(SaliencyOptions); + } + if (HasEstimationClipSize) { + output.WriteRawTag(32); + output.WriteInt32(EstimationClipSize); + } + if (HasSubtractCameraMotionFromFeatures) { + output.WriteRawTag(40); + output.WriteBool(SubtractCameraMotionFromFeatures); + } + if (HasTrackIndex) { + output.WriteRawTag(48); + output.WriteInt32(TrackIndex); + } + if (HasComputeMotionSaliency) { + output.WriteRawTag(56); + output.WriteBool(ComputeMotionSaliency); + } + if (HasSelectSaliencyInliers) { + output.WriteRawTag(64); + output.WriteBool(SelectSaliencyInliers); + } + if (HasFilterSaliency) { + output.WriteRawTag(72); + output.WriteBool(FilterSaliency); + } + if (HasPostIrlsSmoothing) { + output.WriteRawTag(80); + output.WriteBool(PostIrlsSmoothing); + } + if (visualizationOptions_ != null) { + output.WriteRawTag(90); + output.WriteMessage(VisualizationOptions); + } + if (foregroundOptions_ != null) { + output.WriteRawTag(98); + output.WriteMessage(ForegroundOptions); + } + if (HasRejectionTransformThreshold) { + output.WriteRawTag(109); + output.WriteFloat(RejectionTransformThreshold); + } + if (HasAnalysisPolicy) { + output.WriteRawTag(112); + output.WriteEnum((int) AnalysisPolicy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasAnalysisPolicy) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) AnalysisPolicy); + } + if (flowOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FlowOptions); + } + if (motionOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MotionOptions); + } + if (saliencyOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SaliencyOptions); + } + if (HasEstimationClipSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(EstimationClipSize); + } + if (HasSubtractCameraMotionFromFeatures) { + size += 1 + 1; + } + if (HasTrackIndex) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TrackIndex); + } + if (HasComputeMotionSaliency) { + size += 1 + 1; + } + if (HasSelectSaliencyInliers) { + size += 1 + 1; + } + if (HasFilterSaliency) { + size += 1 + 1; + } + if (HasPostIrlsSmoothing) { + size += 1 + 1; + } + if (HasRejectionTransformThreshold) { + size += 1 + 4; + } + if (visualizationOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(VisualizationOptions); + } + if (foregroundOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ForegroundOptions); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionAnalysisOptions other) { + if (other == null) { + return; + } + if (other.HasAnalysisPolicy) { + AnalysisPolicy = other.AnalysisPolicy; + } + if (other.flowOptions_ != null) { + if (flowOptions_ == null) { + FlowOptions = new global::Mediapipe.RegionFlowComputationOptions(); + } + FlowOptions.MergeFrom(other.FlowOptions); + } + if (other.motionOptions_ != null) { + if (motionOptions_ == null) { + MotionOptions = new global::Mediapipe.MotionEstimationOptions(); + } + MotionOptions.MergeFrom(other.MotionOptions); + } + if (other.saliencyOptions_ != null) { + if (saliencyOptions_ == null) { + SaliencyOptions = new global::Mediapipe.MotionSaliencyOptions(); + } + SaliencyOptions.MergeFrom(other.SaliencyOptions); + } + if (other.HasEstimationClipSize) { + EstimationClipSize = other.EstimationClipSize; + } + if (other.HasSubtractCameraMotionFromFeatures) { + SubtractCameraMotionFromFeatures = other.SubtractCameraMotionFromFeatures; + } + if (other.HasTrackIndex) { + TrackIndex = other.TrackIndex; + } + if (other.HasComputeMotionSaliency) { + ComputeMotionSaliency = other.ComputeMotionSaliency; + } + if (other.HasSelectSaliencyInliers) { + SelectSaliencyInliers = other.SelectSaliencyInliers; + } + if (other.HasFilterSaliency) { + FilterSaliency = other.FilterSaliency; + } + if (other.HasPostIrlsSmoothing) { + PostIrlsSmoothing = other.PostIrlsSmoothing; + } + if (other.HasRejectionTransformThreshold) { + RejectionTransformThreshold = other.RejectionTransformThreshold; + } + if (other.visualizationOptions_ != null) { + if (visualizationOptions_ == null) { + VisualizationOptions = new global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions(); + } + VisualizationOptions.MergeFrom(other.VisualizationOptions); + } + if (other.foregroundOptions_ != null) { + if (foregroundOptions_ == null) { + ForegroundOptions = new global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions(); + } + ForegroundOptions.MergeFrom(other.ForegroundOptions); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (flowOptions_ == null) { + FlowOptions = new global::Mediapipe.RegionFlowComputationOptions(); + } + input.ReadMessage(FlowOptions); + break; + } + case 18: { + if (motionOptions_ == null) { + MotionOptions = new global::Mediapipe.MotionEstimationOptions(); + } + input.ReadMessage(MotionOptions); + break; + } + case 26: { + if (saliencyOptions_ == null) { + SaliencyOptions = new global::Mediapipe.MotionSaliencyOptions(); + } + input.ReadMessage(SaliencyOptions); + break; + } + case 32: { + EstimationClipSize = input.ReadInt32(); + break; + } + case 40: { + SubtractCameraMotionFromFeatures = input.ReadBool(); + break; + } + case 48: { + TrackIndex = input.ReadInt32(); + break; + } + case 56: { + ComputeMotionSaliency = input.ReadBool(); + break; + } + case 64: { + SelectSaliencyInliers = input.ReadBool(); + break; + } + case 72: { + FilterSaliency = input.ReadBool(); + break; + } + case 80: { + PostIrlsSmoothing = input.ReadBool(); + break; + } + case 90: { + if (visualizationOptions_ == null) { + VisualizationOptions = new global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions(); + } + input.ReadMessage(VisualizationOptions); + break; + } + case 98: { + if (foregroundOptions_ == null) { + ForegroundOptions = new global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions(); + } + input.ReadMessage(ForegroundOptions); + break; + } + case 109: { + RejectionTransformThreshold = input.ReadFloat(); + break; + } + case 112: { + AnalysisPolicy = (global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (flowOptions_ == null) { + FlowOptions = new global::Mediapipe.RegionFlowComputationOptions(); + } + input.ReadMessage(FlowOptions); + break; + } + case 18: { + if (motionOptions_ == null) { + MotionOptions = new global::Mediapipe.MotionEstimationOptions(); + } + input.ReadMessage(MotionOptions); + break; + } + case 26: { + if (saliencyOptions_ == null) { + SaliencyOptions = new global::Mediapipe.MotionSaliencyOptions(); + } + input.ReadMessage(SaliencyOptions); + break; + } + case 32: { + EstimationClipSize = input.ReadInt32(); + break; + } + case 40: { + SubtractCameraMotionFromFeatures = input.ReadBool(); + break; + } + case 48: { + TrackIndex = input.ReadInt32(); + break; + } + case 56: { + ComputeMotionSaliency = input.ReadBool(); + break; + } + case 64: { + SelectSaliencyInliers = input.ReadBool(); + break; + } + case 72: { + FilterSaliency = input.ReadBool(); + break; + } + case 80: { + PostIrlsSmoothing = input.ReadBool(); + break; + } + case 90: { + if (visualizationOptions_ == null) { + VisualizationOptions = new global::Mediapipe.MotionAnalysisOptions.Types.VisualizationOptions(); + } + input.ReadMessage(VisualizationOptions); + break; + } + case 98: { + if (foregroundOptions_ == null) { + ForegroundOptions = new global::Mediapipe.MotionAnalysisOptions.Types.ForegroundOptions(); + } + input.ReadMessage(ForegroundOptions); + break; + } + case 109: { + RejectionTransformThreshold = input.ReadFloat(); + break; + } + case 112: { + AnalysisPolicy = (global::Mediapipe.MotionAnalysisOptions.Types.AnalysisPolicy) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MotionAnalysisOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Pre-configured policies for MotionAnalysis. + /// For general use, it is recommended to select an appropiate policy + /// instead of customizing flow and motion options by hand. + /// Policies are being kept up to date with appropiate settings. + /// + public enum AnalysisPolicy { + /// + /// Default legacy options. Effectivley no op. + /// + [pbr::OriginalName("ANALYSIS_POLICY_LEGACY")] Legacy = 0, + /// + /// Use for video. + /// + [pbr::OriginalName("ANALYSIS_POLICY_VIDEO")] Video = 1, + /// + /// Use for video on mobile. + /// + [pbr::OriginalName("ANALYSIS_POLICY_VIDEO_MOBILE")] VideoMobile = 2, + /// + /// Use if applied to camera stream on mobile, e.g. + /// low latency and high throughput. + /// ASSUMES DOWNSAMPLED INPUT, e.g. from GPU. + /// + [pbr::OriginalName("ANALYSIS_POLICY_CAMERA_MOBILE")] CameraMobile = 3, + /// + /// Use for sped up video / hyperlapse when adding frames with seeds + /// and rejection transforms. Mostly ups temporal consistency weights + /// and relaxes stability constraints. + /// Only recommended to be used as second pass after initial MotionAnalysis + /// and FrameSelection. + /// + [pbr::OriginalName("ANALYSIS_POLICY_HYPERLAPSE")] Hyperlapse = 4, + } + + /// + /// Adapts visualization for rendered_results when passed to GetResults. + /// + public sealed partial class VisualizationOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VisualizationOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionAnalysisOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualizationOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualizationOptions(VisualizationOptions other) : this() { + _hasBits0 = other._hasBits0; + visualizeRegionFlowFeatures_ = other.visualizeRegionFlowFeatures_; + visualizeSalientPoints_ = other.visualizeSalientPoints_; + lineThickness_ = other.lineThickness_; + foregroundJetColoring_ = other.foregroundJetColoring_; + visualizeBlurAnalysisRegion_ = other.visualizeBlurAnalysisRegion_; + visualizeStats_ = other.visualizeStats_; + minLongFeatureTrack_ = other.minLongFeatureTrack_; + maxLongFeaturePoints_ = other.maxLongFeaturePoints_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualizationOptions Clone() { + return new VisualizationOptions(this); + } + + /// Field number for the "visualize_region_flow_features" field. + public const int VisualizeRegionFlowFeaturesFieldNumber = 1; + private readonly static bool VisualizeRegionFlowFeaturesDefaultValue = true; + + private bool visualizeRegionFlowFeatures_; + /// + /// Visualizes tracked region flow features, colored w.r.t. fitting error. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeRegionFlowFeatures { + get { if ((_hasBits0 & 1) != 0) { return visualizeRegionFlowFeatures_; } else { return VisualizeRegionFlowFeaturesDefaultValue; } } + set { + _hasBits0 |= 1; + visualizeRegionFlowFeatures_ = value; + } + } + /// Gets whether the "visualize_region_flow_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeRegionFlowFeatures { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "visualize_region_flow_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeRegionFlowFeatures() { + _hasBits0 &= ~1; + } + + /// Field number for the "visualize_salient_points" field. + public const int VisualizeSalientPointsFieldNumber = 2; + private readonly static bool VisualizeSalientPointsDefaultValue = false; + + private bool visualizeSalientPoints_; + /// + /// Visualizes salient points. Only applicable is compute_motion_saliency is + /// set to true. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeSalientPoints { + get { if ((_hasBits0 & 2) != 0) { return visualizeSalientPoints_; } else { return VisualizeSalientPointsDefaultValue; } } + set { + _hasBits0 |= 2; + visualizeSalientPoints_ = value; + } + } + /// Gets whether the "visualize_salient_points" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeSalientPoints { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "visualize_salient_points" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeSalientPoints() { + _hasBits0 &= ~2; + } + + /// Field number for the "line_thickness" field. + public const int LineThicknessFieldNumber = 5; + private readonly static int LineThicknessDefaultValue = 4; + + private int lineThickness_; + /// + /// Line thickness of ellipse when rendering salient points. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LineThickness { + get { if ((_hasBits0 & 16) != 0) { return lineThickness_; } else { return LineThicknessDefaultValue; } } + set { + _hasBits0 |= 16; + lineThickness_ = value; + } + } + /// Gets whether the "line_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLineThickness { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "line_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLineThickness() { + _hasBits0 &= ~16; + } + + /// Field number for the "foreground_jet_coloring" field. + public const int ForegroundJetColoringFieldNumber = 3; + private readonly static bool ForegroundJetColoringDefaultValue = false; + + private bool foregroundJetColoring_; + /// + /// Instead of green burn in uses jet coloring to indicate magnitude of + /// foreground motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ForegroundJetColoring { + get { if ((_hasBits0 & 4) != 0) { return foregroundJetColoring_; } else { return ForegroundJetColoringDefaultValue; } } + set { + _hasBits0 |= 4; + foregroundJetColoring_ = value; + } + } + /// Gets whether the "foreground_jet_coloring" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasForegroundJetColoring { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "foreground_jet_coloring" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearForegroundJetColoring() { + _hasBits0 &= ~4; + } + + /// Field number for the "visualize_blur_analysis_region" field. + public const int VisualizeBlurAnalysisRegionFieldNumber = 4; + private readonly static bool VisualizeBlurAnalysisRegionDefaultValue = false; + + private bool visualizeBlurAnalysisRegion_; + /// + /// If set, only keeps masks of pixels that is used for blur analysis, rest + /// is set to zero. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeBlurAnalysisRegion { + get { if ((_hasBits0 & 8) != 0) { return visualizeBlurAnalysisRegion_; } else { return VisualizeBlurAnalysisRegionDefaultValue; } } + set { + _hasBits0 |= 8; + visualizeBlurAnalysisRegion_ = value; + } + } + /// Gets whether the "visualize_blur_analysis_region" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeBlurAnalysisRegion { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "visualize_blur_analysis_region" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeBlurAnalysisRegion() { + _hasBits0 &= ~8; + } + + /// Field number for the "visualize_stats" field. + public const int VisualizeStatsFieldNumber = 6; + private readonly static bool VisualizeStatsDefaultValue = true; + + private bool visualizeStats_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VisualizeStats { + get { if ((_hasBits0 & 32) != 0) { return visualizeStats_; } else { return VisualizeStatsDefaultValue; } } + set { + _hasBits0 |= 32; + visualizeStats_ = value; + } + } + /// Gets whether the "visualize_stats" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualizeStats { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "visualize_stats" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualizeStats() { + _hasBits0 &= ~32; + } + + /// Field number for the "min_long_feature_track" field. + public const int MinLongFeatureTrackFieldNumber = 7; + private readonly static int MinLongFeatureTrackDefaultValue = 0; + + private int minLongFeatureTrack_; + /// + /// Only long feature tracks with specified minimum length are rendered. + /// Set to zero to consider all tracks. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinLongFeatureTrack { + get { if ((_hasBits0 & 64) != 0) { return minLongFeatureTrack_; } else { return MinLongFeatureTrackDefaultValue; } } + set { + _hasBits0 |= 64; + minLongFeatureTrack_ = value; + } + } + /// Gets whether the "min_long_feature_track" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinLongFeatureTrack { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "min_long_feature_track" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinLongFeatureTrack() { + _hasBits0 &= ~64; + } + + /// Field number for the "max_long_feature_points" field. + public const int MaxLongFeaturePointsFieldNumber = 8; + private readonly static int MaxLongFeaturePointsDefaultValue = 0; + + private int maxLongFeaturePoints_; + /// + /// Only the last N points of a long feature track are rendered. Set to zero + /// to render all points. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxLongFeaturePoints { + get { if ((_hasBits0 & 128) != 0) { return maxLongFeaturePoints_; } else { return MaxLongFeaturePointsDefaultValue; } } + set { + _hasBits0 |= 128; + maxLongFeaturePoints_ = value; + } + } + /// Gets whether the "max_long_feature_points" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxLongFeaturePoints { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "max_long_feature_points" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxLongFeaturePoints() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VisualizationOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VisualizationOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (VisualizeRegionFlowFeatures != other.VisualizeRegionFlowFeatures) return false; + if (VisualizeSalientPoints != other.VisualizeSalientPoints) return false; + if (LineThickness != other.LineThickness) return false; + if (ForegroundJetColoring != other.ForegroundJetColoring) return false; + if (VisualizeBlurAnalysisRegion != other.VisualizeBlurAnalysisRegion) return false; + if (VisualizeStats != other.VisualizeStats) return false; + if (MinLongFeatureTrack != other.MinLongFeatureTrack) return false; + if (MaxLongFeaturePoints != other.MaxLongFeaturePoints) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasVisualizeRegionFlowFeatures) hash ^= VisualizeRegionFlowFeatures.GetHashCode(); + if (HasVisualizeSalientPoints) hash ^= VisualizeSalientPoints.GetHashCode(); + if (HasLineThickness) hash ^= LineThickness.GetHashCode(); + if (HasForegroundJetColoring) hash ^= ForegroundJetColoring.GetHashCode(); + if (HasVisualizeBlurAnalysisRegion) hash ^= VisualizeBlurAnalysisRegion.GetHashCode(); + if (HasVisualizeStats) hash ^= VisualizeStats.GetHashCode(); + if (HasMinLongFeatureTrack) hash ^= MinLongFeatureTrack.GetHashCode(); + if (HasMaxLongFeaturePoints) hash ^= MaxLongFeaturePoints.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasVisualizeRegionFlowFeatures) { + output.WriteRawTag(8); + output.WriteBool(VisualizeRegionFlowFeatures); + } + if (HasVisualizeSalientPoints) { + output.WriteRawTag(16); + output.WriteBool(VisualizeSalientPoints); + } + if (HasForegroundJetColoring) { + output.WriteRawTag(24); + output.WriteBool(ForegroundJetColoring); + } + if (HasVisualizeBlurAnalysisRegion) { + output.WriteRawTag(32); + output.WriteBool(VisualizeBlurAnalysisRegion); + } + if (HasLineThickness) { + output.WriteRawTag(40); + output.WriteInt32(LineThickness); + } + if (HasVisualizeStats) { + output.WriteRawTag(48); + output.WriteBool(VisualizeStats); + } + if (HasMinLongFeatureTrack) { + output.WriteRawTag(56); + output.WriteInt32(MinLongFeatureTrack); + } + if (HasMaxLongFeaturePoints) { + output.WriteRawTag(64); + output.WriteInt32(MaxLongFeaturePoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasVisualizeRegionFlowFeatures) { + output.WriteRawTag(8); + output.WriteBool(VisualizeRegionFlowFeatures); + } + if (HasVisualizeSalientPoints) { + output.WriteRawTag(16); + output.WriteBool(VisualizeSalientPoints); + } + if (HasForegroundJetColoring) { + output.WriteRawTag(24); + output.WriteBool(ForegroundJetColoring); + } + if (HasVisualizeBlurAnalysisRegion) { + output.WriteRawTag(32); + output.WriteBool(VisualizeBlurAnalysisRegion); + } + if (HasLineThickness) { + output.WriteRawTag(40); + output.WriteInt32(LineThickness); + } + if (HasVisualizeStats) { + output.WriteRawTag(48); + output.WriteBool(VisualizeStats); + } + if (HasMinLongFeatureTrack) { + output.WriteRawTag(56); + output.WriteInt32(MinLongFeatureTrack); + } + if (HasMaxLongFeaturePoints) { + output.WriteRawTag(64); + output.WriteInt32(MaxLongFeaturePoints); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasVisualizeRegionFlowFeatures) { + size += 1 + 1; + } + if (HasVisualizeSalientPoints) { + size += 1 + 1; + } + if (HasLineThickness) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LineThickness); + } + if (HasForegroundJetColoring) { + size += 1 + 1; + } + if (HasVisualizeBlurAnalysisRegion) { + size += 1 + 1; + } + if (HasVisualizeStats) { + size += 1 + 1; + } + if (HasMinLongFeatureTrack) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinLongFeatureTrack); + } + if (HasMaxLongFeaturePoints) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxLongFeaturePoints); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VisualizationOptions other) { + if (other == null) { + return; + } + if (other.HasVisualizeRegionFlowFeatures) { + VisualizeRegionFlowFeatures = other.VisualizeRegionFlowFeatures; + } + if (other.HasVisualizeSalientPoints) { + VisualizeSalientPoints = other.VisualizeSalientPoints; + } + if (other.HasLineThickness) { + LineThickness = other.LineThickness; + } + if (other.HasForegroundJetColoring) { + ForegroundJetColoring = other.ForegroundJetColoring; + } + if (other.HasVisualizeBlurAnalysisRegion) { + VisualizeBlurAnalysisRegion = other.VisualizeBlurAnalysisRegion; + } + if (other.HasVisualizeStats) { + VisualizeStats = other.VisualizeStats; + } + if (other.HasMinLongFeatureTrack) { + MinLongFeatureTrack = other.MinLongFeatureTrack; + } + if (other.HasMaxLongFeaturePoints) { + MaxLongFeaturePoints = other.MaxLongFeaturePoints; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + VisualizeRegionFlowFeatures = input.ReadBool(); + break; + } + case 16: { + VisualizeSalientPoints = input.ReadBool(); + break; + } + case 24: { + ForegroundJetColoring = input.ReadBool(); + break; + } + case 32: { + VisualizeBlurAnalysisRegion = input.ReadBool(); + break; + } + case 40: { + LineThickness = input.ReadInt32(); + break; + } + case 48: { + VisualizeStats = input.ReadBool(); + break; + } + case 56: { + MinLongFeatureTrack = input.ReadInt32(); + break; + } + case 64: { + MaxLongFeaturePoints = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + VisualizeRegionFlowFeatures = input.ReadBool(); + break; + } + case 16: { + VisualizeSalientPoints = input.ReadBool(); + break; + } + case 24: { + ForegroundJetColoring = input.ReadBool(); + break; + } + case 32: { + VisualizeBlurAnalysisRegion = input.ReadBool(); + break; + } + case 40: { + LineThickness = input.ReadInt32(); + break; + } + case 48: { + VisualizeStats = input.ReadBool(); + break; + } + case 56: { + MinLongFeatureTrack = input.ReadInt32(); + break; + } + case 64: { + MaxLongFeaturePoints = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// Describes how to compute foreground from features. + /// + public sealed partial class ForegroundOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForegroundOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionAnalysisOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ForegroundOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ForegroundOptions(ForegroundOptions other) : this() { + _hasBits0 = other._hasBits0; + foregroundThreshold_ = other.foregroundThreshold_; + foregroundGamma_ = other.foregroundGamma_; + thresholdCoverageScaling_ = other.thresholdCoverageScaling_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ForegroundOptions Clone() { + return new ForegroundOptions(this); + } + + /// Field number for the "foreground_threshold" field. + public const int ForegroundThresholdFieldNumber = 1; + private readonly static float ForegroundThresholdDefaultValue = 0.5F; + + private float foregroundThreshold_; + /// + /// Indicates the *inverse* registration error (i.e. the irls weight) + /// that is deemed a complete inlier. + /// Weights in the interval [0, foreground_threshold] (corresponding to + /// pixel errors in the interval [1 / foreground_threshold, inf]) + /// are mappend to 1 - [0, 1], i.e. foreground threshold is mapped to zero + /// with weights below the threshold being assigned values > 0. + /// Therefore, larger values will increase amount of detected foreground + /// as well as noise. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ForegroundThreshold { + get { if ((_hasBits0 & 1) != 0) { return foregroundThreshold_; } else { return ForegroundThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + foregroundThreshold_ = value; + } + } + /// Gets whether the "foreground_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasForegroundThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "foreground_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearForegroundThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "foreground_gamma" field. + public const int ForegroundGammaFieldNumber = 2; + private readonly static float ForegroundGammaDefaultValue = 1F; + + private float foregroundGamma_; + /// + /// By using foreground_gamma < 1.0 you can increase resolution of small + /// foreground motion at the expense of the resolution of large foreground + /// motions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ForegroundGamma { + get { if ((_hasBits0 & 2) != 0) { return foregroundGamma_; } else { return ForegroundGammaDefaultValue; } } + set { + _hasBits0 |= 2; + foregroundGamma_ = value; + } + } + /// Gets whether the "foreground_gamma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasForegroundGamma { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "foreground_gamma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearForegroundGamma() { + _hasBits0 &= ~2; + } + + /// Field number for the "threshold_coverage_scaling" field. + public const int ThresholdCoverageScalingFieldNumber = 3; + private readonly static bool ThresholdCoverageScalingDefaultValue = true; + + private bool thresholdCoverageScaling_; + /// + /// Threshold is scaled by coverage, i.e. for frames with large registration + /// error less forground is visualized. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ThresholdCoverageScaling { + get { if ((_hasBits0 & 4) != 0) { return thresholdCoverageScaling_; } else { return ThresholdCoverageScalingDefaultValue; } } + set { + _hasBits0 |= 4; + thresholdCoverageScaling_ = value; + } + } + /// Gets whether the "threshold_coverage_scaling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThresholdCoverageScaling { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "threshold_coverage_scaling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThresholdCoverageScaling() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ForegroundOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ForegroundOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ForegroundThreshold, other.ForegroundThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ForegroundGamma, other.ForegroundGamma)) return false; + if (ThresholdCoverageScaling != other.ThresholdCoverageScaling) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasForegroundThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ForegroundThreshold); + if (HasForegroundGamma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ForegroundGamma); + if (HasThresholdCoverageScaling) hash ^= ThresholdCoverageScaling.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasForegroundThreshold) { + output.WriteRawTag(13); + output.WriteFloat(ForegroundThreshold); + } + if (HasForegroundGamma) { + output.WriteRawTag(21); + output.WriteFloat(ForegroundGamma); + } + if (HasThresholdCoverageScaling) { + output.WriteRawTag(24); + output.WriteBool(ThresholdCoverageScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasForegroundThreshold) { + output.WriteRawTag(13); + output.WriteFloat(ForegroundThreshold); + } + if (HasForegroundGamma) { + output.WriteRawTag(21); + output.WriteFloat(ForegroundGamma); + } + if (HasThresholdCoverageScaling) { + output.WriteRawTag(24); + output.WriteBool(ThresholdCoverageScaling); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasForegroundThreshold) { + size += 1 + 4; + } + if (HasForegroundGamma) { + size += 1 + 4; + } + if (HasThresholdCoverageScaling) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ForegroundOptions other) { + if (other == null) { + return; + } + if (other.HasForegroundThreshold) { + ForegroundThreshold = other.ForegroundThreshold; + } + if (other.HasForegroundGamma) { + ForegroundGamma = other.ForegroundGamma; + } + if (other.HasThresholdCoverageScaling) { + ThresholdCoverageScaling = other.ThresholdCoverageScaling; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + ForegroundThreshold = input.ReadFloat(); + break; + } + case 21: { + ForegroundGamma = input.ReadFloat(); + break; + } + case 24: { + ThresholdCoverageScaling = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + ForegroundThreshold = input.ReadFloat(); + break; + } + case 21: { + ForegroundGamma = input.ReadFloat(); + break; + } + case 24: { + ThresholdCoverageScaling = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs.meta new file mode 100644 index 0000000..0ffad19 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionAnalysis.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9ddb93bdabcdac299e69e6fcb65c726 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs new file mode 100644 index 0000000..2961c00 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs @@ -0,0 +1,9111 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/motion_estimation.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/motion_estimation.proto + public static partial class MotionEstimationReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/motion_estimation.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MotionEstimationReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci9tZWRpYXBpcGUvdXRpbC90cmFja2luZy9tb3Rpb25fZXN0aW1hdGlvbi5w", + "cm90bxIJbWVkaWFwaXBlIrc1ChdNb3Rpb25Fc3RpbWF0aW9uT3B0aW9ucxIn", + "Chllc3RpbWF0ZV90cmFuc2xhdGlvbl9pcmxzGAEgASgIOgR0cnVlEncKHGxp", + "bmVhcl9zaW1pbGFyaXR5X2VzdGltYXRpb24YAyABKA4yPS5tZWRpYXBpcGUu", + "TW90aW9uRXN0aW1hdGlvbk9wdGlvbnMuTGluZWFyU2ltaWxhcml0eUVzdGlt", + "YXRpb246EkVTVElNQVRJT05fTFNfSVJMUxJmChFhZmZpbmVfZXN0aW1hdGlv", + "bhgeIAEoDjIzLm1lZGlhcGlwZS5Nb3Rpb25Fc3RpbWF0aW9uT3B0aW9ucy5B", + "ZmZpbmVFc3RpbWF0aW9uOhZFU1RJTUFUSU9OX0FGRklORV9OT05FEm0KFWhv", + "bW9ncmFwaHlfZXN0aW1hdGlvbhgFIAEoDjI3Lm1lZGlhcGlwZS5Nb3Rpb25F", + "c3RpbWF0aW9uT3B0aW9ucy5Ib21vZ3JhcGh5RXN0aW1hdGlvbjoVRVNUSU1B", + "VElPTl9IT01PR19JUkxTEjMKJGhvbW9ncmFwaHlfZXhhY3RfZGVub21pbmF0", + "b3Jfc2NhbGluZxg1IAEoCDoFZmFsc2USLQofdXNlX2V4YWN0X2hvbW9ncmFw", + "aHlfZXN0aW1hdGlvbhg2IAEoCDoEdHJ1ZRI3Cil1c2VfaGlnaGVzdF9hY2N1", + "cmFjeV9mb3Jfbm9ybWFsX2VxdWF0aW9ucxg3IAEoCDoEdHJ1ZRItCiJob21v", + "Z3JhcGh5X3BlcnNwZWN0aXZlX3JlZ3VsYXJpemVyGD0gASgCOgEwEnwKGW1p", + "eF9ob21vZ3JhcGh5X2VzdGltYXRpb24YDCABKA4yPi5tZWRpYXBpcGUuTW90", + "aW9uRXN0aW1hdGlvbk9wdGlvbnMuTWl4dHVyZUhvbW9ncmFwaHlFc3RpbWF0", + "aW9uOhlFU1RJTUFUSU9OX0hPTU9HX01JWF9OT05FEhgKDG51bV9taXh0dXJl", + "cxgNIAEoBToCMTASHgoRbWl4dHVyZV9yb3dfc2lnbWEYDiABKAI6AzAuMRIj", + "ChNtaXh0dXJlX3JlZ3VsYXJpemVyGA8gASgCOgYwLjAwMDESJQoabWl4dHVy", + "ZV9yZWd1bGFyaXplcl9sZXZlbHMYKiABKAI6ATMSJQoYbWl4dHVyZV9yZWd1", + "bGFyaXplcl9iYXNlGCsgASgCOgMyLjISJAoZbWl4dHVyZV9yc19hbmFseXNp", + "c19sZXZlbBgsIAEoBToBMhIXCgtpcmxzX3JvdW5kcxgRIAEoBToCMTASHQoQ", + "aXJsc19wcmlvcl9zY2FsZRgyIAEoAjoDMC4yEiwKHmlybHNfbW90aW9uX21h", + "Z25pdHVkZV9mcmFjdGlvbhgfIAEoAjoEMC4wOBIoChtpcmxzX21peHR1cmVf", + "ZnJhY3Rpb25fc2NhbGUYRCABKAI6AzEuNRIqChtpcmxzX3dlaWdodHNfcHJl", + "aW5pdGlhbGl6ZWQYJyABKAg6BWZhbHNlEi4KH2ZpbHRlcl9pbml0aWFsaXpl", + "ZF9pcmxzX3dlaWdodHMYQyABKAg6BWZhbHNlElkKE2lybHNfaW5pdGlhbGl6", + "YXRpb24YOCABKAsyPC5tZWRpYXBpcGUuTW90aW9uRXN0aW1hdGlvbk9wdGlv", + "bnMuSXJsc091dGxpZXJJbml0aWFsaXphdGlvbhIsCh1mZWF0dXJlX2RlbnNp", + "dHlfbm9ybWFsaXphdGlvbhg+IAEoCDoFZmFsc2USHQoRZmVhdHVyZV9tYXNr", + "X3NpemUYPyABKAU6AjEwEmEKG2xvbmdfZmVhdHVyZV9pbml0aWFsaXphdGlv", + "bhhCIAEoCzI8Lm1lZGlhcGlwZS5Nb3Rpb25Fc3RpbWF0aW9uT3B0aW9ucy5M", + "b25nRmVhdHVyZUluaXRpYWxpemF0aW9uEk0KEWlybHNfbWFza19vcHRpb25z", + "GDkgASgLMjIubWVkaWFwaXBlLk1vdGlvbkVzdGltYXRpb25PcHRpb25zLkly", + "bHNNYXNrT3B0aW9ucxJeChZqb2ludF90cmFja19lc3RpbWF0aW9uGDsgASgL", + "Mj4ubWVkaWFwaXBlLk1vdGlvbkVzdGltYXRpb25PcHRpb25zLkpvaW50VHJh", + "Y2tFc3RpbWF0aW9uT3B0aW9ucxJcChlsb25nX2ZlYXR1cmVfYmlhc19vcHRp", + "b25zGEAgASgLMjkubWVkaWFwaXBlLk1vdGlvbkVzdGltYXRpb25PcHRpb25z", + "LkxvbmdGZWF0dXJlQmlhc09wdGlvbnMSZAoRZXN0aW1hdGlvbl9wb2xpY3kY", + "OiABKA4yMy5tZWRpYXBpcGUuTW90aW9uRXN0aW1hdGlvbk9wdGlvbnMuRXN0", + "aW1hdGlvblBvbGljeToUSU5ERVBFTkRFTlRfUEFSQUxMRUwSHgoSY292ZXJh", + "Z2VfZ3JpZF9zaXplGDMgASgFOgIxMBJmChJtaXh0dXJlX21vZGVsX21vZGUY", + "FyABKA4yMy5tZWRpYXBpcGUuTW90aW9uRXN0aW1hdGlvbk9wdGlvbnMuTWl4", + "dHVyZU1vZGVsTW9kZToVU0tFV19ST1RBVElPTl9NSVhUVVJFEjUKJ3VzZV9v", + "bmx5X2xpbl9zaW1faW5saWVyc19mb3JfaG9tb2dyYXBoeRgGIAEoCDoEdHJ1", + "ZRInChhsaW5fc2ltX2lubGllcl90aHJlc2hvbGQYFCABKAI6BTAuMDAzElcK", + "GXN0YWJsZV90cmFuc2xhdGlvbl9ib3VuZHMYICABKAsyNC5tZWRpYXBpcGUu", + "TW90aW9uRXN0aW1hdGlvbk9wdGlvbnMuVHJhbnNsYXRpb25Cb3VuZHMSVQoY", + "c3RhYmxlX3NpbWlsYXJpdHlfYm91bmRzGCEgASgLMjMubWVkaWFwaXBlLk1v", + "dGlvbkVzdGltYXRpb25PcHRpb25zLlNpbWlsYXJpdHlCb3VuZHMSVQoYc3Rh", + "YmxlX2hvbW9ncmFwaHlfYm91bmRzGAsgASgLMjMubWVkaWFwaXBlLk1vdGlv", + "bkVzdGltYXRpb25PcHRpb25zLkhvbW9ncmFwaHlCb3VuZHMSZAogc3RhYmxl", + "X21peHR1cmVfaG9tb2dyYXBoeV9ib3VuZHMYIiABKAsyOi5tZWRpYXBpcGUu", + "TW90aW9uRXN0aW1hdGlvbk9wdGlvbnMuTWl4dHVyZUhvbW9ncmFwaHlCb3Vu", + "ZHMSJAoVc3RyaWN0X2NvdmVyYWdlX3NjYWxlGCkgASgCOgUxLjMzMxIpChts", + "YWJlbF9lbXB0eV9mcmFtZXNfYXNfdmFsaWQYFiABKAg6BHRydWUSHwoRZmVh", + "dHVyZV9ncmlkX3NpemUYGCABKAI6BDAuMDUSGwoNc3BhdGlhbF9zaWdtYRgZ", + "IAEoAjoEMC4wMRIiChZ0ZW1wb3JhbF9pcmxzX2RpYW1ldGVyGBogASgFOgIy", + "MBIZCg50ZW1wb3JhbF9zaWdtYRgbIAEoAjoBNRIZCg1mZWF0dXJlX3NpZ21h", + "GBwgASgCOgIzMBIcCg1maWx0ZXJfNV90YXBzGB0gASgIOgVmYWxzZRIoChpm", + "cmFtZV9jb25maWRlbmNlX3dlaWdodGluZxgwIAEoCDoEdHJ1ZRInChpyZXNl", + "dF9jb25maWRlbmNlX3RocmVzaG9sZBgxIAEoAjoDMC40EmEKEmlybHNfd2Vp", + "Z2h0X2ZpbHRlchgjIAEoDjIzLm1lZGlhcGlwZS5Nb3Rpb25Fc3RpbWF0aW9u", + "T3B0aW9ucy5JUkxTV2VpZ2h0RmlsdGVyOhBJUkxTX0ZJTFRFUl9OT05FEiAK", + "EW92ZXJsYXlfZGV0ZWN0aW9uGCQgASgIOgVmYWxzZRImChtvdmVybGF5X2Fu", + "YWx5c2lzX2NodW5rX3NpemUYJSABKAU6ATgSXQoZb3ZlcmxheV9kZXRlY3Rp", + "b25fb3B0aW9ucxgmIAEoCzI6Lm1lZGlhcGlwZS5Nb3Rpb25Fc3RpbWF0aW9u", + "T3B0aW9ucy5PdmVybGF5RGV0ZWN0aW9uT3B0aW9ucxJVChVzaG90X2JvdW5k", + "YXJ5X29wdGlvbnMYPCABKAsyNi5tZWRpYXBpcGUuTW90aW9uRXN0aW1hdGlv", + "bk9wdGlvbnMuU2hvdEJvdW5kYXJ5T3B0aW9ucxIpChtvdXRwdXRfcmVmaW5l", + "ZF9pcmxzX3dlaWdodHMYKCABKAg6BHRydWUSlAEKJWhvbW9ncmFwaHlfaXJs", + "c193ZWlnaHRfaW5pdGlhbGl6YXRpb24YLSABKA4yRS5tZWRpYXBpcGUuTW90", + "aW9uRXN0aW1hdGlvbk9wdGlvbnMuSG9tb2dyYXBoeUlybHNXZWlnaHRJbml0", + "aWFsaXphdGlvbjoeSVJMU19XRUlHSFRfUEVSSU1FVEVSX0dBVVNTSUFOEh4K", + "EGlybHNfdXNlX2wwX25vcm0YLiABKAg6BHRydWUSKgobZG9tYWluX2xpbWl0", + "ZWRfaXJsc19zY2FsaW5nGEEgASgIOgVmYWxzZRIyCiNkZWFjdGl2YXRlX3N0", + "YWJsZV9tb3Rpb25fZXN0aW1hdGlvbhgvIAEoCDoFZmFsc2USKQoacHJvamVj", + "dF92YWxpZF9tb3Rpb25zX2Rvd24YNCABKAg6BWZhbHNlEh8KE2VzdGltYXRl", + "X3NpbWlsYXJpdHkYAiABKAhCAhgBGmEKGUlybHNPdXRsaWVySW5pdGlhbGl6", + "YXRpb24SGAoJYWN0aXZhdGVkGAEgASgIOgVmYWxzZRITCgZyb3VuZHMYAiAB", + "KAU6AzEwMBIVCgZjdXRvZmYYAyABKAI6BTAuMDAzGnoKGUxvbmdGZWF0dXJl", + "SW5pdGlhbGl6YXRpb24SGAoJYWN0aXZhdGVkGAEgASgIOgVmYWxzZRIjChVt", + "aW5fbGVuZ3RoX3BlcmNlbnRpbGUYAiABKAI6BDAuOTUSHgoTdXB3ZWlnaHRf", + "bXVsdGlwbGllchgDIAEoAjoBNRrTAQoPSXJsc01hc2tPcHRpb25zEhIKBWRl", + "Y2F5GAIgASgCOgMwLjcSGQoMaW5saWVyX3Njb3JlGAMgASgCOgMwLjQSFwoK", + "YmFzZV9zY29yZRgEIAEoAjoDMC4yEiMKFG1pbl90cmFuc2xhdGlvbl9ub3Jt", + "GAUgASgCOgUwLjAwMhIkChd0cmFuc2xhdGlvbl9ibGVuZF9hbHBoYRgGIAEo", + "AjoDMC43EicKGnRyYW5zbGF0aW9uX3ByaW9yX2luY3JlYXNlGAcgASgCOgMw", + "LjIqBAgBEAIaeQobSm9pbnRUcmFja0VzdGltYXRpb25PcHRpb25zEhwKEW51", + "bV9tb3Rpb25fbW9kZWxzGAEgASgFOgEzEhkKDW1vdGlvbl9zdHJpZGUYAiAB", + "KAU6AjE1EiEKEnRlbXBvcmFsX3Ntb290aGluZxgDIAEoCDoFZmFsc2UaygMK", + "FkxvbmdGZWF0dXJlQmlhc09wdGlvbnMSFwoMdG90YWxfcm91bmRzGA0gASgF", + "OgExEhkKC2lubGllcl9iaWFzGAEgASgCOgQwLjk4EhkKDG91dGxpZXJfYmlh", + "cxgCIAEoAjoDMC43EiEKFW51bV9pcmxzX29ic2VydmF0aW9ucxgDIAEoBToC", + "MTASIQoVbWF4X2lybHNfY2hhbmdlX3JhdGlvGAQgASgCOgIxMBIfChJpbmxp", + "ZXJfaXJsc193ZWlnaHQYBSABKAI6AzAuMhIVCgpiaWFzX3N0ZGV2GAwgASgC", + "OgExEh4KEHVzZV9zcGF0aWFsX2JpYXMYBiABKAg6BHRydWUSFwoJZ3JpZF9z", + "aXplGAcgASgCOgQwLjA0EhsKDXNwYXRpYWxfc2lnbWEYCCABKAI6BDAuMDIS", + "FwoLY29sb3Jfc2lnbWEYCSABKAI6AjIwEiAKFGxvbmdfdHJhY2tfdGhyZXNo", + "b2xkGAogASgFOgIzMBIsCh5sb25nX3RyYWNrX2NvbmZpZGVuY2VfZnJhY3Rp", + "b24YCyABKAI6BDAuMjUSJAoVc2VlZF9wcmlvcnNfZnJvbV9iaWFzGA4gASgI", + "OgVmYWxzZRq+AQoRVHJhbnNsYXRpb25Cb3VuZHMSFwoMbWluX2ZlYXR1cmVz", + "GAEgASgFOgEzEicKGWZyYWNfbWF4X21vdGlvbl9tYWduaXR1ZGUYAiABKAI6", + "BDAuMTUSKAoabWF4X21vdGlvbl9zdGRldl90aHJlc2hvbGQYBCABKAI6BDAu", + "MDESHwoQbWF4X21vdGlvbl9zdGRldhgDIAEoAjoFMC4wNjUSHAoQbWF4X2Fj", + "Y2VsZXJhdGlvbhgFIAEoAjoCMjAapgIKEFNpbWlsYXJpdHlCb3VuZHMSHwoR", + "b25seV9zdGFibGVfaW5wdXQYASABKAg6BHRydWUSIAoTbWluX2lubGllcl9m", + "cmFjdGlvbhgCIAEoAjoDMC4yEhcKC21pbl9pbmxpZXJzGAMgASgCOgIzMBIY", + "Cgtsb3dlcl9zY2FsZRgEIAEoAjoDMC44EhkKC3VwcGVyX3NjYWxlGAUgASgC", + "OgQxLjI1EhwKDmxpbWl0X3JvdGF0aW9uGAYgASgCOgQwLjI1EhsKEGlubGll", + "cl90aHJlc2hvbGQYByABKAI6ATQSIAoVZnJhY19pbmxpZXJfdGhyZXNob2xk", + "GAggASgCOgEwEiQKF3N0cmljdF9pbmxpZXJfdGhyZXNob2xkGAkgASgCOgMw", + "LjUanQIKEEhvbW9ncmFwaHlCb3VuZHMSGAoLbG93ZXJfc2NhbGUYASABKAI6", + "AzAuOBIZCgt1cHBlcl9zY2FsZRgCIAEoAjoEMS4yNRIcCg5saW1pdF9yb3Rh", + "dGlvbhgDIAEoAjoEMC4yNRIhChFsaW1pdF9wZXJzcGVjdGl2ZRgEIAEoAjoG", + "MC4wMDA0EiMKFnJlZ2lzdHJhdGlvbl90aHJlc2hvbGQYBSABKAI6AzAuMRIm", + "ChtmcmFjX3JlZ2lzdHJhdGlvbl90aHJlc2hvbGQYCCABKAI6ATASIAoTbWlu", + "X2lubGllcl9jb3ZlcmFnZRgGIAEoAjoDMC4zEiQKFWZyYWNfaW5saWVyX3Ro", + "cmVzaG9sZBgHIAEoAjoFMC4wMDIasAEKF01peHR1cmVIb21vZ3JhcGh5Qm91", + "bmRzEiAKE21pbl9pbmxpZXJfY292ZXJhZ2UYASABKAI6AzAuNBImChttYXhf", + "YWRqYWNlbnRfb3V0bGllcl9ibG9ja3MYAiABKAU6ATUSJAoZbWF4X2FkamFj", + "ZW50X2VtcHR5X2Jsb2NrcxgDIAEoBToBMxIlChVmcmFjX2lubGllcl90aHJl", + "c2hvbGQYByABKAI6BjAuMDAyNRqVAgoXT3ZlcmxheURldGVjdGlvbk9wdGlv", + "bnMSHgoSYW5hbHlzaXNfbWFza19zaXplGAEgASgFOgIxMBIkChdzdHJpY3Rf", + "bmVhcl96ZXJvX21vdGlvbhgCIAEoAjoDMC4yEikKHHN0cmljdF9tYXhfdHJh", + "bnNsYXRpb25fcmF0aW8YAyABKAI6AzAuMhIkChdzdHJpY3RfbWluX3RleHR1", + "cmVkbmVzcxgFIAEoAjoDMC4xEiEKFmxvb3NlX25lYXJfemVyb19tb3Rpb24Y", + "BCABKAI6ATESHgoRb3ZlcmxheV9taW5fcmF0aW8YBiABKAI6AzAuMxIgChRv", + "dmVybGF5X21pbl9mZWF0dXJlcxgHIAEoAjoCMTAacgoTU2hvdEJvdW5kYXJ5", + "T3B0aW9ucxIqChxtb3Rpb25fY29uc2lzdGVuY3lfdGhyZXNob2xkGAEgASgC", + "OgQwLjAyEi8KIGFwcGVhcmFuY2VfY29uc2lzdGVuY3lfdGhyZXNob2xkGAIg", + "ASgCOgUwLjA3NSKVAQoaTGluZWFyU2ltaWxhcml0eUVzdGltYXRpb24SFgoS", + "RVNUSU1BVElPTl9MU19OT05FEAASFAoQRVNUSU1BVElPTl9MU19MMhABEhYK", + "EkVTVElNQVRJT05fTFNfSVJMUxAEEhsKF0VTVElNQVRJT05fTFNfTDJfUkFO", + "U0FDEAISFAoQRVNUSU1BVElPTl9MU19MMRADImQKEEFmZmluZUVzdGltYXRp", + "b24SGgoWRVNUSU1BVElPTl9BRkZJTkVfTk9ORRAAEhgKFEVTVElNQVRJT05f", + "QUZGSU5FX0wyEAESGgoWRVNUSU1BVElPTl9BRkZJTkVfSVJMUxACImUKFEhv", + "bW9ncmFwaHlFc3RpbWF0aW9uEhkKFUVTVElNQVRJT05fSE9NT0dfTk9ORRAA", + "EhcKE0VTVElNQVRJT05fSE9NT0dfTDIQARIZChVFU1RJTUFUSU9OX0hPTU9H", + "X0lSTFMQAiJ4ChtNaXh0dXJlSG9tb2dyYXBoeUVzdGltYXRpb24SHQoZRVNU", + "SU1BVElPTl9IT01PR19NSVhfTk9ORRAAEhsKF0VTVElNQVRJT05fSE9NT0df", + "TUlYX0wyEAESHQoZRVNUSU1BVElPTl9IT01PR19NSVhfSVJMUxACIn0KEEVz", + "dGltYXRpb25Qb2xpY3kSGAoUSU5ERVBFTkRFTlRfUEFSQUxMRUwQARIWChJU", + "RU1QT1JBTF9JUkxTX01BU0sQAhIeChpURU1QT1JBTF9MT05HX0ZFQVRVUkVf", + "QklBUxAEEhcKE0pPSU5UTFlfRlJPTV9UUkFDS1MQAyJYChBNaXh0dXJlTW9k", + "ZWxNb2RlEhAKDEZVTExfTUlYVFVSRRAAEhcKE1RSQU5TTEFUSU9OX01JWFRV", + "UkUQARIZChVTS0VXX1JPVEFUSU9OX01JWFRVUkUQAiJiChBJUkxTV2VpZ2h0", + "RmlsdGVyEhQKEElSTFNfRklMVEVSX05PTkUQABIXChNJUkxTX0ZJTFRFUl9U", + "RVhUVVJFEAESHwobSVJMU19GSUxURVJfQ09STkVSX1JFU1BPTlNFEAIihwEK", + "IkhvbW9ncmFwaHlJcmxzV2VpZ2h0SW5pdGlhbGl6YXRpb24SHAoYSVJMU19X", + "RUlHSFRfQ09OU1RBTlRfT05FEAESHwobSVJMU19XRUlHSFRfQ0VOVEVSX0dB", + "VVNTSUFOEAISIgoeSVJMU19XRUlHSFRfUEVSSU1FVEVSX0dBVVNTSUFOEAMq", + "BAgHEAgqBAgIEAkqBAgQEBE=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions), global::Mediapipe.MotionEstimationOptions.Parser, new[]{ "EstimateTranslationIrls", "LinearSimilarityEstimation", "AffineEstimation", "HomographyEstimation", "HomographyExactDenominatorScaling", "UseExactHomographyEstimation", "UseHighestAccuracyForNormalEquations", "HomographyPerspectiveRegularizer", "MixHomographyEstimation", "NumMixtures", "MixtureRowSigma", "MixtureRegularizer", "MixtureRegularizerLevels", "MixtureRegularizerBase", "MixtureRsAnalysisLevel", "IrlsRounds", "IrlsPriorScale", "IrlsMotionMagnitudeFraction", "IrlsMixtureFractionScale", "IrlsWeightsPreinitialized", "FilterInitializedIrlsWeights", "IrlsInitialization", "FeatureDensityNormalization", "FeatureMaskSize", "LongFeatureInitialization", "IrlsMaskOptions", "JointTrackEstimation", "LongFeatureBiasOptions", "EstimationPolicy", "CoverageGridSize", "MixtureModelMode", "UseOnlyLinSimInliersForHomography", "LinSimInlierThreshold", "StableTranslationBounds", "StableSimilarityBounds", "StableHomographyBounds", "StableMixtureHomographyBounds", "StrictCoverageScale", "LabelEmptyFramesAsValid", "FeatureGridSize", "SpatialSigma", "TemporalIrlsDiameter", "TemporalSigma", "FeatureSigma", "Filter5Taps", "FrameConfidenceWeighting", "ResetConfidenceThreshold", "IrlsWeightFilter", "OverlayDetection", "OverlayAnalysisChunkSize", "OverlayDetectionOptions", "ShotBoundaryOptions", "OutputRefinedIrlsWeights", "HomographyIrlsWeightInitialization", "IrlsUseL0Norm", "DomainLimitedIrlsScaling", "DeactivateStableMotionEstimation", "ProjectValidMotionsDown", "EstimateSimilarity" }, null, new[]{ typeof(global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation), typeof(global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation), typeof(global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation), typeof(global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation), typeof(global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy), typeof(global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode), typeof(global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter), typeof(global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization), global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization.Parser, new[]{ "Activated", "Rounds", "Cutoff" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization), global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization.Parser, new[]{ "Activated", "MinLengthPercentile", "UpweightMultiplier" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions), global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions.Parser, new[]{ "Decay", "InlierScore", "BaseScore", "MinTranslationNorm", "TranslationBlendAlpha", "TranslationPriorIncrease" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions), global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions.Parser, new[]{ "NumMotionModels", "MotionStride", "TemporalSmoothing" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions), global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions.Parser, new[]{ "TotalRounds", "InlierBias", "OutlierBias", "NumIrlsObservations", "MaxIrlsChangeRatio", "InlierIrlsWeight", "BiasStdev", "UseSpatialBias", "GridSize", "SpatialSigma", "ColorSigma", "LongTrackThreshold", "LongTrackConfidenceFraction", "SeedPriorsFromBias" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds), global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds.Parser, new[]{ "MinFeatures", "FracMaxMotionMagnitude", "MaxMotionStdevThreshold", "MaxMotionStdev", "MaxAcceleration" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds), global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds.Parser, new[]{ "OnlyStableInput", "MinInlierFraction", "MinInliers", "LowerScale", "UpperScale", "LimitRotation", "InlierThreshold", "FracInlierThreshold", "StrictInlierThreshold" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds), global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds.Parser, new[]{ "LowerScale", "UpperScale", "LimitRotation", "LimitPerspective", "RegistrationThreshold", "FracRegistrationThreshold", "MinInlierCoverage", "FracInlierThreshold" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds), global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds.Parser, new[]{ "MinInlierCoverage", "MaxAdjacentOutlierBlocks", "MaxAdjacentEmptyBlocks", "FracInlierThreshold" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions), global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions.Parser, new[]{ "AnalysisMaskSize", "StrictNearZeroMotion", "StrictMaxTranslationRatio", "StrictMinTexturedness", "LooseNearZeroMotion", "OverlayMinRatio", "OverlayMinFeatures" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions), global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions.Parser, new[]{ "MotionConsistencyThreshold", "AppearanceConsistencyThreshold" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Note: In general for Estimation modes, the prefix are used as follows: + /// L2: minimize squared norm of error + /// IRLS: iterative reweighted least square, L2 minimization using multiple + /// iterations, downweighting outliers. + /// Next tag: 69 + /// + public sealed partial class MotionEstimationOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionEstimationOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + private int _hasBits1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionEstimationOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionEstimationOptions(MotionEstimationOptions other) : this() { + _hasBits0 = other._hasBits0; + _hasBits1 = other._hasBits1; + estimateTranslationIrls_ = other.estimateTranslationIrls_; + linearSimilarityEstimation_ = other.linearSimilarityEstimation_; + affineEstimation_ = other.affineEstimation_; + homographyEstimation_ = other.homographyEstimation_; + homographyExactDenominatorScaling_ = other.homographyExactDenominatorScaling_; + useExactHomographyEstimation_ = other.useExactHomographyEstimation_; + useHighestAccuracyForNormalEquations_ = other.useHighestAccuracyForNormalEquations_; + homographyPerspectiveRegularizer_ = other.homographyPerspectiveRegularizer_; + mixHomographyEstimation_ = other.mixHomographyEstimation_; + numMixtures_ = other.numMixtures_; + mixtureRowSigma_ = other.mixtureRowSigma_; + mixtureRegularizer_ = other.mixtureRegularizer_; + mixtureRegularizerLevels_ = other.mixtureRegularizerLevels_; + mixtureRegularizerBase_ = other.mixtureRegularizerBase_; + mixtureRsAnalysisLevel_ = other.mixtureRsAnalysisLevel_; + irlsRounds_ = other.irlsRounds_; + irlsPriorScale_ = other.irlsPriorScale_; + irlsMotionMagnitudeFraction_ = other.irlsMotionMagnitudeFraction_; + irlsMixtureFractionScale_ = other.irlsMixtureFractionScale_; + irlsWeightsPreinitialized_ = other.irlsWeightsPreinitialized_; + filterInitializedIrlsWeights_ = other.filterInitializedIrlsWeights_; + irlsInitialization_ = other.irlsInitialization_ != null ? other.irlsInitialization_.Clone() : null; + featureDensityNormalization_ = other.featureDensityNormalization_; + featureMaskSize_ = other.featureMaskSize_; + longFeatureInitialization_ = other.longFeatureInitialization_ != null ? other.longFeatureInitialization_.Clone() : null; + irlsMaskOptions_ = other.irlsMaskOptions_ != null ? other.irlsMaskOptions_.Clone() : null; + jointTrackEstimation_ = other.jointTrackEstimation_ != null ? other.jointTrackEstimation_.Clone() : null; + longFeatureBiasOptions_ = other.longFeatureBiasOptions_ != null ? other.longFeatureBiasOptions_.Clone() : null; + estimationPolicy_ = other.estimationPolicy_; + coverageGridSize_ = other.coverageGridSize_; + mixtureModelMode_ = other.mixtureModelMode_; + useOnlyLinSimInliersForHomography_ = other.useOnlyLinSimInliersForHomography_; + linSimInlierThreshold_ = other.linSimInlierThreshold_; + stableTranslationBounds_ = other.stableTranslationBounds_ != null ? other.stableTranslationBounds_.Clone() : null; + stableSimilarityBounds_ = other.stableSimilarityBounds_ != null ? other.stableSimilarityBounds_.Clone() : null; + stableHomographyBounds_ = other.stableHomographyBounds_ != null ? other.stableHomographyBounds_.Clone() : null; + stableMixtureHomographyBounds_ = other.stableMixtureHomographyBounds_ != null ? other.stableMixtureHomographyBounds_.Clone() : null; + strictCoverageScale_ = other.strictCoverageScale_; + labelEmptyFramesAsValid_ = other.labelEmptyFramesAsValid_; + featureGridSize_ = other.featureGridSize_; + spatialSigma_ = other.spatialSigma_; + temporalIrlsDiameter_ = other.temporalIrlsDiameter_; + temporalSigma_ = other.temporalSigma_; + featureSigma_ = other.featureSigma_; + filter5Taps_ = other.filter5Taps_; + frameConfidenceWeighting_ = other.frameConfidenceWeighting_; + resetConfidenceThreshold_ = other.resetConfidenceThreshold_; + irlsWeightFilter_ = other.irlsWeightFilter_; + overlayDetection_ = other.overlayDetection_; + overlayAnalysisChunkSize_ = other.overlayAnalysisChunkSize_; + overlayDetectionOptions_ = other.overlayDetectionOptions_ != null ? other.overlayDetectionOptions_.Clone() : null; + shotBoundaryOptions_ = other.shotBoundaryOptions_ != null ? other.shotBoundaryOptions_.Clone() : null; + outputRefinedIrlsWeights_ = other.outputRefinedIrlsWeights_; + homographyIrlsWeightInitialization_ = other.homographyIrlsWeightInitialization_; + irlsUseL0Norm_ = other.irlsUseL0Norm_; + domainLimitedIrlsScaling_ = other.domainLimitedIrlsScaling_; + deactivateStableMotionEstimation_ = other.deactivateStableMotionEstimation_; + projectValidMotionsDown_ = other.projectValidMotionsDown_; + estimateSimilarity_ = other.estimateSimilarity_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionEstimationOptions Clone() { + return new MotionEstimationOptions(this); + } + + /// Field number for the "estimate_translation_irls" field. + public const int EstimateTranslationIrlsFieldNumber = 1; + private readonly static bool EstimateTranslationIrlsDefaultValue = true; + + private bool estimateTranslationIrls_; + /// + /// Specifies which camera models should be estimated, translation is always + /// estimated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EstimateTranslationIrls { + get { if ((_hasBits0 & 1) != 0) { return estimateTranslationIrls_; } else { return EstimateTranslationIrlsDefaultValue; } } + set { + _hasBits0 |= 1; + estimateTranslationIrls_ = value; + } + } + /// Gets whether the "estimate_translation_irls" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEstimateTranslationIrls { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "estimate_translation_irls" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEstimateTranslationIrls() { + _hasBits0 &= ~1; + } + + /// Field number for the "linear_similarity_estimation" field. + public const int LinearSimilarityEstimationFieldNumber = 3; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation LinearSimilarityEstimationDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation.EstimationLsIrls; + + private global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation linearSimilarityEstimation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation LinearSimilarityEstimation { + get { if ((_hasBits0 & 4) != 0) { return linearSimilarityEstimation_; } else { return LinearSimilarityEstimationDefaultValue; } } + set { + _hasBits0 |= 4; + linearSimilarityEstimation_ = value; + } + } + /// Gets whether the "linear_similarity_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLinearSimilarityEstimation { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "linear_similarity_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLinearSimilarityEstimation() { + _hasBits0 &= ~4; + } + + /// Field number for the "affine_estimation" field. + public const int AffineEstimationFieldNumber = 30; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation AffineEstimationDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation.EstimationAffineNone; + + private global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation affineEstimation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation AffineEstimation { + get { if ((_hasBits0 & 524288) != 0) { return affineEstimation_; } else { return AffineEstimationDefaultValue; } } + set { + _hasBits0 |= 524288; + affineEstimation_ = value; + } + } + /// Gets whether the "affine_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAffineEstimation { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "affine_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAffineEstimation() { + _hasBits0 &= ~524288; + } + + /// Field number for the "homography_estimation" field. + public const int HomographyEstimationFieldNumber = 5; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation HomographyEstimationDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation.EstimationHomogIrls; + + private global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation homographyEstimation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation HomographyEstimation { + get { if ((_hasBits0 & 8) != 0) { return homographyEstimation_; } else { return HomographyEstimationDefaultValue; } } + set { + _hasBits0 |= 8; + homographyEstimation_ = value; + } + } + /// Gets whether the "homography_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyEstimation { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "homography_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyEstimation() { + _hasBits0 &= ~8; + } + + /// Field number for the "homography_exact_denominator_scaling" field. + public const int HomographyExactDenominatorScalingFieldNumber = 53; + private readonly static bool HomographyExactDenominatorScalingDefaultValue = false; + + private bool homographyExactDenominatorScaling_; + /// + /// By default, homography estimation minimizes an objective that is not + /// strictly the L2 distance between matched points. If the flag is set, each + /// row of the linear system is scaled with the exact denominator which results + /// in an objective that minimizes the L2 distance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HomographyExactDenominatorScaling { + get { if ((_hasBits1 & 64) != 0) { return homographyExactDenominatorScaling_; } else { return HomographyExactDenominatorScalingDefaultValue; } } + set { + _hasBits1 |= 64; + homographyExactDenominatorScaling_ = value; + } + } + /// Gets whether the "homography_exact_denominator_scaling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyExactDenominatorScaling { + get { return (_hasBits1 & 64) != 0; } + } + /// Clears the value of the "homography_exact_denominator_scaling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyExactDenominatorScaling() { + _hasBits1 &= ~64; + } + + /// Field number for the "use_exact_homography_estimation" field. + public const int UseExactHomographyEstimationFieldNumber = 54; + private readonly static bool UseExactHomographyEstimationDefaultValue = true; + + private bool useExactHomographyEstimation_; + /// + /// Per default, we use exact solver for over-determined system using + /// well-conditioned QR decomposition. For better speed, set value to false to + /// use estimation via normal equations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseExactHomographyEstimation { + get { if ((_hasBits1 & 128) != 0) { return useExactHomographyEstimation_; } else { return UseExactHomographyEstimationDefaultValue; } } + set { + _hasBits1 |= 128; + useExactHomographyEstimation_ = value; + } + } + /// Gets whether the "use_exact_homography_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseExactHomographyEstimation { + get { return (_hasBits1 & 128) != 0; } + } + /// Clears the value of the "use_exact_homography_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseExactHomographyEstimation() { + _hasBits1 &= ~128; + } + + /// Field number for the "use_highest_accuracy_for_normal_equations" field. + public const int UseHighestAccuracyForNormalEquationsFieldNumber = 55; + private readonly static bool UseHighestAccuracyForNormalEquationsDefaultValue = true; + + private bool useHighestAccuracyForNormalEquations_; + /// + /// If set uses double instead of float when computing normal equations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseHighestAccuracyForNormalEquations { + get { if ((_hasBits1 & 256) != 0) { return useHighestAccuracyForNormalEquations_; } else { return UseHighestAccuracyForNormalEquationsDefaultValue; } } + set { + _hasBits1 |= 256; + useHighestAccuracyForNormalEquations_ = value; + } + } + /// Gets whether the "use_highest_accuracy_for_normal_equations" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseHighestAccuracyForNormalEquations { + get { return (_hasBits1 & 256) != 0; } + } + /// Clears the value of the "use_highest_accuracy_for_normal_equations" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseHighestAccuracyForNormalEquations() { + _hasBits1 &= ~256; + } + + /// Field number for the "homography_perspective_regularizer" field. + public const int HomographyPerspectiveRegularizerFieldNumber = 61; + private readonly static float HomographyPerspectiveRegularizerDefaultValue = 0F; + + private float homographyPerspectiveRegularizer_; + /// + /// Regularizer for perspective part of the homography. If zero, no + /// regularization is performed. Should be >= 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HomographyPerspectiveRegularizer { + get { if ((_hasBits1 & 1024) != 0) { return homographyPerspectiveRegularizer_; } else { return HomographyPerspectiveRegularizerDefaultValue; } } + set { + _hasBits1 |= 1024; + homographyPerspectiveRegularizer_ = value; + } + } + /// Gets whether the "homography_perspective_regularizer" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyPerspectiveRegularizer { + get { return (_hasBits1 & 1024) != 0; } + } + /// Clears the value of the "homography_perspective_regularizer" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyPerspectiveRegularizer() { + _hasBits1 &= ~1024; + } + + /// Field number for the "mix_homography_estimation" field. + public const int MixHomographyEstimationFieldNumber = 12; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation MixHomographyEstimationDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation.EstimationHomogMixNone; + + private global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation mixHomographyEstimation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation MixHomographyEstimation { + get { if ((_hasBits0 & 32) != 0) { return mixHomographyEstimation_; } else { return MixHomographyEstimationDefaultValue; } } + set { + _hasBits0 |= 32; + mixHomographyEstimation_ = value; + } + } + /// Gets whether the "mix_homography_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixHomographyEstimation { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "mix_homography_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixHomographyEstimation() { + _hasBits0 &= ~32; + } + + /// Field number for the "num_mixtures" field. + public const int NumMixturesFieldNumber = 13; + private readonly static int NumMixturesDefaultValue = 10; + + private int numMixtures_; + /// + /// If row-wise mixture models are estimated, determines number of them. + /// Note, changing number of mixtures, interpolation sigma and regularizer + /// is very likely to impact the stability analysis for mixtures and rolling + /// shutter scoring. At least MixtureHomographyBounds would need to be adjusted + /// to the new values. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumMixtures { + get { if ((_hasBits0 & 64) != 0) { return numMixtures_; } else { return NumMixturesDefaultValue; } } + set { + _hasBits0 |= 64; + numMixtures_ = value; + } + } + /// Gets whether the "num_mixtures" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumMixtures { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "num_mixtures" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumMixtures() { + _hasBits0 &= ~64; + } + + /// Field number for the "mixture_row_sigma" field. + public const int MixtureRowSigmaFieldNumber = 14; + private readonly static float MixtureRowSigmaDefaultValue = 0.1F; + + private float mixtureRowSigma_; + /// + /// If row-wise mixture models are estimated, determines how much each point is + /// influenced by its neigbhoring mixtures. Specified as relative sigma + /// (standard deviation) w.r.t. frame_height. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureRowSigma { + get { if ((_hasBits0 & 128) != 0) { return mixtureRowSigma_; } else { return MixtureRowSigmaDefaultValue; } } + set { + _hasBits0 |= 128; + mixtureRowSigma_ = value; + } + } + /// Gets whether the "mixture_row_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRowSigma { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "mixture_row_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRowSigma() { + _hasBits0 &= ~128; + } + + /// Field number for the "mixture_regularizer" field. + public const int MixtureRegularizerFieldNumber = 15; + private readonly static float MixtureRegularizerDefaultValue = 0.0001F; + + private float mixtureRegularizer_; + /// + /// Mixture estimation uses L2 regularizer to assure that adjacent mixture + /// models are similar. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureRegularizer { + get { if ((_hasBits0 & 256) != 0) { return mixtureRegularizer_; } else { return MixtureRegularizerDefaultValue; } } + set { + _hasBits0 |= 256; + mixtureRegularizer_ = value; + } + } + /// Gets whether the "mixture_regularizer" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRegularizer { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "mixture_regularizer" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRegularizer() { + _hasBits0 &= ~256; + } + + /// Field number for the "mixture_regularizer_levels" field. + public const int MixtureRegularizerLevelsFieldNumber = 42; + private readonly static float MixtureRegularizerLevelsDefaultValue = 3F; + + private float mixtureRegularizerLevels_; + /// + /// Mixtures are estimated across a spectrum of exponentially increasingly + /// regularizers. In particular the regularizer at level L is given as + /// mixture_regularizer * mixture_regularizer_base^L. + /// A maximum of 10 levels are supported (checked!). + /// Note: When changing the number of levels you probably want to adapt the + /// MotionStabilizationOptions::rolling_shutter_increment value as well, + /// as the number of levels directly controls the highest threshold for + /// the rolling shutter index analysis. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureRegularizerLevels { + get { if ((_hasBits0 & 134217728) != 0) { return mixtureRegularizerLevels_; } else { return MixtureRegularizerLevelsDefaultValue; } } + set { + _hasBits0 |= 134217728; + mixtureRegularizerLevels_ = value; + } + } + /// Gets whether the "mixture_regularizer_levels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRegularizerLevels { + get { return (_hasBits0 & 134217728) != 0; } + } + /// Clears the value of the "mixture_regularizer_levels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRegularizerLevels() { + _hasBits0 &= ~134217728; + } + + /// Field number for the "mixture_regularizer_base" field. + public const int MixtureRegularizerBaseFieldNumber = 43; + private readonly static float MixtureRegularizerBaseDefaultValue = 2.2F; + + private float mixtureRegularizerBase_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureRegularizerBase { + get { if ((_hasBits0 & 268435456) != 0) { return mixtureRegularizerBase_; } else { return MixtureRegularizerBaseDefaultValue; } } + set { + _hasBits0 |= 268435456; + mixtureRegularizerBase_ = value; + } + } + /// Gets whether the "mixture_regularizer_base" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRegularizerBase { + get { return (_hasBits0 & 268435456) != 0; } + } + /// Clears the value of the "mixture_regularizer_base" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRegularizerBase() { + _hasBits0 &= ~268435456; + } + + /// Field number for the "mixture_rs_analysis_level" field. + public const int MixtureRsAnalysisLevelFieldNumber = 44; + private readonly static int MixtureRsAnalysisLevelDefaultValue = 2; + + private int mixtureRsAnalysisLevel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MixtureRsAnalysisLevel { + get { if ((_hasBits0 & 536870912) != 0) { return mixtureRsAnalysisLevel_; } else { return MixtureRsAnalysisLevelDefaultValue; } } + set { + _hasBits0 |= 536870912; + mixtureRsAnalysisLevel_ = value; + } + } + /// Gets whether the "mixture_rs_analysis_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureRsAnalysisLevel { + get { return (_hasBits0 & 536870912) != 0; } + } + /// Clears the value of the "mixture_rs_analysis_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureRsAnalysisLevel() { + _hasBits0 &= ~536870912; + } + + /// Field number for the "irls_rounds" field. + public const int IrlsRoundsFieldNumber = 17; + private readonly static int IrlsRoundsDefaultValue = 10; + + private int irlsRounds_; + /// + /// IRLS rounds to down-weight outliers (default across all models). + /// Note: IRLS in combination with full mixture models (as opposed to the + /// default reduced ones) is somewhat expensive. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int IrlsRounds { + get { if ((_hasBits0 & 512) != 0) { return irlsRounds_; } else { return IrlsRoundsDefaultValue; } } + set { + _hasBits0 |= 512; + irlsRounds_ = value; + } + } + /// Gets whether the "irls_rounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsRounds { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "irls_rounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsRounds() { + _hasBits0 &= ~512; + } + + /// Field number for the "irls_prior_scale" field. + public const int IrlsPriorScaleFieldNumber = 50; + private readonly static float IrlsPriorScaleDefaultValue = 0.2F; + + private float irlsPriorScale_; + /// + /// If set to > 0 (always needs be less than 1.0), influence of supplied prior + /// irls weights is linearlly decreased from the specified prior scale (weight + /// 1.0) to prior_scale. Effectively, biases the solution to the + /// supplied prior features. + /// Note: Without irls_weights_preinitialized set to true, this option is + /// effectively a no op. + /// TODO: Retire this option. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IrlsPriorScale { + get { if ((_hasBits1 & 8) != 0) { return irlsPriorScale_; } else { return IrlsPriorScaleDefaultValue; } } + set { + _hasBits1 |= 8; + irlsPriorScale_ = value; + } + } + /// Gets whether the "irls_prior_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsPriorScale { + get { return (_hasBits1 & 8) != 0; } + } + /// Clears the value of the "irls_prior_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsPriorScale() { + _hasBits1 &= ~8; + } + + /// Field number for the "irls_motion_magnitude_fraction" field. + public const int IrlsMotionMagnitudeFractionFieldNumber = 31; + private readonly static float IrlsMotionMagnitudeFractionDefaultValue = 0.08F; + + private float irlsMotionMagnitudeFraction_; + /// + /// Determine how to normalize irls weights w.r.t. average motion magnitude. + /// In general a residual of 1 pixel is assigned an IRLS weight of 1. + /// However as larger motions in general are affected by a larger error, we + /// normalize irls weights, such that a residual + /// of distance of irls_motion_magnitude_fraction times + /// <average translation magnitude> equals an IRLS weight of 1. + /// Must be larger than zero. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IrlsMotionMagnitudeFraction { + get { if ((_hasBits0 & 1048576) != 0) { return irlsMotionMagnitudeFraction_; } else { return IrlsMotionMagnitudeFractionDefaultValue; } } + set { + _hasBits0 |= 1048576; + irlsMotionMagnitudeFraction_ = value; + } + } + /// Gets whether the "irls_motion_magnitude_fraction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsMotionMagnitudeFraction { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "irls_motion_magnitude_fraction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsMotionMagnitudeFraction() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "irls_mixture_fraction_scale" field. + public const int IrlsMixtureFractionScaleFieldNumber = 68; + private readonly static float IrlsMixtureFractionScaleDefaultValue = 1.5F; + + private float irlsMixtureFractionScale_; + /// + /// Scale that is applied for mixture (where error is expected to be bigger). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IrlsMixtureFractionScale { + get { if ((_hasBits1 & 32768) != 0) { return irlsMixtureFractionScale_; } else { return IrlsMixtureFractionScaleDefaultValue; } } + set { + _hasBits1 |= 32768; + irlsMixtureFractionScale_ = value; + } + } + /// Gets whether the "irls_mixture_fraction_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsMixtureFractionScale { + get { return (_hasBits1 & 32768) != 0; } + } + /// Clears the value of the "irls_mixture_fraction_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsMixtureFractionScale() { + _hasBits1 &= ~32768; + } + + /// Field number for the "irls_weights_preinitialized" field. + public const int IrlsWeightsPreinitializedFieldNumber = 39; + private readonly static bool IrlsWeightsPreinitializedDefaultValue = false; + + private bool irlsWeightsPreinitialized_; + /// + /// By default, irls weight of all features are set uniformly to one before + /// estimating EACH model, refining them in subsequent irls iterations. + /// If flag below is set, input irls weights are used instead for each motion + /// model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IrlsWeightsPreinitialized { + get { if ((_hasBits0 & 16777216) != 0) { return irlsWeightsPreinitialized_; } else { return IrlsWeightsPreinitializedDefaultValue; } } + set { + _hasBits0 |= 16777216; + irlsWeightsPreinitialized_ = value; + } + } + /// Gets whether the "irls_weights_preinitialized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsWeightsPreinitialized { + get { return (_hasBits0 & 16777216) != 0; } + } + /// Clears the value of the "irls_weights_preinitialized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsWeightsPreinitialized() { + _hasBits0 &= ~16777216; + } + + /// Field number for the "filter_initialized_irls_weights" field. + public const int FilterInitializedIrlsWeightsFieldNumber = 67; + private readonly static bool FilterInitializedIrlsWeightsDefaultValue = false; + + private bool filterInitializedIrlsWeights_; + /// + /// If weights are pre-initialized optionally min filter weights along track + /// ids when long tracks are used. This can be used to consistently label + /// outliers in time before estimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FilterInitializedIrlsWeights { + get { if ((_hasBits1 & 16384) != 0) { return filterInitializedIrlsWeights_; } else { return FilterInitializedIrlsWeightsDefaultValue; } } + set { + _hasBits1 |= 16384; + filterInitializedIrlsWeights_ = value; + } + } + /// Gets whether the "filter_initialized_irls_weights" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilterInitializedIrlsWeights { + get { return (_hasBits1 & 16384) != 0; } + } + /// Clears the value of the "filter_initialized_irls_weights" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilterInitializedIrlsWeights() { + _hasBits1 &= ~16384; + } + + /// Field number for the "irls_initialization" field. + public const int IrlsInitializationFieldNumber = 56; + private global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization irlsInitialization_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization IrlsInitialization { + get { return irlsInitialization_; } + set { + irlsInitialization_ = value; + } + } + + /// Field number for the "feature_density_normalization" field. + public const int FeatureDensityNormalizationFieldNumber = 62; + private readonly static bool FeatureDensityNormalizationDefaultValue = false; + + private bool featureDensityNormalization_; + /// + /// Normalizes feature's irls weights prior to estimation such that + /// feature in high density areas are downweighted. Multiplicative in case + /// irls_weights_preinitialized is set to true. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FeatureDensityNormalization { + get { if ((_hasBits1 & 2048) != 0) { return featureDensityNormalization_; } else { return FeatureDensityNormalizationDefaultValue; } } + set { + _hasBits1 |= 2048; + featureDensityNormalization_ = value; + } + } + /// Gets whether the "feature_density_normalization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureDensityNormalization { + get { return (_hasBits1 & 2048) != 0; } + } + /// Clears the value of the "feature_density_normalization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureDensityNormalization() { + _hasBits1 &= ~2048; + } + + /// Field number for the "feature_mask_size" field. + public const int FeatureMaskSizeFieldNumber = 63; + private readonly static int FeatureMaskSizeDefaultValue = 10; + + private int featureMaskSize_; + /// + /// A regular grid of size feature_mask_size x feature_mask_size + /// is used to normalize features w.r.t. their density. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FeatureMaskSize { + get { if ((_hasBits1 & 4096) != 0) { return featureMaskSize_; } else { return FeatureMaskSizeDefaultValue; } } + set { + _hasBits1 |= 4096; + featureMaskSize_ = value; + } + } + /// Gets whether the "feature_mask_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureMaskSize { + get { return (_hasBits1 & 4096) != 0; } + } + /// Clears the value of the "feature_mask_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureMaskSize() { + _hasBits1 &= ~4096; + } + + /// Field number for the "long_feature_initialization" field. + public const int LongFeatureInitializationFieldNumber = 66; + private global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization longFeatureInitialization_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization LongFeatureInitialization { + get { return longFeatureInitialization_; } + set { + longFeatureInitialization_ = value; + } + } + + /// Field number for the "irls_mask_options" field. + public const int IrlsMaskOptionsFieldNumber = 57; + private global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions irlsMaskOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions IrlsMaskOptions { + get { return irlsMaskOptions_; } + set { + irlsMaskOptions_ = value; + } + } + + /// Field number for the "joint_track_estimation" field. + public const int JointTrackEstimationFieldNumber = 59; + private global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions jointTrackEstimation_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions JointTrackEstimation { + get { return jointTrackEstimation_; } + set { + jointTrackEstimation_ = value; + } + } + + /// Field number for the "long_feature_bias_options" field. + public const int LongFeatureBiasOptionsFieldNumber = 64; + private global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions longFeatureBiasOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions LongFeatureBiasOptions { + get { return longFeatureBiasOptions_; } + set { + longFeatureBiasOptions_ = value; + } + } + + /// Field number for the "estimation_policy" field. + public const int EstimationPolicyFieldNumber = 58; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy EstimationPolicyDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy.IndependentParallel; + + private global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy estimationPolicy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy EstimationPolicy { + get { if ((_hasBits1 & 512) != 0) { return estimationPolicy_; } else { return EstimationPolicyDefaultValue; } } + set { + _hasBits1 |= 512; + estimationPolicy_ = value; + } + } + /// Gets whether the "estimation_policy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEstimationPolicy { + get { return (_hasBits1 & 512) != 0; } + } + /// Clears the value of the "estimation_policy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEstimationPolicy() { + _hasBits1 &= ~512; + } + + /// Field number for the "coverage_grid_size" field. + public const int CoverageGridSizeFieldNumber = 51; + private readonly static int CoverageGridSizeDefaultValue = 10; + + private int coverageGridSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CoverageGridSize { + get { if ((_hasBits1 & 16) != 0) { return coverageGridSize_; } else { return CoverageGridSizeDefaultValue; } } + set { + _hasBits1 |= 16; + coverageGridSize_ = value; + } + } + /// Gets whether the "coverage_grid_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCoverageGridSize { + get { return (_hasBits1 & 16) != 0; } + } + /// Clears the value of the "coverage_grid_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCoverageGridSize() { + _hasBits1 &= ~16; + } + + /// Field number for the "mixture_model_mode" field. + public const int MixtureModelModeFieldNumber = 23; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode MixtureModelModeDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode.SkewRotationMixture; + + private global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode mixtureModelMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode MixtureModelMode { + get { if ((_hasBits0 & 4096) != 0) { return mixtureModelMode_; } else { return MixtureModelModeDefaultValue; } } + set { + _hasBits0 |= 4096; + mixtureModelMode_ = value; + } + } + /// Gets whether the "mixture_model_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureModelMode { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "mixture_model_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureModelMode() { + _hasBits0 &= ~4096; + } + + /// Field number for the "use_only_lin_sim_inliers_for_homography" field. + public const int UseOnlyLinSimInliersForHomographyFieldNumber = 6; + private readonly static bool UseOnlyLinSimInliersForHomographyDefaultValue = true; + + private bool useOnlyLinSimInliersForHomography_; + /// + /// If specified, only features that agree with the estimated linear similarity + /// will be used to estimate the homography. + /// If set, linear_similarity_estimation can not be ESTIMATION_NONE! (checked) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseOnlyLinSimInliersForHomography { + get { if ((_hasBits0 & 16) != 0) { return useOnlyLinSimInliersForHomography_; } else { return UseOnlyLinSimInliersForHomographyDefaultValue; } } + set { + _hasBits0 |= 16; + useOnlyLinSimInliersForHomography_ = value; + } + } + /// Gets whether the "use_only_lin_sim_inliers_for_homography" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseOnlyLinSimInliersForHomography { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "use_only_lin_sim_inliers_for_homography" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseOnlyLinSimInliersForHomography() { + _hasBits0 &= ~16; + } + + /// Field number for the "lin_sim_inlier_threshold" field. + public const int LinSimInlierThresholdFieldNumber = 20; + private readonly static float LinSimInlierThresholdDefaultValue = 0.003F; + + private float linSimInlierThreshold_; + /// + /// Max. deviation to be considered an inlier w.r.t. estimated similarity for + /// above flag. This value is set w.r.t. normalized frame diameter. + /// TODO: Should take GetIRLSResidualScale into account. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LinSimInlierThreshold { + get { if ((_hasBits0 & 1024) != 0) { return linSimInlierThreshold_; } else { return LinSimInlierThresholdDefaultValue; } } + set { + _hasBits0 |= 1024; + linSimInlierThreshold_ = value; + } + } + /// Gets whether the "lin_sim_inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLinSimInlierThreshold { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "lin_sim_inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLinSimInlierThreshold() { + _hasBits0 &= ~1024; + } + + /// Field number for the "stable_translation_bounds" field. + public const int StableTranslationBoundsFieldNumber = 32; + private global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds stableTranslationBounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds StableTranslationBounds { + get { return stableTranslationBounds_; } + set { + stableTranslationBounds_ = value; + } + } + + /// Field number for the "stable_similarity_bounds" field. + public const int StableSimilarityBoundsFieldNumber = 33; + private global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds stableSimilarityBounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds StableSimilarityBounds { + get { return stableSimilarityBounds_; } + set { + stableSimilarityBounds_ = value; + } + } + + /// Field number for the "stable_homography_bounds" field. + public const int StableHomographyBoundsFieldNumber = 11; + private global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds stableHomographyBounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds StableHomographyBounds { + get { return stableHomographyBounds_; } + set { + stableHomographyBounds_ = value; + } + } + + /// Field number for the "stable_mixture_homography_bounds" field. + public const int StableMixtureHomographyBoundsFieldNumber = 34; + private global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds stableMixtureHomographyBounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds StableMixtureHomographyBounds { + get { return stableMixtureHomographyBounds_; } + set { + stableMixtureHomographyBounds_ = value; + } + } + + /// Field number for the "strict_coverage_scale" field. + public const int StrictCoverageScaleFieldNumber = 41; + private readonly static float StrictCoverageScaleDefaultValue = 1.333F; + + private float strictCoverageScale_; + /// + /// Scale for stricter coverage evaluation. Used for rolling shutter guess + /// computation, by only using high quality inliers. Larger values reflect + /// stricter coverage. + /// Specifically, when computing coverage via GridCoverage call, + /// frac_inlier_threshold is reduced (divided) by specified scale below. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StrictCoverageScale { + get { if ((_hasBits0 & 67108864) != 0) { return strictCoverageScale_; } else { return StrictCoverageScaleDefaultValue; } } + set { + _hasBits0 |= 67108864; + strictCoverageScale_ = value; + } + } + /// Gets whether the "strict_coverage_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStrictCoverageScale { + get { return (_hasBits0 & 67108864) != 0; } + } + /// Clears the value of the "strict_coverage_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStrictCoverageScale() { + _hasBits0 &= ~67108864; + } + + /// Field number for the "label_empty_frames_as_valid" field. + public const int LabelEmptyFramesAsValidFieldNumber = 22; + private readonly static bool LabelEmptyFramesAsValidDefaultValue = true; + + private bool labelEmptyFramesAsValid_; + /// + /// By default frames with zero trackable features (e.g. at the beginning, + /// empty frame or shot boundary) are set identity model but still labeled as + /// valid. If set to false, these frames are flagged as invalid, which can be + /// useful to locate shot boundaries, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool LabelEmptyFramesAsValid { + get { if ((_hasBits0 & 2048) != 0) { return labelEmptyFramesAsValid_; } else { return LabelEmptyFramesAsValidDefaultValue; } } + set { + _hasBits0 |= 2048; + labelEmptyFramesAsValid_ = value; + } + } + /// Gets whether the "label_empty_frames_as_valid" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabelEmptyFramesAsValid { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "label_empty_frames_as_valid" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabelEmptyFramesAsValid() { + _hasBits0 &= ~2048; + } + + /// Field number for the "feature_grid_size" field. + public const int FeatureGridSizeFieldNumber = 24; + private readonly static float FeatureGridSizeDefaultValue = 0.05F; + + private float featureGridSize_; + /// + /// Setting for temporal smoothing of irls weights in optional post-processing + /// step. + /// In normalized coordinates w.r.t. frame domain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FeatureGridSize { + get { if ((_hasBits0 & 8192) != 0) { return featureGridSize_; } else { return FeatureGridSizeDefaultValue; } } + set { + _hasBits0 |= 8192; + featureGridSize_ = value; + } + } + /// Gets whether the "feature_grid_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureGridSize { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "feature_grid_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureGridSize() { + _hasBits0 &= ~8192; + } + + /// Field number for the "spatial_sigma" field. + public const int SpatialSigmaFieldNumber = 25; + private readonly static float SpatialSigmaDefaultValue = 0.01F; + + private float spatialSigma_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SpatialSigma { + get { if ((_hasBits0 & 16384) != 0) { return spatialSigma_; } else { return SpatialSigmaDefaultValue; } } + set { + _hasBits0 |= 16384; + spatialSigma_ = value; + } + } + /// Gets whether the "spatial_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSpatialSigma { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "spatial_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSpatialSigma() { + _hasBits0 &= ~16384; + } + + /// Field number for the "temporal_irls_diameter" field. + public const int TemporalIrlsDiameterFieldNumber = 26; + private readonly static int TemporalIrlsDiameterDefaultValue = 20; + + private int temporalIrlsDiameter_; + /// + /// Frame diameter across which smoothing is performed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TemporalIrlsDiameter { + get { if ((_hasBits0 & 32768) != 0) { return temporalIrlsDiameter_; } else { return TemporalIrlsDiameterDefaultValue; } } + set { + _hasBits0 |= 32768; + temporalIrlsDiameter_ = value; + } + } + /// Gets whether the "temporal_irls_diameter" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTemporalIrlsDiameter { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "temporal_irls_diameter" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTemporalIrlsDiameter() { + _hasBits0 &= ~32768; + } + + /// Field number for the "temporal_sigma" field. + public const int TemporalSigmaFieldNumber = 27; + private readonly static float TemporalSigmaDefaultValue = 5F; + + private float temporalSigma_; + /// + /// in frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TemporalSigma { + get { if ((_hasBits0 & 65536) != 0) { return temporalSigma_; } else { return TemporalSigmaDefaultValue; } } + set { + _hasBits0 |= 65536; + temporalSigma_ = value; + } + } + /// Gets whether the "temporal_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTemporalSigma { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "temporal_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTemporalSigma() { + _hasBits0 &= ~65536; + } + + /// Field number for the "feature_sigma" field. + public const int FeatureSigmaFieldNumber = 28; + private readonly static float FeatureSigmaDefaultValue = 30F; + + private float featureSigma_; + /// + /// Bilateral weight (for un-normalized color domain [0, .. 255]). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FeatureSigma { + get { if ((_hasBits0 & 131072) != 0) { return featureSigma_; } else { return FeatureSigmaDefaultValue; } } + set { + _hasBits0 |= 131072; + featureSigma_ = value; + } + } + /// Gets whether the "feature_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureSigma { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "feature_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureSigma() { + _hasBits0 &= ~131072; + } + + /// Field number for the "filter_5_taps" field. + public const int Filter5TapsFieldNumber = 29; + private readonly static bool Filter5TapsDefaultValue = false; + + private bool filter5Taps_; + /// + /// If set to false 3 taps are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Filter5Taps { + get { if ((_hasBits0 & 262144) != 0) { return filter5Taps_; } else { return Filter5TapsDefaultValue; } } + set { + _hasBits0 |= 262144; + filter5Taps_ = value; + } + } + /// Gets whether the "filter_5_taps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilter5Taps { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "filter_5_taps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilter5Taps() { + _hasBits0 &= ~262144; + } + + /// Field number for the "frame_confidence_weighting" field. + public const int FrameConfidenceWeightingFieldNumber = 48; + private readonly static bool FrameConfidenceWeightingDefaultValue = true; + + private bool frameConfidenceWeighting_; + /// + /// If set, during temporal smoothing, each frame is weighted by its + /// confidence, defined as the square coverage (or square mean mixture + /// coverage). Therefore, low confidence fits do not errornouesly propagate + /// over time. In addition, if the confidence is below the specified + /// confidence_threshold (relative the the maximum coverage observed in the + /// test interval), irls weights are reset to 1, i.e. biased to be + /// agree with the (unkown) background motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FrameConfidenceWeighting { + get { if ((_hasBits1 & 2) != 0) { return frameConfidenceWeighting_; } else { return FrameConfidenceWeightingDefaultValue; } } + set { + _hasBits1 |= 2; + frameConfidenceWeighting_ = value; + } + } + /// Gets whether the "frame_confidence_weighting" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameConfidenceWeighting { + get { return (_hasBits1 & 2) != 0; } + } + /// Clears the value of the "frame_confidence_weighting" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameConfidenceWeighting() { + _hasBits1 &= ~2; + } + + /// Field number for the "reset_confidence_threshold" field. + public const int ResetConfidenceThresholdFieldNumber = 49; + private readonly static float ResetConfidenceThresholdDefaultValue = 0.4F; + + private float resetConfidenceThreshold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ResetConfidenceThreshold { + get { if ((_hasBits1 & 4) != 0) { return resetConfidenceThreshold_; } else { return ResetConfidenceThresholdDefaultValue; } } + set { + _hasBits1 |= 4; + resetConfidenceThreshold_ = value; + } + } + /// Gets whether the "reset_confidence_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasResetConfidenceThreshold { + get { return (_hasBits1 & 4) != 0; } + } + /// Clears the value of the "reset_confidence_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearResetConfidenceThreshold() { + _hasBits1 &= ~4; + } + + /// Field number for the "irls_weight_filter" field. + public const int IrlsWeightFilterFieldNumber = 35; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter IrlsWeightFilterDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter.IrlsFilterNone; + + private global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter irlsWeightFilter_; + /// + /// Calls TextureFilteredRegionFlowFeatureIRLSWeights on computed irls weights + /// before smoothing them. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter IrlsWeightFilter { + get { if ((_hasBits0 & 2097152) != 0) { return irlsWeightFilter_; } else { return IrlsWeightFilterDefaultValue; } } + set { + _hasBits0 |= 2097152; + irlsWeightFilter_ = value; + } + } + /// Gets whether the "irls_weight_filter" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsWeightFilter { + get { return (_hasBits0 & 2097152) != 0; } + } + /// Clears the value of the "irls_weight_filter" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsWeightFilter() { + _hasBits0 &= ~2097152; + } + + /// Field number for the "overlay_detection" field. + public const int OverlayDetectionFieldNumber = 36; + private readonly static bool OverlayDetectionDefaultValue = false; + + private bool overlayDetection_; + /// + /// Attempts to detect overlays, i.e. static elements burned-into the video + /// that potentially corrupt motion estimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OverlayDetection { + get { if ((_hasBits0 & 4194304) != 0) { return overlayDetection_; } else { return OverlayDetectionDefaultValue; } } + set { + _hasBits0 |= 4194304; + overlayDetection_ = value; + } + } + /// Gets whether the "overlay_detection" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlayDetection { + get { return (_hasBits0 & 4194304) != 0; } + } + /// Clears the value of the "overlay_detection" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlayDetection() { + _hasBits0 &= ~4194304; + } + + /// Field number for the "overlay_analysis_chunk_size" field. + public const int OverlayAnalysisChunkSizeFieldNumber = 37; + private readonly static int OverlayAnalysisChunkSizeDefaultValue = 8; + + private int overlayAnalysisChunkSize_; + /// + /// Overlay detection is performed over specified number of frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OverlayAnalysisChunkSize { + get { if ((_hasBits0 & 8388608) != 0) { return overlayAnalysisChunkSize_; } else { return OverlayAnalysisChunkSizeDefaultValue; } } + set { + _hasBits0 |= 8388608; + overlayAnalysisChunkSize_ = value; + } + } + /// Gets whether the "overlay_analysis_chunk_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlayAnalysisChunkSize { + get { return (_hasBits0 & 8388608) != 0; } + } + /// Clears the value of the "overlay_analysis_chunk_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlayAnalysisChunkSize() { + _hasBits0 &= ~8388608; + } + + /// Field number for the "overlay_detection_options" field. + public const int OverlayDetectionOptionsFieldNumber = 38; + private global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions overlayDetectionOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions OverlayDetectionOptions { + get { return overlayDetectionOptions_; } + set { + overlayDetectionOptions_ = value; + } + } + + /// Field number for the "shot_boundary_options" field. + public const int ShotBoundaryOptionsFieldNumber = 60; + private global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions shotBoundaryOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions ShotBoundaryOptions { + get { return shotBoundaryOptions_; } + set { + shotBoundaryOptions_ = value; + } + } + + /// Field number for the "output_refined_irls_weights" field. + public const int OutputRefinedIrlsWeightsFieldNumber = 40; + private readonly static bool OutputRefinedIrlsWeightsDefaultValue = true; + + private bool outputRefinedIrlsWeights_; + /// + /// By default, irls weights of each feature are overwritten with refined irls + /// weights of the last iteration for the highest degree of freedom model that + /// was estimated stable. If set to false, original irls weights are retained. + /// Note: If overlay detection is activated, features to be deemed overlays + /// have their irls weight set to zero, regardless of this setting. + /// Similarily, an IRLSWeightFilter is applied if requested, regardless + /// of this setting. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OutputRefinedIrlsWeights { + get { if ((_hasBits0 & 33554432) != 0) { return outputRefinedIrlsWeights_; } else { return OutputRefinedIrlsWeightsDefaultValue; } } + set { + _hasBits0 |= 33554432; + outputRefinedIrlsWeights_ = value; + } + } + /// Gets whether the "output_refined_irls_weights" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputRefinedIrlsWeights { + get { return (_hasBits0 & 33554432) != 0; } + } + /// Clears the value of the "output_refined_irls_weights" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputRefinedIrlsWeights() { + _hasBits0 &= ~33554432; + } + + /// Field number for the "homography_irls_weight_initialization" field. + public const int HomographyIrlsWeightInitializationFieldNumber = 45; + private readonly static global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization HomographyIrlsWeightInitializationDefaultValue = global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization.IrlsWeightPerimeterGaussian; + + private global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization homographyIrlsWeightInitialization_; + /// + /// IRLS weights for homography estimation are initialized based on the + /// specified options. If, options irls_weights_preinitialized is set, + /// weights are multiplied instead of reset. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization HomographyIrlsWeightInitialization { + get { if ((_hasBits0 & 1073741824) != 0) { return homographyIrlsWeightInitialization_; } else { return HomographyIrlsWeightInitializationDefaultValue; } } + set { + _hasBits0 |= 1073741824; + homographyIrlsWeightInitialization_ = value; + } + } + /// Gets whether the "homography_irls_weight_initialization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHomographyIrlsWeightInitialization { + get { return (_hasBits0 & 1073741824) != 0; } + } + /// Clears the value of the "homography_irls_weight_initialization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHomographyIrlsWeightInitialization() { + _hasBits0 &= ~1073741824; + } + + /// Field number for the "irls_use_l0_norm" field. + public const int IrlsUseL0NormFieldNumber = 46; + private readonly static bool IrlsUseL0NormDefaultValue = true; + + private bool irlsUseL0Norm_; + /// + /// If set to false use L1 norm irls weights instead of L0 norm irls weights. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IrlsUseL0Norm { + get { if ((_hasBits0 & -2147483648) != 0) { return irlsUseL0Norm_; } else { return IrlsUseL0NormDefaultValue; } } + set { + _hasBits0 |= -2147483648; + irlsUseL0Norm_ = value; + } + } + /// Gets whether the "irls_use_l0_norm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsUseL0Norm { + get { return (_hasBits0 & -2147483648) != 0; } + } + /// Clears the value of the "irls_use_l0_norm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsUseL0Norm() { + _hasBits0 &= ~-2147483648; + } + + /// Field number for the "domain_limited_irls_scaling" field. + public const int DomainLimitedIrlsScalingFieldNumber = 65; + private readonly static bool DomainLimitedIrlsScalingDefaultValue = false; + + private bool domainLimitedIrlsScaling_; + /// + /// IRLS weights are determined in a limited domain (in particular helpful + /// for stabilization analysis on HD videos). + /// TODO: Make this the default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DomainLimitedIrlsScaling { + get { if ((_hasBits1 & 8192) != 0) { return domainLimitedIrlsScaling_; } else { return DomainLimitedIrlsScalingDefaultValue; } } + set { + _hasBits1 |= 8192; + domainLimitedIrlsScaling_ = value; + } + } + /// Gets whether the "domain_limited_irls_scaling" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDomainLimitedIrlsScaling { + get { return (_hasBits1 & 8192) != 0; } + } + /// Clears the value of the "domain_limited_irls_scaling" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDomainLimitedIrlsScaling() { + _hasBits1 &= ~8192; + } + + /// Field number for the "deactivate_stable_motion_estimation" field. + public const int DeactivateStableMotionEstimationFieldNumber = 47; + private readonly static bool DeactivateStableMotionEstimationDefaultValue = false; + + private bool deactivateStableMotionEstimation_; + /// + /// For comparison and debugging purposes. Simply estimates requested models + /// without checking their stability via the stable_*_bounds parameters. + /// However, invertibility is still checked to avoid invalid data being passed + /// to later stages of the stabilizer. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DeactivateStableMotionEstimation { + get { if ((_hasBits1 & 1) != 0) { return deactivateStableMotionEstimation_; } else { return DeactivateStableMotionEstimationDefaultValue; } } + set { + _hasBits1 |= 1; + deactivateStableMotionEstimation_ = value; + } + } + /// Gets whether the "deactivate_stable_motion_estimation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDeactivateStableMotionEstimation { + get { return (_hasBits1 & 1) != 0; } + } + /// Clears the value of the "deactivate_stable_motion_estimation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDeactivateStableMotionEstimation() { + _hasBits1 &= ~1; + } + + /// Field number for the "project_valid_motions_down" field. + public const int ProjectValidMotionsDownFieldNumber = 52; + private readonly static bool ProjectValidMotionsDownDefaultValue = false; + + private bool projectValidMotionsDown_; + /// + /// Projects higher order motions if estimated correctly down to lower order + /// motions, therefore replacing the previously estimated motions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ProjectValidMotionsDown { + get { if ((_hasBits1 & 32) != 0) { return projectValidMotionsDown_; } else { return ProjectValidMotionsDownDefaultValue; } } + set { + _hasBits1 |= 32; + projectValidMotionsDown_ = value; + } + } + /// Gets whether the "project_valid_motions_down" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasProjectValidMotionsDown { + get { return (_hasBits1 & 32) != 0; } + } + /// Clears the value of the "project_valid_motions_down" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearProjectValidMotionsDown() { + _hasBits1 &= ~32; + } + + /// Field number for the "estimate_similarity" field. + public const int EstimateSimilarityFieldNumber = 2; + private readonly static bool EstimateSimilarityDefaultValue = false; + + private bool estimateSimilarity_; + /// + /// DEPRECATED functionality. Use static functions as indicated instead. + /// + /// Non-linear similarity, use MotionEstimation::EstimateSimilarityModelL2. + /// + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool EstimateSimilarity { + get { if ((_hasBits0 & 2) != 0) { return estimateSimilarity_; } else { return EstimateSimilarityDefaultValue; } } + set { + _hasBits0 |= 2; + estimateSimilarity_ = value; + } + } + /// Gets whether the "estimate_similarity" field is set + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasEstimateSimilarity { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "estimate_similarity" field + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearEstimateSimilarity() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionEstimationOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionEstimationOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (EstimateTranslationIrls != other.EstimateTranslationIrls) return false; + if (LinearSimilarityEstimation != other.LinearSimilarityEstimation) return false; + if (AffineEstimation != other.AffineEstimation) return false; + if (HomographyEstimation != other.HomographyEstimation) return false; + if (HomographyExactDenominatorScaling != other.HomographyExactDenominatorScaling) return false; + if (UseExactHomographyEstimation != other.UseExactHomographyEstimation) return false; + if (UseHighestAccuracyForNormalEquations != other.UseHighestAccuracyForNormalEquations) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HomographyPerspectiveRegularizer, other.HomographyPerspectiveRegularizer)) return false; + if (MixHomographyEstimation != other.MixHomographyEstimation) return false; + if (NumMixtures != other.NumMixtures) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureRowSigma, other.MixtureRowSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureRegularizer, other.MixtureRegularizer)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureRegularizerLevels, other.MixtureRegularizerLevels)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureRegularizerBase, other.MixtureRegularizerBase)) return false; + if (MixtureRsAnalysisLevel != other.MixtureRsAnalysisLevel) return false; + if (IrlsRounds != other.IrlsRounds) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IrlsPriorScale, other.IrlsPriorScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IrlsMotionMagnitudeFraction, other.IrlsMotionMagnitudeFraction)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IrlsMixtureFractionScale, other.IrlsMixtureFractionScale)) return false; + if (IrlsWeightsPreinitialized != other.IrlsWeightsPreinitialized) return false; + if (FilterInitializedIrlsWeights != other.FilterInitializedIrlsWeights) return false; + if (!object.Equals(IrlsInitialization, other.IrlsInitialization)) return false; + if (FeatureDensityNormalization != other.FeatureDensityNormalization) return false; + if (FeatureMaskSize != other.FeatureMaskSize) return false; + if (!object.Equals(LongFeatureInitialization, other.LongFeatureInitialization)) return false; + if (!object.Equals(IrlsMaskOptions, other.IrlsMaskOptions)) return false; + if (!object.Equals(JointTrackEstimation, other.JointTrackEstimation)) return false; + if (!object.Equals(LongFeatureBiasOptions, other.LongFeatureBiasOptions)) return false; + if (EstimationPolicy != other.EstimationPolicy) return false; + if (CoverageGridSize != other.CoverageGridSize) return false; + if (MixtureModelMode != other.MixtureModelMode) return false; + if (UseOnlyLinSimInliersForHomography != other.UseOnlyLinSimInliersForHomography) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LinSimInlierThreshold, other.LinSimInlierThreshold)) return false; + if (!object.Equals(StableTranslationBounds, other.StableTranslationBounds)) return false; + if (!object.Equals(StableSimilarityBounds, other.StableSimilarityBounds)) return false; + if (!object.Equals(StableHomographyBounds, other.StableHomographyBounds)) return false; + if (!object.Equals(StableMixtureHomographyBounds, other.StableMixtureHomographyBounds)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StrictCoverageScale, other.StrictCoverageScale)) return false; + if (LabelEmptyFramesAsValid != other.LabelEmptyFramesAsValid) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FeatureGridSize, other.FeatureGridSize)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SpatialSigma, other.SpatialSigma)) return false; + if (TemporalIrlsDiameter != other.TemporalIrlsDiameter) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TemporalSigma, other.TemporalSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FeatureSigma, other.FeatureSigma)) return false; + if (Filter5Taps != other.Filter5Taps) return false; + if (FrameConfidenceWeighting != other.FrameConfidenceWeighting) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ResetConfidenceThreshold, other.ResetConfidenceThreshold)) return false; + if (IrlsWeightFilter != other.IrlsWeightFilter) return false; + if (OverlayDetection != other.OverlayDetection) return false; + if (OverlayAnalysisChunkSize != other.OverlayAnalysisChunkSize) return false; + if (!object.Equals(OverlayDetectionOptions, other.OverlayDetectionOptions)) return false; + if (!object.Equals(ShotBoundaryOptions, other.ShotBoundaryOptions)) return false; + if (OutputRefinedIrlsWeights != other.OutputRefinedIrlsWeights) return false; + if (HomographyIrlsWeightInitialization != other.HomographyIrlsWeightInitialization) return false; + if (IrlsUseL0Norm != other.IrlsUseL0Norm) return false; + if (DomainLimitedIrlsScaling != other.DomainLimitedIrlsScaling) return false; + if (DeactivateStableMotionEstimation != other.DeactivateStableMotionEstimation) return false; + if (ProjectValidMotionsDown != other.ProjectValidMotionsDown) return false; + if (EstimateSimilarity != other.EstimateSimilarity) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasEstimateTranslationIrls) hash ^= EstimateTranslationIrls.GetHashCode(); + if (HasLinearSimilarityEstimation) hash ^= LinearSimilarityEstimation.GetHashCode(); + if (HasAffineEstimation) hash ^= AffineEstimation.GetHashCode(); + if (HasHomographyEstimation) hash ^= HomographyEstimation.GetHashCode(); + if (HasHomographyExactDenominatorScaling) hash ^= HomographyExactDenominatorScaling.GetHashCode(); + if (HasUseExactHomographyEstimation) hash ^= UseExactHomographyEstimation.GetHashCode(); + if (HasUseHighestAccuracyForNormalEquations) hash ^= UseHighestAccuracyForNormalEquations.GetHashCode(); + if (HasHomographyPerspectiveRegularizer) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HomographyPerspectiveRegularizer); + if (HasMixHomographyEstimation) hash ^= MixHomographyEstimation.GetHashCode(); + if (HasNumMixtures) hash ^= NumMixtures.GetHashCode(); + if (HasMixtureRowSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureRowSigma); + if (HasMixtureRegularizer) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureRegularizer); + if (HasMixtureRegularizerLevels) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureRegularizerLevels); + if (HasMixtureRegularizerBase) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureRegularizerBase); + if (HasMixtureRsAnalysisLevel) hash ^= MixtureRsAnalysisLevel.GetHashCode(); + if (HasIrlsRounds) hash ^= IrlsRounds.GetHashCode(); + if (HasIrlsPriorScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IrlsPriorScale); + if (HasIrlsMotionMagnitudeFraction) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IrlsMotionMagnitudeFraction); + if (HasIrlsMixtureFractionScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IrlsMixtureFractionScale); + if (HasIrlsWeightsPreinitialized) hash ^= IrlsWeightsPreinitialized.GetHashCode(); + if (HasFilterInitializedIrlsWeights) hash ^= FilterInitializedIrlsWeights.GetHashCode(); + if (irlsInitialization_ != null) hash ^= IrlsInitialization.GetHashCode(); + if (HasFeatureDensityNormalization) hash ^= FeatureDensityNormalization.GetHashCode(); + if (HasFeatureMaskSize) hash ^= FeatureMaskSize.GetHashCode(); + if (longFeatureInitialization_ != null) hash ^= LongFeatureInitialization.GetHashCode(); + if (irlsMaskOptions_ != null) hash ^= IrlsMaskOptions.GetHashCode(); + if (jointTrackEstimation_ != null) hash ^= JointTrackEstimation.GetHashCode(); + if (longFeatureBiasOptions_ != null) hash ^= LongFeatureBiasOptions.GetHashCode(); + if (HasEstimationPolicy) hash ^= EstimationPolicy.GetHashCode(); + if (HasCoverageGridSize) hash ^= CoverageGridSize.GetHashCode(); + if (HasMixtureModelMode) hash ^= MixtureModelMode.GetHashCode(); + if (HasUseOnlyLinSimInliersForHomography) hash ^= UseOnlyLinSimInliersForHomography.GetHashCode(); + if (HasLinSimInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LinSimInlierThreshold); + if (stableTranslationBounds_ != null) hash ^= StableTranslationBounds.GetHashCode(); + if (stableSimilarityBounds_ != null) hash ^= StableSimilarityBounds.GetHashCode(); + if (stableHomographyBounds_ != null) hash ^= StableHomographyBounds.GetHashCode(); + if (stableMixtureHomographyBounds_ != null) hash ^= StableMixtureHomographyBounds.GetHashCode(); + if (HasStrictCoverageScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StrictCoverageScale); + if (HasLabelEmptyFramesAsValid) hash ^= LabelEmptyFramesAsValid.GetHashCode(); + if (HasFeatureGridSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FeatureGridSize); + if (HasSpatialSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SpatialSigma); + if (HasTemporalIrlsDiameter) hash ^= TemporalIrlsDiameter.GetHashCode(); + if (HasTemporalSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TemporalSigma); + if (HasFeatureSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FeatureSigma); + if (HasFilter5Taps) hash ^= Filter5Taps.GetHashCode(); + if (HasFrameConfidenceWeighting) hash ^= FrameConfidenceWeighting.GetHashCode(); + if (HasResetConfidenceThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ResetConfidenceThreshold); + if (HasIrlsWeightFilter) hash ^= IrlsWeightFilter.GetHashCode(); + if (HasOverlayDetection) hash ^= OverlayDetection.GetHashCode(); + if (HasOverlayAnalysisChunkSize) hash ^= OverlayAnalysisChunkSize.GetHashCode(); + if (overlayDetectionOptions_ != null) hash ^= OverlayDetectionOptions.GetHashCode(); + if (shotBoundaryOptions_ != null) hash ^= ShotBoundaryOptions.GetHashCode(); + if (HasOutputRefinedIrlsWeights) hash ^= OutputRefinedIrlsWeights.GetHashCode(); + if (HasHomographyIrlsWeightInitialization) hash ^= HomographyIrlsWeightInitialization.GetHashCode(); + if (HasIrlsUseL0Norm) hash ^= IrlsUseL0Norm.GetHashCode(); + if (HasDomainLimitedIrlsScaling) hash ^= DomainLimitedIrlsScaling.GetHashCode(); + if (HasDeactivateStableMotionEstimation) hash ^= DeactivateStableMotionEstimation.GetHashCode(); + if (HasProjectValidMotionsDown) hash ^= ProjectValidMotionsDown.GetHashCode(); + if (HasEstimateSimilarity) hash ^= EstimateSimilarity.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasEstimateTranslationIrls) { + output.WriteRawTag(8); + output.WriteBool(EstimateTranslationIrls); + } + if (HasEstimateSimilarity) { + output.WriteRawTag(16); + output.WriteBool(EstimateSimilarity); + } + if (HasLinearSimilarityEstimation) { + output.WriteRawTag(24); + output.WriteEnum((int) LinearSimilarityEstimation); + } + if (HasHomographyEstimation) { + output.WriteRawTag(40); + output.WriteEnum((int) HomographyEstimation); + } + if (HasUseOnlyLinSimInliersForHomography) { + output.WriteRawTag(48); + output.WriteBool(UseOnlyLinSimInliersForHomography); + } + if (stableHomographyBounds_ != null) { + output.WriteRawTag(90); + output.WriteMessage(StableHomographyBounds); + } + if (HasMixHomographyEstimation) { + output.WriteRawTag(96); + output.WriteEnum((int) MixHomographyEstimation); + } + if (HasNumMixtures) { + output.WriteRawTag(104); + output.WriteInt32(NumMixtures); + } + if (HasMixtureRowSigma) { + output.WriteRawTag(117); + output.WriteFloat(MixtureRowSigma); + } + if (HasMixtureRegularizer) { + output.WriteRawTag(125); + output.WriteFloat(MixtureRegularizer); + } + if (HasIrlsRounds) { + output.WriteRawTag(136, 1); + output.WriteInt32(IrlsRounds); + } + if (HasLinSimInlierThreshold) { + output.WriteRawTag(165, 1); + output.WriteFloat(LinSimInlierThreshold); + } + if (HasLabelEmptyFramesAsValid) { + output.WriteRawTag(176, 1); + output.WriteBool(LabelEmptyFramesAsValid); + } + if (HasMixtureModelMode) { + output.WriteRawTag(184, 1); + output.WriteEnum((int) MixtureModelMode); + } + if (HasFeatureGridSize) { + output.WriteRawTag(197, 1); + output.WriteFloat(FeatureGridSize); + } + if (HasSpatialSigma) { + output.WriteRawTag(205, 1); + output.WriteFloat(SpatialSigma); + } + if (HasTemporalIrlsDiameter) { + output.WriteRawTag(208, 1); + output.WriteInt32(TemporalIrlsDiameter); + } + if (HasTemporalSigma) { + output.WriteRawTag(221, 1); + output.WriteFloat(TemporalSigma); + } + if (HasFeatureSigma) { + output.WriteRawTag(229, 1); + output.WriteFloat(FeatureSigma); + } + if (HasFilter5Taps) { + output.WriteRawTag(232, 1); + output.WriteBool(Filter5Taps); + } + if (HasAffineEstimation) { + output.WriteRawTag(240, 1); + output.WriteEnum((int) AffineEstimation); + } + if (HasIrlsMotionMagnitudeFraction) { + output.WriteRawTag(253, 1); + output.WriteFloat(IrlsMotionMagnitudeFraction); + } + if (stableTranslationBounds_ != null) { + output.WriteRawTag(130, 2); + output.WriteMessage(StableTranslationBounds); + } + if (stableSimilarityBounds_ != null) { + output.WriteRawTag(138, 2); + output.WriteMessage(StableSimilarityBounds); + } + if (stableMixtureHomographyBounds_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(StableMixtureHomographyBounds); + } + if (HasIrlsWeightFilter) { + output.WriteRawTag(152, 2); + output.WriteEnum((int) IrlsWeightFilter); + } + if (HasOverlayDetection) { + output.WriteRawTag(160, 2); + output.WriteBool(OverlayDetection); + } + if (HasOverlayAnalysisChunkSize) { + output.WriteRawTag(168, 2); + output.WriteInt32(OverlayAnalysisChunkSize); + } + if (overlayDetectionOptions_ != null) { + output.WriteRawTag(178, 2); + output.WriteMessage(OverlayDetectionOptions); + } + if (HasIrlsWeightsPreinitialized) { + output.WriteRawTag(184, 2); + output.WriteBool(IrlsWeightsPreinitialized); + } + if (HasOutputRefinedIrlsWeights) { + output.WriteRawTag(192, 2); + output.WriteBool(OutputRefinedIrlsWeights); + } + if (HasStrictCoverageScale) { + output.WriteRawTag(205, 2); + output.WriteFloat(StrictCoverageScale); + } + if (HasMixtureRegularizerLevels) { + output.WriteRawTag(213, 2); + output.WriteFloat(MixtureRegularizerLevels); + } + if (HasMixtureRegularizerBase) { + output.WriteRawTag(221, 2); + output.WriteFloat(MixtureRegularizerBase); + } + if (HasMixtureRsAnalysisLevel) { + output.WriteRawTag(224, 2); + output.WriteInt32(MixtureRsAnalysisLevel); + } + if (HasHomographyIrlsWeightInitialization) { + output.WriteRawTag(232, 2); + output.WriteEnum((int) HomographyIrlsWeightInitialization); + } + if (HasIrlsUseL0Norm) { + output.WriteRawTag(240, 2); + output.WriteBool(IrlsUseL0Norm); + } + if (HasDeactivateStableMotionEstimation) { + output.WriteRawTag(248, 2); + output.WriteBool(DeactivateStableMotionEstimation); + } + if (HasFrameConfidenceWeighting) { + output.WriteRawTag(128, 3); + output.WriteBool(FrameConfidenceWeighting); + } + if (HasResetConfidenceThreshold) { + output.WriteRawTag(141, 3); + output.WriteFloat(ResetConfidenceThreshold); + } + if (HasIrlsPriorScale) { + output.WriteRawTag(149, 3); + output.WriteFloat(IrlsPriorScale); + } + if (HasCoverageGridSize) { + output.WriteRawTag(152, 3); + output.WriteInt32(CoverageGridSize); + } + if (HasProjectValidMotionsDown) { + output.WriteRawTag(160, 3); + output.WriteBool(ProjectValidMotionsDown); + } + if (HasHomographyExactDenominatorScaling) { + output.WriteRawTag(168, 3); + output.WriteBool(HomographyExactDenominatorScaling); + } + if (HasUseExactHomographyEstimation) { + output.WriteRawTag(176, 3); + output.WriteBool(UseExactHomographyEstimation); + } + if (HasUseHighestAccuracyForNormalEquations) { + output.WriteRawTag(184, 3); + output.WriteBool(UseHighestAccuracyForNormalEquations); + } + if (irlsInitialization_ != null) { + output.WriteRawTag(194, 3); + output.WriteMessage(IrlsInitialization); + } + if (irlsMaskOptions_ != null) { + output.WriteRawTag(202, 3); + output.WriteMessage(IrlsMaskOptions); + } + if (HasEstimationPolicy) { + output.WriteRawTag(208, 3); + output.WriteEnum((int) EstimationPolicy); + } + if (jointTrackEstimation_ != null) { + output.WriteRawTag(218, 3); + output.WriteMessage(JointTrackEstimation); + } + if (shotBoundaryOptions_ != null) { + output.WriteRawTag(226, 3); + output.WriteMessage(ShotBoundaryOptions); + } + if (HasHomographyPerspectiveRegularizer) { + output.WriteRawTag(237, 3); + output.WriteFloat(HomographyPerspectiveRegularizer); + } + if (HasFeatureDensityNormalization) { + output.WriteRawTag(240, 3); + output.WriteBool(FeatureDensityNormalization); + } + if (HasFeatureMaskSize) { + output.WriteRawTag(248, 3); + output.WriteInt32(FeatureMaskSize); + } + if (longFeatureBiasOptions_ != null) { + output.WriteRawTag(130, 4); + output.WriteMessage(LongFeatureBiasOptions); + } + if (HasDomainLimitedIrlsScaling) { + output.WriteRawTag(136, 4); + output.WriteBool(DomainLimitedIrlsScaling); + } + if (longFeatureInitialization_ != null) { + output.WriteRawTag(146, 4); + output.WriteMessage(LongFeatureInitialization); + } + if (HasFilterInitializedIrlsWeights) { + output.WriteRawTag(152, 4); + output.WriteBool(FilterInitializedIrlsWeights); + } + if (HasIrlsMixtureFractionScale) { + output.WriteRawTag(165, 4); + output.WriteFloat(IrlsMixtureFractionScale); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasEstimateTranslationIrls) { + output.WriteRawTag(8); + output.WriteBool(EstimateTranslationIrls); + } + if (HasEstimateSimilarity) { + output.WriteRawTag(16); + output.WriteBool(EstimateSimilarity); + } + if (HasLinearSimilarityEstimation) { + output.WriteRawTag(24); + output.WriteEnum((int) LinearSimilarityEstimation); + } + if (HasHomographyEstimation) { + output.WriteRawTag(40); + output.WriteEnum((int) HomographyEstimation); + } + if (HasUseOnlyLinSimInliersForHomography) { + output.WriteRawTag(48); + output.WriteBool(UseOnlyLinSimInliersForHomography); + } + if (stableHomographyBounds_ != null) { + output.WriteRawTag(90); + output.WriteMessage(StableHomographyBounds); + } + if (HasMixHomographyEstimation) { + output.WriteRawTag(96); + output.WriteEnum((int) MixHomographyEstimation); + } + if (HasNumMixtures) { + output.WriteRawTag(104); + output.WriteInt32(NumMixtures); + } + if (HasMixtureRowSigma) { + output.WriteRawTag(117); + output.WriteFloat(MixtureRowSigma); + } + if (HasMixtureRegularizer) { + output.WriteRawTag(125); + output.WriteFloat(MixtureRegularizer); + } + if (HasIrlsRounds) { + output.WriteRawTag(136, 1); + output.WriteInt32(IrlsRounds); + } + if (HasLinSimInlierThreshold) { + output.WriteRawTag(165, 1); + output.WriteFloat(LinSimInlierThreshold); + } + if (HasLabelEmptyFramesAsValid) { + output.WriteRawTag(176, 1); + output.WriteBool(LabelEmptyFramesAsValid); + } + if (HasMixtureModelMode) { + output.WriteRawTag(184, 1); + output.WriteEnum((int) MixtureModelMode); + } + if (HasFeatureGridSize) { + output.WriteRawTag(197, 1); + output.WriteFloat(FeatureGridSize); + } + if (HasSpatialSigma) { + output.WriteRawTag(205, 1); + output.WriteFloat(SpatialSigma); + } + if (HasTemporalIrlsDiameter) { + output.WriteRawTag(208, 1); + output.WriteInt32(TemporalIrlsDiameter); + } + if (HasTemporalSigma) { + output.WriteRawTag(221, 1); + output.WriteFloat(TemporalSigma); + } + if (HasFeatureSigma) { + output.WriteRawTag(229, 1); + output.WriteFloat(FeatureSigma); + } + if (HasFilter5Taps) { + output.WriteRawTag(232, 1); + output.WriteBool(Filter5Taps); + } + if (HasAffineEstimation) { + output.WriteRawTag(240, 1); + output.WriteEnum((int) AffineEstimation); + } + if (HasIrlsMotionMagnitudeFraction) { + output.WriteRawTag(253, 1); + output.WriteFloat(IrlsMotionMagnitudeFraction); + } + if (stableTranslationBounds_ != null) { + output.WriteRawTag(130, 2); + output.WriteMessage(StableTranslationBounds); + } + if (stableSimilarityBounds_ != null) { + output.WriteRawTag(138, 2); + output.WriteMessage(StableSimilarityBounds); + } + if (stableMixtureHomographyBounds_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(StableMixtureHomographyBounds); + } + if (HasIrlsWeightFilter) { + output.WriteRawTag(152, 2); + output.WriteEnum((int) IrlsWeightFilter); + } + if (HasOverlayDetection) { + output.WriteRawTag(160, 2); + output.WriteBool(OverlayDetection); + } + if (HasOverlayAnalysisChunkSize) { + output.WriteRawTag(168, 2); + output.WriteInt32(OverlayAnalysisChunkSize); + } + if (overlayDetectionOptions_ != null) { + output.WriteRawTag(178, 2); + output.WriteMessage(OverlayDetectionOptions); + } + if (HasIrlsWeightsPreinitialized) { + output.WriteRawTag(184, 2); + output.WriteBool(IrlsWeightsPreinitialized); + } + if (HasOutputRefinedIrlsWeights) { + output.WriteRawTag(192, 2); + output.WriteBool(OutputRefinedIrlsWeights); + } + if (HasStrictCoverageScale) { + output.WriteRawTag(205, 2); + output.WriteFloat(StrictCoverageScale); + } + if (HasMixtureRegularizerLevels) { + output.WriteRawTag(213, 2); + output.WriteFloat(MixtureRegularizerLevels); + } + if (HasMixtureRegularizerBase) { + output.WriteRawTag(221, 2); + output.WriteFloat(MixtureRegularizerBase); + } + if (HasMixtureRsAnalysisLevel) { + output.WriteRawTag(224, 2); + output.WriteInt32(MixtureRsAnalysisLevel); + } + if (HasHomographyIrlsWeightInitialization) { + output.WriteRawTag(232, 2); + output.WriteEnum((int) HomographyIrlsWeightInitialization); + } + if (HasIrlsUseL0Norm) { + output.WriteRawTag(240, 2); + output.WriteBool(IrlsUseL0Norm); + } + if (HasDeactivateStableMotionEstimation) { + output.WriteRawTag(248, 2); + output.WriteBool(DeactivateStableMotionEstimation); + } + if (HasFrameConfidenceWeighting) { + output.WriteRawTag(128, 3); + output.WriteBool(FrameConfidenceWeighting); + } + if (HasResetConfidenceThreshold) { + output.WriteRawTag(141, 3); + output.WriteFloat(ResetConfidenceThreshold); + } + if (HasIrlsPriorScale) { + output.WriteRawTag(149, 3); + output.WriteFloat(IrlsPriorScale); + } + if (HasCoverageGridSize) { + output.WriteRawTag(152, 3); + output.WriteInt32(CoverageGridSize); + } + if (HasProjectValidMotionsDown) { + output.WriteRawTag(160, 3); + output.WriteBool(ProjectValidMotionsDown); + } + if (HasHomographyExactDenominatorScaling) { + output.WriteRawTag(168, 3); + output.WriteBool(HomographyExactDenominatorScaling); + } + if (HasUseExactHomographyEstimation) { + output.WriteRawTag(176, 3); + output.WriteBool(UseExactHomographyEstimation); + } + if (HasUseHighestAccuracyForNormalEquations) { + output.WriteRawTag(184, 3); + output.WriteBool(UseHighestAccuracyForNormalEquations); + } + if (irlsInitialization_ != null) { + output.WriteRawTag(194, 3); + output.WriteMessage(IrlsInitialization); + } + if (irlsMaskOptions_ != null) { + output.WriteRawTag(202, 3); + output.WriteMessage(IrlsMaskOptions); + } + if (HasEstimationPolicy) { + output.WriteRawTag(208, 3); + output.WriteEnum((int) EstimationPolicy); + } + if (jointTrackEstimation_ != null) { + output.WriteRawTag(218, 3); + output.WriteMessage(JointTrackEstimation); + } + if (shotBoundaryOptions_ != null) { + output.WriteRawTag(226, 3); + output.WriteMessage(ShotBoundaryOptions); + } + if (HasHomographyPerspectiveRegularizer) { + output.WriteRawTag(237, 3); + output.WriteFloat(HomographyPerspectiveRegularizer); + } + if (HasFeatureDensityNormalization) { + output.WriteRawTag(240, 3); + output.WriteBool(FeatureDensityNormalization); + } + if (HasFeatureMaskSize) { + output.WriteRawTag(248, 3); + output.WriteInt32(FeatureMaskSize); + } + if (longFeatureBiasOptions_ != null) { + output.WriteRawTag(130, 4); + output.WriteMessage(LongFeatureBiasOptions); + } + if (HasDomainLimitedIrlsScaling) { + output.WriteRawTag(136, 4); + output.WriteBool(DomainLimitedIrlsScaling); + } + if (longFeatureInitialization_ != null) { + output.WriteRawTag(146, 4); + output.WriteMessage(LongFeatureInitialization); + } + if (HasFilterInitializedIrlsWeights) { + output.WriteRawTag(152, 4); + output.WriteBool(FilterInitializedIrlsWeights); + } + if (HasIrlsMixtureFractionScale) { + output.WriteRawTag(165, 4); + output.WriteFloat(IrlsMixtureFractionScale); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasEstimateTranslationIrls) { + size += 1 + 1; + } + if (HasLinearSimilarityEstimation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LinearSimilarityEstimation); + } + if (HasAffineEstimation) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) AffineEstimation); + } + if (HasHomographyEstimation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HomographyEstimation); + } + if (HasHomographyExactDenominatorScaling) { + size += 2 + 1; + } + if (HasUseExactHomographyEstimation) { + size += 2 + 1; + } + if (HasUseHighestAccuracyForNormalEquations) { + size += 2 + 1; + } + if (HasHomographyPerspectiveRegularizer) { + size += 2 + 4; + } + if (HasMixHomographyEstimation) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MixHomographyEstimation); + } + if (HasNumMixtures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumMixtures); + } + if (HasMixtureRowSigma) { + size += 1 + 4; + } + if (HasMixtureRegularizer) { + size += 1 + 4; + } + if (HasMixtureRegularizerLevels) { + size += 2 + 4; + } + if (HasMixtureRegularizerBase) { + size += 2 + 4; + } + if (HasMixtureRsAnalysisLevel) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MixtureRsAnalysisLevel); + } + if (HasIrlsRounds) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(IrlsRounds); + } + if (HasIrlsPriorScale) { + size += 2 + 4; + } + if (HasIrlsMotionMagnitudeFraction) { + size += 2 + 4; + } + if (HasIrlsMixtureFractionScale) { + size += 2 + 4; + } + if (HasIrlsWeightsPreinitialized) { + size += 2 + 1; + } + if (HasFilterInitializedIrlsWeights) { + size += 2 + 1; + } + if (irlsInitialization_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(IrlsInitialization); + } + if (HasFeatureDensityNormalization) { + size += 2 + 1; + } + if (HasFeatureMaskSize) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FeatureMaskSize); + } + if (longFeatureInitialization_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(LongFeatureInitialization); + } + if (irlsMaskOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(IrlsMaskOptions); + } + if (jointTrackEstimation_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(JointTrackEstimation); + } + if (longFeatureBiasOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(LongFeatureBiasOptions); + } + if (HasEstimationPolicy) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) EstimationPolicy); + } + if (HasCoverageGridSize) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(CoverageGridSize); + } + if (HasMixtureModelMode) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) MixtureModelMode); + } + if (HasUseOnlyLinSimInliersForHomography) { + size += 1 + 1; + } + if (HasLinSimInlierThreshold) { + size += 2 + 4; + } + if (stableTranslationBounds_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(StableTranslationBounds); + } + if (stableSimilarityBounds_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(StableSimilarityBounds); + } + if (stableHomographyBounds_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StableHomographyBounds); + } + if (stableMixtureHomographyBounds_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(StableMixtureHomographyBounds); + } + if (HasStrictCoverageScale) { + size += 2 + 4; + } + if (HasLabelEmptyFramesAsValid) { + size += 2 + 1; + } + if (HasFeatureGridSize) { + size += 2 + 4; + } + if (HasSpatialSigma) { + size += 2 + 4; + } + if (HasTemporalIrlsDiameter) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(TemporalIrlsDiameter); + } + if (HasTemporalSigma) { + size += 2 + 4; + } + if (HasFeatureSigma) { + size += 2 + 4; + } + if (HasFilter5Taps) { + size += 2 + 1; + } + if (HasFrameConfidenceWeighting) { + size += 2 + 1; + } + if (HasResetConfidenceThreshold) { + size += 2 + 4; + } + if (HasIrlsWeightFilter) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) IrlsWeightFilter); + } + if (HasOverlayDetection) { + size += 2 + 1; + } + if (HasOverlayAnalysisChunkSize) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(OverlayAnalysisChunkSize); + } + if (overlayDetectionOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OverlayDetectionOptions); + } + if (shotBoundaryOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(ShotBoundaryOptions); + } + if (HasOutputRefinedIrlsWeights) { + size += 2 + 1; + } + if (HasHomographyIrlsWeightInitialization) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) HomographyIrlsWeightInitialization); + } + if (HasIrlsUseL0Norm) { + size += 2 + 1; + } + if (HasDomainLimitedIrlsScaling) { + size += 2 + 1; + } + if (HasDeactivateStableMotionEstimation) { + size += 2 + 1; + } + if (HasProjectValidMotionsDown) { + size += 2 + 1; + } + if (HasEstimateSimilarity) { + size += 1 + 1; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionEstimationOptions other) { + if (other == null) { + return; + } + if (other.HasEstimateTranslationIrls) { + EstimateTranslationIrls = other.EstimateTranslationIrls; + } + if (other.HasLinearSimilarityEstimation) { + LinearSimilarityEstimation = other.LinearSimilarityEstimation; + } + if (other.HasAffineEstimation) { + AffineEstimation = other.AffineEstimation; + } + if (other.HasHomographyEstimation) { + HomographyEstimation = other.HomographyEstimation; + } + if (other.HasHomographyExactDenominatorScaling) { + HomographyExactDenominatorScaling = other.HomographyExactDenominatorScaling; + } + if (other.HasUseExactHomographyEstimation) { + UseExactHomographyEstimation = other.UseExactHomographyEstimation; + } + if (other.HasUseHighestAccuracyForNormalEquations) { + UseHighestAccuracyForNormalEquations = other.UseHighestAccuracyForNormalEquations; + } + if (other.HasHomographyPerspectiveRegularizer) { + HomographyPerspectiveRegularizer = other.HomographyPerspectiveRegularizer; + } + if (other.HasMixHomographyEstimation) { + MixHomographyEstimation = other.MixHomographyEstimation; + } + if (other.HasNumMixtures) { + NumMixtures = other.NumMixtures; + } + if (other.HasMixtureRowSigma) { + MixtureRowSigma = other.MixtureRowSigma; + } + if (other.HasMixtureRegularizer) { + MixtureRegularizer = other.MixtureRegularizer; + } + if (other.HasMixtureRegularizerLevels) { + MixtureRegularizerLevels = other.MixtureRegularizerLevels; + } + if (other.HasMixtureRegularizerBase) { + MixtureRegularizerBase = other.MixtureRegularizerBase; + } + if (other.HasMixtureRsAnalysisLevel) { + MixtureRsAnalysisLevel = other.MixtureRsAnalysisLevel; + } + if (other.HasIrlsRounds) { + IrlsRounds = other.IrlsRounds; + } + if (other.HasIrlsPriorScale) { + IrlsPriorScale = other.IrlsPriorScale; + } + if (other.HasIrlsMotionMagnitudeFraction) { + IrlsMotionMagnitudeFraction = other.IrlsMotionMagnitudeFraction; + } + if (other.HasIrlsMixtureFractionScale) { + IrlsMixtureFractionScale = other.IrlsMixtureFractionScale; + } + if (other.HasIrlsWeightsPreinitialized) { + IrlsWeightsPreinitialized = other.IrlsWeightsPreinitialized; + } + if (other.HasFilterInitializedIrlsWeights) { + FilterInitializedIrlsWeights = other.FilterInitializedIrlsWeights; + } + if (other.irlsInitialization_ != null) { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization(); + } + IrlsInitialization.MergeFrom(other.IrlsInitialization); + } + if (other.HasFeatureDensityNormalization) { + FeatureDensityNormalization = other.FeatureDensityNormalization; + } + if (other.HasFeatureMaskSize) { + FeatureMaskSize = other.FeatureMaskSize; + } + if (other.longFeatureInitialization_ != null) { + if (longFeatureInitialization_ == null) { + LongFeatureInitialization = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization(); + } + LongFeatureInitialization.MergeFrom(other.LongFeatureInitialization); + } + if (other.irlsMaskOptions_ != null) { + if (irlsMaskOptions_ == null) { + IrlsMaskOptions = new global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions(); + } + IrlsMaskOptions.MergeFrom(other.IrlsMaskOptions); + } + if (other.jointTrackEstimation_ != null) { + if (jointTrackEstimation_ == null) { + JointTrackEstimation = new global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions(); + } + JointTrackEstimation.MergeFrom(other.JointTrackEstimation); + } + if (other.longFeatureBiasOptions_ != null) { + if (longFeatureBiasOptions_ == null) { + LongFeatureBiasOptions = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions(); + } + LongFeatureBiasOptions.MergeFrom(other.LongFeatureBiasOptions); + } + if (other.HasEstimationPolicy) { + EstimationPolicy = other.EstimationPolicy; + } + if (other.HasCoverageGridSize) { + CoverageGridSize = other.CoverageGridSize; + } + if (other.HasMixtureModelMode) { + MixtureModelMode = other.MixtureModelMode; + } + if (other.HasUseOnlyLinSimInliersForHomography) { + UseOnlyLinSimInliersForHomography = other.UseOnlyLinSimInliersForHomography; + } + if (other.HasLinSimInlierThreshold) { + LinSimInlierThreshold = other.LinSimInlierThreshold; + } + if (other.stableTranslationBounds_ != null) { + if (stableTranslationBounds_ == null) { + StableTranslationBounds = new global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds(); + } + StableTranslationBounds.MergeFrom(other.StableTranslationBounds); + } + if (other.stableSimilarityBounds_ != null) { + if (stableSimilarityBounds_ == null) { + StableSimilarityBounds = new global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds(); + } + StableSimilarityBounds.MergeFrom(other.StableSimilarityBounds); + } + if (other.stableHomographyBounds_ != null) { + if (stableHomographyBounds_ == null) { + StableHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds(); + } + StableHomographyBounds.MergeFrom(other.StableHomographyBounds); + } + if (other.stableMixtureHomographyBounds_ != null) { + if (stableMixtureHomographyBounds_ == null) { + StableMixtureHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds(); + } + StableMixtureHomographyBounds.MergeFrom(other.StableMixtureHomographyBounds); + } + if (other.HasStrictCoverageScale) { + StrictCoverageScale = other.StrictCoverageScale; + } + if (other.HasLabelEmptyFramesAsValid) { + LabelEmptyFramesAsValid = other.LabelEmptyFramesAsValid; + } + if (other.HasFeatureGridSize) { + FeatureGridSize = other.FeatureGridSize; + } + if (other.HasSpatialSigma) { + SpatialSigma = other.SpatialSigma; + } + if (other.HasTemporalIrlsDiameter) { + TemporalIrlsDiameter = other.TemporalIrlsDiameter; + } + if (other.HasTemporalSigma) { + TemporalSigma = other.TemporalSigma; + } + if (other.HasFeatureSigma) { + FeatureSigma = other.FeatureSigma; + } + if (other.HasFilter5Taps) { + Filter5Taps = other.Filter5Taps; + } + if (other.HasFrameConfidenceWeighting) { + FrameConfidenceWeighting = other.FrameConfidenceWeighting; + } + if (other.HasResetConfidenceThreshold) { + ResetConfidenceThreshold = other.ResetConfidenceThreshold; + } + if (other.HasIrlsWeightFilter) { + IrlsWeightFilter = other.IrlsWeightFilter; + } + if (other.HasOverlayDetection) { + OverlayDetection = other.OverlayDetection; + } + if (other.HasOverlayAnalysisChunkSize) { + OverlayAnalysisChunkSize = other.OverlayAnalysisChunkSize; + } + if (other.overlayDetectionOptions_ != null) { + if (overlayDetectionOptions_ == null) { + OverlayDetectionOptions = new global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions(); + } + OverlayDetectionOptions.MergeFrom(other.OverlayDetectionOptions); + } + if (other.shotBoundaryOptions_ != null) { + if (shotBoundaryOptions_ == null) { + ShotBoundaryOptions = new global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions(); + } + ShotBoundaryOptions.MergeFrom(other.ShotBoundaryOptions); + } + if (other.HasOutputRefinedIrlsWeights) { + OutputRefinedIrlsWeights = other.OutputRefinedIrlsWeights; + } + if (other.HasHomographyIrlsWeightInitialization) { + HomographyIrlsWeightInitialization = other.HomographyIrlsWeightInitialization; + } + if (other.HasIrlsUseL0Norm) { + IrlsUseL0Norm = other.IrlsUseL0Norm; + } + if (other.HasDomainLimitedIrlsScaling) { + DomainLimitedIrlsScaling = other.DomainLimitedIrlsScaling; + } + if (other.HasDeactivateStableMotionEstimation) { + DeactivateStableMotionEstimation = other.DeactivateStableMotionEstimation; + } + if (other.HasProjectValidMotionsDown) { + ProjectValidMotionsDown = other.ProjectValidMotionsDown; + } + if (other.HasEstimateSimilarity) { + EstimateSimilarity = other.EstimateSimilarity; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + EstimateTranslationIrls = input.ReadBool(); + break; + } + case 16: { + EstimateSimilarity = input.ReadBool(); + break; + } + case 24: { + LinearSimilarityEstimation = (global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation) input.ReadEnum(); + break; + } + case 40: { + HomographyEstimation = (global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation) input.ReadEnum(); + break; + } + case 48: { + UseOnlyLinSimInliersForHomography = input.ReadBool(); + break; + } + case 90: { + if (stableHomographyBounds_ == null) { + StableHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds(); + } + input.ReadMessage(StableHomographyBounds); + break; + } + case 96: { + MixHomographyEstimation = (global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation) input.ReadEnum(); + break; + } + case 104: { + NumMixtures = input.ReadInt32(); + break; + } + case 117: { + MixtureRowSigma = input.ReadFloat(); + break; + } + case 125: { + MixtureRegularizer = input.ReadFloat(); + break; + } + case 136: { + IrlsRounds = input.ReadInt32(); + break; + } + case 165: { + LinSimInlierThreshold = input.ReadFloat(); + break; + } + case 176: { + LabelEmptyFramesAsValid = input.ReadBool(); + break; + } + case 184: { + MixtureModelMode = (global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode) input.ReadEnum(); + break; + } + case 197: { + FeatureGridSize = input.ReadFloat(); + break; + } + case 205: { + SpatialSigma = input.ReadFloat(); + break; + } + case 208: { + TemporalIrlsDiameter = input.ReadInt32(); + break; + } + case 221: { + TemporalSigma = input.ReadFloat(); + break; + } + case 229: { + FeatureSigma = input.ReadFloat(); + break; + } + case 232: { + Filter5Taps = input.ReadBool(); + break; + } + case 240: { + AffineEstimation = (global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation) input.ReadEnum(); + break; + } + case 253: { + IrlsMotionMagnitudeFraction = input.ReadFloat(); + break; + } + case 258: { + if (stableTranslationBounds_ == null) { + StableTranslationBounds = new global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds(); + } + input.ReadMessage(StableTranslationBounds); + break; + } + case 266: { + if (stableSimilarityBounds_ == null) { + StableSimilarityBounds = new global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds(); + } + input.ReadMessage(StableSimilarityBounds); + break; + } + case 274: { + if (stableMixtureHomographyBounds_ == null) { + StableMixtureHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds(); + } + input.ReadMessage(StableMixtureHomographyBounds); + break; + } + case 280: { + IrlsWeightFilter = (global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter) input.ReadEnum(); + break; + } + case 288: { + OverlayDetection = input.ReadBool(); + break; + } + case 296: { + OverlayAnalysisChunkSize = input.ReadInt32(); + break; + } + case 306: { + if (overlayDetectionOptions_ == null) { + OverlayDetectionOptions = new global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions(); + } + input.ReadMessage(OverlayDetectionOptions); + break; + } + case 312: { + IrlsWeightsPreinitialized = input.ReadBool(); + break; + } + case 320: { + OutputRefinedIrlsWeights = input.ReadBool(); + break; + } + case 333: { + StrictCoverageScale = input.ReadFloat(); + break; + } + case 341: { + MixtureRegularizerLevels = input.ReadFloat(); + break; + } + case 349: { + MixtureRegularizerBase = input.ReadFloat(); + break; + } + case 352: { + MixtureRsAnalysisLevel = input.ReadInt32(); + break; + } + case 360: { + HomographyIrlsWeightInitialization = (global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization) input.ReadEnum(); + break; + } + case 368: { + IrlsUseL0Norm = input.ReadBool(); + break; + } + case 376: { + DeactivateStableMotionEstimation = input.ReadBool(); + break; + } + case 384: { + FrameConfidenceWeighting = input.ReadBool(); + break; + } + case 397: { + ResetConfidenceThreshold = input.ReadFloat(); + break; + } + case 405: { + IrlsPriorScale = input.ReadFloat(); + break; + } + case 408: { + CoverageGridSize = input.ReadInt32(); + break; + } + case 416: { + ProjectValidMotionsDown = input.ReadBool(); + break; + } + case 424: { + HomographyExactDenominatorScaling = input.ReadBool(); + break; + } + case 432: { + UseExactHomographyEstimation = input.ReadBool(); + break; + } + case 440: { + UseHighestAccuracyForNormalEquations = input.ReadBool(); + break; + } + case 450: { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization(); + } + input.ReadMessage(IrlsInitialization); + break; + } + case 458: { + if (irlsMaskOptions_ == null) { + IrlsMaskOptions = new global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions(); + } + input.ReadMessage(IrlsMaskOptions); + break; + } + case 464: { + EstimationPolicy = (global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy) input.ReadEnum(); + break; + } + case 474: { + if (jointTrackEstimation_ == null) { + JointTrackEstimation = new global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions(); + } + input.ReadMessage(JointTrackEstimation); + break; + } + case 482: { + if (shotBoundaryOptions_ == null) { + ShotBoundaryOptions = new global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions(); + } + input.ReadMessage(ShotBoundaryOptions); + break; + } + case 493: { + HomographyPerspectiveRegularizer = input.ReadFloat(); + break; + } + case 496: { + FeatureDensityNormalization = input.ReadBool(); + break; + } + case 504: { + FeatureMaskSize = input.ReadInt32(); + break; + } + case 514: { + if (longFeatureBiasOptions_ == null) { + LongFeatureBiasOptions = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions(); + } + input.ReadMessage(LongFeatureBiasOptions); + break; + } + case 520: { + DomainLimitedIrlsScaling = input.ReadBool(); + break; + } + case 530: { + if (longFeatureInitialization_ == null) { + LongFeatureInitialization = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization(); + } + input.ReadMessage(LongFeatureInitialization); + break; + } + case 536: { + FilterInitializedIrlsWeights = input.ReadBool(); + break; + } + case 549: { + IrlsMixtureFractionScale = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + EstimateTranslationIrls = input.ReadBool(); + break; + } + case 16: { + EstimateSimilarity = input.ReadBool(); + break; + } + case 24: { + LinearSimilarityEstimation = (global::Mediapipe.MotionEstimationOptions.Types.LinearSimilarityEstimation) input.ReadEnum(); + break; + } + case 40: { + HomographyEstimation = (global::Mediapipe.MotionEstimationOptions.Types.HomographyEstimation) input.ReadEnum(); + break; + } + case 48: { + UseOnlyLinSimInliersForHomography = input.ReadBool(); + break; + } + case 90: { + if (stableHomographyBounds_ == null) { + StableHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.HomographyBounds(); + } + input.ReadMessage(StableHomographyBounds); + break; + } + case 96: { + MixHomographyEstimation = (global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyEstimation) input.ReadEnum(); + break; + } + case 104: { + NumMixtures = input.ReadInt32(); + break; + } + case 117: { + MixtureRowSigma = input.ReadFloat(); + break; + } + case 125: { + MixtureRegularizer = input.ReadFloat(); + break; + } + case 136: { + IrlsRounds = input.ReadInt32(); + break; + } + case 165: { + LinSimInlierThreshold = input.ReadFloat(); + break; + } + case 176: { + LabelEmptyFramesAsValid = input.ReadBool(); + break; + } + case 184: { + MixtureModelMode = (global::Mediapipe.MotionEstimationOptions.Types.MixtureModelMode) input.ReadEnum(); + break; + } + case 197: { + FeatureGridSize = input.ReadFloat(); + break; + } + case 205: { + SpatialSigma = input.ReadFloat(); + break; + } + case 208: { + TemporalIrlsDiameter = input.ReadInt32(); + break; + } + case 221: { + TemporalSigma = input.ReadFloat(); + break; + } + case 229: { + FeatureSigma = input.ReadFloat(); + break; + } + case 232: { + Filter5Taps = input.ReadBool(); + break; + } + case 240: { + AffineEstimation = (global::Mediapipe.MotionEstimationOptions.Types.AffineEstimation) input.ReadEnum(); + break; + } + case 253: { + IrlsMotionMagnitudeFraction = input.ReadFloat(); + break; + } + case 258: { + if (stableTranslationBounds_ == null) { + StableTranslationBounds = new global::Mediapipe.MotionEstimationOptions.Types.TranslationBounds(); + } + input.ReadMessage(StableTranslationBounds); + break; + } + case 266: { + if (stableSimilarityBounds_ == null) { + StableSimilarityBounds = new global::Mediapipe.MotionEstimationOptions.Types.SimilarityBounds(); + } + input.ReadMessage(StableSimilarityBounds); + break; + } + case 274: { + if (stableMixtureHomographyBounds_ == null) { + StableMixtureHomographyBounds = new global::Mediapipe.MotionEstimationOptions.Types.MixtureHomographyBounds(); + } + input.ReadMessage(StableMixtureHomographyBounds); + break; + } + case 280: { + IrlsWeightFilter = (global::Mediapipe.MotionEstimationOptions.Types.IRLSWeightFilter) input.ReadEnum(); + break; + } + case 288: { + OverlayDetection = input.ReadBool(); + break; + } + case 296: { + OverlayAnalysisChunkSize = input.ReadInt32(); + break; + } + case 306: { + if (overlayDetectionOptions_ == null) { + OverlayDetectionOptions = new global::Mediapipe.MotionEstimationOptions.Types.OverlayDetectionOptions(); + } + input.ReadMessage(OverlayDetectionOptions); + break; + } + case 312: { + IrlsWeightsPreinitialized = input.ReadBool(); + break; + } + case 320: { + OutputRefinedIrlsWeights = input.ReadBool(); + break; + } + case 333: { + StrictCoverageScale = input.ReadFloat(); + break; + } + case 341: { + MixtureRegularizerLevels = input.ReadFloat(); + break; + } + case 349: { + MixtureRegularizerBase = input.ReadFloat(); + break; + } + case 352: { + MixtureRsAnalysisLevel = input.ReadInt32(); + break; + } + case 360: { + HomographyIrlsWeightInitialization = (global::Mediapipe.MotionEstimationOptions.Types.HomographyIrlsWeightInitialization) input.ReadEnum(); + break; + } + case 368: { + IrlsUseL0Norm = input.ReadBool(); + break; + } + case 376: { + DeactivateStableMotionEstimation = input.ReadBool(); + break; + } + case 384: { + FrameConfidenceWeighting = input.ReadBool(); + break; + } + case 397: { + ResetConfidenceThreshold = input.ReadFloat(); + break; + } + case 405: { + IrlsPriorScale = input.ReadFloat(); + break; + } + case 408: { + CoverageGridSize = input.ReadInt32(); + break; + } + case 416: { + ProjectValidMotionsDown = input.ReadBool(); + break; + } + case 424: { + HomographyExactDenominatorScaling = input.ReadBool(); + break; + } + case 432: { + UseExactHomographyEstimation = input.ReadBool(); + break; + } + case 440: { + UseHighestAccuracyForNormalEquations = input.ReadBool(); + break; + } + case 450: { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.MotionEstimationOptions.Types.IrlsOutlierInitialization(); + } + input.ReadMessage(IrlsInitialization); + break; + } + case 458: { + if (irlsMaskOptions_ == null) { + IrlsMaskOptions = new global::Mediapipe.MotionEstimationOptions.Types.IrlsMaskOptions(); + } + input.ReadMessage(IrlsMaskOptions); + break; + } + case 464: { + EstimationPolicy = (global::Mediapipe.MotionEstimationOptions.Types.EstimationPolicy) input.ReadEnum(); + break; + } + case 474: { + if (jointTrackEstimation_ == null) { + JointTrackEstimation = new global::Mediapipe.MotionEstimationOptions.Types.JointTrackEstimationOptions(); + } + input.ReadMessage(JointTrackEstimation); + break; + } + case 482: { + if (shotBoundaryOptions_ == null) { + ShotBoundaryOptions = new global::Mediapipe.MotionEstimationOptions.Types.ShotBoundaryOptions(); + } + input.ReadMessage(ShotBoundaryOptions); + break; + } + case 493: { + HomographyPerspectiveRegularizer = input.ReadFloat(); + break; + } + case 496: { + FeatureDensityNormalization = input.ReadBool(); + break; + } + case 504: { + FeatureMaskSize = input.ReadInt32(); + break; + } + case 514: { + if (longFeatureBiasOptions_ == null) { + LongFeatureBiasOptions = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureBiasOptions(); + } + input.ReadMessage(LongFeatureBiasOptions); + break; + } + case 520: { + DomainLimitedIrlsScaling = input.ReadBool(); + break; + } + case 530: { + if (longFeatureInitialization_ == null) { + LongFeatureInitialization = new global::Mediapipe.MotionEstimationOptions.Types.LongFeatureInitialization(); + } + input.ReadMessage(LongFeatureInitialization); + break; + } + case 536: { + FilterInitializedIrlsWeights = input.ReadBool(); + break; + } + case 549: { + IrlsMixtureFractionScale = input.ReadFloat(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the MotionEstimationOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum LinearSimilarityEstimation { + [pbr::OriginalName("ESTIMATION_LS_NONE")] EstimationLsNone = 0, + /// + /// L2 estimation + /// + [pbr::OriginalName("ESTIMATION_LS_L2")] EstimationLsL2 = 1, + /// + /// good performance, robust to outliers. + /// + [pbr::OriginalName("ESTIMATION_LS_IRLS")] EstimationLsIrls = 4, + /// + /// DEPRECATED modes. + /// + [pbr::OriginalName("ESTIMATION_LS_L2_RANSAC")] EstimationLsL2Ransac = 2, + /// + /// DEPRECATED, use IRLS instead, or static + /// + [pbr::OriginalName("ESTIMATION_LS_L1")] EstimationLsL1 = 3, + } + + public enum AffineEstimation { + [pbr::OriginalName("ESTIMATION_AFFINE_NONE")] EstimationAffineNone = 0, + [pbr::OriginalName("ESTIMATION_AFFINE_L2")] EstimationAffineL2 = 1, + [pbr::OriginalName("ESTIMATION_AFFINE_IRLS")] EstimationAffineIrls = 2, + } + + public enum HomographyEstimation { + [pbr::OriginalName("ESTIMATION_HOMOG_NONE")] EstimationHomogNone = 0, + [pbr::OriginalName("ESTIMATION_HOMOG_L2")] EstimationHomogL2 = 1, + [pbr::OriginalName("ESTIMATION_HOMOG_IRLS")] EstimationHomogIrls = 2, + } + + /// + /// Note: Mixture models have high DOF are much more affected by outliers + /// than models above. It is recommended that if IRLS estimation is NOT used, + /// that mixture_regularizer is increased by a factor >=3. + /// + public enum MixtureHomographyEstimation { + [pbr::OriginalName("ESTIMATION_HOMOG_MIX_NONE")] EstimationHomogMixNone = 0, + [pbr::OriginalName("ESTIMATION_HOMOG_MIX_L2")] EstimationHomogMixL2 = 1, + /// + /// robust to outliers. + /// + [pbr::OriginalName("ESTIMATION_HOMOG_MIX_IRLS")] EstimationHomogMixIrls = 2, + } + + /// + /// Controls how multiple models via EstimateMotionsParallel are estimated. + /// + public enum EstimationPolicy { + /// + /// Models are estimated independently across + /// + [pbr::OriginalName("INDEPENDENT_PARALLEL")] IndependentParallel = 1, + /// + /// frames in parallel. + /// + [pbr::OriginalName("TEMPORAL_IRLS_MASK")] TemporalIrlsMask = 2, + /// + /// current one, controlled via above + /// IrlsMaskOptions. + /// + [pbr::OriginalName("TEMPORAL_LONG_FEATURE_BIAS")] TemporalLongFeatureBias = 4, + /// + /// long features, controlled via above + /// LongFeatureBiasOptions. + /// + [pbr::OriginalName("JOINTLY_FROM_TRACKS")] JointlyFromTracks = 3, + } + + /// + /// Degree of freedom of estimated homography mixtures. If desired, specific + /// parts of the homography can be held constant across the mixture. + /// For fast draft TRANSLATION_MIXTURE is recommended, for high quality + /// SKEW_ROTATION_MIXTURE. + /// + public enum MixtureModelMode { + /// + /// 8 dof * num_mixtures + /// + [pbr::OriginalName("FULL_MIXTURE")] FullMixture = 0, + /// + /// 6 dof + 2 dof * num_mixtures + /// + [pbr::OriginalName("TRANSLATION_MIXTURE")] TranslationMixture = 1, + /// + /// 4 dof + 4 dof * num_mixtures + /// + [pbr::OriginalName("SKEW_ROTATION_MIXTURE")] SkewRotationMixture = 2, + } + + /// + /// Filters irls weights before smoothing them according to specified + /// operation. + /// + public enum IRLSWeightFilter { + [pbr::OriginalName("IRLS_FILTER_NONE")] IrlsFilterNone = 0, + [pbr::OriginalName("IRLS_FILTER_TEXTURE")] IrlsFilterTexture = 1, + [pbr::OriginalName("IRLS_FILTER_CORNER_RESPONSE")] IrlsFilterCornerResponse = 2, + } + + /// + /// Weight initialization for homography estimation. This is to bias homography + /// estimation either to foreground or background. + /// + public enum HomographyIrlsWeightInitialization { + /// + /// Constant, treat all features equally. + /// + [pbr::OriginalName("IRLS_WEIGHT_CONSTANT_ONE")] IrlsWeightConstantOne = 1, + /// + /// Weight features in the center higher. + /// + [pbr::OriginalName("IRLS_WEIGHT_CENTER_GAUSSIAN")] IrlsWeightCenterGaussian = 2, + /// + /// Tends to lock onto foreground. + /// + [pbr::OriginalName("IRLS_WEIGHT_PERIMETER_GAUSSIAN")] IrlsWeightPerimeterGaussian = 3, + } + + /// + /// If activated, irls weight of outlier features are reset. Outliers are + /// defined as those features, for which the best model fit after #rounds + /// iterations of RANSAC did NOT yield an error lower than cutoff. + /// Only applies to translation and similarity estimation. + /// + public sealed partial class IrlsOutlierInitialization : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IrlsOutlierInitialization()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsOutlierInitialization() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsOutlierInitialization(IrlsOutlierInitialization other) : this() { + _hasBits0 = other._hasBits0; + activated_ = other.activated_; + rounds_ = other.rounds_; + cutoff_ = other.cutoff_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsOutlierInitialization Clone() { + return new IrlsOutlierInitialization(this); + } + + /// Field number for the "activated" field. + public const int ActivatedFieldNumber = 1; + private readonly static bool ActivatedDefaultValue = false; + + private bool activated_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Activated { + get { if ((_hasBits0 & 1) != 0) { return activated_; } else { return ActivatedDefaultValue; } } + set { + _hasBits0 |= 1; + activated_ = value; + } + } + /// Gets whether the "activated" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivated { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "activated" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivated() { + _hasBits0 &= ~1; + } + + /// Field number for the "rounds" field. + public const int RoundsFieldNumber = 2; + private readonly static int RoundsDefaultValue = 100; + + private int rounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Rounds { + get { if ((_hasBits0 & 2) != 0) { return rounds_; } else { return RoundsDefaultValue; } } + set { + _hasBits0 |= 2; + rounds_ = value; + } + } + /// Gets whether the "rounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRounds { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "rounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRounds() { + _hasBits0 &= ~2; + } + + /// Field number for the "cutoff" field. + public const int CutoffFieldNumber = 3; + private readonly static float CutoffDefaultValue = 0.003F; + + private float cutoff_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Cutoff { + get { if ((_hasBits0 & 4) != 0) { return cutoff_; } else { return CutoffDefaultValue; } } + set { + _hasBits0 |= 4; + cutoff_ = value; + } + } + /// Gets whether the "cutoff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCutoff { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "cutoff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCutoff() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IrlsOutlierInitialization); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IrlsOutlierInitialization other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Activated != other.Activated) return false; + if (Rounds != other.Rounds) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Cutoff, other.Cutoff)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasActivated) hash ^= Activated.GetHashCode(); + if (HasRounds) hash ^= Rounds.GetHashCode(); + if (HasCutoff) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Cutoff); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasRounds) { + output.WriteRawTag(16); + output.WriteInt32(Rounds); + } + if (HasCutoff) { + output.WriteRawTag(29); + output.WriteFloat(Cutoff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasRounds) { + output.WriteRawTag(16); + output.WriteInt32(Rounds); + } + if (HasCutoff) { + output.WriteRawTag(29); + output.WriteFloat(Cutoff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasActivated) { + size += 1 + 1; + } + if (HasRounds) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Rounds); + } + if (HasCutoff) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IrlsOutlierInitialization other) { + if (other == null) { + return; + } + if (other.HasActivated) { + Activated = other.Activated; + } + if (other.HasRounds) { + Rounds = other.Rounds; + } + if (other.HasCutoff) { + Cutoff = other.Cutoff; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 16: { + Rounds = input.ReadInt32(); + break; + } + case 29: { + Cutoff = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 16: { + Rounds = input.ReadInt32(); + break; + } + case 29: { + Cutoff = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// In addition to above outlier and density initialization, long features + /// that are present for a specified ratio of the analysis interval can be + /// upweighted. This greatly improves temporal consistency. + /// + public sealed partial class LongFeatureInitialization : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongFeatureInitialization()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureInitialization() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureInitialization(LongFeatureInitialization other) : this() { + _hasBits0 = other._hasBits0; + activated_ = other.activated_; + minLengthPercentile_ = other.minLengthPercentile_; + upweightMultiplier_ = other.upweightMultiplier_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureInitialization Clone() { + return new LongFeatureInitialization(this); + } + + /// Field number for the "activated" field. + public const int ActivatedFieldNumber = 1; + private readonly static bool ActivatedDefaultValue = false; + + private bool activated_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Activated { + get { if ((_hasBits0 & 1) != 0) { return activated_; } else { return ActivatedDefaultValue; } } + set { + _hasBits0 |= 1; + activated_ = value; + } + } + /// Gets whether the "activated" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivated { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "activated" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivated() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_length_percentile" field. + public const int MinLengthPercentileFieldNumber = 2; + private readonly static float MinLengthPercentileDefaultValue = 0.95F; + + private float minLengthPercentile_; + /// + /// Tracks with a length greater of equal to the specified percentile + /// are upweighted by the specified upweight_multiplier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinLengthPercentile { + get { if ((_hasBits0 & 2) != 0) { return minLengthPercentile_; } else { return MinLengthPercentileDefaultValue; } } + set { + _hasBits0 |= 2; + minLengthPercentile_ = value; + } + } + /// Gets whether the "min_length_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinLengthPercentile { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_length_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinLengthPercentile() { + _hasBits0 &= ~2; + } + + /// Field number for the "upweight_multiplier" field. + public const int UpweightMultiplierFieldNumber = 3; + private readonly static float UpweightMultiplierDefaultValue = 5F; + + private float upweightMultiplier_; + /// + /// Features passing above test have their irls weight increased by the + /// specified multiplier prior to estimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float UpweightMultiplier { + get { if ((_hasBits0 & 4) != 0) { return upweightMultiplier_; } else { return UpweightMultiplierDefaultValue; } } + set { + _hasBits0 |= 4; + upweightMultiplier_ = value; + } + } + /// Gets whether the "upweight_multiplier" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpweightMultiplier { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "upweight_multiplier" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpweightMultiplier() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LongFeatureInitialization); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LongFeatureInitialization other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Activated != other.Activated) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinLengthPercentile, other.MinLengthPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpweightMultiplier, other.UpweightMultiplier)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasActivated) hash ^= Activated.GetHashCode(); + if (HasMinLengthPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinLengthPercentile); + if (HasUpweightMultiplier) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpweightMultiplier); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasMinLengthPercentile) { + output.WriteRawTag(21); + output.WriteFloat(MinLengthPercentile); + } + if (HasUpweightMultiplier) { + output.WriteRawTag(29); + output.WriteFloat(UpweightMultiplier); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasMinLengthPercentile) { + output.WriteRawTag(21); + output.WriteFloat(MinLengthPercentile); + } + if (HasUpweightMultiplier) { + output.WriteRawTag(29); + output.WriteFloat(UpweightMultiplier); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasActivated) { + size += 1 + 1; + } + if (HasMinLengthPercentile) { + size += 1 + 4; + } + if (HasUpweightMultiplier) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LongFeatureInitialization other) { + if (other == null) { + return; + } + if (other.HasActivated) { + Activated = other.Activated; + } + if (other.HasMinLengthPercentile) { + MinLengthPercentile = other.MinLengthPercentile; + } + if (other.HasUpweightMultiplier) { + UpweightMultiplier = other.UpweightMultiplier; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 21: { + MinLengthPercentile = input.ReadFloat(); + break; + } + case 29: { + UpweightMultiplier = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 21: { + MinLengthPercentile = input.ReadFloat(); + break; + } + case 29: { + UpweightMultiplier = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Irls initialization can be performed in a temporal depdent manner, + /// (if estimation_policy() == TEMPORALLY_DEPENDENT), where + /// the previous frame's motion estimation biases the IrlsInitialization of the + /// currently processed frame. In particular the location and magnitude of + /// inliers is used during the RANSAC selection stage, to favor those features + /// that agree with the prior, represented as confidence mask of inliers + /// (using same dimension as above feature_mask_size). + /// After estimation, the prior is updated. + /// + public sealed partial class IrlsMaskOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IrlsMaskOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsMaskOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsMaskOptions(IrlsMaskOptions other) : this() { + _hasBits0 = other._hasBits0; + decay_ = other.decay_; + inlierScore_ = other.inlierScore_; + baseScore_ = other.baseScore_; + minTranslationNorm_ = other.minTranslationNorm_; + translationBlendAlpha_ = other.translationBlendAlpha_; + translationPriorIncrease_ = other.translationPriorIncrease_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsMaskOptions Clone() { + return new IrlsMaskOptions(this); + } + + /// Field number for the "decay" field. + public const int DecayFieldNumber = 2; + private readonly static float DecayDefaultValue = 0.7F; + + private float decay_; + /// + /// Amount prior is decayed after each iteration. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Decay { + get { if ((_hasBits0 & 1) != 0) { return decay_; } else { return DecayDefaultValue; } } + set { + _hasBits0 |= 1; + decay_ = value; + } + } + /// Gets whether the "decay" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDecay { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "decay" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDecay() { + _hasBits0 &= ~1; + } + + /// Field number for the "inlier_score" field. + public const int InlierScoreFieldNumber = 3; + private readonly static float InlierScoreDefaultValue = 0.4F; + + private float inlierScore_; + /// + /// Score that each inlier adds to the current prior. Specified w.r.t. total + /// number of features, i.e. each feature increases a bins score by + /// inlier_score. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierScore { + get { if ((_hasBits0 & 2) != 0) { return inlierScore_; } else { return InlierScoreDefaultValue; } } + set { + _hasBits0 |= 2; + inlierScore_ = value; + } + } + /// Gets whether the "inlier_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierScore { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "inlier_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierScore() { + _hasBits0 &= ~2; + } + + /// Field number for the "base_score" field. + public const int BaseScoreFieldNumber = 4; + private readonly static float BaseScoreDefaultValue = 0.2F; + + private float baseScore_; + /// + /// Each inlier scores at least this value regardless of the inlier mask + /// (additive). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BaseScore { + get { if ((_hasBits0 & 4) != 0) { return baseScore_; } else { return BaseScoreDefaultValue; } } + set { + _hasBits0 |= 4; + baseScore_ = value; + } + } + /// Gets whether the "base_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBaseScore { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "base_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBaseScore() { + _hasBits0 &= ~4; + } + + /// Field number for the "min_translation_norm" field. + public const int MinTranslationNormFieldNumber = 5; + private readonly static float MinTranslationNormDefaultValue = 0.002F; + + private float minTranslationNorm_; + /// + /// Motions are scored relative to previous motion. Threshold denotes + /// absolute minimum of denominator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinTranslationNorm { + get { if ((_hasBits0 & 8) != 0) { return minTranslationNorm_; } else { return MinTranslationNormDefaultValue; } } + set { + _hasBits0 |= 8; + minTranslationNorm_ = value; + } + } + /// Gets whether the "min_translation_norm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinTranslationNorm { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "min_translation_norm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinTranslationNorm() { + _hasBits0 &= ~8; + } + + /// Field number for the "translation_blend_alpha" field. + public const int TranslationBlendAlphaFieldNumber = 6; + private readonly static float TranslationBlendAlphaDefaultValue = 0.7F; + + private float translationBlendAlpha_; + /// + /// Translation is updated in every step by blending it with the previous + /// estimated translation. (alpha is within 0 to 1, where 0 indicates to use + /// only measured translation, i.e. no blending). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TranslationBlendAlpha { + get { if ((_hasBits0 & 16) != 0) { return translationBlendAlpha_; } else { return TranslationBlendAlphaDefaultValue; } } + set { + _hasBits0 |= 16; + translationBlendAlpha_ = value; + } + } + /// Gets whether the "translation_blend_alpha" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTranslationBlendAlpha { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "translation_blend_alpha" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTranslationBlendAlpha() { + _hasBits0 &= ~16; + } + + /// Field number for the "translation_prior_increase" field. + public const int TranslationPriorIncreaseFieldNumber = 7; + private readonly static float TranslationPriorIncreaseDefaultValue = 0.2F; + + private float translationPriorIncrease_; + /// + /// Every time translation is updated, prior (in [0, 1]) is increased by the + /// specified amount. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TranslationPriorIncrease { + get { if ((_hasBits0 & 32) != 0) { return translationPriorIncrease_; } else { return TranslationPriorIncreaseDefaultValue; } } + set { + _hasBits0 |= 32; + translationPriorIncrease_ = value; + } + } + /// Gets whether the "translation_prior_increase" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTranslationPriorIncrease { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "translation_prior_increase" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTranslationPriorIncrease() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IrlsMaskOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IrlsMaskOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Decay, other.Decay)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierScore, other.InlierScore)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BaseScore, other.BaseScore)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinTranslationNorm, other.MinTranslationNorm)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TranslationBlendAlpha, other.TranslationBlendAlpha)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TranslationPriorIncrease, other.TranslationPriorIncrease)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDecay) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Decay); + if (HasInlierScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierScore); + if (HasBaseScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BaseScore); + if (HasMinTranslationNorm) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinTranslationNorm); + if (HasTranslationBlendAlpha) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TranslationBlendAlpha); + if (HasTranslationPriorIncrease) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TranslationPriorIncrease); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDecay) { + output.WriteRawTag(21); + output.WriteFloat(Decay); + } + if (HasInlierScore) { + output.WriteRawTag(29); + output.WriteFloat(InlierScore); + } + if (HasBaseScore) { + output.WriteRawTag(37); + output.WriteFloat(BaseScore); + } + if (HasMinTranslationNorm) { + output.WriteRawTag(45); + output.WriteFloat(MinTranslationNorm); + } + if (HasTranslationBlendAlpha) { + output.WriteRawTag(53); + output.WriteFloat(TranslationBlendAlpha); + } + if (HasTranslationPriorIncrease) { + output.WriteRawTag(61); + output.WriteFloat(TranslationPriorIncrease); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDecay) { + output.WriteRawTag(21); + output.WriteFloat(Decay); + } + if (HasInlierScore) { + output.WriteRawTag(29); + output.WriteFloat(InlierScore); + } + if (HasBaseScore) { + output.WriteRawTag(37); + output.WriteFloat(BaseScore); + } + if (HasMinTranslationNorm) { + output.WriteRawTag(45); + output.WriteFloat(MinTranslationNorm); + } + if (HasTranslationBlendAlpha) { + output.WriteRawTag(53); + output.WriteFloat(TranslationBlendAlpha); + } + if (HasTranslationPriorIncrease) { + output.WriteRawTag(61); + output.WriteFloat(TranslationPriorIncrease); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDecay) { + size += 1 + 4; + } + if (HasInlierScore) { + size += 1 + 4; + } + if (HasBaseScore) { + size += 1 + 4; + } + if (HasMinTranslationNorm) { + size += 1 + 4; + } + if (HasTranslationBlendAlpha) { + size += 1 + 4; + } + if (HasTranslationPriorIncrease) { + size += 1 + 4; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IrlsMaskOptions other) { + if (other == null) { + return; + } + if (other.HasDecay) { + Decay = other.Decay; + } + if (other.HasInlierScore) { + InlierScore = other.InlierScore; + } + if (other.HasBaseScore) { + BaseScore = other.BaseScore; + } + if (other.HasMinTranslationNorm) { + MinTranslationNorm = other.MinTranslationNorm; + } + if (other.HasTranslationBlendAlpha) { + TranslationBlendAlpha = other.TranslationBlendAlpha; + } + if (other.HasTranslationPriorIncrease) { + TranslationPriorIncrease = other.TranslationPriorIncrease; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 21: { + Decay = input.ReadFloat(); + break; + } + case 29: { + InlierScore = input.ReadFloat(); + break; + } + case 37: { + BaseScore = input.ReadFloat(); + break; + } + case 45: { + MinTranslationNorm = input.ReadFloat(); + break; + } + case 53: { + TranslationBlendAlpha = input.ReadFloat(); + break; + } + case 61: { + TranslationPriorIncrease = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 21: { + Decay = input.ReadFloat(); + break; + } + case 29: { + InlierScore = input.ReadFloat(); + break; + } + case 37: { + BaseScore = input.ReadFloat(); + break; + } + case 45: { + MinTranslationNorm = input.ReadFloat(); + break; + } + case 53: { + TranslationBlendAlpha = input.ReadFloat(); + break; + } + case 61: { + TranslationPriorIncrease = input.ReadFloat(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + /// + /// Describes how long feature tracks are leveraged for joint estimation across + /// many frames. + /// + public sealed partial class JointTrackEstimationOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JointTrackEstimationOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JointTrackEstimationOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JointTrackEstimationOptions(JointTrackEstimationOptions other) : this() { + _hasBits0 = other._hasBits0; + numMotionModels_ = other.numMotionModels_; + motionStride_ = other.motionStride_; + temporalSmoothing_ = other.temporalSmoothing_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JointTrackEstimationOptions Clone() { + return new JointTrackEstimationOptions(this); + } + + /// Field number for the "num_motion_models" field. + public const int NumMotionModelsFieldNumber = 1; + private readonly static int NumMotionModelsDefaultValue = 3; + + private int numMotionModels_; + /// + /// For each frame-pair motion model, describing the motion between frame + /// I and I - 1, estimate in addition several additional motion + /// models along long feature tracks describing the motion between frame + /// I and I - k * motion_stride (additional models are not output, + /// but help to filter irls weights). + /// Specifies total number of estimated motion models per frame-pair. Must be + /// greater than zero. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumMotionModels { + get { if ((_hasBits0 & 1) != 0) { return numMotionModels_; } else { return NumMotionModelsDefaultValue; } } + set { + _hasBits0 |= 1; + numMotionModels_ = value; + } + } + /// Gets whether the "num_motion_models" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumMotionModels { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_motion_models" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumMotionModels() { + _hasBits0 &= ~1; + } + + /// Field number for the "motion_stride" field. + public const int MotionStrideFieldNumber = 2; + private readonly static int MotionStrideDefaultValue = 15; + + private int motionStride_; + /// + /// Spacing in frames for additional motion models. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MotionStride { + get { if ((_hasBits0 & 2) != 0) { return motionStride_; } else { return MotionStrideDefaultValue; } } + set { + _hasBits0 |= 2; + motionStride_ = value; + } + } + /// Gets whether the "motion_stride" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionStride { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "motion_stride" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionStride() { + _hasBits0 &= ~2; + } + + /// Field number for the "temporal_smoothing" field. + public const int TemporalSmoothingFieldNumber = 3; + private readonly static bool TemporalSmoothingDefaultValue = false; + + private bool temporalSmoothing_; + /// + /// If set, performs temporal smoothing across frames of the obtained irls + /// weights. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TemporalSmoothing { + get { if ((_hasBits0 & 4) != 0) { return temporalSmoothing_; } else { return TemporalSmoothingDefaultValue; } } + set { + _hasBits0 |= 4; + temporalSmoothing_ = value; + } + } + /// Gets whether the "temporal_smoothing" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTemporalSmoothing { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "temporal_smoothing" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTemporalSmoothing() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JointTrackEstimationOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JointTrackEstimationOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumMotionModels != other.NumMotionModels) return false; + if (MotionStride != other.MotionStride) return false; + if (TemporalSmoothing != other.TemporalSmoothing) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumMotionModels) hash ^= NumMotionModels.GetHashCode(); + if (HasMotionStride) hash ^= MotionStride.GetHashCode(); + if (HasTemporalSmoothing) hash ^= TemporalSmoothing.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumMotionModels) { + output.WriteRawTag(8); + output.WriteInt32(NumMotionModels); + } + if (HasMotionStride) { + output.WriteRawTag(16); + output.WriteInt32(MotionStride); + } + if (HasTemporalSmoothing) { + output.WriteRawTag(24); + output.WriteBool(TemporalSmoothing); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumMotionModels) { + output.WriteRawTag(8); + output.WriteInt32(NumMotionModels); + } + if (HasMotionStride) { + output.WriteRawTag(16); + output.WriteInt32(MotionStride); + } + if (HasTemporalSmoothing) { + output.WriteRawTag(24); + output.WriteBool(TemporalSmoothing); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumMotionModels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumMotionModels); + } + if (HasMotionStride) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MotionStride); + } + if (HasTemporalSmoothing) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JointTrackEstimationOptions other) { + if (other == null) { + return; + } + if (other.HasNumMotionModels) { + NumMotionModels = other.NumMotionModels; + } + if (other.HasMotionStride) { + MotionStride = other.MotionStride; + } + if (other.HasTemporalSmoothing) { + TemporalSmoothing = other.TemporalSmoothing; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumMotionModels = input.ReadInt32(); + break; + } + case 16: { + MotionStride = input.ReadInt32(); + break; + } + case 24: { + TemporalSmoothing = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumMotionModels = input.ReadInt32(); + break; + } + case 16: { + MotionStride = input.ReadInt32(); + break; + } + case 24: { + TemporalSmoothing = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// Options being used to bias IRLS features if estimation mode + /// TEMPORAL_LONG_FEATURE_BIAS is being used. + /// Next Tag: 15 + /// + public sealed partial class LongFeatureBiasOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongFeatureBiasOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureBiasOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureBiasOptions(LongFeatureBiasOptions other) : this() { + _hasBits0 = other._hasBits0; + totalRounds_ = other.totalRounds_; + inlierBias_ = other.inlierBias_; + outlierBias_ = other.outlierBias_; + numIrlsObservations_ = other.numIrlsObservations_; + maxIrlsChangeRatio_ = other.maxIrlsChangeRatio_; + inlierIrlsWeight_ = other.inlierIrlsWeight_; + biasStdev_ = other.biasStdev_; + useSpatialBias_ = other.useSpatialBias_; + gridSize_ = other.gridSize_; + spatialSigma_ = other.spatialSigma_; + colorSigma_ = other.colorSigma_; + longTrackThreshold_ = other.longTrackThreshold_; + longTrackConfidenceFraction_ = other.longTrackConfidenceFraction_; + seedPriorsFromBias_ = other.seedPriorsFromBias_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LongFeatureBiasOptions Clone() { + return new LongFeatureBiasOptions(this); + } + + /// Field number for the "total_rounds" field. + public const int TotalRoundsFieldNumber = 13; + private readonly static int TotalRoundsDefaultValue = 1; + + private int totalRounds_; + /// + /// Estimation is performed multiple times, alternating between model + /// estimation and smooth temporal feature biasing for the specified number + /// of rounds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TotalRounds { + get { if ((_hasBits0 & 4096) != 0) { return totalRounds_; } else { return TotalRoundsDefaultValue; } } + set { + _hasBits0 |= 4096; + totalRounds_ = value; + } + } + /// Gets whether the "total_rounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTotalRounds { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "total_rounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTotalRounds() { + _hasBits0 &= ~4096; + } + + /// Field number for the "inlier_bias" field. + public const int InlierBiasFieldNumber = 1; + private readonly static float InlierBiasDefaultValue = 0.98F; + + private float inlierBias_; + /// + /// Controls how fast the bias for a track gets updated, in case feature is + /// an inlier. Use higher values for less decay of background motion over + /// time. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierBias { + get { if ((_hasBits0 & 1) != 0) { return inlierBias_; } else { return InlierBiasDefaultValue; } } + set { + _hasBits0 |= 1; + inlierBias_ = value; + } + } + /// Gets whether the "inlier_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierBias { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "inlier_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierBias() { + _hasBits0 &= ~1; + } + + /// Field number for the "outlier_bias" field. + public const int OutlierBiasFieldNumber = 2; + private readonly static float OutlierBiasDefaultValue = 0.7F; + + private float outlierBias_; + /// + /// Same as above for outliers (or features with low prior), i.e those that + /// got recently seeded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OutlierBias { + get { if ((_hasBits0 & 2) != 0) { return outlierBias_; } else { return OutlierBiasDefaultValue; } } + set { + _hasBits0 |= 2; + outlierBias_ = value; + } + } + /// Gets whether the "outlier_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutlierBias { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "outlier_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutlierBias() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_irls_observations" field. + public const int NumIrlsObservationsFieldNumber = 3; + private readonly static int NumIrlsObservationsDefaultValue = 10; + + private int numIrlsObservations_; + /// + /// Number of elements after which we deem estimation to be stable. + /// Used to control weight of bias if fewer than the specified number have + /// been observed. Also used as maximum ring buffer size (only most recent + /// number of observations are kept). Must be > 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumIrlsObservations { + get { if ((_hasBits0 & 4) != 0) { return numIrlsObservations_; } else { return NumIrlsObservationsDefaultValue; } } + set { + _hasBits0 |= 4; + numIrlsObservations_ = value; + } + } + /// Gets whether the "num_irls_observations" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumIrlsObservations { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_irls_observations" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumIrlsObservations() { + _hasBits0 &= ~4; + } + + /// Field number for the "max_irls_change_ratio" field. + public const int MaxIrlsChangeRatioFieldNumber = 4; + private readonly static float MaxIrlsChangeRatioDefaultValue = 10F; + + private float maxIrlsChangeRatio_; + /// + /// Change in irls weight magnitude (from outlier to inlier) above which we + /// reset the current bias. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxIrlsChangeRatio { + get { if ((_hasBits0 & 8) != 0) { return maxIrlsChangeRatio_; } else { return MaxIrlsChangeRatioDefaultValue; } } + set { + _hasBits0 |= 8; + maxIrlsChangeRatio_ = value; + } + } + /// Gets whether the "max_irls_change_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxIrlsChangeRatio { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "max_irls_change_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxIrlsChangeRatio() { + _hasBits0 &= ~8; + } + + /// Field number for the "inlier_irls_weight" field. + public const int InlierIrlsWeightFieldNumber = 5; + private readonly static float InlierIrlsWeightDefaultValue = 0.2F; + + private float inlierIrlsWeight_; + /// + /// Irls weight above which we consider it to be an inlier for bias update + /// purposes (see above inlier and outlier bias). By default, outliers are + /// allowed to update their bias faster than inliers. Must be > 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierIrlsWeight { + get { if ((_hasBits0 & 16) != 0) { return inlierIrlsWeight_; } else { return InlierIrlsWeightDefaultValue; } } + set { + _hasBits0 |= 16; + inlierIrlsWeight_ = value; + } + } + /// Gets whether the "inlier_irls_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierIrlsWeight { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "inlier_irls_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierIrlsWeight() { + _hasBits0 &= ~16; + } + + /// Field number for the "bias_stdev" field. + public const int BiasStdevFieldNumber = 12; + private readonly static float BiasStdevDefaultValue = 1F; + + private float biasStdev_; + /// + /// Standard deviation used during feature initialization. Current bias of a + /// track is used to pre-weight features via gaussian weighting with + /// specified standard deviation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BiasStdev { + get { if ((_hasBits0 & 2048) != 0) { return biasStdev_; } else { return BiasStdevDefaultValue; } } + set { + _hasBits0 |= 2048; + biasStdev_ = value; + } + } + /// Gets whether the "bias_stdev" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBiasStdev { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "bias_stdev" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBiasStdev() { + _hasBits0 &= ~2048; + } + + /// Field number for the "use_spatial_bias" field. + public const int UseSpatialBiasFieldNumber = 6; + private readonly static bool UseSpatialBiasDefaultValue = true; + + private bool useSpatialBias_; + /// + /// When seeding new tracks (on the first frame), we bilaterally pool + /// neighboring feature biases as seed. Details are controlled by options + /// below. If false, the feature's estimation error is used instead + /// (faster, but less spatially smooth). + /// If activated it is advised to use a patch descriptor radius of at least + /// 20 pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseSpatialBias { + get { if ((_hasBits0 & 32) != 0) { return useSpatialBias_; } else { return UseSpatialBiasDefaultValue; } } + set { + _hasBits0 |= 32; + useSpatialBias_ = value; + } + } + /// Gets whether the "use_spatial_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseSpatialBias { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "use_spatial_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseSpatialBias() { + _hasBits0 &= ~32; + } + + /// Field number for the "grid_size" field. + public const int GridSizeFieldNumber = 7; + private readonly static float GridSizeDefaultValue = 0.04F; + + private float gridSize_; + /// + /// Newly observered tracks's biases are seeded by similar looking features + /// in close spatial proximity. For efficieny a grid is used to determine + /// proximity. + /// Grid size in normalized coordinates w.r.t. frame domain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GridSize { + get { if ((_hasBits0 & 64) != 0) { return gridSize_; } else { return GridSizeDefaultValue; } } + set { + _hasBits0 |= 64; + gridSize_ = value; + } + } + /// Gets whether the "grid_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGridSize { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "grid_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGridSize() { + _hasBits0 &= ~64; + } + + /// Field number for the "spatial_sigma" field. + public const int SpatialSigmaFieldNumber = 8; + private readonly static float SpatialSigmaDefaultValue = 0.02F; + + private float spatialSigma_; + /// + /// Sigma's for combining feature biases. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SpatialSigma { + get { if ((_hasBits0 & 128) != 0) { return spatialSigma_; } else { return SpatialSigmaDefaultValue; } } + set { + _hasBits0 |= 128; + spatialSigma_ = value; + } + } + /// Gets whether the "spatial_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSpatialSigma { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "spatial_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSpatialSigma() { + _hasBits0 &= ~128; + } + + /// Field number for the "color_sigma" field. + public const int ColorSigmaFieldNumber = 9; + private readonly static float ColorSigmaDefaultValue = 20F; + + private float colorSigma_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ColorSigma { + get { if ((_hasBits0 & 256) != 0) { return colorSigma_; } else { return ColorSigmaDefaultValue; } } + set { + _hasBits0 |= 256; + colorSigma_ = value; + } + } + /// Gets whether the "color_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasColorSigma { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "color_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearColorSigma() { + _hasBits0 &= ~256; + } + + /// Field number for the "long_track_threshold" field. + public const int LongTrackThresholdFieldNumber = 10; + private readonly static int LongTrackThresholdDefaultValue = 30; + + private int longTrackThreshold_; + /// + /// Defines what we consider to be a long track. Features spawned around + /// locations of similar looking long tracks are considered to have + /// high prior, e.g. their initilization is given more weight. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LongTrackThreshold { + get { if ((_hasBits0 & 512) != 0) { return longTrackThreshold_; } else { return LongTrackThresholdDefaultValue; } } + set { + _hasBits0 |= 512; + longTrackThreshold_ = value; + } + } + /// Gets whether the "long_track_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLongTrackThreshold { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "long_track_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLongTrackThreshold() { + _hasBits0 &= ~512; + } + + /// Field number for the "long_track_confidence_fraction" field. + public const int LongTrackConfidenceFractionFieldNumber = 11; + private readonly static float LongTrackConfidenceFractionDefaultValue = 0.25F; + + private float longTrackConfidenceFraction_; + /// + /// Determines with fraction of long tracks is considered to be sufficient + /// for highly confident bias seed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LongTrackConfidenceFraction { + get { if ((_hasBits0 & 1024) != 0) { return longTrackConfidenceFraction_; } else { return LongTrackConfidenceFractionDefaultValue; } } + set { + _hasBits0 |= 1024; + longTrackConfidenceFraction_ = value; + } + } + /// Gets whether the "long_track_confidence_fraction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLongTrackConfidenceFraction { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "long_track_confidence_fraction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLongTrackConfidenceFraction() { + _hasBits0 &= ~1024; + } + + /// Field number for the "seed_priors_from_bias" field. + public const int SeedPriorsFromBiasFieldNumber = 14; + private readonly static bool SeedPriorsFromBiasDefaultValue = false; + + private bool seedPriorsFromBias_; + /// + /// If activated, uses the irls weights from the estimation of the lower + /// degree of freedom model to seed the bias of the higher degree of freedom + /// model. This improves rigidity of the computed motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool SeedPriorsFromBias { + get { if ((_hasBits0 & 8192) != 0) { return seedPriorsFromBias_; } else { return SeedPriorsFromBiasDefaultValue; } } + set { + _hasBits0 |= 8192; + seedPriorsFromBias_ = value; + } + } + /// Gets whether the "seed_priors_from_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSeedPriorsFromBias { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "seed_priors_from_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSeedPriorsFromBias() { + _hasBits0 &= ~8192; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LongFeatureBiasOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LongFeatureBiasOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TotalRounds != other.TotalRounds) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierBias, other.InlierBias)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OutlierBias, other.OutlierBias)) return false; + if (NumIrlsObservations != other.NumIrlsObservations) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxIrlsChangeRatio, other.MaxIrlsChangeRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierIrlsWeight, other.InlierIrlsWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BiasStdev, other.BiasStdev)) return false; + if (UseSpatialBias != other.UseSpatialBias) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GridSize, other.GridSize)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SpatialSigma, other.SpatialSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ColorSigma, other.ColorSigma)) return false; + if (LongTrackThreshold != other.LongTrackThreshold) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LongTrackConfidenceFraction, other.LongTrackConfidenceFraction)) return false; + if (SeedPriorsFromBias != other.SeedPriorsFromBias) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTotalRounds) hash ^= TotalRounds.GetHashCode(); + if (HasInlierBias) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierBias); + if (HasOutlierBias) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OutlierBias); + if (HasNumIrlsObservations) hash ^= NumIrlsObservations.GetHashCode(); + if (HasMaxIrlsChangeRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxIrlsChangeRatio); + if (HasInlierIrlsWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierIrlsWeight); + if (HasBiasStdev) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasStdev); + if (HasUseSpatialBias) hash ^= UseSpatialBias.GetHashCode(); + if (HasGridSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GridSize); + if (HasSpatialSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SpatialSigma); + if (HasColorSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ColorSigma); + if (HasLongTrackThreshold) hash ^= LongTrackThreshold.GetHashCode(); + if (HasLongTrackConfidenceFraction) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LongTrackConfidenceFraction); + if (HasSeedPriorsFromBias) hash ^= SeedPriorsFromBias.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasInlierBias) { + output.WriteRawTag(13); + output.WriteFloat(InlierBias); + } + if (HasOutlierBias) { + output.WriteRawTag(21); + output.WriteFloat(OutlierBias); + } + if (HasNumIrlsObservations) { + output.WriteRawTag(24); + output.WriteInt32(NumIrlsObservations); + } + if (HasMaxIrlsChangeRatio) { + output.WriteRawTag(37); + output.WriteFloat(MaxIrlsChangeRatio); + } + if (HasInlierIrlsWeight) { + output.WriteRawTag(45); + output.WriteFloat(InlierIrlsWeight); + } + if (HasUseSpatialBias) { + output.WriteRawTag(48); + output.WriteBool(UseSpatialBias); + } + if (HasGridSize) { + output.WriteRawTag(61); + output.WriteFloat(GridSize); + } + if (HasSpatialSigma) { + output.WriteRawTag(69); + output.WriteFloat(SpatialSigma); + } + if (HasColorSigma) { + output.WriteRawTag(77); + output.WriteFloat(ColorSigma); + } + if (HasLongTrackThreshold) { + output.WriteRawTag(80); + output.WriteInt32(LongTrackThreshold); + } + if (HasLongTrackConfidenceFraction) { + output.WriteRawTag(93); + output.WriteFloat(LongTrackConfidenceFraction); + } + if (HasBiasStdev) { + output.WriteRawTag(101); + output.WriteFloat(BiasStdev); + } + if (HasTotalRounds) { + output.WriteRawTag(104); + output.WriteInt32(TotalRounds); + } + if (HasSeedPriorsFromBias) { + output.WriteRawTag(112); + output.WriteBool(SeedPriorsFromBias); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasInlierBias) { + output.WriteRawTag(13); + output.WriteFloat(InlierBias); + } + if (HasOutlierBias) { + output.WriteRawTag(21); + output.WriteFloat(OutlierBias); + } + if (HasNumIrlsObservations) { + output.WriteRawTag(24); + output.WriteInt32(NumIrlsObservations); + } + if (HasMaxIrlsChangeRatio) { + output.WriteRawTag(37); + output.WriteFloat(MaxIrlsChangeRatio); + } + if (HasInlierIrlsWeight) { + output.WriteRawTag(45); + output.WriteFloat(InlierIrlsWeight); + } + if (HasUseSpatialBias) { + output.WriteRawTag(48); + output.WriteBool(UseSpatialBias); + } + if (HasGridSize) { + output.WriteRawTag(61); + output.WriteFloat(GridSize); + } + if (HasSpatialSigma) { + output.WriteRawTag(69); + output.WriteFloat(SpatialSigma); + } + if (HasColorSigma) { + output.WriteRawTag(77); + output.WriteFloat(ColorSigma); + } + if (HasLongTrackThreshold) { + output.WriteRawTag(80); + output.WriteInt32(LongTrackThreshold); + } + if (HasLongTrackConfidenceFraction) { + output.WriteRawTag(93); + output.WriteFloat(LongTrackConfidenceFraction); + } + if (HasBiasStdev) { + output.WriteRawTag(101); + output.WriteFloat(BiasStdev); + } + if (HasTotalRounds) { + output.WriteRawTag(104); + output.WriteInt32(TotalRounds); + } + if (HasSeedPriorsFromBias) { + output.WriteRawTag(112); + output.WriteBool(SeedPriorsFromBias); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTotalRounds) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TotalRounds); + } + if (HasInlierBias) { + size += 1 + 4; + } + if (HasOutlierBias) { + size += 1 + 4; + } + if (HasNumIrlsObservations) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumIrlsObservations); + } + if (HasMaxIrlsChangeRatio) { + size += 1 + 4; + } + if (HasInlierIrlsWeight) { + size += 1 + 4; + } + if (HasBiasStdev) { + size += 1 + 4; + } + if (HasUseSpatialBias) { + size += 1 + 1; + } + if (HasGridSize) { + size += 1 + 4; + } + if (HasSpatialSigma) { + size += 1 + 4; + } + if (HasColorSigma) { + size += 1 + 4; + } + if (HasLongTrackThreshold) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LongTrackThreshold); + } + if (HasLongTrackConfidenceFraction) { + size += 1 + 4; + } + if (HasSeedPriorsFromBias) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LongFeatureBiasOptions other) { + if (other == null) { + return; + } + if (other.HasTotalRounds) { + TotalRounds = other.TotalRounds; + } + if (other.HasInlierBias) { + InlierBias = other.InlierBias; + } + if (other.HasOutlierBias) { + OutlierBias = other.OutlierBias; + } + if (other.HasNumIrlsObservations) { + NumIrlsObservations = other.NumIrlsObservations; + } + if (other.HasMaxIrlsChangeRatio) { + MaxIrlsChangeRatio = other.MaxIrlsChangeRatio; + } + if (other.HasInlierIrlsWeight) { + InlierIrlsWeight = other.InlierIrlsWeight; + } + if (other.HasBiasStdev) { + BiasStdev = other.BiasStdev; + } + if (other.HasUseSpatialBias) { + UseSpatialBias = other.UseSpatialBias; + } + if (other.HasGridSize) { + GridSize = other.GridSize; + } + if (other.HasSpatialSigma) { + SpatialSigma = other.SpatialSigma; + } + if (other.HasColorSigma) { + ColorSigma = other.ColorSigma; + } + if (other.HasLongTrackThreshold) { + LongTrackThreshold = other.LongTrackThreshold; + } + if (other.HasLongTrackConfidenceFraction) { + LongTrackConfidenceFraction = other.LongTrackConfidenceFraction; + } + if (other.HasSeedPriorsFromBias) { + SeedPriorsFromBias = other.SeedPriorsFromBias; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + InlierBias = input.ReadFloat(); + break; + } + case 21: { + OutlierBias = input.ReadFloat(); + break; + } + case 24: { + NumIrlsObservations = input.ReadInt32(); + break; + } + case 37: { + MaxIrlsChangeRatio = input.ReadFloat(); + break; + } + case 45: { + InlierIrlsWeight = input.ReadFloat(); + break; + } + case 48: { + UseSpatialBias = input.ReadBool(); + break; + } + case 61: { + GridSize = input.ReadFloat(); + break; + } + case 69: { + SpatialSigma = input.ReadFloat(); + break; + } + case 77: { + ColorSigma = input.ReadFloat(); + break; + } + case 80: { + LongTrackThreshold = input.ReadInt32(); + break; + } + case 93: { + LongTrackConfidenceFraction = input.ReadFloat(); + break; + } + case 101: { + BiasStdev = input.ReadFloat(); + break; + } + case 104: { + TotalRounds = input.ReadInt32(); + break; + } + case 112: { + SeedPriorsFromBias = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + InlierBias = input.ReadFloat(); + break; + } + case 21: { + OutlierBias = input.ReadFloat(); + break; + } + case 24: { + NumIrlsObservations = input.ReadInt32(); + break; + } + case 37: { + MaxIrlsChangeRatio = input.ReadFloat(); + break; + } + case 45: { + InlierIrlsWeight = input.ReadFloat(); + break; + } + case 48: { + UseSpatialBias = input.ReadBool(); + break; + } + case 61: { + GridSize = input.ReadFloat(); + break; + } + case 69: { + SpatialSigma = input.ReadFloat(); + break; + } + case 77: { + ColorSigma = input.ReadFloat(); + break; + } + case 80: { + LongTrackThreshold = input.ReadInt32(); + break; + } + case 93: { + LongTrackConfidenceFraction = input.ReadFloat(); + break; + } + case 101: { + BiasStdev = input.ReadFloat(); + break; + } + case 104: { + TotalRounds = input.ReadInt32(); + break; + } + case 112: { + SeedPriorsFromBias = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// If any parameter of the input flow or estimated translation exceeds these + /// thresholds we deem the motion INVALID. + /// + public sealed partial class TranslationBounds : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TranslationBounds()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationBounds() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationBounds(TranslationBounds other) : this() { + _hasBits0 = other._hasBits0; + minFeatures_ = other.minFeatures_; + fracMaxMotionMagnitude_ = other.fracMaxMotionMagnitude_; + maxMotionStdevThreshold_ = other.maxMotionStdevThreshold_; + maxMotionStdev_ = other.maxMotionStdev_; + maxAcceleration_ = other.maxAcceleration_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationBounds Clone() { + return new TranslationBounds(this); + } + + /// Field number for the "min_features" field. + public const int MinFeaturesFieldNumber = 1; + private readonly static int MinFeaturesDefaultValue = 3; + + private int minFeatures_; + /// + /// Absolute minimum of features present. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinFeatures { + get { if ((_hasBits0 & 1) != 0) { return minFeatures_; } else { return MinFeaturesDefaultValue; } } + set { + _hasBits0 |= 1; + minFeatures_ = value; + } + } + /// Gets whether the "min_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatures { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatures() { + _hasBits0 &= ~1; + } + + /// Field number for the "frac_max_motion_magnitude" field. + public const int FracMaxMotionMagnitudeFieldNumber = 2; + private readonly static float FracMaxMotionMagnitudeDefaultValue = 0.15F; + + private float fracMaxMotionMagnitude_; + /// + /// Max magnitude of the translation expressed w.r.t. frame diameter + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracMaxMotionMagnitude { + get { if ((_hasBits0 & 2) != 0) { return fracMaxMotionMagnitude_; } else { return FracMaxMotionMagnitudeDefaultValue; } } + set { + _hasBits0 |= 2; + fracMaxMotionMagnitude_ = value; + } + } + /// Gets whether the "frac_max_motion_magnitude" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracMaxMotionMagnitude { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frac_max_motion_magnitude" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracMaxMotionMagnitude() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_motion_stdev_threshold" field. + public const int MaxMotionStdevThresholdFieldNumber = 4; + private readonly static float MaxMotionStdevThresholdDefaultValue = 0.01F; + + private float maxMotionStdevThreshold_; + /// + /// Motion magnitude is only tested for if standard deviation of estimated + /// translation exceeds threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxMotionStdevThreshold { + get { if ((_hasBits0 & 8) != 0) { return maxMotionStdevThreshold_; } else { return MaxMotionStdevThresholdDefaultValue; } } + set { + _hasBits0 |= 8; + maxMotionStdevThreshold_ = value; + } + } + /// Gets whether the "max_motion_stdev_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxMotionStdevThreshold { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "max_motion_stdev_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxMotionStdevThreshold() { + _hasBits0 &= ~8; + } + + /// Field number for the "max_motion_stdev" field. + public const int MaxMotionStdevFieldNumber = 3; + private readonly static float MaxMotionStdevDefaultValue = 0.065F; + + private float maxMotionStdev_; + /// + /// Max standard deviation of the estimated translation (normalized to frame + /// diameter). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxMotionStdev { + get { if ((_hasBits0 & 4) != 0) { return maxMotionStdev_; } else { return MaxMotionStdevDefaultValue; } } + set { + _hasBits0 |= 4; + maxMotionStdev_ = value; + } + } + /// Gets whether the "max_motion_stdev" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxMotionStdev { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_motion_stdev" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxMotionStdev() { + _hasBits0 &= ~4; + } + + /// Field number for the "max_acceleration" field. + public const int MaxAccelerationFieldNumber = 5; + private readonly static float MaxAccelerationDefaultValue = 20F; + + private float maxAcceleration_; + /// + /// Maximum acceleration between frames. Specified relative to minimum + /// velocity across two adjacent frames (absolute minimum of 0.001 is + /// enforced, ~1 pix for 480p). + /// If exceeded for one frame, the whole batch passed to + /// EstimateMotionsParallel is labeled unstable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxAcceleration { + get { if ((_hasBits0 & 16) != 0) { return maxAcceleration_; } else { return MaxAccelerationDefaultValue; } } + set { + _hasBits0 |= 16; + maxAcceleration_ = value; + } + } + /// Gets whether the "max_acceleration" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxAcceleration { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "max_acceleration" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxAcceleration() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TranslationBounds); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TranslationBounds other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (MinFeatures != other.MinFeatures) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracMaxMotionMagnitude, other.FracMaxMotionMagnitude)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxMotionStdevThreshold, other.MaxMotionStdevThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxMotionStdev, other.MaxMotionStdev)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAcceleration, other.MaxAcceleration)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinFeatures) hash ^= MinFeatures.GetHashCode(); + if (HasFracMaxMotionMagnitude) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracMaxMotionMagnitude); + if (HasMaxMotionStdevThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxMotionStdevThreshold); + if (HasMaxMotionStdev) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxMotionStdev); + if (HasMaxAcceleration) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAcceleration); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinFeatures) { + output.WriteRawTag(8); + output.WriteInt32(MinFeatures); + } + if (HasFracMaxMotionMagnitude) { + output.WriteRawTag(21); + output.WriteFloat(FracMaxMotionMagnitude); + } + if (HasMaxMotionStdev) { + output.WriteRawTag(29); + output.WriteFloat(MaxMotionStdev); + } + if (HasMaxMotionStdevThreshold) { + output.WriteRawTag(37); + output.WriteFloat(MaxMotionStdevThreshold); + } + if (HasMaxAcceleration) { + output.WriteRawTag(45); + output.WriteFloat(MaxAcceleration); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinFeatures) { + output.WriteRawTag(8); + output.WriteInt32(MinFeatures); + } + if (HasFracMaxMotionMagnitude) { + output.WriteRawTag(21); + output.WriteFloat(FracMaxMotionMagnitude); + } + if (HasMaxMotionStdev) { + output.WriteRawTag(29); + output.WriteFloat(MaxMotionStdev); + } + if (HasMaxMotionStdevThreshold) { + output.WriteRawTag(37); + output.WriteFloat(MaxMotionStdevThreshold); + } + if (HasMaxAcceleration) { + output.WriteRawTag(45); + output.WriteFloat(MaxAcceleration); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinFeatures); + } + if (HasFracMaxMotionMagnitude) { + size += 1 + 4; + } + if (HasMaxMotionStdevThreshold) { + size += 1 + 4; + } + if (HasMaxMotionStdev) { + size += 1 + 4; + } + if (HasMaxAcceleration) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TranslationBounds other) { + if (other == null) { + return; + } + if (other.HasMinFeatures) { + MinFeatures = other.MinFeatures; + } + if (other.HasFracMaxMotionMagnitude) { + FracMaxMotionMagnitude = other.FracMaxMotionMagnitude; + } + if (other.HasMaxMotionStdevThreshold) { + MaxMotionStdevThreshold = other.MaxMotionStdevThreshold; + } + if (other.HasMaxMotionStdev) { + MaxMotionStdev = other.MaxMotionStdev; + } + if (other.HasMaxAcceleration) { + MaxAcceleration = other.MaxAcceleration; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MinFeatures = input.ReadInt32(); + break; + } + case 21: { + FracMaxMotionMagnitude = input.ReadFloat(); + break; + } + case 29: { + MaxMotionStdev = input.ReadFloat(); + break; + } + case 37: { + MaxMotionStdevThreshold = input.ReadFloat(); + break; + } + case 45: { + MaxAcceleration = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MinFeatures = input.ReadInt32(); + break; + } + case 21: { + FracMaxMotionMagnitude = input.ReadFloat(); + break; + } + case 29: { + MaxMotionStdev = input.ReadFloat(); + break; + } + case 37: { + MaxMotionStdevThreshold = input.ReadFloat(); + break; + } + case 45: { + MaxAcceleration = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// If any test/bound is violated, the motion is deemed UNSTABLE. + /// + public sealed partial class SimilarityBounds : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimilarityBounds()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityBounds() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityBounds(SimilarityBounds other) : this() { + _hasBits0 = other._hasBits0; + onlyStableInput_ = other.onlyStableInput_; + minInlierFraction_ = other.minInlierFraction_; + minInliers_ = other.minInliers_; + lowerScale_ = other.lowerScale_; + upperScale_ = other.upperScale_; + limitRotation_ = other.limitRotation_; + inlierThreshold_ = other.inlierThreshold_; + fracInlierThreshold_ = other.fracInlierThreshold_; + strictInlierThreshold_ = other.strictInlierThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityBounds Clone() { + return new SimilarityBounds(this); + } + + /// Field number for the "only_stable_input" field. + public const int OnlyStableInputFieldNumber = 1; + private readonly static bool OnlyStableInputDefaultValue = true; + + private bool onlyStableInput_; + /// + /// Input frame has to be labeled stable, i.e. enough features and coverage + /// present. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OnlyStableInput { + get { if ((_hasBits0 & 1) != 0) { return onlyStableInput_; } else { return OnlyStableInputDefaultValue; } } + set { + _hasBits0 |= 1; + onlyStableInput_ = value; + } + } + /// Gets whether the "only_stable_input" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOnlyStableInput { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "only_stable_input" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOnlyStableInput() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_inlier_fraction" field. + public const int MinInlierFractionFieldNumber = 2; + private readonly static float MinInlierFractionDefaultValue = 0.2F; + + private float minInlierFraction_; + /// + /// Minimum number of inlier features (absolute and as fraction of total + /// number of features). + /// TODO: Dataset run setting this to 0.15 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierFraction { + get { if ((_hasBits0 & 2) != 0) { return minInlierFraction_; } else { return MinInlierFractionDefaultValue; } } + set { + _hasBits0 |= 2; + minInlierFraction_ = value; + } + } + /// Gets whether the "min_inlier_fraction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierFraction { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_inlier_fraction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierFraction() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_inliers" field. + public const int MinInliersFieldNumber = 3; + private readonly static float MinInliersDefaultValue = 30F; + + private float minInliers_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInliers { + get { if ((_hasBits0 & 4) != 0) { return minInliers_; } else { return MinInliersDefaultValue; } } + set { + _hasBits0 |= 4; + minInliers_ = value; + } + } + /// Gets whether the "min_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInliers { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInliers() { + _hasBits0 &= ~4; + } + + /// Field number for the "lower_scale" field. + public const int LowerScaleFieldNumber = 4; + private readonly static float LowerScaleDefaultValue = 0.8F; + + private float lowerScale_; + /// + /// Bounds on valid similarities. We use larger values compared to + /// homographies. Note: Bounds are necessary, to guarantee invertability + /// of the resulting similarity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowerScale { + get { if ((_hasBits0 & 8) != 0) { return lowerScale_; } else { return LowerScaleDefaultValue; } } + set { + _hasBits0 |= 8; + lowerScale_ = value; + } + } + /// Gets whether the "lower_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowerScale { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "lower_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowerScale() { + _hasBits0 &= ~8; + } + + /// Field number for the "upper_scale" field. + public const int UpperScaleFieldNumber = 5; + private readonly static float UpperScaleDefaultValue = 1.25F; + + private float upperScale_; + /// + /// 1 / 0.8. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float UpperScale { + get { if ((_hasBits0 & 16) != 0) { return upperScale_; } else { return UpperScaleDefaultValue; } } + set { + _hasBits0 |= 16; + upperScale_ = value; + } + } + /// Gets whether the "upper_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpperScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "upper_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpperScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "limit_rotation" field. + public const int LimitRotationFieldNumber = 6; + private readonly static float LimitRotationDefaultValue = 0.25F; + + private float limitRotation_; + /// + /// 15 degrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LimitRotation { + get { if ((_hasBits0 & 32) != 0) { return limitRotation_; } else { return LimitRotationDefaultValue; } } + set { + _hasBits0 |= 32; + limitRotation_ = value; + } + } + /// Gets whether the "limit_rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLimitRotation { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "limit_rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLimitRotation() { + _hasBits0 &= ~32; + } + + /// Field number for the "inlier_threshold" field. + public const int InlierThresholdFieldNumber = 7; + private readonly static float InlierThresholdDefaultValue = 4F; + + private float inlierThreshold_; + /// + /// Thresholds for a feature to be considered inlier w.r.t similarity + /// transform, expressed in terms of pixel residual error. Max of absolute + /// and fractional thresholds is used. + /// Ratio of inliers that pass regular and strict thresholds are storred in + /// CameraMotion. + /// + /// TODO: Just use lin_sim_inlier_threshold directly, however that + /// recomputes the error, and requires regression testing. Using an extra + /// fractional inlier threshold for now. + /// + /// Absolute in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierThreshold { + get { if ((_hasBits0 & 64) != 0) { return inlierThreshold_; } else { return InlierThresholdDefaultValue; } } + set { + _hasBits0 |= 64; + inlierThreshold_ = value; + } + } + /// Gets whether the "inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierThreshold { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierThreshold() { + _hasBits0 &= ~64; + } + + /// Field number for the "frac_inlier_threshold" field. + public const int FracInlierThresholdFieldNumber = 8; + private readonly static float FracInlierThresholdDefaultValue = 0F; + + private float fracInlierThreshold_; + /// + /// Scaled by frame diameter. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracInlierThreshold { + get { if ((_hasBits0 & 128) != 0) { return fracInlierThreshold_; } else { return FracInlierThresholdDefaultValue; } } + set { + _hasBits0 |= 128; + fracInlierThreshold_ = value; + } + } + /// Gets whether the "frac_inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracInlierThreshold { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "frac_inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracInlierThreshold() { + _hasBits0 &= ~128; + } + + /// Field number for the "strict_inlier_threshold" field. + public const int StrictInlierThresholdFieldNumber = 9; + private readonly static float StrictInlierThresholdDefaultValue = 0.5F; + + private float strictInlierThreshold_; + /// + /// TODO: Revisit after frame selection change. + /// Absolute in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StrictInlierThreshold { + get { if ((_hasBits0 & 256) != 0) { return strictInlierThreshold_; } else { return StrictInlierThresholdDefaultValue; } } + set { + _hasBits0 |= 256; + strictInlierThreshold_ = value; + } + } + /// Gets whether the "strict_inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStrictInlierThreshold { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "strict_inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStrictInlierThreshold() { + _hasBits0 &= ~256; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SimilarityBounds); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SimilarityBounds other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OnlyStableInput != other.OnlyStableInput) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierFraction, other.MinInlierFraction)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInliers, other.MinInliers)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowerScale, other.LowerScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpperScale, other.UpperScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LimitRotation, other.LimitRotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierThreshold, other.InlierThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracInlierThreshold, other.FracInlierThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StrictInlierThreshold, other.StrictInlierThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOnlyStableInput) hash ^= OnlyStableInput.GetHashCode(); + if (HasMinInlierFraction) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierFraction); + if (HasMinInliers) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInliers); + if (HasLowerScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowerScale); + if (HasUpperScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpperScale); + if (HasLimitRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LimitRotation); + if (HasInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierThreshold); + if (HasFracInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracInlierThreshold); + if (HasStrictInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StrictInlierThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOnlyStableInput) { + output.WriteRawTag(8); + output.WriteBool(OnlyStableInput); + } + if (HasMinInlierFraction) { + output.WriteRawTag(21); + output.WriteFloat(MinInlierFraction); + } + if (HasMinInliers) { + output.WriteRawTag(29); + output.WriteFloat(MinInliers); + } + if (HasLowerScale) { + output.WriteRawTag(37); + output.WriteFloat(LowerScale); + } + if (HasUpperScale) { + output.WriteRawTag(45); + output.WriteFloat(UpperScale); + } + if (HasLimitRotation) { + output.WriteRawTag(53); + output.WriteFloat(LimitRotation); + } + if (HasInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(InlierThreshold); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(69); + output.WriteFloat(FracInlierThreshold); + } + if (HasStrictInlierThreshold) { + output.WriteRawTag(77); + output.WriteFloat(StrictInlierThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOnlyStableInput) { + output.WriteRawTag(8); + output.WriteBool(OnlyStableInput); + } + if (HasMinInlierFraction) { + output.WriteRawTag(21); + output.WriteFloat(MinInlierFraction); + } + if (HasMinInliers) { + output.WriteRawTag(29); + output.WriteFloat(MinInliers); + } + if (HasLowerScale) { + output.WriteRawTag(37); + output.WriteFloat(LowerScale); + } + if (HasUpperScale) { + output.WriteRawTag(45); + output.WriteFloat(UpperScale); + } + if (HasLimitRotation) { + output.WriteRawTag(53); + output.WriteFloat(LimitRotation); + } + if (HasInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(InlierThreshold); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(69); + output.WriteFloat(FracInlierThreshold); + } + if (HasStrictInlierThreshold) { + output.WriteRawTag(77); + output.WriteFloat(StrictInlierThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOnlyStableInput) { + size += 1 + 1; + } + if (HasMinInlierFraction) { + size += 1 + 4; + } + if (HasMinInliers) { + size += 1 + 4; + } + if (HasLowerScale) { + size += 1 + 4; + } + if (HasUpperScale) { + size += 1 + 4; + } + if (HasLimitRotation) { + size += 1 + 4; + } + if (HasInlierThreshold) { + size += 1 + 4; + } + if (HasFracInlierThreshold) { + size += 1 + 4; + } + if (HasStrictInlierThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SimilarityBounds other) { + if (other == null) { + return; + } + if (other.HasOnlyStableInput) { + OnlyStableInput = other.OnlyStableInput; + } + if (other.HasMinInlierFraction) { + MinInlierFraction = other.MinInlierFraction; + } + if (other.HasMinInliers) { + MinInliers = other.MinInliers; + } + if (other.HasLowerScale) { + LowerScale = other.LowerScale; + } + if (other.HasUpperScale) { + UpperScale = other.UpperScale; + } + if (other.HasLimitRotation) { + LimitRotation = other.LimitRotation; + } + if (other.HasInlierThreshold) { + InlierThreshold = other.InlierThreshold; + } + if (other.HasFracInlierThreshold) { + FracInlierThreshold = other.FracInlierThreshold; + } + if (other.HasStrictInlierThreshold) { + StrictInlierThreshold = other.StrictInlierThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OnlyStableInput = input.ReadBool(); + break; + } + case 21: { + MinInlierFraction = input.ReadFloat(); + break; + } + case 29: { + MinInliers = input.ReadFloat(); + break; + } + case 37: { + LowerScale = input.ReadFloat(); + break; + } + case 45: { + UpperScale = input.ReadFloat(); + break; + } + case 53: { + LimitRotation = input.ReadFloat(); + break; + } + case 61: { + InlierThreshold = input.ReadFloat(); + break; + } + case 69: { + FracInlierThreshold = input.ReadFloat(); + break; + } + case 77: { + StrictInlierThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OnlyStableInput = input.ReadBool(); + break; + } + case 21: { + MinInlierFraction = input.ReadFloat(); + break; + } + case 29: { + MinInliers = input.ReadFloat(); + break; + } + case 37: { + LowerScale = input.ReadFloat(); + break; + } + case 45: { + UpperScale = input.ReadFloat(); + break; + } + case 53: { + LimitRotation = input.ReadFloat(); + break; + } + case 61: { + InlierThreshold = input.ReadFloat(); + break; + } + case 69: { + FracInlierThreshold = input.ReadFloat(); + break; + } + case 77: { + StrictInlierThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// If any parameter of the estimated homography exceeds these bounds, + /// we deem it UNSTABLE_SIM and use estimated similarity instead. + /// + public sealed partial class HomographyBounds : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HomographyBounds()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyBounds() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyBounds(HomographyBounds other) : this() { + _hasBits0 = other._hasBits0; + lowerScale_ = other.lowerScale_; + upperScale_ = other.upperScale_; + limitRotation_ = other.limitRotation_; + limitPerspective_ = other.limitPerspective_; + registrationThreshold_ = other.registrationThreshold_; + fracRegistrationThreshold_ = other.fracRegistrationThreshold_; + minInlierCoverage_ = other.minInlierCoverage_; + fracInlierThreshold_ = other.fracInlierThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HomographyBounds Clone() { + return new HomographyBounds(this); + } + + /// Field number for the "lower_scale" field. + public const int LowerScaleFieldNumber = 1; + private readonly static float LowerScaleDefaultValue = 0.8F; + + private float lowerScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowerScale { + get { if ((_hasBits0 & 1) != 0) { return lowerScale_; } else { return LowerScaleDefaultValue; } } + set { + _hasBits0 |= 1; + lowerScale_ = value; + } + } + /// Gets whether the "lower_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowerScale { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "lower_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowerScale() { + _hasBits0 &= ~1; + } + + /// Field number for the "upper_scale" field. + public const int UpperScaleFieldNumber = 2; + private readonly static float UpperScaleDefaultValue = 1.25F; + + private float upperScale_; + /// + /// 1 / 0.8. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float UpperScale { + get { if ((_hasBits0 & 2) != 0) { return upperScale_; } else { return UpperScaleDefaultValue; } } + set { + _hasBits0 |= 2; + upperScale_ = value; + } + } + /// Gets whether the "upper_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpperScale { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "upper_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpperScale() { + _hasBits0 &= ~2; + } + + /// Field number for the "limit_rotation" field. + public const int LimitRotationFieldNumber = 3; + private readonly static float LimitRotationDefaultValue = 0.25F; + + private float limitRotation_; + /// + /// 15 degrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LimitRotation { + get { if ((_hasBits0 & 4) != 0) { return limitRotation_; } else { return LimitRotationDefaultValue; } } + set { + _hasBits0 |= 4; + limitRotation_ = value; + } + } + /// Gets whether the "limit_rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLimitRotation { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "limit_rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLimitRotation() { + _hasBits0 &= ~4; + } + + /// Field number for the "limit_perspective" field. + public const int LimitPerspectiveFieldNumber = 4; + private readonly static float LimitPerspectiveDefaultValue = 0.0004F; + + private float limitPerspective_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LimitPerspective { + get { if ((_hasBits0 & 8) != 0) { return limitPerspective_; } else { return LimitPerspectiveDefaultValue; } } + set { + _hasBits0 |= 8; + limitPerspective_ = value; + } + } + /// Gets whether the "limit_perspective" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLimitPerspective { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "limit_perspective" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLimitPerspective() { + _hasBits0 &= ~8; + } + + /// Field number for the "registration_threshold" field. + public const int RegistrationThresholdFieldNumber = 5; + private readonly static float RegistrationThresholdDefaultValue = 0.1F; + + private float registrationThreshold_; + /// + /// Inlier coverage is only tested for if average homography error exceeds + /// registration_thresholds. Max of the following two thresholds is used. + /// + /// Absolute in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RegistrationThreshold { + get { if ((_hasBits0 & 16) != 0) { return registrationThreshold_; } else { return RegistrationThresholdDefaultValue; } } + set { + _hasBits0 |= 16; + registrationThreshold_ = value; + } + } + /// Gets whether the "registration_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRegistrationThreshold { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "registration_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRegistrationThreshold() { + _hasBits0 &= ~16; + } + + /// Field number for the "frac_registration_threshold" field. + public const int FracRegistrationThresholdFieldNumber = 8; + private readonly static float FracRegistrationThresholdDefaultValue = 0F; + + private float fracRegistrationThreshold_; + /// + /// Scaled by frame diameter. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracRegistrationThreshold { + get { if ((_hasBits0 & 128) != 0) { return fracRegistrationThreshold_; } else { return FracRegistrationThresholdDefaultValue; } } + set { + _hasBits0 |= 128; + fracRegistrationThreshold_ = value; + } + } + /// Gets whether the "frac_registration_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracRegistrationThreshold { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "frac_registration_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracRegistrationThreshold() { + _hasBits0 &= ~128; + } + + /// Field number for the "min_inlier_coverage" field. + public const int MinInlierCoverageFieldNumber = 6; + private readonly static float MinInlierCoverageDefaultValue = 0.3F; + + private float minInlierCoverage_; + /// + /// Minimum fraction of inlier features w.r.t. frame area. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierCoverage { + get { if ((_hasBits0 & 32) != 0) { return minInlierCoverage_; } else { return MinInlierCoverageDefaultValue; } } + set { + _hasBits0 |= 32; + minInlierCoverage_ = value; + } + } + /// Gets whether the "min_inlier_coverage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierCoverage { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "min_inlier_coverage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierCoverage() { + _hasBits0 &= ~32; + } + + /// Field number for the "frac_inlier_threshold" field. + public const int FracInlierThresholdFieldNumber = 7; + private readonly static float FracInlierThresholdDefaultValue = 0.002F; + + private float fracInlierThreshold_; + /// + /// Grid coverage inlier threshold. Pixel errors below this + /// threshold are considered inliers. Defined w.r.t. frame diameter, approx. + /// 1.5 for 16:9 SD video (480p), i.e. threshold is multiplied by frame + /// diameter. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracInlierThreshold { + get { if ((_hasBits0 & 64) != 0) { return fracInlierThreshold_; } else { return FracInlierThresholdDefaultValue; } } + set { + _hasBits0 |= 64; + fracInlierThreshold_ = value; + } + } + /// Gets whether the "frac_inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracInlierThreshold { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "frac_inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracInlierThreshold() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as HomographyBounds); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(HomographyBounds other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowerScale, other.LowerScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpperScale, other.UpperScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LimitRotation, other.LimitRotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LimitPerspective, other.LimitPerspective)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RegistrationThreshold, other.RegistrationThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracRegistrationThreshold, other.FracRegistrationThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierCoverage, other.MinInlierCoverage)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracInlierThreshold, other.FracInlierThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLowerScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowerScale); + if (HasUpperScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpperScale); + if (HasLimitRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LimitRotation); + if (HasLimitPerspective) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LimitPerspective); + if (HasRegistrationThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RegistrationThreshold); + if (HasFracRegistrationThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracRegistrationThreshold); + if (HasMinInlierCoverage) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierCoverage); + if (HasFracInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracInlierThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLowerScale) { + output.WriteRawTag(13); + output.WriteFloat(LowerScale); + } + if (HasUpperScale) { + output.WriteRawTag(21); + output.WriteFloat(UpperScale); + } + if (HasLimitRotation) { + output.WriteRawTag(29); + output.WriteFloat(LimitRotation); + } + if (HasLimitPerspective) { + output.WriteRawTag(37); + output.WriteFloat(LimitPerspective); + } + if (HasRegistrationThreshold) { + output.WriteRawTag(45); + output.WriteFloat(RegistrationThreshold); + } + if (HasMinInlierCoverage) { + output.WriteRawTag(53); + output.WriteFloat(MinInlierCoverage); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(FracInlierThreshold); + } + if (HasFracRegistrationThreshold) { + output.WriteRawTag(69); + output.WriteFloat(FracRegistrationThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLowerScale) { + output.WriteRawTag(13); + output.WriteFloat(LowerScale); + } + if (HasUpperScale) { + output.WriteRawTag(21); + output.WriteFloat(UpperScale); + } + if (HasLimitRotation) { + output.WriteRawTag(29); + output.WriteFloat(LimitRotation); + } + if (HasLimitPerspective) { + output.WriteRawTag(37); + output.WriteFloat(LimitPerspective); + } + if (HasRegistrationThreshold) { + output.WriteRawTag(45); + output.WriteFloat(RegistrationThreshold); + } + if (HasMinInlierCoverage) { + output.WriteRawTag(53); + output.WriteFloat(MinInlierCoverage); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(FracInlierThreshold); + } + if (HasFracRegistrationThreshold) { + output.WriteRawTag(69); + output.WriteFloat(FracRegistrationThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLowerScale) { + size += 1 + 4; + } + if (HasUpperScale) { + size += 1 + 4; + } + if (HasLimitRotation) { + size += 1 + 4; + } + if (HasLimitPerspective) { + size += 1 + 4; + } + if (HasRegistrationThreshold) { + size += 1 + 4; + } + if (HasFracRegistrationThreshold) { + size += 1 + 4; + } + if (HasMinInlierCoverage) { + size += 1 + 4; + } + if (HasFracInlierThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(HomographyBounds other) { + if (other == null) { + return; + } + if (other.HasLowerScale) { + LowerScale = other.LowerScale; + } + if (other.HasUpperScale) { + UpperScale = other.UpperScale; + } + if (other.HasLimitRotation) { + LimitRotation = other.LimitRotation; + } + if (other.HasLimitPerspective) { + LimitPerspective = other.LimitPerspective; + } + if (other.HasRegistrationThreshold) { + RegistrationThreshold = other.RegistrationThreshold; + } + if (other.HasFracRegistrationThreshold) { + FracRegistrationThreshold = other.FracRegistrationThreshold; + } + if (other.HasMinInlierCoverage) { + MinInlierCoverage = other.MinInlierCoverage; + } + if (other.HasFracInlierThreshold) { + FracInlierThreshold = other.FracInlierThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + LowerScale = input.ReadFloat(); + break; + } + case 21: { + UpperScale = input.ReadFloat(); + break; + } + case 29: { + LimitRotation = input.ReadFloat(); + break; + } + case 37: { + LimitPerspective = input.ReadFloat(); + break; + } + case 45: { + RegistrationThreshold = input.ReadFloat(); + break; + } + case 53: { + MinInlierCoverage = input.ReadFloat(); + break; + } + case 61: { + FracInlierThreshold = input.ReadFloat(); + break; + } + case 69: { + FracRegistrationThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + LowerScale = input.ReadFloat(); + break; + } + case 21: { + UpperScale = input.ReadFloat(); + break; + } + case 29: { + LimitRotation = input.ReadFloat(); + break; + } + case 37: { + LimitPerspective = input.ReadFloat(); + break; + } + case 45: { + RegistrationThreshold = input.ReadFloat(); + break; + } + case 53: { + MinInlierCoverage = input.ReadFloat(); + break; + } + case 61: { + FracInlierThreshold = input.ReadFloat(); + break; + } + case 69: { + FracRegistrationThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// If any parameter of the estimated homography mixture exceeds these bounds, + /// we deem it UNSTABLE_HOMOG and use the estimated homography instead. + /// + public sealed partial class MixtureHomographyBounds : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureHomographyBounds()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomographyBounds() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomographyBounds(MixtureHomographyBounds other) : this() { + _hasBits0 = other._hasBits0; + minInlierCoverage_ = other.minInlierCoverage_; + maxAdjacentOutlierBlocks_ = other.maxAdjacentOutlierBlocks_; + maxAdjacentEmptyBlocks_ = other.maxAdjacentEmptyBlocks_; + fracInlierThreshold_ = other.fracInlierThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomographyBounds Clone() { + return new MixtureHomographyBounds(this); + } + + /// Field number for the "min_inlier_coverage" field. + public const int MinInlierCoverageFieldNumber = 1; + private readonly static float MinInlierCoverageDefaultValue = 0.4F; + + private float minInlierCoverage_; + /// + /// Minimum fraction of inlier features w.r.t. block area. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierCoverage { + get { if ((_hasBits0 & 1) != 0) { return minInlierCoverage_; } else { return MinInlierCoverageDefaultValue; } } + set { + _hasBits0 |= 1; + minInlierCoverage_ = value; + } + } + /// Gets whether the "min_inlier_coverage" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierCoverage { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_inlier_coverage" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierCoverage() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_adjacent_outlier_blocks" field. + public const int MaxAdjacentOutlierBlocksFieldNumber = 2; + private readonly static int MaxAdjacentOutlierBlocksDefaultValue = 5; + + private int maxAdjacentOutlierBlocks_; + /// + /// Each block is tested to be stable, regarding the outliers. + /// A frame is labeled unstable, if more or equal than the specified adjacent + /// blocks are labeled outliers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxAdjacentOutlierBlocks { + get { if ((_hasBits0 & 2) != 0) { return maxAdjacentOutlierBlocks_; } else { return MaxAdjacentOutlierBlocksDefaultValue; } } + set { + _hasBits0 |= 2; + maxAdjacentOutlierBlocks_ = value; + } + } + /// Gets whether the "max_adjacent_outlier_blocks" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxAdjacentOutlierBlocks { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_adjacent_outlier_blocks" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxAdjacentOutlierBlocks() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_adjacent_empty_blocks" field. + public const int MaxAdjacentEmptyBlocksFieldNumber = 3; + private readonly static int MaxAdjacentEmptyBlocksDefaultValue = 3; + + private int maxAdjacentEmptyBlocks_; + /// + /// Maximum number of adjacent empty blocks (no inliers). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxAdjacentEmptyBlocks { + get { if ((_hasBits0 & 4) != 0) { return maxAdjacentEmptyBlocks_; } else { return MaxAdjacentEmptyBlocksDefaultValue; } } + set { + _hasBits0 |= 4; + maxAdjacentEmptyBlocks_ = value; + } + } + /// Gets whether the "max_adjacent_empty_blocks" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxAdjacentEmptyBlocks { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_adjacent_empty_blocks" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxAdjacentEmptyBlocks() { + _hasBits0 &= ~4; + } + + /// Field number for the "frac_inlier_threshold" field. + public const int FracInlierThresholdFieldNumber = 7; + private readonly static float FracInlierThresholdDefaultValue = 0.0025F; + + private float fracInlierThreshold_; + /// + /// Grid coverage threshold inlier threshold. See identical parameter in + /// HomographyBounds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracInlierThreshold { + get { if ((_hasBits0 & 8) != 0) { return fracInlierThreshold_; } else { return FracInlierThresholdDefaultValue; } } + set { + _hasBits0 |= 8; + fracInlierThreshold_ = value; + } + } + /// Gets whether the "frac_inlier_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracInlierThreshold { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "frac_inlier_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracInlierThreshold() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureHomographyBounds); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureHomographyBounds other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierCoverage, other.MinInlierCoverage)) return false; + if (MaxAdjacentOutlierBlocks != other.MaxAdjacentOutlierBlocks) return false; + if (MaxAdjacentEmptyBlocks != other.MaxAdjacentEmptyBlocks) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracInlierThreshold, other.FracInlierThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinInlierCoverage) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierCoverage); + if (HasMaxAdjacentOutlierBlocks) hash ^= MaxAdjacentOutlierBlocks.GetHashCode(); + if (HasMaxAdjacentEmptyBlocks) hash ^= MaxAdjacentEmptyBlocks.GetHashCode(); + if (HasFracInlierThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracInlierThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinInlierCoverage) { + output.WriteRawTag(13); + output.WriteFloat(MinInlierCoverage); + } + if (HasMaxAdjacentOutlierBlocks) { + output.WriteRawTag(16); + output.WriteInt32(MaxAdjacentOutlierBlocks); + } + if (HasMaxAdjacentEmptyBlocks) { + output.WriteRawTag(24); + output.WriteInt32(MaxAdjacentEmptyBlocks); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(FracInlierThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinInlierCoverage) { + output.WriteRawTag(13); + output.WriteFloat(MinInlierCoverage); + } + if (HasMaxAdjacentOutlierBlocks) { + output.WriteRawTag(16); + output.WriteInt32(MaxAdjacentOutlierBlocks); + } + if (HasMaxAdjacentEmptyBlocks) { + output.WriteRawTag(24); + output.WriteInt32(MaxAdjacentEmptyBlocks); + } + if (HasFracInlierThreshold) { + output.WriteRawTag(61); + output.WriteFloat(FracInlierThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinInlierCoverage) { + size += 1 + 4; + } + if (HasMaxAdjacentOutlierBlocks) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxAdjacentOutlierBlocks); + } + if (HasMaxAdjacentEmptyBlocks) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxAdjacentEmptyBlocks); + } + if (HasFracInlierThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureHomographyBounds other) { + if (other == null) { + return; + } + if (other.HasMinInlierCoverage) { + MinInlierCoverage = other.MinInlierCoverage; + } + if (other.HasMaxAdjacentOutlierBlocks) { + MaxAdjacentOutlierBlocks = other.MaxAdjacentOutlierBlocks; + } + if (other.HasMaxAdjacentEmptyBlocks) { + MaxAdjacentEmptyBlocks = other.MaxAdjacentEmptyBlocks; + } + if (other.HasFracInlierThreshold) { + FracInlierThreshold = other.FracInlierThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinInlierCoverage = input.ReadFloat(); + break; + } + case 16: { + MaxAdjacentOutlierBlocks = input.ReadInt32(); + break; + } + case 24: { + MaxAdjacentEmptyBlocks = input.ReadInt32(); + break; + } + case 61: { + FracInlierThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinInlierCoverage = input.ReadFloat(); + break; + } + case 16: { + MaxAdjacentOutlierBlocks = input.ReadInt32(); + break; + } + case 24: { + MaxAdjacentEmptyBlocks = input.ReadInt32(); + break; + } + case 61: { + FracInlierThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class OverlayDetectionOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OverlayDetectionOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OverlayDetectionOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OverlayDetectionOptions(OverlayDetectionOptions other) : this() { + _hasBits0 = other._hasBits0; + analysisMaskSize_ = other.analysisMaskSize_; + strictNearZeroMotion_ = other.strictNearZeroMotion_; + strictMaxTranslationRatio_ = other.strictMaxTranslationRatio_; + strictMinTexturedness_ = other.strictMinTexturedness_; + looseNearZeroMotion_ = other.looseNearZeroMotion_; + overlayMinRatio_ = other.overlayMinRatio_; + overlayMinFeatures_ = other.overlayMinFeatures_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public OverlayDetectionOptions Clone() { + return new OverlayDetectionOptions(this); + } + + /// Field number for the "analysis_mask_size" field. + public const int AnalysisMaskSizeFieldNumber = 1; + private readonly static int AnalysisMaskSizeDefaultValue = 10; + + private int analysisMaskSize_; + /// + /// Potential overlay features are aggregated over a mask with cells + /// mask_size x mask_size as specified below. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AnalysisMaskSize { + get { if ((_hasBits0 & 1) != 0) { return analysisMaskSize_; } else { return AnalysisMaskSizeDefaultValue; } } + set { + _hasBits0 |= 1; + analysisMaskSize_ = value; + } + } + /// Gets whether the "analysis_mask_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAnalysisMaskSize { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "analysis_mask_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAnalysisMaskSize() { + _hasBits0 &= ~1; + } + + /// Field number for the "strict_near_zero_motion" field. + public const int StrictNearZeroMotionFieldNumber = 2; + private readonly static float StrictNearZeroMotionDefaultValue = 0.2F; + + private float strictNearZeroMotion_; + /// + /// A feature is a strict overlay feature if its motion is less than + /// near_zero_motion and AND less than max_translation_ratio times the + /// estimated translation magnitude at that frame AND is texturedness is + /// sufficiently high. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StrictNearZeroMotion { + get { if ((_hasBits0 & 2) != 0) { return strictNearZeroMotion_; } else { return StrictNearZeroMotionDefaultValue; } } + set { + _hasBits0 |= 2; + strictNearZeroMotion_ = value; + } + } + /// Gets whether the "strict_near_zero_motion" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStrictNearZeroMotion { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "strict_near_zero_motion" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStrictNearZeroMotion() { + _hasBits0 &= ~2; + } + + /// Field number for the "strict_max_translation_ratio" field. + public const int StrictMaxTranslationRatioFieldNumber = 3; + private readonly static float StrictMaxTranslationRatioDefaultValue = 0.2F; + + private float strictMaxTranslationRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StrictMaxTranslationRatio { + get { if ((_hasBits0 & 4) != 0) { return strictMaxTranslationRatio_; } else { return StrictMaxTranslationRatioDefaultValue; } } + set { + _hasBits0 |= 4; + strictMaxTranslationRatio_ = value; + } + } + /// Gets whether the "strict_max_translation_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStrictMaxTranslationRatio { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "strict_max_translation_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStrictMaxTranslationRatio() { + _hasBits0 &= ~4; + } + + /// Field number for the "strict_min_texturedness" field. + public const int StrictMinTexturednessFieldNumber = 5; + private readonly static float StrictMinTexturednessDefaultValue = 0.1F; + + private float strictMinTexturedness_; + /// + /// Minimum texturedness of a feature to be considered an overlay. + /// Motivation: Overlays are mostly text or graphics, i.e. have visually + /// distinguished features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StrictMinTexturedness { + get { if ((_hasBits0 & 16) != 0) { return strictMinTexturedness_; } else { return StrictMinTexturednessDefaultValue; } } + set { + _hasBits0 |= 16; + strictMinTexturedness_ = value; + } + } + /// Gets whether the "strict_min_texturedness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStrictMinTexturedness { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "strict_min_texturedness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStrictMinTexturedness() { + _hasBits0 &= ~16; + } + + /// Field number for the "loose_near_zero_motion" field. + public const int LooseNearZeroMotionFieldNumber = 4; + private readonly static float LooseNearZeroMotionDefaultValue = 1F; + + private float looseNearZeroMotion_; + /// + /// A feature is a loose overlay feature if its motion is less than + /// loose_near_zero_motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LooseNearZeroMotion { + get { if ((_hasBits0 & 8) != 0) { return looseNearZeroMotion_; } else { return LooseNearZeroMotionDefaultValue; } } + set { + _hasBits0 |= 8; + looseNearZeroMotion_ = value; + } + } + /// Gets whether the "loose_near_zero_motion" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLooseNearZeroMotion { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "loose_near_zero_motion" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLooseNearZeroMotion() { + _hasBits0 &= ~8; + } + + /// Field number for the "overlay_min_ratio" field. + public const int OverlayMinRatioFieldNumber = 6; + private readonly static float OverlayMinRatioDefaultValue = 0.3F; + + private float overlayMinRatio_; + /// + /// Minimum fraction of strict overlay features within a cell to be + /// considered an overlay cell. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OverlayMinRatio { + get { if ((_hasBits0 & 32) != 0) { return overlayMinRatio_; } else { return OverlayMinRatioDefaultValue; } } + set { + _hasBits0 |= 32; + overlayMinRatio_ = value; + } + } + /// Gets whether the "overlay_min_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlayMinRatio { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "overlay_min_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlayMinRatio() { + _hasBits0 &= ~32; + } + + /// Field number for the "overlay_min_features" field. + public const int OverlayMinFeaturesFieldNumber = 7; + private readonly static float OverlayMinFeaturesDefaultValue = 10F; + + private float overlayMinFeatures_; + /// + /// Absolute minimum number of strict overlay features within a cell to be + /// considered an overlay cel.. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OverlayMinFeatures { + get { if ((_hasBits0 & 64) != 0) { return overlayMinFeatures_; } else { return OverlayMinFeaturesDefaultValue; } } + set { + _hasBits0 |= 64; + overlayMinFeatures_ = value; + } + } + /// Gets whether the "overlay_min_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOverlayMinFeatures { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "overlay_min_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOverlayMinFeatures() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as OverlayDetectionOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(OverlayDetectionOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AnalysisMaskSize != other.AnalysisMaskSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StrictNearZeroMotion, other.StrictNearZeroMotion)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StrictMaxTranslationRatio, other.StrictMaxTranslationRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StrictMinTexturedness, other.StrictMinTexturedness)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LooseNearZeroMotion, other.LooseNearZeroMotion)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlayMinRatio, other.OverlayMinRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlayMinFeatures, other.OverlayMinFeatures)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasAnalysisMaskSize) hash ^= AnalysisMaskSize.GetHashCode(); + if (HasStrictNearZeroMotion) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StrictNearZeroMotion); + if (HasStrictMaxTranslationRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StrictMaxTranslationRatio); + if (HasStrictMinTexturedness) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StrictMinTexturedness); + if (HasLooseNearZeroMotion) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LooseNearZeroMotion); + if (HasOverlayMinRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlayMinRatio); + if (HasOverlayMinFeatures) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlayMinFeatures); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasAnalysisMaskSize) { + output.WriteRawTag(8); + output.WriteInt32(AnalysisMaskSize); + } + if (HasStrictNearZeroMotion) { + output.WriteRawTag(21); + output.WriteFloat(StrictNearZeroMotion); + } + if (HasStrictMaxTranslationRatio) { + output.WriteRawTag(29); + output.WriteFloat(StrictMaxTranslationRatio); + } + if (HasLooseNearZeroMotion) { + output.WriteRawTag(37); + output.WriteFloat(LooseNearZeroMotion); + } + if (HasStrictMinTexturedness) { + output.WriteRawTag(45); + output.WriteFloat(StrictMinTexturedness); + } + if (HasOverlayMinRatio) { + output.WriteRawTag(53); + output.WriteFloat(OverlayMinRatio); + } + if (HasOverlayMinFeatures) { + output.WriteRawTag(61); + output.WriteFloat(OverlayMinFeatures); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAnalysisMaskSize) { + output.WriteRawTag(8); + output.WriteInt32(AnalysisMaskSize); + } + if (HasStrictNearZeroMotion) { + output.WriteRawTag(21); + output.WriteFloat(StrictNearZeroMotion); + } + if (HasStrictMaxTranslationRatio) { + output.WriteRawTag(29); + output.WriteFloat(StrictMaxTranslationRatio); + } + if (HasLooseNearZeroMotion) { + output.WriteRawTag(37); + output.WriteFloat(LooseNearZeroMotion); + } + if (HasStrictMinTexturedness) { + output.WriteRawTag(45); + output.WriteFloat(StrictMinTexturedness); + } + if (HasOverlayMinRatio) { + output.WriteRawTag(53); + output.WriteFloat(OverlayMinRatio); + } + if (HasOverlayMinFeatures) { + output.WriteRawTag(61); + output.WriteFloat(OverlayMinFeatures); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasAnalysisMaskSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AnalysisMaskSize); + } + if (HasStrictNearZeroMotion) { + size += 1 + 4; + } + if (HasStrictMaxTranslationRatio) { + size += 1 + 4; + } + if (HasStrictMinTexturedness) { + size += 1 + 4; + } + if (HasLooseNearZeroMotion) { + size += 1 + 4; + } + if (HasOverlayMinRatio) { + size += 1 + 4; + } + if (HasOverlayMinFeatures) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(OverlayDetectionOptions other) { + if (other == null) { + return; + } + if (other.HasAnalysisMaskSize) { + AnalysisMaskSize = other.AnalysisMaskSize; + } + if (other.HasStrictNearZeroMotion) { + StrictNearZeroMotion = other.StrictNearZeroMotion; + } + if (other.HasStrictMaxTranslationRatio) { + StrictMaxTranslationRatio = other.StrictMaxTranslationRatio; + } + if (other.HasStrictMinTexturedness) { + StrictMinTexturedness = other.StrictMinTexturedness; + } + if (other.HasLooseNearZeroMotion) { + LooseNearZeroMotion = other.LooseNearZeroMotion; + } + if (other.HasOverlayMinRatio) { + OverlayMinRatio = other.OverlayMinRatio; + } + if (other.HasOverlayMinFeatures) { + OverlayMinFeatures = other.OverlayMinFeatures; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + AnalysisMaskSize = input.ReadInt32(); + break; + } + case 21: { + StrictNearZeroMotion = input.ReadFloat(); + break; + } + case 29: { + StrictMaxTranslationRatio = input.ReadFloat(); + break; + } + case 37: { + LooseNearZeroMotion = input.ReadFloat(); + break; + } + case 45: { + StrictMinTexturedness = input.ReadFloat(); + break; + } + case 53: { + OverlayMinRatio = input.ReadFloat(); + break; + } + case 61: { + OverlayMinFeatures = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + AnalysisMaskSize = input.ReadInt32(); + break; + } + case 21: { + StrictNearZeroMotion = input.ReadFloat(); + break; + } + case 29: { + StrictMaxTranslationRatio = input.ReadFloat(); + break; + } + case 37: { + LooseNearZeroMotion = input.ReadFloat(); + break; + } + case 45: { + StrictMinTexturedness = input.ReadFloat(); + break; + } + case 53: { + OverlayMinRatio = input.ReadFloat(); + break; + } + case 61: { + OverlayMinFeatures = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Shot boundaries are introduced in 3 different scenarios: + /// a) Frame has zero tracked features w.r.t. previous frame + /// b) Estimated motion is deemed invalid (CameraMotion::INVALID). + /// c) Visual consistency is above threshold of two adjacent frames. + /// + public sealed partial class ShotBoundaryOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ShotBoundaryOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionEstimationOptions.Descriptor.NestedTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ShotBoundaryOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ShotBoundaryOptions(ShotBoundaryOptions other) : this() { + _hasBits0 = other._hasBits0; + motionConsistencyThreshold_ = other.motionConsistencyThreshold_; + appearanceConsistencyThreshold_ = other.appearanceConsistencyThreshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ShotBoundaryOptions Clone() { + return new ShotBoundaryOptions(this); + } + + /// Field number for the "motion_consistency_threshold" field. + public const int MotionConsistencyThresholdFieldNumber = 1; + private readonly static float MotionConsistencyThresholdDefaultValue = 0.02F; + + private float motionConsistencyThreshold_; + /// + /// After cases a & b are determined from features/camera motion, they + /// are verified by ensuring visual consistency is above specified threshold, + /// if visual consistency has been computed. Only if this is case will the + /// frame be labeled as shot boundary. Motivation is, that there should + /// always be some (even small) measurable increase in the frame difference + /// at a shot boundary. + /// Verification is only performed if visual_consistency has been evaluated + /// (value >= 0). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MotionConsistencyThreshold { + get { if ((_hasBits0 & 1) != 0) { return motionConsistencyThreshold_; } else { return MotionConsistencyThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + motionConsistencyThreshold_ = value; + } + } + /// Gets whether the "motion_consistency_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionConsistencyThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "motion_consistency_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionConsistencyThreshold() { + _hasBits0 &= ~1; + } + + /// Field number for the "appearance_consistency_threshold" field. + public const int AppearanceConsistencyThresholdFieldNumber = 2; + private readonly static float AppearanceConsistencyThresholdDefaultValue = 0.075F; + + private float appearanceConsistencyThreshold_; + /// + /// Threshold for case c). Sometimes, motion estimation will miss shot + /// boundaries. We define shot boundaries for which the visual consistency is + /// higher than the specified threshold for at least two adjacent frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AppearanceConsistencyThreshold { + get { if ((_hasBits0 & 2) != 0) { return appearanceConsistencyThreshold_; } else { return AppearanceConsistencyThresholdDefaultValue; } } + set { + _hasBits0 |= 2; + appearanceConsistencyThreshold_ = value; + } + } + /// Gets whether the "appearance_consistency_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAppearanceConsistencyThreshold { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "appearance_consistency_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAppearanceConsistencyThreshold() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ShotBoundaryOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ShotBoundaryOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MotionConsistencyThreshold, other.MotionConsistencyThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AppearanceConsistencyThreshold, other.AppearanceConsistencyThreshold)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMotionConsistencyThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MotionConsistencyThreshold); + if (HasAppearanceConsistencyThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AppearanceConsistencyThreshold); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMotionConsistencyThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MotionConsistencyThreshold); + } + if (HasAppearanceConsistencyThreshold) { + output.WriteRawTag(21); + output.WriteFloat(AppearanceConsistencyThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMotionConsistencyThreshold) { + output.WriteRawTag(13); + output.WriteFloat(MotionConsistencyThreshold); + } + if (HasAppearanceConsistencyThreshold) { + output.WriteRawTag(21); + output.WriteFloat(AppearanceConsistencyThreshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMotionConsistencyThreshold) { + size += 1 + 4; + } + if (HasAppearanceConsistencyThreshold) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ShotBoundaryOptions other) { + if (other == null) { + return; + } + if (other.HasMotionConsistencyThreshold) { + MotionConsistencyThreshold = other.MotionConsistencyThreshold; + } + if (other.HasAppearanceConsistencyThreshold) { + AppearanceConsistencyThreshold = other.AppearanceConsistencyThreshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MotionConsistencyThreshold = input.ReadFloat(); + break; + } + case 21: { + AppearanceConsistencyThreshold = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MotionConsistencyThreshold = input.ReadFloat(); + break; + } + case 21: { + AppearanceConsistencyThreshold = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs.meta new file mode 100644 index 0000000..c1251f6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionEstimation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 460266f068274dd438044f0f7112db07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs new file mode 100644 index 0000000..0f8e1a0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs @@ -0,0 +1,2748 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/motion_models.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/motion_models.proto + public static partial class MotionModelsReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/motion_models.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MotionModelsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CittZWRpYXBpcGUvdXRpbC90cmFja2luZy9tb3Rpb25fbW9kZWxzLnByb3Rv", + "EgltZWRpYXBpcGUiMAoQVHJhbnNsYXRpb25Nb2RlbBINCgJkeBgBIAEoAjoB", + "MBINCgJkeRgCIAEoAjoBMCJWCg9TaW1pbGFyaXR5TW9kZWwSDQoCZHgYASAB", + "KAI6ATASDQoCZHkYAiABKAI6ATASEAoFc2NhbGUYAyABKAI6ATESEwoIcm90", + "YXRpb24YBCABKAI6ATAiUQoVTGluZWFyU2ltaWxhcml0eU1vZGVsEg0KAmR4", + "GAEgASgCOgEwEg0KAmR5GAIgASgCOgEwEgwKAWEYAyABKAI6ATESDAoBYhgE", + "IAEoAjoBMCJjCgtBZmZpbmVNb2RlbBINCgJkeBgBIAEoAjoBMBINCgJkeRgC", + "IAEoAjoBMBIMCgFhGAMgASgCOgExEgwKAWIYBCABKAI6ATASDAoBYxgFIAEo", + "AjoBMBIMCgFkGAYgASgCOgExIpQBCgpIb21vZ3JhcGh5Eg8KBGhfMDAYASAB", + "KAI6ATESDwoEaF8wMRgCIAEoAjoBMBIPCgRoXzAyGAMgASgCOgEwEg8KBGhf", + "MTAYBCABKAI6ATASDwoEaF8xMRgFIAEoAjoBMRIPCgRoXzEyGAYgASgCOgEw", + "Eg8KBGhfMjAYByABKAI6ATASDwoEaF8yMRgIIAEoAjoBMCJKChdNaXh0dXJl", + "TGluZWFyU2ltaWxhcml0eRIvCgVtb2RlbBgBIAMoCzIgLm1lZGlhcGlwZS5M", + "aW5lYXJTaW1pbGFyaXR5TW9kZWwiNgoNTWl4dHVyZUFmZmluZRIlCgVtb2Rl", + "bBgBIAMoCzIWLm1lZGlhcGlwZS5BZmZpbmVNb2RlbCLQAQoRTWl4dHVyZUhv", + "bW9ncmFwaHkSJAoFbW9kZWwYASADKAsyFS5tZWRpYXBpcGUuSG9tb2dyYXBo", + "eRI+CgNkb2YYAiABKA4yKC5tZWRpYXBpcGUuTWl4dHVyZUhvbW9ncmFwaHku", + "VmFyaWFibGVET0Y6B0FMTF9ET0YiVQoLVmFyaWFibGVET0YSCwoHQUxMX0RP", + "RhAAEhMKD1RSQU5TTEFUSU9OX0RPRhABEhUKEVNLRVdfUk9UQVRJT05fRE9G", + "EAISDQoJQ09OU1RfRE9GEAM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TranslationModel), global::Mediapipe.TranslationModel.Parser, new[]{ "Dx", "Dy" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SimilarityModel), global::Mediapipe.SimilarityModel.Parser, new[]{ "Dx", "Dy", "Scale", "Rotation" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.LinearSimilarityModel), global::Mediapipe.LinearSimilarityModel.Parser, new[]{ "Dx", "Dy", "A", "B" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AffineModel), global::Mediapipe.AffineModel.Parser, new[]{ "Dx", "Dy", "A", "B", "C", "D" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.Homography), global::Mediapipe.Homography.Parser, new[]{ "H00", "H01", "H02", "H10", "H11", "H12", "H20", "H21" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MixtureLinearSimilarity), global::Mediapipe.MixtureLinearSimilarity.Parser, new[]{ "Model" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MixtureAffine), global::Mediapipe.MixtureAffine.Parser, new[]{ "Model" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MixtureHomography), global::Mediapipe.MixtureHomography.Parser, new[]{ "Model", "Dof" }, null, new[]{ typeof(global::Mediapipe.MixtureHomography.Types.VariableDOF) }, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Simple translational model: + /// I * x + [dx; dy] with I being 2x2 identity transform. + /// + public sealed partial class TranslationModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TranslationModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationModel(TranslationModel other) : this() { + _hasBits0 = other._hasBits0; + dx_ = other.dx_; + dy_ = other.dy_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TranslationModel Clone() { + return new TranslationModel(this); + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 1; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 1) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 1; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~1; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 2; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 2) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 2; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TranslationModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TranslationModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TranslationModel other) { + if (other == null) { + return; + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Non-linear similarity model (w.r.t. to its parametrization). + /// c_r := cos(rotation); + /// s_r := sin(rotation); + /// Transformation applied to x: + /// [scale 0; * [c_r -s_r; * x + [dx; + /// 0 scale] s_r c_r] dy] + /// + public sealed partial class SimilarityModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimilarityModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityModel(SimilarityModel other) : this() { + _hasBits0 = other._hasBits0; + dx_ = other.dx_; + dy_ = other.dy_; + scale_ = other.scale_; + rotation_ = other.rotation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SimilarityModel Clone() { + return new SimilarityModel(this); + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 1; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 1) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 1; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~1; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 2; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 2) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 2; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~2; + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 3; + private readonly static float ScaleDefaultValue = 1F; + + private float scale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Scale { + get { if ((_hasBits0 & 4) != 0) { return scale_; } else { return ScaleDefaultValue; } } + set { + _hasBits0 |= 4; + scale_ = value; + } + } + /// Gets whether the "scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScale() { + _hasBits0 &= ~4; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 4; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// angle in [-pi, pi]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 8) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 8; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SimilarityModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SimilarityModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Scale, other.Scale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (HasScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Scale); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasScale) { + output.WriteRawTag(29); + output.WriteFloat(Scale); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasScale) { + output.WriteRawTag(29); + output.WriteFloat(Scale); + } + if (HasRotation) { + output.WriteRawTag(37); + output.WriteFloat(Rotation); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (HasScale) { + size += 1 + 4; + } + if (HasRotation) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SimilarityModel other) { + if (other == null) { + return; + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + if (other.HasScale) { + Scale = other.Scale; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + Scale = input.ReadFloat(); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + Scale = input.ReadFloat(); + break; + } + case 37: { + Rotation = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Linear similarity model: + /// [a -b; * x + [dx; + /// b a] dy] + /// + public sealed partial class LinearSimilarityModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LinearSimilarityModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LinearSimilarityModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LinearSimilarityModel(LinearSimilarityModel other) : this() { + _hasBits0 = other._hasBits0; + dx_ = other.dx_; + dy_ = other.dy_; + a_ = other.a_; + b_ = other.b_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public LinearSimilarityModel Clone() { + return new LinearSimilarityModel(this); + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 1; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 1) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 1; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~1; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 2; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 2) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 2; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~2; + } + + /// Field number for the "a" field. + public const int AFieldNumber = 3; + private readonly static float ADefaultValue = 1F; + + private float a_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float A { + get { if ((_hasBits0 & 4) != 0) { return a_; } else { return ADefaultValue; } } + set { + _hasBits0 |= 4; + a_ = value; + } + } + /// Gets whether the "a" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasA { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "a" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearA() { + _hasBits0 &= ~4; + } + + /// Field number for the "b" field. + public const int BFieldNumber = 4; + private readonly static float BDefaultValue = 0F; + + private float b_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float B { + get { if ((_hasBits0 & 8) != 0) { return b_; } else { return BDefaultValue; } } + set { + _hasBits0 |= 8; + b_ = value; + } + } + /// Gets whether the "b" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasB { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "b" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearB() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as LinearSimilarityModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(LinearSimilarityModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(A, other.A)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(B, other.B)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (HasA) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(A); + if (HasB) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(B); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasA) { + output.WriteRawTag(29); + output.WriteFloat(A); + } + if (HasB) { + output.WriteRawTag(37); + output.WriteFloat(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasA) { + output.WriteRawTag(29); + output.WriteFloat(A); + } + if (HasB) { + output.WriteRawTag(37); + output.WriteFloat(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (HasA) { + size += 1 + 4; + } + if (HasB) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(LinearSimilarityModel other) { + if (other == null) { + return; + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + if (other.HasA) { + A = other.A; + } + if (other.HasB) { + B = other.B; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + A = input.ReadFloat(); + break; + } + case 37: { + B = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + A = input.ReadFloat(); + break; + } + case 37: { + B = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Affine according to + /// ( [a b * x + [dx; + /// ( c d] dy] + /// + public sealed partial class AffineModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AffineModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineModel(AffineModel other) : this() { + _hasBits0 = other._hasBits0; + dx_ = other.dx_; + dy_ = other.dy_; + a_ = other.a_; + b_ = other.b_; + c_ = other.c_; + d_ = other.d_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineModel Clone() { + return new AffineModel(this); + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 1; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 1) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 1; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~1; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 2; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 2) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 2; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~2; + } + + /// Field number for the "a" field. + public const int AFieldNumber = 3; + private readonly static float ADefaultValue = 1F; + + private float a_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float A { + get { if ((_hasBits0 & 4) != 0) { return a_; } else { return ADefaultValue; } } + set { + _hasBits0 |= 4; + a_ = value; + } + } + /// Gets whether the "a" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasA { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "a" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearA() { + _hasBits0 &= ~4; + } + + /// Field number for the "b" field. + public const int BFieldNumber = 4; + private readonly static float BDefaultValue = 0F; + + private float b_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float B { + get { if ((_hasBits0 & 8) != 0) { return b_; } else { return BDefaultValue; } } + set { + _hasBits0 |= 8; + b_ = value; + } + } + /// Gets whether the "b" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasB { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "b" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearB() { + _hasBits0 &= ~8; + } + + /// Field number for the "c" field. + public const int CFieldNumber = 5; + private readonly static float CDefaultValue = 0F; + + private float c_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float C { + get { if ((_hasBits0 & 16) != 0) { return c_; } else { return CDefaultValue; } } + set { + _hasBits0 |= 16; + c_ = value; + } + } + /// Gets whether the "c" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasC { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "c" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearC() { + _hasBits0 &= ~16; + } + + /// Field number for the "d" field. + public const int DFieldNumber = 6; + private readonly static float DDefaultValue = 1F; + + private float d_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float D { + get { if ((_hasBits0 & 32) != 0) { return d_; } else { return DDefaultValue; } } + set { + _hasBits0 |= 32; + d_ = value; + } + } + /// Gets whether the "d" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasD { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "d" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearD() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AffineModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AffineModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(A, other.A)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(B, other.B)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(C, other.C)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(D, other.D)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (HasA) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(A); + if (HasB) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(B); + if (HasC) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(C); + if (HasD) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(D); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasA) { + output.WriteRawTag(29); + output.WriteFloat(A); + } + if (HasB) { + output.WriteRawTag(37); + output.WriteFloat(B); + } + if (HasC) { + output.WriteRawTag(45); + output.WriteFloat(C); + } + if (HasD) { + output.WriteRawTag(53); + output.WriteFloat(D); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDx) { + output.WriteRawTag(13); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(21); + output.WriteFloat(Dy); + } + if (HasA) { + output.WriteRawTag(29); + output.WriteFloat(A); + } + if (HasB) { + output.WriteRawTag(37); + output.WriteFloat(B); + } + if (HasC) { + output.WriteRawTag(45); + output.WriteFloat(C); + } + if (HasD) { + output.WriteRawTag(53); + output.WriteFloat(D); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (HasA) { + size += 1 + 4; + } + if (HasB) { + size += 1 + 4; + } + if (HasC) { + size += 1 + 4; + } + if (HasD) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AffineModel other) { + if (other == null) { + return; + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + if (other.HasA) { + A = other.A; + } + if (other.HasB) { + B = other.B; + } + if (other.HasC) { + C = other.C; + } + if (other.HasD) { + D = other.D; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + A = input.ReadFloat(); + break; + } + case 37: { + B = input.ReadFloat(); + break; + } + case 45: { + C = input.ReadFloat(); + break; + } + case 53: { + D = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Dx = input.ReadFloat(); + break; + } + case 21: { + Dy = input.ReadFloat(); + break; + } + case 29: { + A = input.ReadFloat(); + break; + } + case 37: { + B = input.ReadFloat(); + break; + } + case 45: { + C = input.ReadFloat(); + break; + } + case 53: { + D = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Homography according to + /// [h_00 h_01 h_02; + /// h_10 h_11 h_12; + /// h_20 h_21 1]; + /// Note: The parametrization with h_22 = 1 does not always hold, e.g. + /// if the origin (0, 0, 1) gets mapped to the line at infinity + /// (0, 0, 1). However for video we expect small perspective + /// changes between frames and this parametrization improves + /// robustness greatly as it removes an additional DOF. + /// Therefore, all methods in motion_stabilization should not be + /// used for general wide-baseline matching of frames. + /// + public sealed partial class Homography : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Homography()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Homography() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Homography(Homography other) : this() { + _hasBits0 = other._hasBits0; + h00_ = other.h00_; + h01_ = other.h01_; + h02_ = other.h02_; + h10_ = other.h10_; + h11_ = other.h11_; + h12_ = other.h12_; + h20_ = other.h20_; + h21_ = other.h21_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Homography Clone() { + return new Homography(this); + } + + /// Field number for the "h_00" field. + public const int H00FieldNumber = 1; + private readonly static float H00DefaultValue = 1F; + + private float h00_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H00 { + get { if ((_hasBits0 & 1) != 0) { return h00_; } else { return H00DefaultValue; } } + set { + _hasBits0 |= 1; + h00_ = value; + } + } + /// Gets whether the "h_00" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH00 { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "h_00" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH00() { + _hasBits0 &= ~1; + } + + /// Field number for the "h_01" field. + public const int H01FieldNumber = 2; + private readonly static float H01DefaultValue = 0F; + + private float h01_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H01 { + get { if ((_hasBits0 & 2) != 0) { return h01_; } else { return H01DefaultValue; } } + set { + _hasBits0 |= 2; + h01_ = value; + } + } + /// Gets whether the "h_01" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH01 { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "h_01" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH01() { + _hasBits0 &= ~2; + } + + /// Field number for the "h_02" field. + public const int H02FieldNumber = 3; + private readonly static float H02DefaultValue = 0F; + + private float h02_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H02 { + get { if ((_hasBits0 & 4) != 0) { return h02_; } else { return H02DefaultValue; } } + set { + _hasBits0 |= 4; + h02_ = value; + } + } + /// Gets whether the "h_02" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH02 { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "h_02" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH02() { + _hasBits0 &= ~4; + } + + /// Field number for the "h_10" field. + public const int H10FieldNumber = 4; + private readonly static float H10DefaultValue = 0F; + + private float h10_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H10 { + get { if ((_hasBits0 & 8) != 0) { return h10_; } else { return H10DefaultValue; } } + set { + _hasBits0 |= 8; + h10_ = value; + } + } + /// Gets whether the "h_10" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH10 { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "h_10" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH10() { + _hasBits0 &= ~8; + } + + /// Field number for the "h_11" field. + public const int H11FieldNumber = 5; + private readonly static float H11DefaultValue = 1F; + + private float h11_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H11 { + get { if ((_hasBits0 & 16) != 0) { return h11_; } else { return H11DefaultValue; } } + set { + _hasBits0 |= 16; + h11_ = value; + } + } + /// Gets whether the "h_11" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH11 { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "h_11" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH11() { + _hasBits0 &= ~16; + } + + /// Field number for the "h_12" field. + public const int H12FieldNumber = 6; + private readonly static float H12DefaultValue = 0F; + + private float h12_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H12 { + get { if ((_hasBits0 & 32) != 0) { return h12_; } else { return H12DefaultValue; } } + set { + _hasBits0 |= 32; + h12_ = value; + } + } + /// Gets whether the "h_12" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH12 { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "h_12" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH12() { + _hasBits0 &= ~32; + } + + /// Field number for the "h_20" field. + public const int H20FieldNumber = 7; + private readonly static float H20DefaultValue = 0F; + + private float h20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H20 { + get { if ((_hasBits0 & 64) != 0) { return h20_; } else { return H20DefaultValue; } } + set { + _hasBits0 |= 64; + h20_ = value; + } + } + /// Gets whether the "h_20" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH20 { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "h_20" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH20() { + _hasBits0 &= ~64; + } + + /// Field number for the "h_21" field. + public const int H21FieldNumber = 8; + private readonly static float H21DefaultValue = 0F; + + private float h21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float H21 { + get { if ((_hasBits0 & 128) != 0) { return h21_; } else { return H21DefaultValue; } } + set { + _hasBits0 |= 128; + h21_ = value; + } + } + /// Gets whether the "h_21" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH21 { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "h_21" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH21() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Homography); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Homography other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H00, other.H00)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H01, other.H01)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H02, other.H02)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H10, other.H10)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H11, other.H11)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H12, other.H12)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H20, other.H20)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(H21, other.H21)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasH00) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H00); + if (HasH01) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H01); + if (HasH02) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H02); + if (HasH10) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H10); + if (HasH11) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H11); + if (HasH12) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H12); + if (HasH20) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H20); + if (HasH21) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(H21); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasH00) { + output.WriteRawTag(13); + output.WriteFloat(H00); + } + if (HasH01) { + output.WriteRawTag(21); + output.WriteFloat(H01); + } + if (HasH02) { + output.WriteRawTag(29); + output.WriteFloat(H02); + } + if (HasH10) { + output.WriteRawTag(37); + output.WriteFloat(H10); + } + if (HasH11) { + output.WriteRawTag(45); + output.WriteFloat(H11); + } + if (HasH12) { + output.WriteRawTag(53); + output.WriteFloat(H12); + } + if (HasH20) { + output.WriteRawTag(61); + output.WriteFloat(H20); + } + if (HasH21) { + output.WriteRawTag(69); + output.WriteFloat(H21); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasH00) { + output.WriteRawTag(13); + output.WriteFloat(H00); + } + if (HasH01) { + output.WriteRawTag(21); + output.WriteFloat(H01); + } + if (HasH02) { + output.WriteRawTag(29); + output.WriteFloat(H02); + } + if (HasH10) { + output.WriteRawTag(37); + output.WriteFloat(H10); + } + if (HasH11) { + output.WriteRawTag(45); + output.WriteFloat(H11); + } + if (HasH12) { + output.WriteRawTag(53); + output.WriteFloat(H12); + } + if (HasH20) { + output.WriteRawTag(61); + output.WriteFloat(H20); + } + if (HasH21) { + output.WriteRawTag(69); + output.WriteFloat(H21); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasH00) { + size += 1 + 4; + } + if (HasH01) { + size += 1 + 4; + } + if (HasH02) { + size += 1 + 4; + } + if (HasH10) { + size += 1 + 4; + } + if (HasH11) { + size += 1 + 4; + } + if (HasH12) { + size += 1 + 4; + } + if (HasH20) { + size += 1 + 4; + } + if (HasH21) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Homography other) { + if (other == null) { + return; + } + if (other.HasH00) { + H00 = other.H00; + } + if (other.HasH01) { + H01 = other.H01; + } + if (other.HasH02) { + H02 = other.H02; + } + if (other.HasH10) { + H10 = other.H10; + } + if (other.HasH11) { + H11 = other.H11; + } + if (other.HasH12) { + H12 = other.H12; + } + if (other.HasH20) { + H20 = other.H20; + } + if (other.HasH21) { + H21 = other.H21; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + H00 = input.ReadFloat(); + break; + } + case 21: { + H01 = input.ReadFloat(); + break; + } + case 29: { + H02 = input.ReadFloat(); + break; + } + case 37: { + H10 = input.ReadFloat(); + break; + } + case 45: { + H11 = input.ReadFloat(); + break; + } + case 53: { + H12 = input.ReadFloat(); + break; + } + case 61: { + H20 = input.ReadFloat(); + break; + } + case 69: { + H21 = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + H00 = input.ReadFloat(); + break; + } + case 21: { + H01 = input.ReadFloat(); + break; + } + case 29: { + H02 = input.ReadFloat(); + break; + } + case 37: { + H10 = input.ReadFloat(); + break; + } + case 45: { + H11 = input.ReadFloat(); + break; + } + case 53: { + H12 = input.ReadFloat(); + break; + } + case 61: { + H20 = input.ReadFloat(); + break; + } + case 69: { + H21 = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Mixture models with higher degrees of freedom, according to + /// \sum_i model(i) * weight(i), where weights are passed during transform and + /// are expected to sum to one. + /// + public sealed partial class MixtureLinearSimilarity : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureLinearSimilarity()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureLinearSimilarity() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureLinearSimilarity(MixtureLinearSimilarity other) : this() { + model_ = other.model_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureLinearSimilarity Clone() { + return new MixtureLinearSimilarity(this); + } + + /// Field number for the "model" field. + public const int ModelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_model_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.LinearSimilarityModel.Parser); + private readonly pbc::RepeatedField model_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Model { + get { return model_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureLinearSimilarity); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureLinearSimilarity other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!model_.Equals(other.model_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= model_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + model_.WriteTo(output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + model_.WriteTo(ref output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += model_.CalculateSize(_repeated_model_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureLinearSimilarity other) { + if (other == null) { + return; + } + model_.Add(other.model_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + model_.AddEntriesFrom(input, _repeated_model_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + model_.AddEntriesFrom(ref input, _repeated_model_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class MixtureAffine : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureAffine()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffine() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffine(MixtureAffine other) : this() { + model_ = other.model_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffine Clone() { + return new MixtureAffine(this); + } + + /// Field number for the "model" field. + public const int ModelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_model_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.AffineModel.Parser); + private readonly pbc::RepeatedField model_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Model { + get { return model_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureAffine); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureAffine other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!model_.Equals(other.model_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= model_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + model_.WriteTo(output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + model_.WriteTo(ref output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += model_.CalculateSize(_repeated_model_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureAffine other) { + if (other == null) { + return; + } + model_.Add(other.model_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + model_.AddEntriesFrom(input, _repeated_model_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + model_.AddEntriesFrom(ref input, _repeated_model_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class MixtureHomography : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureHomography()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionModelsReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomography() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomography(MixtureHomography other) : this() { + _hasBits0 = other._hasBits0; + model_ = other.model_.Clone(); + dof_ = other.dof_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureHomography Clone() { + return new MixtureHomography(this); + } + + /// Field number for the "model" field. + public const int ModelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_model_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.Homography.Parser); + private readonly pbc::RepeatedField model_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Model { + get { return model_; } + } + + /// Field number for the "dof" field. + public const int DofFieldNumber = 2; + private readonly static global::Mediapipe.MixtureHomography.Types.VariableDOF DofDefaultValue = global::Mediapipe.MixtureHomography.Types.VariableDOF.AllDof; + + private global::Mediapipe.MixtureHomography.Types.VariableDOF dof_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MixtureHomography.Types.VariableDOF Dof { + get { if ((_hasBits0 & 1) != 0) { return dof_; } else { return DofDefaultValue; } } + set { + _hasBits0 |= 1; + dof_ = value; + } + } + /// Gets whether the "dof" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDof { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "dof" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDof() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureHomography); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureHomography other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!model_.Equals(other.model_)) return false; + if (Dof != other.Dof) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= model_.GetHashCode(); + if (HasDof) hash ^= Dof.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + model_.WriteTo(output, _repeated_model_codec); + if (HasDof) { + output.WriteRawTag(16); + output.WriteEnum((int) Dof); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + model_.WriteTo(ref output, _repeated_model_codec); + if (HasDof) { + output.WriteRawTag(16); + output.WriteEnum((int) Dof); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += model_.CalculateSize(_repeated_model_codec); + if (HasDof) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dof); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureHomography other) { + if (other == null) { + return; + } + model_.Add(other.model_); + if (other.HasDof) { + Dof = other.Dof; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + model_.AddEntriesFrom(input, _repeated_model_codec); + break; + } + case 16: { + Dof = (global::Mediapipe.MixtureHomography.Types.VariableDOF) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + model_.AddEntriesFrom(ref input, _repeated_model_codec); + break; + } + case 16: { + Dof = (global::Mediapipe.MixtureHomography.Types.VariableDOF) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MixtureHomography message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Specifies which degree of freedom vary across mixture. + /// Can be used to implement several transformation functions quicker. + /// + public enum VariableDOF { + /// + /// All dof are variable. + /// + [pbr::OriginalName("ALL_DOF")] AllDof = 0, + /// + /// Only translation (h_02, h_12) varies. + /// + [pbr::OriginalName("TRANSLATION_DOF")] TranslationDof = 1, + /// + /// Translation (h_02, h_12), and skew-rotation + /// + [pbr::OriginalName("SKEW_ROTATION_DOF")] SkewRotationDof = 2, + /// + /// (h_01, h_10) vary. + /// + [pbr::OriginalName("CONST_DOF")] ConstDof = 3, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs.meta new file mode 100644 index 0000000..52acfa8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionModels.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46a46ee4c714840aea9fee2fdfbc2cb6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs new file mode 100644 index 0000000..7d797c7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs @@ -0,0 +1,1090 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/motion_saliency.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/motion_saliency.proto + public static partial class MotionSaliencyReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/motion_saliency.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MotionSaliencyReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci1tZWRpYXBpcGUvdXRpbC90cmFja2luZy9tb3Rpb25fc2FsaWVuY3kucHJv", + "dG8SCW1lZGlhcGlwZSKlBAoVTW90aW9uU2FsaWVuY3lPcHRpb25zEhcKCmJv", + "dW5kX2xlZnQYASABKAI6AzAuMxIZCgxib3VuZF9ib3R0b20YAiABKAI6AzAu", + "MxIYCgtib3VuZF9yaWdodBgPIAEoAjoDMC4zEhYKCWJvdW5kX3RvcBgQIAEo", + "AjoDMC4zEhsKD3NhbGllbmN5X3dlaWdodBgDIAEoAjoCMjASLQoec2NhbGVf", + "d2VpZ2h0X2J5X2Zsb3dfbWFnbml0dWRlGAggASgIOgVmYWxzZRIXCgxtaW5f", + "ZmVhdHVyZXMYBCABKAU6ATUSKgobdXNlX29ubHlfZm9yZWdyb3VuZF9yZWdp", + "b25zGAkgASgIOgVmYWxzZRIgChRtaW5faXJsc19tb2RlX3dlaWdodBgKIAEo", + "AjoCMTASHQoSbnVtX3RvcF9pcmxzX21vZGVzGAsgASgFOgEzEhwKD21vZGVf", + "YmFuZF93aWR0aBgMIAEoAjoDMC4xEiEKFnNlbGVjdGlvbl9mcmFtZV9yYWRp", + "dXMYBSABKAU6ATUSJwoac2VsZWN0aW9uX3N1cHBvcnRfZGlzdGFuY2UYBiAB", + "KAI6AzAuMhIkChlzZWxlY3Rpb25fbWluaW11bV9zdXBwb3J0GAcgASgFOgE0", + "EiMKFWZpbHRlcmluZ19zaWdtYV9zcGFjZRgNIAEoAjoEMC4wNRIfChRmaWx0", + "ZXJpbmdfc2lnbWFfdGltZRgOIAEoAjoBNQ==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionSaliencyOptions), global::Mediapipe.MotionSaliencyOptions.Parser, new[]{ "BoundLeft", "BoundBottom", "BoundRight", "BoundTop", "SaliencyWeight", "ScaleWeightByFlowMagnitude", "MinFeatures", "UseOnlyForegroundRegions", "MinIrlsModeWeight", "NumTopIrlsModes", "ModeBandWidth", "SelectionFrameRadius", "SelectionSupportDistance", "SelectionMinimumSupport", "FilteringSigmaSpace", "FilteringSigmaTime" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Next tag: 17 + /// + public sealed partial class MotionSaliencyOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionSaliencyOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionSaliencyReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionSaliencyOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionSaliencyOptions(MotionSaliencyOptions other) : this() { + _hasBits0 = other._hasBits0; + boundLeft_ = other.boundLeft_; + boundBottom_ = other.boundBottom_; + boundRight_ = other.boundRight_; + boundTop_ = other.boundTop_; + saliencyWeight_ = other.saliencyWeight_; + scaleWeightByFlowMagnitude_ = other.scaleWeightByFlowMagnitude_; + minFeatures_ = other.minFeatures_; + useOnlyForegroundRegions_ = other.useOnlyForegroundRegions_; + minIrlsModeWeight_ = other.minIrlsModeWeight_; + numTopIrlsModes_ = other.numTopIrlsModes_; + modeBandWidth_ = other.modeBandWidth_; + selectionFrameRadius_ = other.selectionFrameRadius_; + selectionSupportDistance_ = other.selectionSupportDistance_; + selectionMinimumSupport_ = other.selectionMinimumSupport_; + filteringSigmaSpace_ = other.filteringSigmaSpace_; + filteringSigmaTime_ = other.filteringSigmaTime_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionSaliencyOptions Clone() { + return new MotionSaliencyOptions(this); + } + + /// Field number for the "bound_left" field. + public const int BoundLeftFieldNumber = 1; + private readonly static float BoundLeftDefaultValue = 0.3F; + + private float boundLeft_; + /// + /// Standard normalized bounds and weights used to initialize salient points. + /// See region_flow.proto for details. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoundLeft { + get { if ((_hasBits0 & 1) != 0) { return boundLeft_; } else { return BoundLeftDefaultValue; } } + set { + _hasBits0 |= 1; + boundLeft_ = value; + } + } + /// Gets whether the "bound_left" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoundLeft { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "bound_left" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoundLeft() { + _hasBits0 &= ~1; + } + + /// Field number for the "bound_bottom" field. + public const int BoundBottomFieldNumber = 2; + private readonly static float BoundBottomDefaultValue = 0.3F; + + private float boundBottom_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoundBottom { + get { if ((_hasBits0 & 2) != 0) { return boundBottom_; } else { return BoundBottomDefaultValue; } } + set { + _hasBits0 |= 2; + boundBottom_ = value; + } + } + /// Gets whether the "bound_bottom" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoundBottom { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "bound_bottom" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoundBottom() { + _hasBits0 &= ~2; + } + + /// Field number for the "bound_right" field. + public const int BoundRightFieldNumber = 15; + private readonly static float BoundRightDefaultValue = 0.3F; + + private float boundRight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoundRight { + get { if ((_hasBits0 & 16384) != 0) { return boundRight_; } else { return BoundRightDefaultValue; } } + set { + _hasBits0 |= 16384; + boundRight_ = value; + } + } + /// Gets whether the "bound_right" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoundRight { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "bound_right" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoundRight() { + _hasBits0 &= ~16384; + } + + /// Field number for the "bound_top" field. + public const int BoundTopFieldNumber = 16; + private readonly static float BoundTopDefaultValue = 0.3F; + + private float boundTop_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoundTop { + get { if ((_hasBits0 & 32768) != 0) { return boundTop_; } else { return BoundTopDefaultValue; } } + set { + _hasBits0 |= 32768; + boundTop_ = value; + } + } + /// Gets whether the "bound_top" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoundTop { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "bound_top" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoundTop() { + _hasBits0 &= ~32768; + } + + /// Field number for the "saliency_weight" field. + public const int SaliencyWeightFieldNumber = 3; + private readonly static float SaliencyWeightDefaultValue = 20F; + + private float saliencyWeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SaliencyWeight { + get { if ((_hasBits0 & 4) != 0) { return saliencyWeight_; } else { return SaliencyWeightDefaultValue; } } + set { + _hasBits0 |= 4; + saliencyWeight_ = value; + } + } + /// Gets whether the "saliency_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSaliencyWeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "saliency_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSaliencyWeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "scale_weight_by_flow_magnitude" field. + public const int ScaleWeightByFlowMagnitudeFieldNumber = 8; + private readonly static bool ScaleWeightByFlowMagnitudeDefaultValue = false; + + private bool scaleWeightByFlowMagnitude_; + /// + /// If set, scales saliency_weight by flow magnitude. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ScaleWeightByFlowMagnitude { + get { if ((_hasBits0 & 128) != 0) { return scaleWeightByFlowMagnitude_; } else { return ScaleWeightByFlowMagnitudeDefaultValue; } } + set { + _hasBits0 |= 128; + scaleWeightByFlowMagnitude_ = value; + } + } + /// Gets whether the "scale_weight_by_flow_magnitude" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScaleWeightByFlowMagnitude { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "scale_weight_by_flow_magnitude" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScaleWeightByFlowMagnitude() { + _hasBits0 &= ~128; + } + + /// Field number for the "min_features" field. + public const int MinFeaturesFieldNumber = 4; + private readonly static int MinFeaturesDefaultValue = 5; + + private int minFeatures_; + /// + /// Minimum number of features within a region to be considered salient. + /// Only applicable for functions accepting RegionFlowFrames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinFeatures { + get { if ((_hasBits0 & 8) != 0) { return minFeatures_; } else { return MinFeaturesDefaultValue; } } + set { + _hasBits0 |= 8; + minFeatures_ = value; + } + } + /// Gets whether the "min_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatures { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "min_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatures() { + _hasBits0 &= ~8; + } + + /// Field number for the "use_only_foreground_regions" field. + public const int UseOnlyForegroundRegionsFieldNumber = 9; + private readonly static bool UseOnlyForegroundRegionsDefaultValue = false; + + private bool useOnlyForegroundRegions_; + /// + /// If set, only considers regions flagged as forground. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseOnlyForegroundRegions { + get { if ((_hasBits0 & 256) != 0) { return useOnlyForegroundRegions_; } else { return UseOnlyForegroundRegionsDefaultValue; } } + set { + _hasBits0 |= 256; + useOnlyForegroundRegions_ = value; + } + } + /// Gets whether the "use_only_foreground_regions" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseOnlyForegroundRegions { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "use_only_foreground_regions" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseOnlyForegroundRegions() { + _hasBits0 &= ~256; + } + + /// Field number for the "min_irls_mode_weight" field. + public const int MinIrlsModeWeightFieldNumber = 10; + private readonly static float MinIrlsModeWeightDefaultValue = 10F; + + private float minIrlsModeWeight_; + /// + /// Specifies roughly number of foreground features mapped to one mode, + /// for mode to be considered salient. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinIrlsModeWeight { + get { if ((_hasBits0 & 512) != 0) { return minIrlsModeWeight_; } else { return MinIrlsModeWeightDefaultValue; } } + set { + _hasBits0 |= 512; + minIrlsModeWeight_ = value; + } + } + /// Gets whether the "min_irls_mode_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinIrlsModeWeight { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "min_irls_mode_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinIrlsModeWeight() { + _hasBits0 &= ~512; + } + + /// Field number for the "num_top_irls_modes" field. + public const int NumTopIrlsModesFieldNumber = 11; + private readonly static int NumTopIrlsModesDefaultValue = 3; + + private int numTopIrlsModes_; + /// + /// Only returns the top N irls modes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumTopIrlsModes { + get { if ((_hasBits0 & 1024) != 0) { return numTopIrlsModes_; } else { return NumTopIrlsModesDefaultValue; } } + set { + _hasBits0 |= 1024; + numTopIrlsModes_ = value; + } + } + /// Gets whether the "num_top_irls_modes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumTopIrlsModes { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "num_top_irls_modes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumTopIrlsModes() { + _hasBits0 &= ~1024; + } + + /// Field number for the "mode_band_width" field. + public const int ModeBandWidthFieldNumber = 12; + private readonly static float ModeBandWidthDefaultValue = 0.1F; + + private float modeBandWidth_; + /// + /// Mode finding is performed with a fraction radius of 10% of frame + /// diameter by default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ModeBandWidth { + get { if ((_hasBits0 & 2048) != 0) { return modeBandWidth_; } else { return ModeBandWidthDefaultValue; } } + set { + _hasBits0 |= 2048; + modeBandWidth_ = value; + } + } + /// Gets whether the "mode_band_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasModeBandWidth { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "mode_band_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearModeBandWidth() { + _hasBits0 &= ~2048; + } + + /// Field number for the "selection_frame_radius" field. + public const int SelectionFrameRadiusFieldNumber = 5; + private readonly static int SelectionFrameRadiusDefaultValue = 5; + + private int selectionFrameRadius_; + /// + /// We filter salient points along the temporal dimension only, keeping those + /// that have sufficient support (in form of neighboring salient points). For + /// every salient point in frame n, all points in frames + /// [n - filtering_frame_radius, n + filtering_frame_radius] are tested, + /// whether they support the current test point. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SelectionFrameRadius { + get { if ((_hasBits0 & 16) != 0) { return selectionFrameRadius_; } else { return SelectionFrameRadiusDefaultValue; } } + set { + _hasBits0 |= 16; + selectionFrameRadius_ = value; + } + } + /// Gets whether the "selection_frame_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSelectionFrameRadius { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "selection_frame_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSelectionFrameRadius() { + _hasBits0 &= ~16; + } + + /// Field number for the "selection_support_distance" field. + public const int SelectionSupportDistanceFieldNumber = 6; + private readonly static float SelectionSupportDistanceDefaultValue = 0.2F; + + private float selectionSupportDistance_; + /// + /// Fractional distance to be considered a supporting salient point for a test + /// point. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SelectionSupportDistance { + get { if ((_hasBits0 & 32) != 0) { return selectionSupportDistance_; } else { return SelectionSupportDistanceDefaultValue; } } + set { + _hasBits0 |= 32; + selectionSupportDistance_ = value; + } + } + /// Gets whether the "selection_support_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSelectionSupportDistance { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "selection_support_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSelectionSupportDistance() { + _hasBits0 &= ~32; + } + + /// Field number for the "selection_minimum_support" field. + public const int SelectionMinimumSupportFieldNumber = 7; + private readonly static int SelectionMinimumSupportDefaultValue = 4; + + private int selectionMinimumSupport_; + /// + /// Minimum number of supporting salient points that need to be present in + /// order for a point to be considered an inlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SelectionMinimumSupport { + get { if ((_hasBits0 & 64) != 0) { return selectionMinimumSupport_; } else { return SelectionMinimumSupportDefaultValue; } } + set { + _hasBits0 |= 64; + selectionMinimumSupport_ = value; + } + } + /// Gets whether the "selection_minimum_support" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSelectionMinimumSupport { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "selection_minimum_support" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSelectionMinimumSupport() { + _hasBits0 &= ~64; + } + + /// Field number for the "filtering_sigma_space" field. + public const int FilteringSigmaSpaceFieldNumber = 13; + private readonly static float FilteringSigmaSpaceDefaultValue = 0.05F; + + private float filteringSigmaSpace_; + /// + /// Sigma in space (normalized domain). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FilteringSigmaSpace { + get { if ((_hasBits0 & 4096) != 0) { return filteringSigmaSpace_; } else { return FilteringSigmaSpaceDefaultValue; } } + set { + _hasBits0 |= 4096; + filteringSigmaSpace_ = value; + } + } + /// Gets whether the "filtering_sigma_space" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilteringSigmaSpace { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "filtering_sigma_space" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilteringSigmaSpace() { + _hasBits0 &= ~4096; + } + + /// Field number for the "filtering_sigma_time" field. + public const int FilteringSigmaTimeFieldNumber = 14; + private readonly static float FilteringSigmaTimeDefaultValue = 5F; + + private float filteringSigmaTime_; + /// + /// Sigma in time (in frames). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FilteringSigmaTime { + get { if ((_hasBits0 & 8192) != 0) { return filteringSigmaTime_; } else { return FilteringSigmaTimeDefaultValue; } } + set { + _hasBits0 |= 8192; + filteringSigmaTime_ = value; + } + } + /// Gets whether the "filtering_sigma_time" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFilteringSigmaTime { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "filtering_sigma_time" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFilteringSigmaTime() { + _hasBits0 &= ~8192; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionSaliencyOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionSaliencyOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoundLeft, other.BoundLeft)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoundBottom, other.BoundBottom)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoundRight, other.BoundRight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoundTop, other.BoundTop)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SaliencyWeight, other.SaliencyWeight)) return false; + if (ScaleWeightByFlowMagnitude != other.ScaleWeightByFlowMagnitude) return false; + if (MinFeatures != other.MinFeatures) return false; + if (UseOnlyForegroundRegions != other.UseOnlyForegroundRegions) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinIrlsModeWeight, other.MinIrlsModeWeight)) return false; + if (NumTopIrlsModes != other.NumTopIrlsModes) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ModeBandWidth, other.ModeBandWidth)) return false; + if (SelectionFrameRadius != other.SelectionFrameRadius) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SelectionSupportDistance, other.SelectionSupportDistance)) return false; + if (SelectionMinimumSupport != other.SelectionMinimumSupport) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FilteringSigmaSpace, other.FilteringSigmaSpace)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FilteringSigmaTime, other.FilteringSigmaTime)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBoundLeft) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoundLeft); + if (HasBoundBottom) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoundBottom); + if (HasBoundRight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoundRight); + if (HasBoundTop) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoundTop); + if (HasSaliencyWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SaliencyWeight); + if (HasScaleWeightByFlowMagnitude) hash ^= ScaleWeightByFlowMagnitude.GetHashCode(); + if (HasMinFeatures) hash ^= MinFeatures.GetHashCode(); + if (HasUseOnlyForegroundRegions) hash ^= UseOnlyForegroundRegions.GetHashCode(); + if (HasMinIrlsModeWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinIrlsModeWeight); + if (HasNumTopIrlsModes) hash ^= NumTopIrlsModes.GetHashCode(); + if (HasModeBandWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ModeBandWidth); + if (HasSelectionFrameRadius) hash ^= SelectionFrameRadius.GetHashCode(); + if (HasSelectionSupportDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SelectionSupportDistance); + if (HasSelectionMinimumSupport) hash ^= SelectionMinimumSupport.GetHashCode(); + if (HasFilteringSigmaSpace) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FilteringSigmaSpace); + if (HasFilteringSigmaTime) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FilteringSigmaTime); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBoundLeft) { + output.WriteRawTag(13); + output.WriteFloat(BoundLeft); + } + if (HasBoundBottom) { + output.WriteRawTag(21); + output.WriteFloat(BoundBottom); + } + if (HasSaliencyWeight) { + output.WriteRawTag(29); + output.WriteFloat(SaliencyWeight); + } + if (HasMinFeatures) { + output.WriteRawTag(32); + output.WriteInt32(MinFeatures); + } + if (HasSelectionFrameRadius) { + output.WriteRawTag(40); + output.WriteInt32(SelectionFrameRadius); + } + if (HasSelectionSupportDistance) { + output.WriteRawTag(53); + output.WriteFloat(SelectionSupportDistance); + } + if (HasSelectionMinimumSupport) { + output.WriteRawTag(56); + output.WriteInt32(SelectionMinimumSupport); + } + if (HasScaleWeightByFlowMagnitude) { + output.WriteRawTag(64); + output.WriteBool(ScaleWeightByFlowMagnitude); + } + if (HasUseOnlyForegroundRegions) { + output.WriteRawTag(72); + output.WriteBool(UseOnlyForegroundRegions); + } + if (HasMinIrlsModeWeight) { + output.WriteRawTag(85); + output.WriteFloat(MinIrlsModeWeight); + } + if (HasNumTopIrlsModes) { + output.WriteRawTag(88); + output.WriteInt32(NumTopIrlsModes); + } + if (HasModeBandWidth) { + output.WriteRawTag(101); + output.WriteFloat(ModeBandWidth); + } + if (HasFilteringSigmaSpace) { + output.WriteRawTag(109); + output.WriteFloat(FilteringSigmaSpace); + } + if (HasFilteringSigmaTime) { + output.WriteRawTag(117); + output.WriteFloat(FilteringSigmaTime); + } + if (HasBoundRight) { + output.WriteRawTag(125); + output.WriteFloat(BoundRight); + } + if (HasBoundTop) { + output.WriteRawTag(133, 1); + output.WriteFloat(BoundTop); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBoundLeft) { + output.WriteRawTag(13); + output.WriteFloat(BoundLeft); + } + if (HasBoundBottom) { + output.WriteRawTag(21); + output.WriteFloat(BoundBottom); + } + if (HasSaliencyWeight) { + output.WriteRawTag(29); + output.WriteFloat(SaliencyWeight); + } + if (HasMinFeatures) { + output.WriteRawTag(32); + output.WriteInt32(MinFeatures); + } + if (HasSelectionFrameRadius) { + output.WriteRawTag(40); + output.WriteInt32(SelectionFrameRadius); + } + if (HasSelectionSupportDistance) { + output.WriteRawTag(53); + output.WriteFloat(SelectionSupportDistance); + } + if (HasSelectionMinimumSupport) { + output.WriteRawTag(56); + output.WriteInt32(SelectionMinimumSupport); + } + if (HasScaleWeightByFlowMagnitude) { + output.WriteRawTag(64); + output.WriteBool(ScaleWeightByFlowMagnitude); + } + if (HasUseOnlyForegroundRegions) { + output.WriteRawTag(72); + output.WriteBool(UseOnlyForegroundRegions); + } + if (HasMinIrlsModeWeight) { + output.WriteRawTag(85); + output.WriteFloat(MinIrlsModeWeight); + } + if (HasNumTopIrlsModes) { + output.WriteRawTag(88); + output.WriteInt32(NumTopIrlsModes); + } + if (HasModeBandWidth) { + output.WriteRawTag(101); + output.WriteFloat(ModeBandWidth); + } + if (HasFilteringSigmaSpace) { + output.WriteRawTag(109); + output.WriteFloat(FilteringSigmaSpace); + } + if (HasFilteringSigmaTime) { + output.WriteRawTag(117); + output.WriteFloat(FilteringSigmaTime); + } + if (HasBoundRight) { + output.WriteRawTag(125); + output.WriteFloat(BoundRight); + } + if (HasBoundTop) { + output.WriteRawTag(133, 1); + output.WriteFloat(BoundTop); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBoundLeft) { + size += 1 + 4; + } + if (HasBoundBottom) { + size += 1 + 4; + } + if (HasBoundRight) { + size += 1 + 4; + } + if (HasBoundTop) { + size += 2 + 4; + } + if (HasSaliencyWeight) { + size += 1 + 4; + } + if (HasScaleWeightByFlowMagnitude) { + size += 1 + 1; + } + if (HasMinFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinFeatures); + } + if (HasUseOnlyForegroundRegions) { + size += 1 + 1; + } + if (HasMinIrlsModeWeight) { + size += 1 + 4; + } + if (HasNumTopIrlsModes) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumTopIrlsModes); + } + if (HasModeBandWidth) { + size += 1 + 4; + } + if (HasSelectionFrameRadius) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SelectionFrameRadius); + } + if (HasSelectionSupportDistance) { + size += 1 + 4; + } + if (HasSelectionMinimumSupport) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SelectionMinimumSupport); + } + if (HasFilteringSigmaSpace) { + size += 1 + 4; + } + if (HasFilteringSigmaTime) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionSaliencyOptions other) { + if (other == null) { + return; + } + if (other.HasBoundLeft) { + BoundLeft = other.BoundLeft; + } + if (other.HasBoundBottom) { + BoundBottom = other.BoundBottom; + } + if (other.HasBoundRight) { + BoundRight = other.BoundRight; + } + if (other.HasBoundTop) { + BoundTop = other.BoundTop; + } + if (other.HasSaliencyWeight) { + SaliencyWeight = other.SaliencyWeight; + } + if (other.HasScaleWeightByFlowMagnitude) { + ScaleWeightByFlowMagnitude = other.ScaleWeightByFlowMagnitude; + } + if (other.HasMinFeatures) { + MinFeatures = other.MinFeatures; + } + if (other.HasUseOnlyForegroundRegions) { + UseOnlyForegroundRegions = other.UseOnlyForegroundRegions; + } + if (other.HasMinIrlsModeWeight) { + MinIrlsModeWeight = other.MinIrlsModeWeight; + } + if (other.HasNumTopIrlsModes) { + NumTopIrlsModes = other.NumTopIrlsModes; + } + if (other.HasModeBandWidth) { + ModeBandWidth = other.ModeBandWidth; + } + if (other.HasSelectionFrameRadius) { + SelectionFrameRadius = other.SelectionFrameRadius; + } + if (other.HasSelectionSupportDistance) { + SelectionSupportDistance = other.SelectionSupportDistance; + } + if (other.HasSelectionMinimumSupport) { + SelectionMinimumSupport = other.SelectionMinimumSupport; + } + if (other.HasFilteringSigmaSpace) { + FilteringSigmaSpace = other.FilteringSigmaSpace; + } + if (other.HasFilteringSigmaTime) { + FilteringSigmaTime = other.FilteringSigmaTime; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + BoundLeft = input.ReadFloat(); + break; + } + case 21: { + BoundBottom = input.ReadFloat(); + break; + } + case 29: { + SaliencyWeight = input.ReadFloat(); + break; + } + case 32: { + MinFeatures = input.ReadInt32(); + break; + } + case 40: { + SelectionFrameRadius = input.ReadInt32(); + break; + } + case 53: { + SelectionSupportDistance = input.ReadFloat(); + break; + } + case 56: { + SelectionMinimumSupport = input.ReadInt32(); + break; + } + case 64: { + ScaleWeightByFlowMagnitude = input.ReadBool(); + break; + } + case 72: { + UseOnlyForegroundRegions = input.ReadBool(); + break; + } + case 85: { + MinIrlsModeWeight = input.ReadFloat(); + break; + } + case 88: { + NumTopIrlsModes = input.ReadInt32(); + break; + } + case 101: { + ModeBandWidth = input.ReadFloat(); + break; + } + case 109: { + FilteringSigmaSpace = input.ReadFloat(); + break; + } + case 117: { + FilteringSigmaTime = input.ReadFloat(); + break; + } + case 125: { + BoundRight = input.ReadFloat(); + break; + } + case 133: { + BoundTop = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + BoundLeft = input.ReadFloat(); + break; + } + case 21: { + BoundBottom = input.ReadFloat(); + break; + } + case 29: { + SaliencyWeight = input.ReadFloat(); + break; + } + case 32: { + MinFeatures = input.ReadInt32(); + break; + } + case 40: { + SelectionFrameRadius = input.ReadInt32(); + break; + } + case 53: { + SelectionSupportDistance = input.ReadFloat(); + break; + } + case 56: { + SelectionMinimumSupport = input.ReadInt32(); + break; + } + case 64: { + ScaleWeightByFlowMagnitude = input.ReadBool(); + break; + } + case 72: { + UseOnlyForegroundRegions = input.ReadBool(); + break; + } + case 85: { + MinIrlsModeWeight = input.ReadFloat(); + break; + } + case 88: { + NumTopIrlsModes = input.ReadInt32(); + break; + } + case 101: { + ModeBandWidth = input.ReadFloat(); + break; + } + case 109: { + FilteringSigmaSpace = input.ReadFloat(); + break; + } + case 117: { + FilteringSigmaTime = input.ReadFloat(); + break; + } + case 125: { + BoundRight = input.ReadFloat(); + break; + } + case 133: { + BoundTop = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs.meta new file mode 100644 index 0000000..bc0e4f6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/MotionSaliency.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b891b0717b9faa5f5a948007a79f8ed0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs new file mode 100644 index 0000000..0fc3eaf --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs @@ -0,0 +1,521 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/push_pull_filtering.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/push_pull_filtering.proto + public static partial class PushPullFilteringReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/push_pull_filtering.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static PushPullFilteringReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjFtZWRpYXBpcGUvdXRpbC90cmFja2luZy9wdXNoX3B1bGxfZmlsdGVyaW5n", + "LnByb3RvEgltZWRpYXBpcGUiwAEKD1B1c2hQdWxsT3B0aW9ucxIbCg9iaWxh", + "dGVyYWxfc2lnbWEYASABKAI6AjIwEiEKFnB1bGxfcHJvcGFnYXRpb25fc2Nh", + "bGUYAyABKAI6ATgSIQoWcHVzaF9wcm9wYWdhdGlvbl9zY2FsZRgEIAEoAjoB", + "OBIhChRwdWxsX2JpbGF0ZXJhbF9zY2FsZRgFIAEoAjoDMC43EiEKFHB1c2hf", + "YmlsYXRlcmFsX3NjYWxlGAYgASgCOgMwLjkqBAgCEAM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PushPullOptions), global::Mediapipe.PushPullOptions.Parser, new[]{ "BilateralSigma", "PullPropagationScale", "PushPropagationScale", "PullBilateralScale", "PushBilateralScale" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class PushPullOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PushPullOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.PushPullFilteringReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PushPullOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PushPullOptions(PushPullOptions other) : this() { + _hasBits0 = other._hasBits0; + bilateralSigma_ = other.bilateralSigma_; + pullPropagationScale_ = other.pullPropagationScale_; + pushPropagationScale_ = other.pushPropagationScale_; + pullBilateralScale_ = other.pullBilateralScale_; + pushBilateralScale_ = other.pushBilateralScale_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PushPullOptions Clone() { + return new PushPullOptions(this); + } + + /// Field number for the "bilateral_sigma" field. + public const int BilateralSigmaFieldNumber = 1; + private readonly static float BilateralSigmaDefaultValue = 20F; + + private float bilateralSigma_; + /// + /// Sigma for color difference. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BilateralSigma { + get { if ((_hasBits0 & 1) != 0) { return bilateralSigma_; } else { return BilateralSigmaDefaultValue; } } + set { + _hasBits0 |= 1; + bilateralSigma_ = value; + } + } + /// Gets whether the "bilateral_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBilateralSigma { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "bilateral_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBilateralSigma() { + _hasBits0 &= ~1; + } + + /// Field number for the "pull_propagation_scale" field. + public const int PullPropagationScaleFieldNumber = 3; + private readonly static float PullPropagationScaleDefaultValue = 8F; + + private float pullPropagationScale_; + /// + /// Determines how fast confident values can propagate. Filters are normalized, + /// such that confidence dissipates quickly instead of propagating. + /// To ensure confidence propagates the importance weight is scaled by the + /// scalars specified below. Larger values yield quicker propagation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PullPropagationScale { + get { if ((_hasBits0 & 2) != 0) { return pullPropagationScale_; } else { return PullPropagationScaleDefaultValue; } } + set { + _hasBits0 |= 2; + pullPropagationScale_ = value; + } + } + /// Gets whether the "pull_propagation_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPullPropagationScale { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "pull_propagation_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPullPropagationScale() { + _hasBits0 &= ~2; + } + + /// Field number for the "push_propagation_scale" field. + public const int PushPropagationScaleFieldNumber = 4; + private readonly static float PushPropagationScaleDefaultValue = 8F; + + private float pushPropagationScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PushPropagationScale { + get { if ((_hasBits0 & 4) != 0) { return pushPropagationScale_; } else { return PushPropagationScaleDefaultValue; } } + set { + _hasBits0 |= 4; + pushPropagationScale_ = value; + } + } + /// Gets whether the "push_propagation_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPushPropagationScale { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "push_propagation_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPushPropagationScale() { + _hasBits0 &= ~4; + } + + /// Field number for the "pull_bilateral_scale" field. + public const int PullBilateralScaleFieldNumber = 5; + private readonly static float PullBilateralScaleDefaultValue = 0.7F; + + private float pullBilateralScale_; + /// + /// Above bilateral sigma is scaled at each level by the specified scale + /// (for push and pull phase). This is due to iterative downsampling of the + /// guidance image introduces errors making bilateral weighting increasingly + /// errorneous. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PullBilateralScale { + get { if ((_hasBits0 & 8) != 0) { return pullBilateralScale_; } else { return PullBilateralScaleDefaultValue; } } + set { + _hasBits0 |= 8; + pullBilateralScale_ = value; + } + } + /// Gets whether the "pull_bilateral_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPullBilateralScale { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "pull_bilateral_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPullBilateralScale() { + _hasBits0 &= ~8; + } + + /// Field number for the "push_bilateral_scale" field. + public const int PushBilateralScaleFieldNumber = 6; + private readonly static float PushBilateralScaleDefaultValue = 0.9F; + + private float pushBilateralScale_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PushBilateralScale { + get { if ((_hasBits0 & 16) != 0) { return pushBilateralScale_; } else { return PushBilateralScaleDefaultValue; } } + set { + _hasBits0 |= 16; + pushBilateralScale_ = value; + } + } + /// Gets whether the "push_bilateral_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPushBilateralScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "push_bilateral_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPushBilateralScale() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PushPullOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PushPullOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BilateralSigma, other.BilateralSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PullPropagationScale, other.PullPropagationScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PushPropagationScale, other.PushPropagationScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PullBilateralScale, other.PullBilateralScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PushBilateralScale, other.PushBilateralScale)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBilateralSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BilateralSigma); + if (HasPullPropagationScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PullPropagationScale); + if (HasPushPropagationScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PushPropagationScale); + if (HasPullBilateralScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PullBilateralScale); + if (HasPushBilateralScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PushBilateralScale); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBilateralSigma) { + output.WriteRawTag(13); + output.WriteFloat(BilateralSigma); + } + if (HasPullPropagationScale) { + output.WriteRawTag(29); + output.WriteFloat(PullPropagationScale); + } + if (HasPushPropagationScale) { + output.WriteRawTag(37); + output.WriteFloat(PushPropagationScale); + } + if (HasPullBilateralScale) { + output.WriteRawTag(45); + output.WriteFloat(PullBilateralScale); + } + if (HasPushBilateralScale) { + output.WriteRawTag(53); + output.WriteFloat(PushBilateralScale); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBilateralSigma) { + output.WriteRawTag(13); + output.WriteFloat(BilateralSigma); + } + if (HasPullPropagationScale) { + output.WriteRawTag(29); + output.WriteFloat(PullPropagationScale); + } + if (HasPushPropagationScale) { + output.WriteRawTag(37); + output.WriteFloat(PushPropagationScale); + } + if (HasPullBilateralScale) { + output.WriteRawTag(45); + output.WriteFloat(PullBilateralScale); + } + if (HasPushBilateralScale) { + output.WriteRawTag(53); + output.WriteFloat(PushBilateralScale); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBilateralSigma) { + size += 1 + 4; + } + if (HasPullPropagationScale) { + size += 1 + 4; + } + if (HasPushPropagationScale) { + size += 1 + 4; + } + if (HasPullBilateralScale) { + size += 1 + 4; + } + if (HasPushBilateralScale) { + size += 1 + 4; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PushPullOptions other) { + if (other == null) { + return; + } + if (other.HasBilateralSigma) { + BilateralSigma = other.BilateralSigma; + } + if (other.HasPullPropagationScale) { + PullPropagationScale = other.PullPropagationScale; + } + if (other.HasPushPropagationScale) { + PushPropagationScale = other.PushPropagationScale; + } + if (other.HasPullBilateralScale) { + PullBilateralScale = other.PullBilateralScale; + } + if (other.HasPushBilateralScale) { + PushBilateralScale = other.PushBilateralScale; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 13: { + BilateralSigma = input.ReadFloat(); + break; + } + case 29: { + PullPropagationScale = input.ReadFloat(); + break; + } + case 37: { + PushPropagationScale = input.ReadFloat(); + break; + } + case 45: { + PullBilateralScale = input.ReadFloat(); + break; + } + case 53: { + PushBilateralScale = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 13: { + BilateralSigma = input.ReadFloat(); + break; + } + case 29: { + PullPropagationScale = input.ReadFloat(); + break; + } + case 37: { + PushPropagationScale = input.ReadFloat(); + break; + } + case 45: { + PullBilateralScale = input.ReadFloat(); + break; + } + case 53: { + PushBilateralScale = input.ReadFloat(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs.meta new file mode 100644 index 0000000..70a81a2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/PushPullFiltering.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0e706247b055a0e7a862d2de687bb89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs new file mode 100644 index 0000000..54bd01a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs @@ -0,0 +1,5153 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/region_flow.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/region_flow.proto + public static partial class RegionFlowReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/region_flow.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RegionFlowReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiltZWRpYXBpcGUvdXRpbC90cmFja2luZy9yZWdpb25fZmxvdy5wcm90bxIJ", + "bWVkaWFwaXBlIh8KD1BhdGNoRGVzY3JpcHRvchIMCgRkYXRhGAEgAygCIicK", + "F0JpbmFyeUZlYXR1cmVEZXNjcmlwdG9yEgwKBGRhdGEYASABKAwiRAoVVGVt", + "cG9yYWxJUkxTU21vb3RoaW5nEhUKCndlaWdodF9zdW0YASABKAI6ATASFAoJ", + "dmFsdWVfc3VtGAIgASgCOgEwIpkEChFSZWdpb25GbG93RmVhdHVyZRIMCgF4", + "GAEgASgCOgEwEgwKAXkYAiABKAI6ATASDQoCZHgYAyABKAI6ATASDQoCZHkY", + "BCABKAI6ATASFAoIdHJhY2tfaWQYDSABKAU6Ai0xEhkKDnRyYWNraW5nX2Vy", + "cm9yGAUgASgCOgEwEhYKC2lybHNfd2VpZ2h0GAYgASgCOgExEhoKD2Nvcm5l", + "cl9yZXNwb25zZRgLIAEoAjoBMBI2ChJmZWF0dXJlX2Rlc2NyaXB0b3IYByAB", + "KAsyGi5tZWRpYXBpcGUuUGF0Y2hEZXNjcmlwdG9yEjwKGGZlYXR1cmVfbWF0", + "Y2hfZGVzY3JpcHRvchgIIAEoCzIaLm1lZGlhcGlwZS5QYXRjaERlc2NyaXB0", + "b3ISNwoNaW50ZXJuYWxfaXJscxgKIAEoCzIgLm1lZGlhcGlwZS5UZW1wb3Jh", + "bElSTFNTbW9vdGhpbmcSDQoFbGFiZWwYDiABKAkSDQoFZmxhZ3MYDyABKAUS", + "EgoKZmVhdHVyZV9pZBgQIAEoBRIRCgZvY3RhdmUYESABKAU6ATASRQoZYmlu", + "YXJ5X2ZlYXR1cmVfZGVzY3JpcHRvchgSIAEoCzIiLm1lZGlhcGlwZS5CaW5h", + "cnlGZWF0dXJlRGVzY3JpcHRvciIeCgVGbGFncxIVChFGTEFHX0JST0tFTl9U", + "UkFDSxABKgQICRAKKgQIDBANIr0ECg9SZWdpb25GbG93RnJhbWUSOgoLcmVn", + "aW9uX2Zsb3cYASADKAsyJS5tZWRpYXBpcGUuUmVnaW9uRmxvd0ZyYW1lLlJl", + "Z2lvbkZsb3cSHQoSbnVtX3RvdGFsX2ZlYXR1cmVzGAIgASgFOgEwEh0KDnVu", + "c3RhYmxlX2ZyYW1lGAQgASgIOgVmYWxzZRISCgpibHVyX3Njb3JlGAcgASgC", + "EhMKC2ZyYW1lX3dpZHRoGAggASgFEhQKDGZyYW1lX2hlaWdodBgJIAEoBRJE", + "ChBibG9ja19kZXNjcmlwdG9yGAogASgLMioubWVkaWFwaXBlLlJlZ2lvbkZs", + "b3dGcmFtZS5CbG9ja0Rlc2NyaXB0b3IaqAEKClJlZ2lvbkZsb3cSEQoJcmVn", + "aW9uX2lkGAEgAigFEhUKCmNlbnRyb2lkX3gYAiABKAI6ATASFQoKY2VudHJv", + "aWRfeRgDIAEoAjoBMBIRCgZmbG93X3gYBCABKAI6ATASEQoGZmxvd195GAUg", + "ASgCOgEwEi0KB2ZlYXR1cmUYByADKAsyHC5tZWRpYXBpcGUuUmVnaW9uRmxv", + "d0ZlYXR1cmUqBAgGEAcabgoPQmxvY2tEZXNjcmlwdG9yEhMKC2Jsb2NrX3dp", + "ZHRoGAEgASgFEhQKDGJsb2NrX2hlaWdodBgCIAEoBRIXCgxudW1fYmxvY2tz", + "X3gYAyABKAU6ATASFwoMbnVtX2Jsb2Nrc195GAQgASgFOgEwKgQIAxAEKgQI", + "BRAGKgQIBhAHIpwDChVSZWdpb25GbG93RmVhdHVyZUxpc3QSLQoHZmVhdHVy", + "ZRgBIAMoCzIcLm1lZGlhcGlwZS5SZWdpb25GbG93RmVhdHVyZRITCgtmcmFt", + "ZV93aWR0aBgCIAEoBRIUCgxmcmFtZV9oZWlnaHQYAyABKAUSFwoIdW5zdGFi", + "bGUYBCABKAg6BWZhbHNlEh8KFGRpc3RhbmNlX2Zyb21fYm9yZGVyGAUgASgF", + "OgEwEhIKCmJsdXJfc2NvcmUYBiABKAISGgoLbG9uZ190cmFja3MYByABKAg6", + "BWZhbHNlEiYKG2ZyYWNfbG9uZ19mZWF0dXJlc19yZWplY3RlZBgIIAEoAjoB", + "MBIeChJ2aXN1YWxfY29uc2lzdGVuY3kYCSABKAI6Ai0xEhkKDnRpbWVzdGFt", + "cF91c2VjGAogASgDOgEwEhYKC21hdGNoX2ZyYW1lGAsgASgFOgEwEhwKDWlz", + "X2R1cGxpY2F0ZWQYDCABKAg6BWZhbHNlEiYKHmFjdGl2ZWx5X2Rpc2NhcmRl", + "ZF90cmFja2VkX2lkcxgNIAMoBSKAAwoMU2FsaWVudFBvaW50EhcKDG5vcm1f", + "cG9pbnRfeBgBIAEoAjoBMBIXCgxub3JtX3BvaW50X3kYAiABKAI6ATASRAoE", + "dHlwZRgLIAEoDjIoLm1lZGlhcGlwZS5TYWxpZW50UG9pbnQuU2FsaWVudFBv", + "aW50VHlwZToMVFlQRV9JTkNMVURFEhEKBGxlZnQYAyABKAI6AzAuMxITCgZi", + "b3R0b20YBCABKAI6AzAuMxISCgVyaWdodBgJIAEoAjoDMC4zEhAKA3RvcBgK", + "IAEoAjoDMC4zEhIKBndlaWdodBgFIAEoAjoCMTUSEgoKbm9ybV9tYWpvchgG", + "IAEoAhISCgpub3JtX21pbm9yGAcgASgCEg0KBWFuZ2xlGAggASgCIlMKEFNh", + "bGllbnRQb2ludFR5cGUSEAoMVFlQRV9JTkNMVURFEAESFQoRVFlQRV9FWENM", + "VURFX0xFRlQQAhIWChJUWVBFX0VYQ0xVREVfUklHSFQQAyoKCKCcARCAgICA", + "AiJHChFTYWxpZW50UG9pbnRGcmFtZRImCgVwb2ludBgBIAMoCzIXLm1lZGlh", + "cGlwZS5TYWxpZW50UG9pbnQqCgignAEQgICAgAJCIQodY29tLmdvb2dsZS5t", + "ZWRpYXBpcGUudHJhY2tpbmdQAQ==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PatchDescriptor), global::Mediapipe.PatchDescriptor.Parser, new[]{ "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.BinaryFeatureDescriptor), global::Mediapipe.BinaryFeatureDescriptor.Parser, new[]{ "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TemporalIRLSSmoothing), global::Mediapipe.TemporalIRLSSmoothing.Parser, new[]{ "WeightSum", "ValueSum" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowFeature), global::Mediapipe.RegionFlowFeature.Parser, new[]{ "X", "Y", "Dx", "Dy", "TrackId", "TrackingError", "IrlsWeight", "CornerResponse", "FeatureDescriptor", "FeatureMatchDescriptor", "InternalIrls", "Label", "Flags", "FeatureId", "Octave", "BinaryFeatureDescriptor" }, null, new[]{ typeof(global::Mediapipe.RegionFlowFeature.Types.Flags) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowFrame), global::Mediapipe.RegionFlowFrame.Parser, new[]{ "RegionFlow", "NumTotalFeatures", "UnstableFrame", "BlurScore", "FrameWidth", "FrameHeight", "BlockDescriptor" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowFrame.Types.RegionFlow), global::Mediapipe.RegionFlowFrame.Types.RegionFlow.Parser, new[]{ "RegionId", "CentroidX", "CentroidY", "FlowX", "FlowY", "Feature" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor), global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor.Parser, new[]{ "BlockWidth", "BlockHeight", "NumBlocksX", "NumBlocksY" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowFeatureList), global::Mediapipe.RegionFlowFeatureList.Parser, new[]{ "Feature", "FrameWidth", "FrameHeight", "Unstable", "DistanceFromBorder", "BlurScore", "LongTracks", "FracLongFeaturesRejected", "VisualConsistency", "TimestampUsec", "MatchFrame", "IsDuplicated", "ActivelyDiscardedTrackedIds" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SalientPoint), global::Mediapipe.SalientPoint.Parser, new[]{ "NormPointX", "NormPointY", "Type", "Left", "Bottom", "Right", "Top", "Weight", "NormMajor", "NormMinor", "Angle" }, null, new[]{ typeof(global::Mediapipe.SalientPoint.Types.SalientPointType) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.SalientPointFrame), global::Mediapipe.SalientPointFrame.Parser, new[]{ "Point" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Captures additional information about a RegionFlowFeature's + /// surrounding patch. + /// Using MotionEstimation::RetrieveRegionFlowFeatureList or + /// ComputeRegionFlowFeatureDescriptors the patch descriptor has the folling + /// layout: + /// (9 dimensional: 3 mean intensities, 3x3 covariance matrix, (only store upper + /// half (6 elems) in column major order, i.e. indices for data in patch + /// descriptor refer to: + /// mean: 0 1 2, covariance: 3 4 5 + /// 6 7 + /// 8 + /// + public sealed partial class PatchDescriptor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PatchDescriptor()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchDescriptor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchDescriptor(PatchDescriptor other) : this() { + data_ = other.data_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchDescriptor Clone() { + return new PatchDescriptor(this); + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_data_codec + = pb::FieldCodec.ForFloat(13); + private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); + /// + /// The actual feature descriptor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Data { + get { return data_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PatchDescriptor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PatchDescriptor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!data_.Equals(other.data_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= data_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + data_.WriteTo(output, _repeated_data_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + data_.WriteTo(ref output, _repeated_data_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += data_.CalculateSize(_repeated_data_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PatchDescriptor other) { + if (other == null) { + return; + } + data_.Add(other.data_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + data_.AddEntriesFrom(input, _repeated_data_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + data_.AddEntriesFrom(ref input, _repeated_data_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Binary feature descriptor for a particular feature. + /// For example: orb + /// http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.370.4395&rep=rep1&type=pdf + /// + public sealed partial class BinaryFeatureDescriptor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BinaryFeatureDescriptor()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryFeatureDescriptor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryFeatureDescriptor(BinaryFeatureDescriptor other) : this() { + data_ = other.data_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BinaryFeatureDescriptor Clone() { + return new BinaryFeatureDescriptor(this); + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 1; + private readonly static pb::ByteString DataDefaultValue = pb::ByteString.Empty; + + private pb::ByteString data_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Data { + get { return data_ ?? DataDefaultValue; } + set { + data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "data" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasData { + get { return data_ != null; } + } + /// Clears the value of the "data" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearData() { + data_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BinaryFeatureDescriptor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BinaryFeatureDescriptor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Data != other.Data) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasData) hash ^= Data.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasData) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasData) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BinaryFeatureDescriptor other) { + if (other == null) { + return; + } + if (other.HasData) { + Data = other.Data; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + /// Internal datastructure used during temporal IRLS smoothing. + /// + public sealed partial class TemporalIRLSSmoothing : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TemporalIRLSSmoothing()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TemporalIRLSSmoothing() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TemporalIRLSSmoothing(TemporalIRLSSmoothing other) : this() { + _hasBits0 = other._hasBits0; + weightSum_ = other.weightSum_; + valueSum_ = other.valueSum_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TemporalIRLSSmoothing Clone() { + return new TemporalIRLSSmoothing(this); + } + + /// Field number for the "weight_sum" field. + public const int WeightSumFieldNumber = 1; + private readonly static float WeightSumDefaultValue = 0F; + + private float weightSum_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float WeightSum { + get { if ((_hasBits0 & 1) != 0) { return weightSum_; } else { return WeightSumDefaultValue; } } + set { + _hasBits0 |= 1; + weightSum_ = value; + } + } + /// Gets whether the "weight_sum" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWeightSum { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "weight_sum" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWeightSum() { + _hasBits0 &= ~1; + } + + /// Field number for the "value_sum" field. + public const int ValueSumFieldNumber = 2; + private readonly static float ValueSumDefaultValue = 0F; + + private float valueSum_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ValueSum { + get { if ((_hasBits0 & 2) != 0) { return valueSum_; } else { return ValueSumDefaultValue; } } + set { + _hasBits0 |= 2; + valueSum_ = value; + } + } + /// Gets whether the "value_sum" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasValueSum { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "value_sum" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearValueSum() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TemporalIRLSSmoothing); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TemporalIRLSSmoothing other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WeightSum, other.WeightSum)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ValueSum, other.ValueSum)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasWeightSum) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WeightSum); + if (HasValueSum) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ValueSum); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasWeightSum) { + output.WriteRawTag(13); + output.WriteFloat(WeightSum); + } + if (HasValueSum) { + output.WriteRawTag(21); + output.WriteFloat(ValueSum); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasWeightSum) { + output.WriteRawTag(13); + output.WriteFloat(WeightSum); + } + if (HasValueSum) { + output.WriteRawTag(21); + output.WriteFloat(ValueSum); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasWeightSum) { + size += 1 + 4; + } + if (HasValueSum) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TemporalIRLSSmoothing other) { + if (other == null) { + return; + } + if (other.HasWeightSum) { + WeightSum = other.WeightSum; + } + if (other.HasValueSum) { + ValueSum = other.ValueSum; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + WeightSum = input.ReadFloat(); + break; + } + case 21: { + ValueSum = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + WeightSum = input.ReadFloat(); + break; + } + case 21: { + ValueSum = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Tracked feature at location (x,y) with flow (dx, dy) and patch based + /// error (sum of absolute value of intensity difference). + /// Next tag: 19 + /// + public sealed partial class RegionFlowFeature : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionFlowFeature()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeature() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeature(RegionFlowFeature other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + dx_ = other.dx_; + dy_ = other.dy_; + trackId_ = other.trackId_; + trackingError_ = other.trackingError_; + irlsWeight_ = other.irlsWeight_; + cornerResponse_ = other.cornerResponse_; + featureDescriptor_ = other.featureDescriptor_ != null ? other.featureDescriptor_.Clone() : null; + featureMatchDescriptor_ = other.featureMatchDescriptor_ != null ? other.featureMatchDescriptor_.Clone() : null; + internalIrls_ = other.internalIrls_ != null ? other.internalIrls_.Clone() : null; + label_ = other.label_; + flags_ = other.flags_; + featureId_ = other.featureId_; + octave_ = other.octave_; + binaryFeatureDescriptor_ = other.binaryFeatureDescriptor_ != null ? other.binaryFeatureDescriptor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeature Clone() { + return new RegionFlowFeature(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static float XDefaultValue = 0F; + + private float x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static float YDefaultValue = 0F; + + private float y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 3; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 4) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 4; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~4; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 4; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 8) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 8; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~8; + } + + /// Field number for the "track_id" field. + public const int TrackIdFieldNumber = 13; + private readonly static int TrackIdDefaultValue = -1; + + private int trackId_; + /// + /// Features that belong to the same feature track are assigned a unique id + /// and are identified via it. + /// Note, this id is only unique within the lifetime of a RegionFlowComputation + /// object. That is, if distribution or parallelization using multiple + /// instances was used, the ids are only unique within that instance context. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TrackId { + get { if ((_hasBits0 & 128) != 0) { return trackId_; } else { return TrackIdDefaultValue; } } + set { + _hasBits0 |= 128; + trackId_ = value; + } + } + /// Gets whether the "track_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackId { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "track_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackId() { + _hasBits0 &= ~128; + } + + /// Field number for the "tracking_error" field. + public const int TrackingErrorFieldNumber = 5; + private readonly static float TrackingErrorDefaultValue = 0F; + + private float trackingError_; + /// + /// Tracking error as patch intensity residual (SSD). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TrackingError { + get { if ((_hasBits0 & 16) != 0) { return trackingError_; } else { return TrackingErrorDefaultValue; } } + set { + _hasBits0 |= 16; + trackingError_ = value; + } + } + /// Gets whether the "tracking_error" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingError { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "tracking_error" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingError() { + _hasBits0 &= ~16; + } + + /// Field number for the "irls_weight" field. + public const int IrlsWeightFieldNumber = 6; + private readonly static float IrlsWeightDefaultValue = 1F; + + private float irlsWeight_; + /// + /// Inverse of registration error (in pixels), after parametric motion model + /// fitting. Values are in [0, 1e6]. + /// Low values correspond to outliers, high values to inliers. + /// Set by MotionEstimation::EstimateMotions* + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IrlsWeight { + get { if ((_hasBits0 & 32) != 0) { return irlsWeight_; } else { return IrlsWeightDefaultValue; } } + set { + _hasBits0 |= 32; + irlsWeight_ = value; + } + } + /// Gets whether the "irls_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsWeight { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "irls_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsWeight() { + _hasBits0 &= ~32; + } + + /// Field number for the "corner_response" field. + public const int CornerResponseFieldNumber = 11; + private readonly static float CornerResponseDefaultValue = 0F; + + private float cornerResponse_; + /// + /// Corner response (computed as minimum eigenvalue of + /// block filtered 2nd moment matrix). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CornerResponse { + get { if ((_hasBits0 & 64) != 0) { return cornerResponse_; } else { return CornerResponseDefaultValue; } } + set { + _hasBits0 |= 64; + cornerResponse_ = value; + } + } + /// Gets whether the "corner_response" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCornerResponse { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "corner_response" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCornerResponse() { + _hasBits0 &= ~64; + } + + /// Field number for the "feature_descriptor" field. + public const int FeatureDescriptorFieldNumber = 7; + private global::Mediapipe.PatchDescriptor featureDescriptor_; + /// + /// Patch feature descriptors. *For internal use only*. External clients should + /// not rely on their contents. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PatchDescriptor FeatureDescriptor { + get { return featureDescriptor_; } + set { + featureDescriptor_ = value; + } + } + + /// Field number for the "feature_match_descriptor" field. + public const int FeatureMatchDescriptorFieldNumber = 8; + private global::Mediapipe.PatchDescriptor featureMatchDescriptor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.PatchDescriptor FeatureMatchDescriptor { + get { return featureMatchDescriptor_; } + set { + featureMatchDescriptor_ = value; + } + } + + /// Field number for the "internal_irls" field. + public const int InternalIrlsFieldNumber = 10; + private global::Mediapipe.TemporalIRLSSmoothing internalIrls_; + /// + /// Internal datastructure used temporally during temporal IRLS smoothing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TemporalIRLSSmoothing InternalIrls { + get { return internalIrls_; } + set { + internalIrls_ = value; + } + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 14; + private readonly static string LabelDefaultValue = ""; + + private string label_; + /// + /// Optional label for debugging purposes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Label { + get { return label_ ?? LabelDefaultValue; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "label" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLabel { + get { return label_ != null; } + } + /// Clears the value of the "label" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLabel() { + label_ = null; + } + + /// Field number for the "flags" field. + public const int FlagsFieldNumber = 15; + private readonly static int FlagsDefaultValue = 0; + + private int flags_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Flags { + get { if ((_hasBits0 & 256) != 0) { return flags_; } else { return FlagsDefaultValue; } } + set { + _hasBits0 |= 256; + flags_ = value; + } + } + /// Gets whether the "flags" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlags { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "flags" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlags() { + _hasBits0 &= ~256; + } + + /// Field number for the "feature_id" field. + public const int FeatureIdFieldNumber = 16; + private readonly static int FeatureIdDefaultValue = 0; + + private int featureId_; + /// + /// Unique feature id per RegionFlowComputation object. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FeatureId { + get { if ((_hasBits0 & 512) != 0) { return featureId_; } else { return FeatureIdDefaultValue; } } + set { + _hasBits0 |= 512; + featureId_ = value; + } + } + /// Gets whether the "feature_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureId { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "feature_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureId() { + _hasBits0 &= ~512; + } + + /// Field number for the "octave" field. + public const int OctaveFieldNumber = 17; + private readonly static int OctaveDefaultValue = 0; + + private int octave_; + /// + /// octave (pyramid layer) from which the keypoint has been extracted + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Octave { + get { if ((_hasBits0 & 1024) != 0) { return octave_; } else { return OctaveDefaultValue; } } + set { + _hasBits0 |= 1024; + octave_ = value; + } + } + /// Gets whether the "octave" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOctave { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "octave" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOctave() { + _hasBits0 &= ~1024; + } + + /// Field number for the "binary_feature_descriptor" field. + public const int BinaryFeatureDescriptorFieldNumber = 18; + private global::Mediapipe.BinaryFeatureDescriptor binaryFeatureDescriptor_; + /// + /// Feature descriptor for the current feature. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.BinaryFeatureDescriptor BinaryFeatureDescriptor { + get { return binaryFeatureDescriptor_; } + set { + binaryFeatureDescriptor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RegionFlowFeature); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RegionFlowFeature other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + if (TrackId != other.TrackId) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TrackingError, other.TrackingError)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IrlsWeight, other.IrlsWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CornerResponse, other.CornerResponse)) return false; + if (!object.Equals(FeatureDescriptor, other.FeatureDescriptor)) return false; + if (!object.Equals(FeatureMatchDescriptor, other.FeatureMatchDescriptor)) return false; + if (!object.Equals(InternalIrls, other.InternalIrls)) return false; + if (Label != other.Label) return false; + if (Flags != other.Flags) return false; + if (FeatureId != other.FeatureId) return false; + if (Octave != other.Octave) return false; + if (!object.Equals(BinaryFeatureDescriptor, other.BinaryFeatureDescriptor)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (HasTrackId) hash ^= TrackId.GetHashCode(); + if (HasTrackingError) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TrackingError); + if (HasIrlsWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IrlsWeight); + if (HasCornerResponse) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CornerResponse); + if (featureDescriptor_ != null) hash ^= FeatureDescriptor.GetHashCode(); + if (featureMatchDescriptor_ != null) hash ^= FeatureMatchDescriptor.GetHashCode(); + if (internalIrls_ != null) hash ^= InternalIrls.GetHashCode(); + if (HasLabel) hash ^= Label.GetHashCode(); + if (HasFlags) hash ^= Flags.GetHashCode(); + if (HasFeatureId) hash ^= FeatureId.GetHashCode(); + if (HasOctave) hash ^= Octave.GetHashCode(); + if (binaryFeatureDescriptor_ != null) hash ^= BinaryFeatureDescriptor.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasDx) { + output.WriteRawTag(29); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(37); + output.WriteFloat(Dy); + } + if (HasTrackingError) { + output.WriteRawTag(45); + output.WriteFloat(TrackingError); + } + if (HasIrlsWeight) { + output.WriteRawTag(53); + output.WriteFloat(IrlsWeight); + } + if (featureDescriptor_ != null) { + output.WriteRawTag(58); + output.WriteMessage(FeatureDescriptor); + } + if (featureMatchDescriptor_ != null) { + output.WriteRawTag(66); + output.WriteMessage(FeatureMatchDescriptor); + } + if (internalIrls_ != null) { + output.WriteRawTag(82); + output.WriteMessage(InternalIrls); + } + if (HasCornerResponse) { + output.WriteRawTag(93); + output.WriteFloat(CornerResponse); + } + if (HasTrackId) { + output.WriteRawTag(104); + output.WriteInt32(TrackId); + } + if (HasLabel) { + output.WriteRawTag(114); + output.WriteString(Label); + } + if (HasFlags) { + output.WriteRawTag(120); + output.WriteInt32(Flags); + } + if (HasFeatureId) { + output.WriteRawTag(128, 1); + output.WriteInt32(FeatureId); + } + if (HasOctave) { + output.WriteRawTag(136, 1); + output.WriteInt32(Octave); + } + if (binaryFeatureDescriptor_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(BinaryFeatureDescriptor); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(13); + output.WriteFloat(X); + } + if (HasY) { + output.WriteRawTag(21); + output.WriteFloat(Y); + } + if (HasDx) { + output.WriteRawTag(29); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(37); + output.WriteFloat(Dy); + } + if (HasTrackingError) { + output.WriteRawTag(45); + output.WriteFloat(TrackingError); + } + if (HasIrlsWeight) { + output.WriteRawTag(53); + output.WriteFloat(IrlsWeight); + } + if (featureDescriptor_ != null) { + output.WriteRawTag(58); + output.WriteMessage(FeatureDescriptor); + } + if (featureMatchDescriptor_ != null) { + output.WriteRawTag(66); + output.WriteMessage(FeatureMatchDescriptor); + } + if (internalIrls_ != null) { + output.WriteRawTag(82); + output.WriteMessage(InternalIrls); + } + if (HasCornerResponse) { + output.WriteRawTag(93); + output.WriteFloat(CornerResponse); + } + if (HasTrackId) { + output.WriteRawTag(104); + output.WriteInt32(TrackId); + } + if (HasLabel) { + output.WriteRawTag(114); + output.WriteString(Label); + } + if (HasFlags) { + output.WriteRawTag(120); + output.WriteInt32(Flags); + } + if (HasFeatureId) { + output.WriteRawTag(128, 1); + output.WriteInt32(FeatureId); + } + if (HasOctave) { + output.WriteRawTag(136, 1); + output.WriteInt32(Octave); + } + if (binaryFeatureDescriptor_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(BinaryFeatureDescriptor); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 4; + } + if (HasY) { + size += 1 + 4; + } + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (HasTrackId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TrackId); + } + if (HasTrackingError) { + size += 1 + 4; + } + if (HasIrlsWeight) { + size += 1 + 4; + } + if (HasCornerResponse) { + size += 1 + 4; + } + if (featureDescriptor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FeatureDescriptor); + } + if (featureMatchDescriptor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FeatureMatchDescriptor); + } + if (internalIrls_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(InternalIrls); + } + if (HasLabel) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (HasFlags) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Flags); + } + if (HasFeatureId) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FeatureId); + } + if (HasOctave) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Octave); + } + if (binaryFeatureDescriptor_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(BinaryFeatureDescriptor); + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RegionFlowFeature other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + if (other.HasTrackId) { + TrackId = other.TrackId; + } + if (other.HasTrackingError) { + TrackingError = other.TrackingError; + } + if (other.HasIrlsWeight) { + IrlsWeight = other.IrlsWeight; + } + if (other.HasCornerResponse) { + CornerResponse = other.CornerResponse; + } + if (other.featureDescriptor_ != null) { + if (featureDescriptor_ == null) { + FeatureDescriptor = new global::Mediapipe.PatchDescriptor(); + } + FeatureDescriptor.MergeFrom(other.FeatureDescriptor); + } + if (other.featureMatchDescriptor_ != null) { + if (featureMatchDescriptor_ == null) { + FeatureMatchDescriptor = new global::Mediapipe.PatchDescriptor(); + } + FeatureMatchDescriptor.MergeFrom(other.FeatureMatchDescriptor); + } + if (other.internalIrls_ != null) { + if (internalIrls_ == null) { + InternalIrls = new global::Mediapipe.TemporalIRLSSmoothing(); + } + InternalIrls.MergeFrom(other.InternalIrls); + } + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasFeatureId) { + FeatureId = other.FeatureId; + } + if (other.HasOctave) { + Octave = other.Octave; + } + if (other.binaryFeatureDescriptor_ != null) { + if (binaryFeatureDescriptor_ == null) { + BinaryFeatureDescriptor = new global::Mediapipe.BinaryFeatureDescriptor(); + } + BinaryFeatureDescriptor.MergeFrom(other.BinaryFeatureDescriptor); + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Dx = input.ReadFloat(); + break; + } + case 37: { + Dy = input.ReadFloat(); + break; + } + case 45: { + TrackingError = input.ReadFloat(); + break; + } + case 53: { + IrlsWeight = input.ReadFloat(); + break; + } + case 58: { + if (featureDescriptor_ == null) { + FeatureDescriptor = new global::Mediapipe.PatchDescriptor(); + } + input.ReadMessage(FeatureDescriptor); + break; + } + case 66: { + if (featureMatchDescriptor_ == null) { + FeatureMatchDescriptor = new global::Mediapipe.PatchDescriptor(); + } + input.ReadMessage(FeatureMatchDescriptor); + break; + } + case 82: { + if (internalIrls_ == null) { + InternalIrls = new global::Mediapipe.TemporalIRLSSmoothing(); + } + input.ReadMessage(InternalIrls); + break; + } + case 93: { + CornerResponse = input.ReadFloat(); + break; + } + case 104: { + TrackId = input.ReadInt32(); + break; + } + case 114: { + Label = input.ReadString(); + break; + } + case 120: { + Flags = input.ReadInt32(); + break; + } + case 128: { + FeatureId = input.ReadInt32(); + break; + } + case 136: { + Octave = input.ReadInt32(); + break; + } + case 146: { + if (binaryFeatureDescriptor_ == null) { + BinaryFeatureDescriptor = new global::Mediapipe.BinaryFeatureDescriptor(); + } + input.ReadMessage(BinaryFeatureDescriptor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 13: { + X = input.ReadFloat(); + break; + } + case 21: { + Y = input.ReadFloat(); + break; + } + case 29: { + Dx = input.ReadFloat(); + break; + } + case 37: { + Dy = input.ReadFloat(); + break; + } + case 45: { + TrackingError = input.ReadFloat(); + break; + } + case 53: { + IrlsWeight = input.ReadFloat(); + break; + } + case 58: { + if (featureDescriptor_ == null) { + FeatureDescriptor = new global::Mediapipe.PatchDescriptor(); + } + input.ReadMessage(FeatureDescriptor); + break; + } + case 66: { + if (featureMatchDescriptor_ == null) { + FeatureMatchDescriptor = new global::Mediapipe.PatchDescriptor(); + } + input.ReadMessage(FeatureMatchDescriptor); + break; + } + case 82: { + if (internalIrls_ == null) { + InternalIrls = new global::Mediapipe.TemporalIRLSSmoothing(); + } + input.ReadMessage(InternalIrls); + break; + } + case 93: { + CornerResponse = input.ReadFloat(); + break; + } + case 104: { + TrackId = input.ReadInt32(); + break; + } + case 114: { + Label = input.ReadString(); + break; + } + case 120: { + Flags = input.ReadInt32(); + break; + } + case 128: { + FeatureId = input.ReadInt32(); + break; + } + case 136: { + Octave = input.ReadInt32(); + break; + } + case 146: { + if (binaryFeatureDescriptor_ == null) { + BinaryFeatureDescriptor = new global::Mediapipe.BinaryFeatureDescriptor(); + } + input.ReadMessage(BinaryFeatureDescriptor); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the RegionFlowFeature message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Flags indicating specific statuses. + /// + public enum Flags { + /// + /// Used for long feature tracks if track id + /// + [pbr::OriginalName("FLAG_BROKEN_TRACK")] FlagBrokenTrack = 1, + } + + } + #endregion + + } + + /// + /// RegionFlowFrame is a optical flow representation where each region has a + /// consistent optical flow (adheres to local translational model). + /// Regions are arranged in a regular grid according to BlockDescriptor. + /// Next tag: 11. + /// + public sealed partial class RegionFlowFrame : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionFlowFrame()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFrame() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFrame(RegionFlowFrame other) : this() { + _hasBits0 = other._hasBits0; + regionFlow_ = other.regionFlow_.Clone(); + numTotalFeatures_ = other.numTotalFeatures_; + unstableFrame_ = other.unstableFrame_; + blurScore_ = other.blurScore_; + frameWidth_ = other.frameWidth_; + frameHeight_ = other.frameHeight_; + blockDescriptor_ = other.blockDescriptor_ != null ? other.blockDescriptor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFrame Clone() { + return new RegionFlowFrame(this); + } + + /// Field number for the "region_flow" field. + public const int RegionFlowFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_regionFlow_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.RegionFlowFrame.Types.RegionFlow.Parser); + private readonly pbc::RepeatedField regionFlow_ = new pbc::RepeatedField(); + /// + /// Sorted by id for quick lookup. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField RegionFlow { + get { return regionFlow_; } + } + + /// Field number for the "num_total_features" field. + public const int NumTotalFeaturesFieldNumber = 2; + private readonly static int NumTotalFeaturesDefaultValue = 0; + + private int numTotalFeatures_; + /// + /// Total number of features in all RegionFlow's. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumTotalFeatures { + get { if ((_hasBits0 & 1) != 0) { return numTotalFeatures_; } else { return NumTotalFeaturesDefaultValue; } } + set { + _hasBits0 |= 1; + numTotalFeatures_ = value; + } + } + /// Gets whether the "num_total_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumTotalFeatures { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_total_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumTotalFeatures() { + _hasBits0 &= ~1; + } + + /// Field number for the "unstable_frame" field. + public const int UnstableFrameFieldNumber = 4; + private readonly static bool UnstableFrameDefaultValue = false; + + private bool unstableFrame_; + /// + /// If set, indicates that the frame's region flow is unstable. + /// (not enough features or coverage too low). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UnstableFrame { + get { if ((_hasBits0 & 2) != 0) { return unstableFrame_; } else { return UnstableFrameDefaultValue; } } + set { + _hasBits0 |= 2; + unstableFrame_ = value; + } + } + /// Gets whether the "unstable_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUnstableFrame { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "unstable_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUnstableFrame() { + _hasBits0 &= ~2; + } + + /// Field number for the "blur_score" field. + public const int BlurScoreFieldNumber = 7; + private readonly static float BlurScoreDefaultValue = 0F; + + private float blurScore_; + /// + /// Blur score of the current frame is defined as the n-th percentile + /// of the corneress of the input frame evaluated over regions of high + /// corneress. For details see BlurScoreOptions in + /// region_flow_computation.proto. + /// The actual value is pretty meaningless, but relative to the blur score + /// of other frames one can detect blurry frames, e.g. by a 'significant' + /// local maxima in a sequence of blur_scores. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BlurScore { + get { if ((_hasBits0 & 4) != 0) { return blurScore_; } else { return BlurScoreDefaultValue; } } + set { + _hasBits0 |= 4; + blurScore_ = value; + } + } + /// Gets whether the "blur_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlurScore { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "blur_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlurScore() { + _hasBits0 &= ~4; + } + + /// Field number for the "frame_width" field. + public const int FrameWidthFieldNumber = 8; + private readonly static int FrameWidthDefaultValue = 0; + + private int frameWidth_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameWidth { + get { if ((_hasBits0 & 8) != 0) { return frameWidth_; } else { return FrameWidthDefaultValue; } } + set { + _hasBits0 |= 8; + frameWidth_ = value; + } + } + /// Gets whether the "frame_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameWidth { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "frame_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameWidth() { + _hasBits0 &= ~8; + } + + /// Field number for the "frame_height" field. + public const int FrameHeightFieldNumber = 9; + private readonly static int FrameHeightDefaultValue = 0; + + private int frameHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameHeight { + get { if ((_hasBits0 & 16) != 0) { return frameHeight_; } else { return FrameHeightDefaultValue; } } + set { + _hasBits0 |= 16; + frameHeight_ = value; + } + } + /// Gets whether the "frame_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameHeight { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "frame_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameHeight() { + _hasBits0 &= ~16; + } + + /// Field number for the "block_descriptor" field. + public const int BlockDescriptorFieldNumber = 10; + private global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor blockDescriptor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor BlockDescriptor { + get { return blockDescriptor_; } + set { + blockDescriptor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RegionFlowFrame); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RegionFlowFrame other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!regionFlow_.Equals(other.regionFlow_)) return false; + if (NumTotalFeatures != other.NumTotalFeatures) return false; + if (UnstableFrame != other.UnstableFrame) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BlurScore, other.BlurScore)) return false; + if (FrameWidth != other.FrameWidth) return false; + if (FrameHeight != other.FrameHeight) return false; + if (!object.Equals(BlockDescriptor, other.BlockDescriptor)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= regionFlow_.GetHashCode(); + if (HasNumTotalFeatures) hash ^= NumTotalFeatures.GetHashCode(); + if (HasUnstableFrame) hash ^= UnstableFrame.GetHashCode(); + if (HasBlurScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BlurScore); + if (HasFrameWidth) hash ^= FrameWidth.GetHashCode(); + if (HasFrameHeight) hash ^= FrameHeight.GetHashCode(); + if (blockDescriptor_ != null) hash ^= BlockDescriptor.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + regionFlow_.WriteTo(output, _repeated_regionFlow_codec); + if (HasNumTotalFeatures) { + output.WriteRawTag(16); + output.WriteInt32(NumTotalFeatures); + } + if (HasUnstableFrame) { + output.WriteRawTag(32); + output.WriteBool(UnstableFrame); + } + if (HasBlurScore) { + output.WriteRawTag(61); + output.WriteFloat(BlurScore); + } + if (HasFrameWidth) { + output.WriteRawTag(64); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(72); + output.WriteInt32(FrameHeight); + } + if (blockDescriptor_ != null) { + output.WriteRawTag(82); + output.WriteMessage(BlockDescriptor); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + regionFlow_.WriteTo(ref output, _repeated_regionFlow_codec); + if (HasNumTotalFeatures) { + output.WriteRawTag(16); + output.WriteInt32(NumTotalFeatures); + } + if (HasUnstableFrame) { + output.WriteRawTag(32); + output.WriteBool(UnstableFrame); + } + if (HasBlurScore) { + output.WriteRawTag(61); + output.WriteFloat(BlurScore); + } + if (HasFrameWidth) { + output.WriteRawTag(64); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(72); + output.WriteInt32(FrameHeight); + } + if (blockDescriptor_ != null) { + output.WriteRawTag(82); + output.WriteMessage(BlockDescriptor); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += regionFlow_.CalculateSize(_repeated_regionFlow_codec); + if (HasNumTotalFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumTotalFeatures); + } + if (HasUnstableFrame) { + size += 1 + 1; + } + if (HasBlurScore) { + size += 1 + 4; + } + if (HasFrameWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameWidth); + } + if (HasFrameHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameHeight); + } + if (blockDescriptor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlockDescriptor); + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RegionFlowFrame other) { + if (other == null) { + return; + } + regionFlow_.Add(other.regionFlow_); + if (other.HasNumTotalFeatures) { + NumTotalFeatures = other.NumTotalFeatures; + } + if (other.HasUnstableFrame) { + UnstableFrame = other.UnstableFrame; + } + if (other.HasBlurScore) { + BlurScore = other.BlurScore; + } + if (other.HasFrameWidth) { + FrameWidth = other.FrameWidth; + } + if (other.HasFrameHeight) { + FrameHeight = other.FrameHeight; + } + if (other.blockDescriptor_ != null) { + if (blockDescriptor_ == null) { + BlockDescriptor = new global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor(); + } + BlockDescriptor.MergeFrom(other.BlockDescriptor); + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + regionFlow_.AddEntriesFrom(input, _repeated_regionFlow_codec); + break; + } + case 16: { + NumTotalFeatures = input.ReadInt32(); + break; + } + case 32: { + UnstableFrame = input.ReadBool(); + break; + } + case 61: { + BlurScore = input.ReadFloat(); + break; + } + case 64: { + FrameWidth = input.ReadInt32(); + break; + } + case 72: { + FrameHeight = input.ReadInt32(); + break; + } + case 82: { + if (blockDescriptor_ == null) { + BlockDescriptor = new global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor(); + } + input.ReadMessage(BlockDescriptor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 10: { + regionFlow_.AddEntriesFrom(ref input, _repeated_regionFlow_codec); + break; + } + case 16: { + NumTotalFeatures = input.ReadInt32(); + break; + } + case 32: { + UnstableFrame = input.ReadBool(); + break; + } + case 61: { + BlurScore = input.ReadFloat(); + break; + } + case 64: { + FrameWidth = input.ReadInt32(); + break; + } + case 72: { + FrameHeight = input.ReadInt32(); + break; + } + case 82: { + if (blockDescriptor_ == null) { + BlockDescriptor = new global::Mediapipe.RegionFlowFrame.Types.BlockDescriptor(); + } + input.ReadMessage(BlockDescriptor); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the RegionFlowFrame message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Next tag: 8 + /// + public sealed partial class RegionFlow : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionFlow()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowFrame.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlow() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlow(RegionFlow other) : this() { + _hasBits0 = other._hasBits0; + regionId_ = other.regionId_; + centroidX_ = other.centroidX_; + centroidY_ = other.centroidY_; + flowX_ = other.flowX_; + flowY_ = other.flowY_; + feature_ = other.feature_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlow Clone() { + return new RegionFlow(this); + } + + /// Field number for the "region_id" field. + public const int RegionIdFieldNumber = 1; + private readonly static int RegionIdDefaultValue = 0; + + private int regionId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RegionId { + get { if ((_hasBits0 & 1) != 0) { return regionId_; } else { return RegionIdDefaultValue; } } + set { + _hasBits0 |= 1; + regionId_ = value; + } + } + /// Gets whether the "region_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRegionId { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "region_id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRegionId() { + _hasBits0 &= ~1; + } + + /// Field number for the "centroid_x" field. + public const int CentroidXFieldNumber = 2; + private readonly static float CentroidXDefaultValue = 0F; + + private float centroidX_; + /// + /// Mean anchor point (centroid) of flow vector and mean flow. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CentroidX { + get { if ((_hasBits0 & 2) != 0) { return centroidX_; } else { return CentroidXDefaultValue; } } + set { + _hasBits0 |= 2; + centroidX_ = value; + } + } + /// Gets whether the "centroid_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCentroidX { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "centroid_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCentroidX() { + _hasBits0 &= ~2; + } + + /// Field number for the "centroid_y" field. + public const int CentroidYFieldNumber = 3; + private readonly static float CentroidYDefaultValue = 0F; + + private float centroidY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CentroidY { + get { if ((_hasBits0 & 4) != 0) { return centroidY_; } else { return CentroidYDefaultValue; } } + set { + _hasBits0 |= 4; + centroidY_ = value; + } + } + /// Gets whether the "centroid_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCentroidY { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "centroid_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCentroidY() { + _hasBits0 &= ~4; + } + + /// Field number for the "flow_x" field. + public const int FlowXFieldNumber = 4; + private readonly static float FlowXDefaultValue = 0F; + + private float flowX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FlowX { + get { if ((_hasBits0 & 8) != 0) { return flowX_; } else { return FlowXDefaultValue; } } + set { + _hasBits0 |= 8; + flowX_ = value; + } + } + /// Gets whether the "flow_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlowX { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "flow_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlowX() { + _hasBits0 &= ~8; + } + + /// Field number for the "flow_y" field. + public const int FlowYFieldNumber = 5; + private readonly static float FlowYDefaultValue = 0F; + + private float flowY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FlowY { + get { if ((_hasBits0 & 16) != 0) { return flowY_; } else { return FlowYDefaultValue; } } + set { + _hasBits0 |= 16; + flowY_ = value; + } + } + /// Gets whether the "flow_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFlowY { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "flow_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFlowY() { + _hasBits0 &= ~16; + } + + /// Field number for the "feature" field. + public const int FeatureFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_feature_codec + = pb::FieldCodec.ForMessage(58, global::Mediapipe.RegionFlowFeature.Parser); + private readonly pbc::RepeatedField feature_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Feature { + get { return feature_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RegionFlow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RegionFlow other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RegionId != other.RegionId) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CentroidX, other.CentroidX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CentroidY, other.CentroidY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FlowX, other.FlowX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FlowY, other.FlowY)) return false; + if(!feature_.Equals(other.feature_)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasRegionId) hash ^= RegionId.GetHashCode(); + if (HasCentroidX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CentroidX); + if (HasCentroidY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CentroidY); + if (HasFlowX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FlowX); + if (HasFlowY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FlowY); + hash ^= feature_.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasRegionId) { + output.WriteRawTag(8); + output.WriteInt32(RegionId); + } + if (HasCentroidX) { + output.WriteRawTag(21); + output.WriteFloat(CentroidX); + } + if (HasCentroidY) { + output.WriteRawTag(29); + output.WriteFloat(CentroidY); + } + if (HasFlowX) { + output.WriteRawTag(37); + output.WriteFloat(FlowX); + } + if (HasFlowY) { + output.WriteRawTag(45); + output.WriteFloat(FlowY); + } + feature_.WriteTo(output, _repeated_feature_codec); + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRegionId) { + output.WriteRawTag(8); + output.WriteInt32(RegionId); + } + if (HasCentroidX) { + output.WriteRawTag(21); + output.WriteFloat(CentroidX); + } + if (HasCentroidY) { + output.WriteRawTag(29); + output.WriteFloat(CentroidY); + } + if (HasFlowX) { + output.WriteRawTag(37); + output.WriteFloat(FlowX); + } + if (HasFlowY) { + output.WriteRawTag(45); + output.WriteFloat(FlowY); + } + feature_.WriteTo(ref output, _repeated_feature_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasRegionId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RegionId); + } + if (HasCentroidX) { + size += 1 + 4; + } + if (HasCentroidY) { + size += 1 + 4; + } + if (HasFlowX) { + size += 1 + 4; + } + if (HasFlowY) { + size += 1 + 4; + } + size += feature_.CalculateSize(_repeated_feature_codec); + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RegionFlow other) { + if (other == null) { + return; + } + if (other.HasRegionId) { + RegionId = other.RegionId; + } + if (other.HasCentroidX) { + CentroidX = other.CentroidX; + } + if (other.HasCentroidY) { + CentroidY = other.CentroidY; + } + if (other.HasFlowX) { + FlowX = other.FlowX; + } + if (other.HasFlowY) { + FlowY = other.FlowY; + } + feature_.Add(other.feature_); + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + RegionId = input.ReadInt32(); + break; + } + case 21: { + CentroidX = input.ReadFloat(); + break; + } + case 29: { + CentroidY = input.ReadFloat(); + break; + } + case 37: { + FlowX = input.ReadFloat(); + break; + } + case 45: { + FlowY = input.ReadFloat(); + break; + } + case 58: { + feature_.AddEntriesFrom(input, _repeated_feature_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + RegionId = input.ReadInt32(); + break; + } + case 21: { + CentroidX = input.ReadFloat(); + break; + } + case 29: { + CentroidY = input.ReadFloat(); + break; + } + case 37: { + FlowX = input.ReadFloat(); + break; + } + case 45: { + FlowY = input.ReadFloat(); + break; + } + case 58: { + feature_.AddEntriesFrom(ref input, _repeated_feature_codec); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + /// + /// Region flow is estimated using a grid of equal sized bins as regions. + /// BlockDescriptor specifies size of bins/blocks. + /// + public sealed partial class BlockDescriptor : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BlockDescriptor()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowFrame.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlockDescriptor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlockDescriptor(BlockDescriptor other) : this() { + _hasBits0 = other._hasBits0; + blockWidth_ = other.blockWidth_; + blockHeight_ = other.blockHeight_; + numBlocksX_ = other.numBlocksX_; + numBlocksY_ = other.numBlocksY_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlockDescriptor Clone() { + return new BlockDescriptor(this); + } + + /// Field number for the "block_width" field. + public const int BlockWidthFieldNumber = 1; + private readonly static int BlockWidthDefaultValue = 0; + + private int blockWidth_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BlockWidth { + get { if ((_hasBits0 & 1) != 0) { return blockWidth_; } else { return BlockWidthDefaultValue; } } + set { + _hasBits0 |= 1; + blockWidth_ = value; + } + } + /// Gets whether the "block_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlockWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "block_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlockWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "block_height" field. + public const int BlockHeightFieldNumber = 2; + private readonly static int BlockHeightDefaultValue = 0; + + private int blockHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BlockHeight { + get { if ((_hasBits0 & 2) != 0) { return blockHeight_; } else { return BlockHeightDefaultValue; } } + set { + _hasBits0 |= 2; + blockHeight_ = value; + } + } + /// Gets whether the "block_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlockHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "block_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlockHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "num_blocks_x" field. + public const int NumBlocksXFieldNumber = 3; + private readonly static int NumBlocksXDefaultValue = 0; + + private int numBlocksX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumBlocksX { + get { if ((_hasBits0 & 4) != 0) { return numBlocksX_; } else { return NumBlocksXDefaultValue; } } + set { + _hasBits0 |= 4; + numBlocksX_ = value; + } + } + /// Gets whether the "num_blocks_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumBlocksX { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "num_blocks_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumBlocksX() { + _hasBits0 &= ~4; + } + + /// Field number for the "num_blocks_y" field. + public const int NumBlocksYFieldNumber = 4; + private readonly static int NumBlocksYDefaultValue = 0; + + private int numBlocksY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumBlocksY { + get { if ((_hasBits0 & 8) != 0) { return numBlocksY_; } else { return NumBlocksYDefaultValue; } } + set { + _hasBits0 |= 8; + numBlocksY_ = value; + } + } + /// Gets whether the "num_blocks_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumBlocksY { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "num_blocks_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumBlocksY() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BlockDescriptor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BlockDescriptor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BlockWidth != other.BlockWidth) return false; + if (BlockHeight != other.BlockHeight) return false; + if (NumBlocksX != other.NumBlocksX) return false; + if (NumBlocksY != other.NumBlocksY) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBlockWidth) hash ^= BlockWidth.GetHashCode(); + if (HasBlockHeight) hash ^= BlockHeight.GetHashCode(); + if (HasNumBlocksX) hash ^= NumBlocksX.GetHashCode(); + if (HasNumBlocksY) hash ^= NumBlocksY.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBlockWidth) { + output.WriteRawTag(8); + output.WriteInt32(BlockWidth); + } + if (HasBlockHeight) { + output.WriteRawTag(16); + output.WriteInt32(BlockHeight); + } + if (HasNumBlocksX) { + output.WriteRawTag(24); + output.WriteInt32(NumBlocksX); + } + if (HasNumBlocksY) { + output.WriteRawTag(32); + output.WriteInt32(NumBlocksY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBlockWidth) { + output.WriteRawTag(8); + output.WriteInt32(BlockWidth); + } + if (HasBlockHeight) { + output.WriteRawTag(16); + output.WriteInt32(BlockHeight); + } + if (HasNumBlocksX) { + output.WriteRawTag(24); + output.WriteInt32(NumBlocksX); + } + if (HasNumBlocksY) { + output.WriteRawTag(32); + output.WriteInt32(NumBlocksY); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBlockWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BlockWidth); + } + if (HasBlockHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BlockHeight); + } + if (HasNumBlocksX) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumBlocksX); + } + if (HasNumBlocksY) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumBlocksY); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BlockDescriptor other) { + if (other == null) { + return; + } + if (other.HasBlockWidth) { + BlockWidth = other.BlockWidth; + } + if (other.HasBlockHeight) { + BlockHeight = other.BlockHeight; + } + if (other.HasNumBlocksX) { + NumBlocksX = other.NumBlocksX; + } + if (other.HasNumBlocksY) { + NumBlocksY = other.NumBlocksY; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BlockWidth = input.ReadInt32(); + break; + } + case 16: { + BlockHeight = input.ReadInt32(); + break; + } + case 24: { + NumBlocksX = input.ReadInt32(); + break; + } + case 32: { + NumBlocksY = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + BlockWidth = input.ReadInt32(); + break; + } + case 16: { + BlockHeight = input.ReadInt32(); + break; + } + case 24: { + NumBlocksX = input.ReadInt32(); + break; + } + case 32: { + NumBlocksY = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Encapsulates a list of features with associated flow. + /// Can be extracted from RegionFlow via GetRegionFlowFeatureList + /// declared in region_flow.h. This is the essential (additional) information + /// required by Cropper using wobble_suppression with displacements. + /// Next tag: 14 + /// + public sealed partial class RegionFlowFeatureList : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionFlowFeatureList()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeatureList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeatureList(RegionFlowFeatureList other) : this() { + _hasBits0 = other._hasBits0; + feature_ = other.feature_.Clone(); + frameWidth_ = other.frameWidth_; + frameHeight_ = other.frameHeight_; + unstable_ = other.unstable_; + distanceFromBorder_ = other.distanceFromBorder_; + blurScore_ = other.blurScore_; + longTracks_ = other.longTracks_; + fracLongFeaturesRejected_ = other.fracLongFeaturesRejected_; + visualConsistency_ = other.visualConsistency_; + timestampUsec_ = other.timestampUsec_; + matchFrame_ = other.matchFrame_; + isDuplicated_ = other.isDuplicated_; + activelyDiscardedTrackedIds_ = other.activelyDiscardedTrackedIds_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowFeatureList Clone() { + return new RegionFlowFeatureList(this); + } + + /// Field number for the "feature" field. + public const int FeatureFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_feature_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.RegionFlowFeature.Parser); + private readonly pbc::RepeatedField feature_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Feature { + get { return feature_; } + } + + /// Field number for the "frame_width" field. + public const int FrameWidthFieldNumber = 2; + private readonly static int FrameWidthDefaultValue = 0; + + private int frameWidth_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameWidth { + get { if ((_hasBits0 & 1) != 0) { return frameWidth_; } else { return FrameWidthDefaultValue; } } + set { + _hasBits0 |= 1; + frameWidth_ = value; + } + } + /// Gets whether the "frame_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameWidth { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "frame_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameWidth() { + _hasBits0 &= ~1; + } + + /// Field number for the "frame_height" field. + public const int FrameHeightFieldNumber = 3; + private readonly static int FrameHeightDefaultValue = 0; + + private int frameHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FrameHeight { + get { if ((_hasBits0 & 2) != 0) { return frameHeight_; } else { return FrameHeightDefaultValue; } } + set { + _hasBits0 |= 2; + frameHeight_ = value; + } + } + /// Gets whether the "frame_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFrameHeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frame_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFrameHeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "unstable" field. + public const int UnstableFieldNumber = 4; + private readonly static bool UnstableDefaultValue = false; + + private bool unstable_; + /// + /// Set from corresponding RegionFlowFrame field. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Unstable { + get { if ((_hasBits0 & 4) != 0) { return unstable_; } else { return UnstableDefaultValue; } } + set { + _hasBits0 |= 4; + unstable_ = value; + } + } + /// Gets whether the "unstable" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUnstable { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "unstable" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUnstable() { + _hasBits0 &= ~4; + } + + /// Field number for the "distance_from_border" field. + public const int DistanceFromBorderFieldNumber = 5; + private readonly static int DistanceFromBorderDefaultValue = 0; + + private int distanceFromBorder_; + /// + /// Records the minimum distance from the image border for each feature and + /// matching feature (if enforced > 0). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DistanceFromBorder { + get { if ((_hasBits0 & 8) != 0) { return distanceFromBorder_; } else { return DistanceFromBorderDefaultValue; } } + set { + _hasBits0 |= 8; + distanceFromBorder_ = value; + } + } + /// Gets whether the "distance_from_border" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDistanceFromBorder { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "distance_from_border" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDistanceFromBorder() { + _hasBits0 &= ~8; + } + + /// Field number for the "blur_score" field. + public const int BlurScoreFieldNumber = 6; + private readonly static float BlurScoreDefaultValue = 0F; + + private float blurScore_; + /// + /// Set from corresponding RegionFlowFrame field. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BlurScore { + get { if ((_hasBits0 & 16) != 0) { return blurScore_; } else { return BlurScoreDefaultValue; } } + set { + _hasBits0 |= 16; + blurScore_ = value; + } + } + /// Gets whether the "blur_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBlurScore { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "blur_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBlurScore() { + _hasBits0 &= ~16; + } + + /// Field number for the "long_tracks" field. + public const int LongTracksFieldNumber = 7; + private readonly static bool LongTracksDefaultValue = false; + + private bool longTracks_; + /// + /// If set, indicates, that features represent long tracks, i.e. each feature + /// has a valid track_id() >= 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool LongTracks { + get { if ((_hasBits0 & 32) != 0) { return longTracks_; } else { return LongTracksDefaultValue; } } + set { + _hasBits0 |= 32; + longTracks_ = value; + } + } + /// Gets whether the "long_tracks" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLongTracks { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "long_tracks" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLongTracks() { + _hasBits0 &= ~32; + } + + /// Field number for the "frac_long_features_rejected" field. + public const int FracLongFeaturesRejectedFieldNumber = 8; + private readonly static float FracLongFeaturesRejectedDefaultValue = 0F; + + private float fracLongFeaturesRejected_; + /// + /// If long_tracks, stores number of long feature tracks that got rejected in + /// this frame, as their patches were deemed inconsistent with the track's very + /// first extracted patch. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracLongFeaturesRejected { + get { if ((_hasBits0 & 64) != 0) { return fracLongFeaturesRejected_; } else { return FracLongFeaturesRejectedDefaultValue; } } + set { + _hasBits0 |= 64; + fracLongFeaturesRejected_ = value; + } + } + /// Gets whether the "frac_long_features_rejected" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracLongFeaturesRejected { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "frac_long_features_rejected" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracLongFeaturesRejected() { + _hasBits0 &= ~64; + } + + /// Field number for the "visual_consistency" field. + public const int VisualConsistencyFieldNumber = 9; + private readonly static float VisualConsistencyDefaultValue = -1F; + + private float visualConsistency_; + /// + /// Measures visual consistency between adjacent frames. In particular, stores + /// the absolute *change* in visual difference between two adjancent frame + /// pairs, i.e. the modulus of the 2nd derivative of the frame appearance. + /// Normalized w.r.t. number of channels and total pixels of the underlying + /// frame. + /// In particular for sudden changes (e.g. shot boundaries) this value will + /// be significantly non-zero (> 0.05). + /// Negative value per default indicates no consistency has been computed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VisualConsistency { + get { if ((_hasBits0 & 128) != 0) { return visualConsistency_; } else { return VisualConsistencyDefaultValue; } } + set { + _hasBits0 |= 128; + visualConsistency_ = value; + } + } + /// Gets whether the "visual_consistency" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVisualConsistency { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "visual_consistency" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVisualConsistency() { + _hasBits0 &= ~128; + } + + /// Field number for the "timestamp_usec" field. + public const int TimestampUsecFieldNumber = 10; + private readonly static long TimestampUsecDefaultValue = 0L; + + private long timestampUsec_; + /// + /// Timestamp in micro seconds of the underlying frame, that is the frame + /// for which the source features (not matching features) were computed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimestampUsec { + get { if ((_hasBits0 & 256) != 0) { return timestampUsec_; } else { return TimestampUsecDefaultValue; } } + set { + _hasBits0 |= 256; + timestampUsec_ = value; + } + } + /// Gets whether the "timestamp_usec" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTimestampUsec { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "timestamp_usec" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTimestampUsec() { + _hasBits0 &= ~256; + } + + /// Field number for the "match_frame" field. + public const int MatchFrameFieldNumber = 11; + private readonly static int MatchFrameDefaultValue = 0; + + private int matchFrame_; + /// + /// Denotes the frame that flow was computed w.r.t. to, locally to the current + /// frame. For example, if current frame is N, N + match_frame is the matching + /// frame that flow was computed to. + /// Values < 0 indicate backward tracking, while values > 0 indicate forward + /// tracking. By default, for empty feature lists, matching frame is the + /// same as current frame, i.e. match_frame = 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MatchFrame { + get { if ((_hasBits0 & 512) != 0) { return matchFrame_; } else { return MatchFrameDefaultValue; } } + set { + _hasBits0 |= 512; + matchFrame_ = value; + } + } + /// Gets whether the "match_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMatchFrame { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "match_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMatchFrame() { + _hasBits0 &= ~512; + } + + /// Field number for the "is_duplicated" field. + public const int IsDuplicatedFieldNumber = 12; + private readonly static bool IsDuplicatedDefaultValue = false; + + private bool isDuplicated_; + /// + /// Set, if frame is estimated to be an exact duplicate of the previous frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsDuplicated { + get { if ((_hasBits0 & 1024) != 0) { return isDuplicated_; } else { return IsDuplicatedDefaultValue; } } + set { + _hasBits0 |= 1024; + isDuplicated_ = value; + } + } + /// Gets whether the "is_duplicated" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIsDuplicated { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "is_duplicated" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIsDuplicated() { + _hasBits0 &= ~1024; + } + + /// Field number for the "actively_discarded_tracked_ids" field. + public const int ActivelyDiscardedTrackedIdsFieldNumber = 13; + private static readonly pb::FieldCodec _repeated_activelyDiscardedTrackedIds_codec + = pb::FieldCodec.ForInt32(104); + private readonly pbc::RepeatedField activelyDiscardedTrackedIds_ = new pbc::RepeatedField(); + /// + /// Stores all the tracked ids that have been discarded actively in this frame. + /// This information will be popluated via RegionFlowFeatureList, so that the + /// downstreaming modules can receive it and use it to avoid misjudgement on + /// tracking continuity. + /// Discard reason: + /// (1) A tracked feature has too long track, which might create drift. + /// (2) A tracked feature in a highly densed area, which provides little value. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ActivelyDiscardedTrackedIds { + get { return activelyDiscardedTrackedIds_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RegionFlowFeatureList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RegionFlowFeatureList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!feature_.Equals(other.feature_)) return false; + if (FrameWidth != other.FrameWidth) return false; + if (FrameHeight != other.FrameHeight) return false; + if (Unstable != other.Unstable) return false; + if (DistanceFromBorder != other.DistanceFromBorder) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BlurScore, other.BlurScore)) return false; + if (LongTracks != other.LongTracks) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracLongFeaturesRejected, other.FracLongFeaturesRejected)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VisualConsistency, other.VisualConsistency)) return false; + if (TimestampUsec != other.TimestampUsec) return false; + if (MatchFrame != other.MatchFrame) return false; + if (IsDuplicated != other.IsDuplicated) return false; + if(!activelyDiscardedTrackedIds_.Equals(other.activelyDiscardedTrackedIds_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= feature_.GetHashCode(); + if (HasFrameWidth) hash ^= FrameWidth.GetHashCode(); + if (HasFrameHeight) hash ^= FrameHeight.GetHashCode(); + if (HasUnstable) hash ^= Unstable.GetHashCode(); + if (HasDistanceFromBorder) hash ^= DistanceFromBorder.GetHashCode(); + if (HasBlurScore) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BlurScore); + if (HasLongTracks) hash ^= LongTracks.GetHashCode(); + if (HasFracLongFeaturesRejected) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracLongFeaturesRejected); + if (HasVisualConsistency) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VisualConsistency); + if (HasTimestampUsec) hash ^= TimestampUsec.GetHashCode(); + if (HasMatchFrame) hash ^= MatchFrame.GetHashCode(); + if (HasIsDuplicated) hash ^= IsDuplicated.GetHashCode(); + hash ^= activelyDiscardedTrackedIds_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + feature_.WriteTo(output, _repeated_feature_codec); + if (HasFrameWidth) { + output.WriteRawTag(16); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(24); + output.WriteInt32(FrameHeight); + } + if (HasUnstable) { + output.WriteRawTag(32); + output.WriteBool(Unstable); + } + if (HasDistanceFromBorder) { + output.WriteRawTag(40); + output.WriteInt32(DistanceFromBorder); + } + if (HasBlurScore) { + output.WriteRawTag(53); + output.WriteFloat(BlurScore); + } + if (HasLongTracks) { + output.WriteRawTag(56); + output.WriteBool(LongTracks); + } + if (HasFracLongFeaturesRejected) { + output.WriteRawTag(69); + output.WriteFloat(FracLongFeaturesRejected); + } + if (HasVisualConsistency) { + output.WriteRawTag(77); + output.WriteFloat(VisualConsistency); + } + if (HasTimestampUsec) { + output.WriteRawTag(80); + output.WriteInt64(TimestampUsec); + } + if (HasMatchFrame) { + output.WriteRawTag(88); + output.WriteInt32(MatchFrame); + } + if (HasIsDuplicated) { + output.WriteRawTag(96); + output.WriteBool(IsDuplicated); + } + activelyDiscardedTrackedIds_.WriteTo(output, _repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + feature_.WriteTo(ref output, _repeated_feature_codec); + if (HasFrameWidth) { + output.WriteRawTag(16); + output.WriteInt32(FrameWidth); + } + if (HasFrameHeight) { + output.WriteRawTag(24); + output.WriteInt32(FrameHeight); + } + if (HasUnstable) { + output.WriteRawTag(32); + output.WriteBool(Unstable); + } + if (HasDistanceFromBorder) { + output.WriteRawTag(40); + output.WriteInt32(DistanceFromBorder); + } + if (HasBlurScore) { + output.WriteRawTag(53); + output.WriteFloat(BlurScore); + } + if (HasLongTracks) { + output.WriteRawTag(56); + output.WriteBool(LongTracks); + } + if (HasFracLongFeaturesRejected) { + output.WriteRawTag(69); + output.WriteFloat(FracLongFeaturesRejected); + } + if (HasVisualConsistency) { + output.WriteRawTag(77); + output.WriteFloat(VisualConsistency); + } + if (HasTimestampUsec) { + output.WriteRawTag(80); + output.WriteInt64(TimestampUsec); + } + if (HasMatchFrame) { + output.WriteRawTag(88); + output.WriteInt32(MatchFrame); + } + if (HasIsDuplicated) { + output.WriteRawTag(96); + output.WriteBool(IsDuplicated); + } + activelyDiscardedTrackedIds_.WriteTo(ref output, _repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += feature_.CalculateSize(_repeated_feature_codec); + if (HasFrameWidth) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameWidth); + } + if (HasFrameHeight) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FrameHeight); + } + if (HasUnstable) { + size += 1 + 1; + } + if (HasDistanceFromBorder) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DistanceFromBorder); + } + if (HasBlurScore) { + size += 1 + 4; + } + if (HasLongTracks) { + size += 1 + 1; + } + if (HasFracLongFeaturesRejected) { + size += 1 + 4; + } + if (HasVisualConsistency) { + size += 1 + 4; + } + if (HasTimestampUsec) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimestampUsec); + } + if (HasMatchFrame) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MatchFrame); + } + if (HasIsDuplicated) { + size += 1 + 1; + } + size += activelyDiscardedTrackedIds_.CalculateSize(_repeated_activelyDiscardedTrackedIds_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RegionFlowFeatureList other) { + if (other == null) { + return; + } + feature_.Add(other.feature_); + if (other.HasFrameWidth) { + FrameWidth = other.FrameWidth; + } + if (other.HasFrameHeight) { + FrameHeight = other.FrameHeight; + } + if (other.HasUnstable) { + Unstable = other.Unstable; + } + if (other.HasDistanceFromBorder) { + DistanceFromBorder = other.DistanceFromBorder; + } + if (other.HasBlurScore) { + BlurScore = other.BlurScore; + } + if (other.HasLongTracks) { + LongTracks = other.LongTracks; + } + if (other.HasFracLongFeaturesRejected) { + FracLongFeaturesRejected = other.FracLongFeaturesRejected; + } + if (other.HasVisualConsistency) { + VisualConsistency = other.VisualConsistency; + } + if (other.HasTimestampUsec) { + TimestampUsec = other.TimestampUsec; + } + if (other.HasMatchFrame) { + MatchFrame = other.MatchFrame; + } + if (other.HasIsDuplicated) { + IsDuplicated = other.IsDuplicated; + } + activelyDiscardedTrackedIds_.Add(other.activelyDiscardedTrackedIds_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + feature_.AddEntriesFrom(input, _repeated_feature_codec); + break; + } + case 16: { + FrameWidth = input.ReadInt32(); + break; + } + case 24: { + FrameHeight = input.ReadInt32(); + break; + } + case 32: { + Unstable = input.ReadBool(); + break; + } + case 40: { + DistanceFromBorder = input.ReadInt32(); + break; + } + case 53: { + BlurScore = input.ReadFloat(); + break; + } + case 56: { + LongTracks = input.ReadBool(); + break; + } + case 69: { + FracLongFeaturesRejected = input.ReadFloat(); + break; + } + case 77: { + VisualConsistency = input.ReadFloat(); + break; + } + case 80: { + TimestampUsec = input.ReadInt64(); + break; + } + case 88: { + MatchFrame = input.ReadInt32(); + break; + } + case 96: { + IsDuplicated = input.ReadBool(); + break; + } + case 106: + case 104: { + activelyDiscardedTrackedIds_.AddEntriesFrom(input, _repeated_activelyDiscardedTrackedIds_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + feature_.AddEntriesFrom(ref input, _repeated_feature_codec); + break; + } + case 16: { + FrameWidth = input.ReadInt32(); + break; + } + case 24: { + FrameHeight = input.ReadInt32(); + break; + } + case 32: { + Unstable = input.ReadBool(); + break; + } + case 40: { + DistanceFromBorder = input.ReadInt32(); + break; + } + case 53: { + BlurScore = input.ReadFloat(); + break; + } + case 56: { + LongTracks = input.ReadBool(); + break; + } + case 69: { + FracLongFeaturesRejected = input.ReadFloat(); + break; + } + case 77: { + VisualConsistency = input.ReadFloat(); + break; + } + case 80: { + TimestampUsec = input.ReadInt64(); + break; + } + case 88: { + MatchFrame = input.ReadInt32(); + break; + } + case 96: { + IsDuplicated = input.ReadBool(); + break; + } + case 106: + case 104: { + activelyDiscardedTrackedIds_.AddEntriesFrom(ref input, _repeated_activelyDiscardedTrackedIds_codec); + break; + } + } + } + } + #endif + + } + + /// + /// For TYPE_INCLUDE: + /// During retargeting and stabilization salient points introduce constraints + /// that will try to keep the normalized location in the rectangle + /// frame_size - normalized bounds. + /// For this soft constraints are used, therefore the weight specifies + /// how "important" the salient point is (higher is better). + /// In particular for each point p the retargeter introduces two pairs of + /// constraints of the form: + /// x - slack < width - right + /// and x + slack > 0 + left, with slack > 0 + /// where the weight specifies the importance of the slack. + /// + /// For TYPE_EXCLUDE_*: + /// Similar to above, but constraints are introduced to keep + /// the point to the left of the left bound OR the right of the right bound. + /// In particular: + /// x - slack < left OR + /// x + slack >= right + /// Similar to above, the weight specifies the importance of the slack. + /// + /// Note: Choosing a too high weight can lead to + /// jerkiness as the stabilization essentially starts tracking the salient point. + /// + public sealed partial class SalientPoint : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SalientPoint()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPoint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPoint(SalientPoint other) : this() { + _hasBits0 = other._hasBits0; + normPointX_ = other.normPointX_; + normPointY_ = other.normPointY_; + type_ = other.type_; + left_ = other.left_; + bottom_ = other.bottom_; + right_ = other.right_; + top_ = other.top_; + weight_ = other.weight_; + normMajor_ = other.normMajor_; + normMinor_ = other.normMinor_; + angle_ = other.angle_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPoint Clone() { + return new SalientPoint(this); + } + + /// Field number for the "norm_point_x" field. + public const int NormPointXFieldNumber = 1; + private readonly static float NormPointXDefaultValue = 0F; + + private float normPointX_; + /// + /// Normalized location of the point (within domain [0, 1] x [0, 1]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormPointX { + get { if ((_hasBits0 & 1) != 0) { return normPointX_; } else { return NormPointXDefaultValue; } } + set { + _hasBits0 |= 1; + normPointX_ = value; + } + } + /// Gets whether the "norm_point_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormPointX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "norm_point_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormPointX() { + _hasBits0 &= ~1; + } + + /// Field number for the "norm_point_y" field. + public const int NormPointYFieldNumber = 2; + private readonly static float NormPointYDefaultValue = 0F; + + private float normPointY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormPointY { + get { if ((_hasBits0 & 2) != 0) { return normPointY_; } else { return NormPointYDefaultValue; } } + set { + _hasBits0 |= 2; + normPointY_ = value; + } + } + /// Gets whether the "norm_point_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormPointY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "norm_point_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormPointY() { + _hasBits0 &= ~2; + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 11; + private readonly static global::Mediapipe.SalientPoint.Types.SalientPointType TypeDefaultValue = global::Mediapipe.SalientPoint.Types.SalientPointType.TypeInclude; + + private global::Mediapipe.SalientPoint.Types.SalientPointType type_; + /// + /// Salient point type. By default we try to frame the salient point within + /// the bounding box specified by left, bottom, right, top. Alternatively, one + /// can choose to exclude the point. For details, see discussion above. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.SalientPoint.Types.SalientPointType Type { + get { if ((_hasBits0 & 1024) != 0) { return type_; } else { return TypeDefaultValue; } } + set { + _hasBits0 |= 1024; + type_ = value; + } + } + /// Gets whether the "type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasType { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearType() { + _hasBits0 &= ~1024; + } + + /// Field number for the "left" field. + public const int LeftFieldNumber = 3; + private readonly static float LeftDefaultValue = 0.3F; + + private float left_; + /// + /// Bounds are specified in normalized coordinates [0, 1], FROM the specified + /// border. Opposing bounds (e.g. left and right) may not add to values + /// larger than 1. + /// Default bounds center salient point within centering third of the frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Left { + get { if ((_hasBits0 & 4) != 0) { return left_; } else { return LeftDefaultValue; } } + set { + _hasBits0 |= 4; + left_ = value; + } + } + /// Gets whether the "left" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeft { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "left" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeft() { + _hasBits0 &= ~4; + } + + /// Field number for the "bottom" field. + public const int BottomFieldNumber = 4; + private readonly static float BottomDefaultValue = 0.3F; + + private float bottom_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Bottom { + get { if ((_hasBits0 & 8) != 0) { return bottom_; } else { return BottomDefaultValue; } } + set { + _hasBits0 |= 8; + bottom_ = value; + } + } + /// Gets whether the "bottom" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBottom { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "bottom" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBottom() { + _hasBits0 &= ~8; + } + + /// Field number for the "right" field. + public const int RightFieldNumber = 9; + private readonly static float RightDefaultValue = 0.3F; + + private float right_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Right { + get { if ((_hasBits0 & 256) != 0) { return right_; } else { return RightDefaultValue; } } + set { + _hasBits0 |= 256; + right_ = value; + } + } + /// Gets whether the "right" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRight { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "right" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRight() { + _hasBits0 &= ~256; + } + + /// Field number for the "top" field. + public const int TopFieldNumber = 10; + private readonly static float TopDefaultValue = 0.3F; + + private float top_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Top { + get { if ((_hasBits0 & 512) != 0) { return top_; } else { return TopDefaultValue; } } + set { + _hasBits0 |= 512; + top_ = value; + } + } + /// Gets whether the "top" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTop { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "top" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTop() { + _hasBits0 &= ~512; + } + + /// Field number for the "weight" field. + public const int WeightFieldNumber = 5; + private readonly static float WeightDefaultValue = 15F; + + private float weight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Weight { + get { if ((_hasBits0 & 16) != 0) { return weight_; } else { return WeightDefaultValue; } } + set { + _hasBits0 |= 16; + weight_ = value; + } + } + /// Gets whether the "weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWeight { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWeight() { + _hasBits0 &= ~16; + } + + /// Field number for the "norm_major" field. + public const int NormMajorFieldNumber = 6; + private readonly static float NormMajorDefaultValue = 0F; + + private float normMajor_; + /// + /// In addition salient point can represent a region of interest (defined as + /// ellipse of size norm_major x norm_minor (normalized to [0, 1] domain) + /// which orientation is given by angle (in radians in [0, pi]). + /// Due to aspect ratio change of the normalized domain, it is recommended that + /// transformations to other domains are done via the ScaleSalientPoint + /// function. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormMajor { + get { if ((_hasBits0 & 32) != 0) { return normMajor_; } else { return NormMajorDefaultValue; } } + set { + _hasBits0 |= 32; + normMajor_ = value; + } + } + /// Gets whether the "norm_major" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormMajor { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "norm_major" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormMajor() { + _hasBits0 &= ~32; + } + + /// Field number for the "norm_minor" field. + public const int NormMinorFieldNumber = 7; + private readonly static float NormMinorDefaultValue = 0F; + + private float normMinor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float NormMinor { + get { if ((_hasBits0 & 64) != 0) { return normMinor_; } else { return NormMinorDefaultValue; } } + set { + _hasBits0 |= 64; + normMinor_ = value; + } + } + /// Gets whether the "norm_minor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormMinor { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "norm_minor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormMinor() { + _hasBits0 &= ~64; + } + + /// Field number for the "angle" field. + public const int AngleFieldNumber = 8; + private readonly static float AngleDefaultValue = 0F; + + private float angle_; + /// + /// Angle of major axis with x-axis (counter-clock wise, in radians). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Angle { + get { if ((_hasBits0 & 128) != 0) { return angle_; } else { return AngleDefaultValue; } } + set { + _hasBits0 |= 128; + angle_ = value; + } + } + /// Gets whether the "angle" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAngle { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "angle" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAngle() { + _hasBits0 &= ~128; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SalientPoint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SalientPoint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormPointX, other.NormPointX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormPointY, other.NormPointY)) return false; + if (Type != other.Type) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Left, other.Left)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Bottom, other.Bottom)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Right, other.Right)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Top, other.Top)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Weight, other.Weight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormMajor, other.NormMajor)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NormMinor, other.NormMinor)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Angle, other.Angle)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNormPointX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormPointX); + if (HasNormPointY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormPointY); + if (HasType) hash ^= Type.GetHashCode(); + if (HasLeft) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Left); + if (HasBottom) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Bottom); + if (HasRight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Right); + if (HasTop) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Top); + if (HasWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight); + if (HasNormMajor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormMajor); + if (HasNormMinor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NormMinor); + if (HasAngle) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Angle); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNormPointX) { + output.WriteRawTag(13); + output.WriteFloat(NormPointX); + } + if (HasNormPointY) { + output.WriteRawTag(21); + output.WriteFloat(NormPointY); + } + if (HasLeft) { + output.WriteRawTag(29); + output.WriteFloat(Left); + } + if (HasBottom) { + output.WriteRawTag(37); + output.WriteFloat(Bottom); + } + if (HasWeight) { + output.WriteRawTag(45); + output.WriteFloat(Weight); + } + if (HasNormMajor) { + output.WriteRawTag(53); + output.WriteFloat(NormMajor); + } + if (HasNormMinor) { + output.WriteRawTag(61); + output.WriteFloat(NormMinor); + } + if (HasAngle) { + output.WriteRawTag(69); + output.WriteFloat(Angle); + } + if (HasRight) { + output.WriteRawTag(77); + output.WriteFloat(Right); + } + if (HasTop) { + output.WriteRawTag(85); + output.WriteFloat(Top); + } + if (HasType) { + output.WriteRawTag(88); + output.WriteEnum((int) Type); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNormPointX) { + output.WriteRawTag(13); + output.WriteFloat(NormPointX); + } + if (HasNormPointY) { + output.WriteRawTag(21); + output.WriteFloat(NormPointY); + } + if (HasLeft) { + output.WriteRawTag(29); + output.WriteFloat(Left); + } + if (HasBottom) { + output.WriteRawTag(37); + output.WriteFloat(Bottom); + } + if (HasWeight) { + output.WriteRawTag(45); + output.WriteFloat(Weight); + } + if (HasNormMajor) { + output.WriteRawTag(53); + output.WriteFloat(NormMajor); + } + if (HasNormMinor) { + output.WriteRawTag(61); + output.WriteFloat(NormMinor); + } + if (HasAngle) { + output.WriteRawTag(69); + output.WriteFloat(Angle); + } + if (HasRight) { + output.WriteRawTag(77); + output.WriteFloat(Right); + } + if (HasTop) { + output.WriteRawTag(85); + output.WriteFloat(Top); + } + if (HasType) { + output.WriteRawTag(88); + output.WriteEnum((int) Type); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNormPointX) { + size += 1 + 4; + } + if (HasNormPointY) { + size += 1 + 4; + } + if (HasType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (HasLeft) { + size += 1 + 4; + } + if (HasBottom) { + size += 1 + 4; + } + if (HasRight) { + size += 1 + 4; + } + if (HasTop) { + size += 1 + 4; + } + if (HasWeight) { + size += 1 + 4; + } + if (HasNormMajor) { + size += 1 + 4; + } + if (HasNormMinor) { + size += 1 + 4; + } + if (HasAngle) { + size += 1 + 4; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SalientPoint other) { + if (other == null) { + return; + } + if (other.HasNormPointX) { + NormPointX = other.NormPointX; + } + if (other.HasNormPointY) { + NormPointY = other.NormPointY; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasLeft) { + Left = other.Left; + } + if (other.HasBottom) { + Bottom = other.Bottom; + } + if (other.HasRight) { + Right = other.Right; + } + if (other.HasTop) { + Top = other.Top; + } + if (other.HasWeight) { + Weight = other.Weight; + } + if (other.HasNormMajor) { + NormMajor = other.NormMajor; + } + if (other.HasNormMinor) { + NormMinor = other.NormMinor; + } + if (other.HasAngle) { + Angle = other.Angle; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 13: { + NormPointX = input.ReadFloat(); + break; + } + case 21: { + NormPointY = input.ReadFloat(); + break; + } + case 29: { + Left = input.ReadFloat(); + break; + } + case 37: { + Bottom = input.ReadFloat(); + break; + } + case 45: { + Weight = input.ReadFloat(); + break; + } + case 53: { + NormMajor = input.ReadFloat(); + break; + } + case 61: { + NormMinor = input.ReadFloat(); + break; + } + case 69: { + Angle = input.ReadFloat(); + break; + } + case 77: { + Right = input.ReadFloat(); + break; + } + case 85: { + Top = input.ReadFloat(); + break; + } + case 88: { + Type = (global::Mediapipe.SalientPoint.Types.SalientPointType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 13: { + NormPointX = input.ReadFloat(); + break; + } + case 21: { + NormPointY = input.ReadFloat(); + break; + } + case 29: { + Left = input.ReadFloat(); + break; + } + case 37: { + Bottom = input.ReadFloat(); + break; + } + case 45: { + Weight = input.ReadFloat(); + break; + } + case 53: { + NormMajor = input.ReadFloat(); + break; + } + case 61: { + NormMinor = input.ReadFloat(); + break; + } + case 69: { + Angle = input.ReadFloat(); + break; + } + case 77: { + Right = input.ReadFloat(); + break; + } + case 85: { + Top = input.ReadFloat(); + break; + } + case 88: { + Type = (global::Mediapipe.SalientPoint.Types.SalientPointType) input.ReadEnum(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the SalientPoint message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum SalientPointType { + [pbr::OriginalName("TYPE_INCLUDE")] TypeInclude = 1, + [pbr::OriginalName("TYPE_EXCLUDE_LEFT")] TypeExcludeLeft = 2, + [pbr::OriginalName("TYPE_EXCLUDE_RIGHT")] TypeExcludeRight = 3, + } + + } + #endregion + + } + + /// + /// Aggregates SalientPoint's for a frame. + /// + public sealed partial class SalientPointFrame : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SalientPointFrame()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPointFrame() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPointFrame(SalientPointFrame other) : this() { + point_ = other.point_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SalientPointFrame Clone() { + return new SalientPointFrame(this); + } + + /// Field number for the "point" field. + public const int PointFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_point_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.SalientPoint.Parser); + private readonly pbc::RepeatedField point_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Point { + get { return point_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SalientPointFrame); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SalientPointFrame other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!point_.Equals(other.point_)) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= point_.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + point_.WriteTo(output, _repeated_point_codec); + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + point_.WriteTo(ref output, _repeated_point_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += point_.CalculateSize(_repeated_point_codec); + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SalientPointFrame other) { + if (other == null) { + return; + } + point_.Add(other.point_); + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + point_.AddEntriesFrom(input, _repeated_point_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 10: { + point_.AddEntriesFrom(ref input, _repeated_point_codec); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs.meta new file mode 100644 index 0000000..99f00fa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26dea69d01e3083179df0525b778b611 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs new file mode 100644 index 0000000..3c94c44 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs @@ -0,0 +1,7034 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/region_flow_computation.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/region_flow_computation.proto + public static partial class RegionFlowComputationReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/region_flow_computation.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RegionFlowComputationReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjVtZWRpYXBpcGUvdXRpbC90cmFja2luZy9yZWdpb25fZmxvd19jb21wdXRh", + "dGlvbi5wcm90bxIJbWVkaWFwaXBlGi1tZWRpYXBpcGUvdXRpbC90cmFja2lu", + "Zy90b25lX2VzdGltYXRpb24ucHJvdG8i0xAKD1RyYWNraW5nT3B0aW9ucxJX", + "ChtpbnRlcm5hbF90cmFja2luZ19kaXJlY3Rpb24YEyABKA4yKC5tZWRpYXBp", + "cGUuVHJhY2tpbmdPcHRpb25zLkZsb3dEaXJlY3Rpb246CEJBQ0tXQVJEElEK", + "FW91dHB1dF9mbG93X2RpcmVjdGlvbhgUIAEoDjIoLm1lZGlhcGlwZS5UcmFj", + "a2luZ09wdGlvbnMuRmxvd0RpcmVjdGlvbjoIQkFDS1dBUkQSVwoPdHJhY2tp", + "bmdfcG9saWN5GBkgASgOMikubWVkaWFwaXBlLlRyYWNraW5nT3B0aW9ucy5U", + "cmFja2luZ1BvbGljeToTUE9MSUNZX1NJTkdMRV9GUkFNRRIgChVtdWx0aV9m", + "cmFtZXNfdG9fdHJhY2sYASABKAU6ATESIwoWbG9uZ190cmFja3NfbWF4X2Zy", + "YW1lcxgaIAEoBToDMzAwEhoKDG1heF9mZWF0dXJlcxgCIAEoBToEMjAwMBJr", + "Chhjb3JuZXJfZXh0cmFjdGlvbl9tZXRob2QYGyABKA4yMS5tZWRpYXBpcGUu", + "VHJhY2tpbmdPcHRpb25zLkNvcm5lckV4dHJhY3Rpb25NZXRob2Q6FkVYVFJB", + "Q1RJT05fTUlOX0VJR19WQUwSVAoUbWluX2VpZ192YWxfc2V0dGluZ3MYHCAB", + "KAsyNi5tZWRpYXBpcGUuVHJhY2tpbmdPcHRpb25zLk1pbkVpZ1ZhbEV4dHJh", + "Y3Rpb25TZXR0aW5ncxJMCg9oYXJyaXNfc2V0dGluZ3MYHSABKAsyMy5tZWRp", + "YXBpcGUuVHJhY2tpbmdPcHRpb25zLkhhcnJpc0V4dHJhY3Rpb25TZXR0aW5n", + "cxJICg1mYXN0X3NldHRpbmdzGB8gASgLMjEubWVkaWFwaXBlLlRyYWNraW5n", + "T3B0aW9ucy5GYXN0RXh0cmFjdGlvblNldHRpbmdzEiAKFHRyYWNraW5nX3dp", + "bmRvd19zaXplGAQgASgFOgIxMBIfChN0cmFja2luZ19pdGVyYXRpb25zGAUg", + "ASgFOgIxMBIqChxmcmFjdGlvbmFsX3RyYWNraW5nX2Rpc3RhbmNlGAYgASgC", + "OgQwLjE1EikKGmFkYXB0aXZlX3RyYWNraW5nX2Rpc3RhbmNlGBggASgIOgVm", + "YWxzZRIfChRtaW5fZmVhdHVyZV9kaXN0YW5jZRgHIAEoAjoBNxIlChdkaXN0", + "YW5jZV9kb3duc2NhbGVfc3FydBgVIAEoCDoEdHJ1ZRItCh9hZGFwdGl2ZV9n", + "b29kX2ZlYXR1cmVzX3RvX3RyYWNrGAggASgIOgR0cnVlEioKHGFkYXB0aXZl", + "X2ZlYXR1cmVzX2Jsb2NrX3NpemUYCSABKAI6BDAuMjYSIwoYYWRhcHRpdmVf", + "ZmVhdHVyZXNfbGV2ZWxzGAogASgFOgExEiUKGmFkYXB0aXZlX2V4dHJhY3Rp", + "b25fbGV2ZWxzGBYgASgFOgExEjEKJmFkYXB0aXZlX2V4dHJhY3Rpb25fbGV2", + "ZWxzX2xvd2VzdF9zaXplGBcgASgFOgEwEi0KH3N5bnRoZXRpY196ZXJvX21v", + "dGlvbl9ncmlkX3N0ZXAYDSABKAI6BDAuMDQSJQoWd2lkZV9iYXNlbGluZV9t", + "YXRjaGluZxgOIAEoCDoFZmFsc2USIQoUcmF0aW9fdGVzdF90aHJlc2hvbGQY", + "DyABKAI6AzAuOBIrChxyZWZpbmVfd2lkZV9iYXNlbGluZV9tYXRjaGVzGBAg", + "ASgIOgVmYWxzZRIsCiFyZXVzZV9mZWF0dXJlc19tYXhfZnJhbWVfZGlzdGFu", + "Y2UYESABKAU6ATASLQogcmV1c2VfZmVhdHVyZXNfbWluX3N1cnZpdmVkX2Zy", + "YWMYEiABKAI6AzAuNxInChl1c2VfY3ZfdHJhY2tpbmdfYWxnb3JpdGhtGB4g", + "ASgIOgR0cnVlEmMKGmtsdF90cmFja2VyX2ltcGxlbWVudGF0aW9uGCAgASgO", + "MjMubWVkaWFwaXBlLlRyYWNraW5nT3B0aW9ucy5LbHRUcmFja2VySW1wbGVt", + "ZW50YXRpb246CktMVF9PUEVOQ1YacAobTWluRWlnVmFsRXh0cmFjdGlvblNl", + "dHRpbmdzEiMKFWZlYXR1cmVfcXVhbGl0eV9sZXZlbBgBIAEoAjoEMC4wMRIs", + "Ch1hZGFwdGl2ZV9sb3dlc3RfcXVhbGl0eV9sZXZlbBgCIAEoAjoFOGUtMDUa", + "QgoYSGFycmlzRXh0cmFjdGlvblNldHRpbmdzEiYKFWZlYXR1cmVfcXVhbGl0", + "eV9sZXZlbBgBIAEoAjoHMC4wMDAyNRovChZGYXN0RXh0cmFjdGlvblNldHRp", + "bmdzEhUKCXRocmVzaG9sZBgBIAEoBToCMTAiPQoNRmxvd0RpcmVjdGlvbhIL", + "CgdGT1JXQVJEEAESDAoIQkFDS1dBUkQQAhIRCg1DT05TRUNVVElWRUxZEAMi", + "WQoOVHJhY2tpbmdQb2xpY3kSFwoTUE9MSUNZX1NJTkdMRV9GUkFNRRABEhYK", + "ElBPTElDWV9NVUxUSV9GUkFNRRACEhYKElBPTElDWV9MT05HX1RSQUNLUxAD", + "ImAKFkNvcm5lckV4dHJhY3Rpb25NZXRob2QSFQoRRVhUUkFDVElPTl9IQVJS", + "SVMQARIaChZFWFRSQUNUSU9OX01JTl9FSUdfVkFMEAISEwoPRVhUUkFDVElP", + "Tl9GQVNUEAMiOwoYS2x0VHJhY2tlckltcGxlbWVudGF0aW9uEg8KC1VOU1BF", + "Q0lGSUVEEAASDgoKS0xUX09QRU5DVhABKgQIAxAEKgQICxAMKgQIDBANIucc", + "ChxSZWdpb25GbG93Q29tcHV0YXRpb25PcHRpb25zEjQKEHRyYWNraW5nX29w", + "dGlvbnMYASABKAsyGi5tZWRpYXBpcGUuVHJhY2tpbmdPcHRpb25zEh4KE21p", + "bl9mZWF0dXJlX2lubGllcnMYAiABKAU6ATMSKQoccmVsYXRpdmVfbWluX2Zl", + "YXR1cmVfaW5saWVycxguIAEoAjoDMC4yEhsKDnByZV9ibHVyX3NpZ21hGCEg", + "ASgCOgMwLjgSJAoYcmFuc2FjX3JvdW5kc19wZXJfcmVnaW9uGAMgASgFOgIx", + "NRIqCh9hYnNvbHV0ZV9pbmxpZXJfZXJyb3JfdGhyZXNob2xkGAQgASgCOgEy", + "EiYKG2ZyYWNfaW5saWVyX2Vycm9yX3RocmVzaG9sZBg0IAEoAjoBMBIsCh9y", + "ZWxhdGl2ZV9pbmxpZXJfZXJyb3JfdGhyZXNob2xkGCwgASgCOgMwLjESGgoP", + "dG9wX2lubGllcl9zZXRzGC0gASgFOgEyEiEKEm5vX2VzdGltYXRpb25fbW9k", + "ZRgoIAEoCDoFZmFsc2USKAoaZmFzdF9lc3RpbWF0aW9uX2Jsb2NrX3NpemUY", + "BiABKAI6BDAuMjUSKwoeZmFzdF9lc3RpbWF0aW9uX21pbl9ibG9ja19zaXpl", + "GBkgASgFOgMxMDASKAodZmFzdF9lc3RpbWF0aW9uX292ZXJsYXBfZ3JpZHMY", + "FiABKAU6ATMSKgodbWF4X21hZ25pdHVkZV90aHJlc2hvbGRfcmF0aW8YFyAB", + "KAI6AzAuMhIiChdtZWRpYW5fbWFnbml0dWRlX2JvdW5kcxgzIAEoAjoBMBJp", + "ChNpcmxzX2luaXRpYWxpemF0aW9uGDEgASgOMjoubWVkaWFwaXBlLlJlZ2lv", + "bkZsb3dDb21wdXRhdGlvbk9wdGlvbnMuSXJsc0luaXRpYWxpemF0aW9uOhBJ", + "TklUX0NPTlNJU1RFTkNZEmAKD2Rvd25zYW1wbGVfbW9kZRgLIAEoDjI2Lm1l", + "ZGlhcGlwZS5SZWdpb25GbG93Q29tcHV0YXRpb25PcHRpb25zLkRvd25zYW1w", + "bGVNb2RlOg9ET1dOU0FNUExFX05PTkUSHgoRZG93bnNhbXBsaW5nX3NpemUY", + "DCABKAU6AzI1NhIcChFkb3duc2FtcGxlX2ZhY3RvchgSIAEoAjoBMhImChdy", + "b3VuZF9kb3duc2FtcGxlX2ZhY3Rvchg+IAEoCDoFZmFsc2USVwoTZG93bnNh", + "bXBsZV9zY2hlZHVsZRgTIAEoCzI6Lm1lZGlhcGlwZS5SZWdpb25GbG93Q29t", + "cHV0YXRpb25PcHRpb25zLkRvd25TYW1wbGVTY2hlZHVsZRIjChdtaW5fZmVh", + "dHVyZV9yZXF1aXJlbWVudBgNIAEoBToCMjASHwoRbWluX2ZlYXR1cmVfY292", + "ZXIYDiABKAI6BDAuMTUSIQoWbWluX2ZlYXR1cmVfY292ZXJfZ3JpZBgUIAEo", + "BToBOBIhChJjb21wdXRlX2JsdXJfc2NvcmUYESABKAg6BWZhbHNlElQKEmJs", + "dXJfc2NvcmVfb3B0aW9ucxgfIAEoCzI4Lm1lZGlhcGlwZS5SZWdpb25GbG93", + "Q29tcHV0YXRpb25PcHRpb25zLkJsdXJTY29yZU9wdGlvbnMSZAoadmlzdWFs", + "X2NvbnNpc3RlbmN5X29wdGlvbnMYNyABKAsyQC5tZWRpYXBpcGUuUmVnaW9u", + "Rmxvd0NvbXB1dGF0aW9uT3B0aW9ucy5WaXN1YWxDb25zaXN0ZW5jeU9wdGlv", + "bnMSIgoXcGF0Y2hfZGVzY3JpcHRvcl9yYWRpdXMYFSABKAU6ATMSHwoUZGlz", + "dGFuY2VfZnJvbV9ib3JkZXIYMiABKAU6ATMSIwoVY29ybmVyX3Jlc3BvbnNl", + "X3NjYWxlGBogASgCOgQxNTAwEh4KD3ZlcmlmeV9mZWF0dXJlcxgbIAEoCDoF", + "ZmFsc2USIgoVdmVyaWZpY2F0aW9uX2Rpc3RhbmNlGBwgASgCOgMwLjUSIgoU", + "dmVyaWZ5X2xvbmdfZmVhdHVyZXMYNSABKAg6BHRydWUSMQojbG9uZ19mZWF0", + "dXJlX3ZlcmlmaWNhdGlvbl90aHJlc2hvbGQYNiABKAI6BDAuMDQSKAodbWF4", + "X2xvbmdfZmVhdHVyZV9hY2NlbGVyYXRpb24YOCABKAI6ATUSLwogdmVyaWZ5", + "X2xvbmdfZmVhdHVyZV9hY2NlbGVyYXRpb24YPyABKAg6BWZhbHNlEiwKIXZl", + "cmlmeV9sb25nX2ZlYXR1cmVfdHJpZ2dlcl9yYXRpbxhAIAEoAjoBMBIlChZo", + "aXN0b2dyYW1fZXF1YWxpemF0aW9uGDkgASgIOgVmYWxzZRI6Cit1c2Vfc3lu", + "dGhldGljX3plcm9fbW90aW9uX3RyYWNrc19hbGxfZnJhbWVzGCIgASgIOgVm", + "YWxzZRI7Cix1c2Vfc3ludGhldGljX3plcm9fbW90aW9uX3RyYWNrc19maXJz", + "dF9mcmFtZRgjIAEoCDoFZmFsc2USHgoPZ2Fpbl9jb3JyZWN0aW9uGCQgASgI", + "OgVmYWxzZRIjChRmYXN0X2dhaW5fY29ycmVjdGlvbhg9IAEoCDoFZmFsc2US", + "MQojZ2Fpbl9jb3JyZWN0aW9uX211bHRpcGxlX2h5cG90aGVzZXMYLyABKAg6", + "BHRydWUSNAonZ2Fpbl9jb3JyZWN0aW9uX2lubGllcl9pbXByb3ZlbWVudF9m", + "cmFjGDAgASgCOgMwLjESLwogZ2Fpbl9jb3JyZWN0aW9uX2JyaWdodF9yZWZl", + "cmVuY2UYOyABKAg6BWZhbHNlEisKIGdhaW5fY29ycmVjdGlvbl90cmlnZ2Vy", + "aW5nX3JhdGlvGDwgASgCOgEwEiMKFmZyYWNfZ2Fpbl9mZWF0dXJlX3NpemUY", + "JSABKAI6AzAuMxIbCg5mcmFjX2dhaW5fc3RlcBgmIAEoAjoDMC4xEm0KEWdh", + "aW5fY29ycmVjdF9tb2RlGCkgASgOMjcubWVkaWFwaXBlLlJlZ2lvbkZsb3dD", + "b21wdXRhdGlvbk9wdGlvbnMuR2FpbkNvcnJlY3RNb2RlOhlHQUlOX0NPUlJF", + "Q1RfREVGQVVMVF9VU0VSEkkKEGdhaW5fYmlhc19ib3VuZHMYJyABKAsyLy5t", + "ZWRpYXBpcGUuVG9uZUVzdGltYXRpb25PcHRpb25zLkdhaW5CaWFzQm91bmRz", + "ElUKDGltYWdlX2Zvcm1hdBg6IAEoDjIzLm1lZGlhcGlwZS5SZWdpb25GbG93", + "Q29tcHV0YXRpb25PcHRpb25zLkltYWdlRm9ybWF0OgpGT1JNQVRfUkdCEmcK", + "GWRlc2NyaXB0b3JfZXh0cmFjdG9yX3R5cGUYQSABKA4yPy5tZWRpYXBpcGUu", + "UmVnaW9uRmxvd0NvbXB1dGF0aW9uT3B0aW9ucy5EZXNjcmlwdG9yRXh0cmFj", + "dG9yVHlwZToDT1JCEisKHWNvbXB1dGVfZGVyaXZhdGl2ZV9pbl9weXJhbWlk", + "GEIgASgIOgR0cnVlGqEBChJEb3duU2FtcGxlU2NoZWR1bGUSIQoWZG93bnNh", + "bXBsZV9mYWN0b3JfMzYwcBgBIAEoAjoBMRIhChZkb3duc2FtcGxlX2ZhY3Rv", + "cl80ODBwGAIgASgCOgExEiEKFmRvd25zYW1wbGVfZmFjdG9yXzcyMHAYAyAB", + "KAI6ATISIgoXZG93bnNhbXBsZV9mYWN0b3JfMTA4MHAYBCABKAI6ATIaqwEK", + "EEJsdXJTY29yZU9wdGlvbnMSGgoPYm94X2ZpbHRlcl9kaWFtGAEgASgFOgEz", + "EisKHXJlbGF0aXZlX2Nvcm5lcm5lc3NfdGhyZXNob2xkGAIgASgCOgQwLjAz", + "Ei0KHWFic29sdXRlX2Nvcm5lcm5lc3NfdGhyZXNob2xkGAMgASgCOgYwLjAw", + "MDESHwoRbWVkaWFuX3BlcmNlbnRpbGUYBSABKAI6BDAuODUaXwoYVmlzdWFs", + "Q29uc2lzdGVuY3lPcHRpb25zEiEKE2NvbXB1dGVfY29uc2lzdGVuY3kYASAB", + "KAg6BHRydWUSIAoUdGlueV9pbWFnZV9kaW1lbnNpb24YAiABKAU6AjIwIjwK", + "EklybHNJbml0aWFsaXphdGlvbhIQCgxJTklUX1VOSUZPUk0QARIUChBJTklU", + "X0NPTlNJU1RFTkNZEAIisQEKDkRvd25zYW1wbGVNb2RlEhMKD0RPV05TQU1Q", + "TEVfTk9ORRABEhoKFkRPV05TQU1QTEVfVE9fTUFYX1NJWkUQAhIYChRET1dO", + "U0FNUExFX0JZX0ZBQ1RPUhADEhoKFkRPV05TQU1QTEVfQllfU0NIRURVTEUQ", + "BBIaChZET1dOU0FNUExFX1RPX01JTl9TSVpFEAUSHAoYRE9XTlNBTVBMRV9U", + "T19JTlBVVF9TSVpFEAYifAoPR2FpbkNvcnJlY3RNb2RlEh0KGUdBSU5fQ09S", + "UkVDVF9ERUZBVUxUX1VTRVIQARIWChJHQUlOX0NPUlJFQ1RfVklERU8QAhIU", + "ChBHQUlOX0NPUlJFQ1RfSERSEAMSHAoYR0FJTl9DT1JSRUNUX1BIT1RPX0JV", + "UlNUEAQiZQoLSW1hZ2VGb3JtYXQSFAoQRk9STUFUX0dSQVlTQ0FMRRABEg4K", + "CkZPUk1BVF9SR0IQAhIPCgtGT1JNQVRfUkdCQRADEg4KCkZPUk1BVF9CR1IQ", + "BBIPCgtGT1JNQVRfQkdSQRAFIiIKF0Rlc2NyaXB0b3JFeHRyYWN0b3JUeXBl", + "EgcKA09SQhAAKgQIBRAGKgQIBxAIKgQICBAJKgQICRAKKgQIChALKgQIDxAQ", + "KgQIEBARKgQIGBAZKgQIHRAeKgQIHhAfKgQIIBAhKgQIKhArKgQIKxAs")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.ToneEstimationReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingOptions), global::Mediapipe.TrackingOptions.Parser, new[]{ "InternalTrackingDirection", "OutputFlowDirection", "TrackingPolicy", "MultiFramesToTrack", "LongTracksMaxFrames", "MaxFeatures", "CornerExtractionMethod", "MinEigValSettings", "HarrisSettings", "FastSettings", "TrackingWindowSize", "TrackingIterations", "FractionalTrackingDistance", "AdaptiveTrackingDistance", "MinFeatureDistance", "DistanceDownscaleSqrt", "AdaptiveGoodFeaturesToTrack", "AdaptiveFeaturesBlockSize", "AdaptiveFeaturesLevels", "AdaptiveExtractionLevels", "AdaptiveExtractionLevelsLowestSize", "SyntheticZeroMotionGridStep", "WideBaselineMatching", "RatioTestThreshold", "RefineWideBaselineMatches", "ReuseFeaturesMaxFrameDistance", "ReuseFeaturesMinSurvivedFrac", "UseCvTrackingAlgorithm", "KltTrackerImplementation" }, null, new[]{ typeof(global::Mediapipe.TrackingOptions.Types.FlowDirection), typeof(global::Mediapipe.TrackingOptions.Types.TrackingPolicy), typeof(global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod), typeof(global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings), global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings.Parser, new[]{ "FeatureQualityLevel", "AdaptiveLowestQualityLevel" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings), global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings.Parser, new[]{ "FeatureQualityLevel" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackingOptions.Types.FastExtractionSettings), global::Mediapipe.TrackingOptions.Types.FastExtractionSettings.Parser, new[]{ "Threshold" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowComputationOptions), global::Mediapipe.RegionFlowComputationOptions.Parser, new[]{ "TrackingOptions", "MinFeatureInliers", "RelativeMinFeatureInliers", "PreBlurSigma", "RansacRoundsPerRegion", "AbsoluteInlierErrorThreshold", "FracInlierErrorThreshold", "RelativeInlierErrorThreshold", "TopInlierSets", "NoEstimationMode", "FastEstimationBlockSize", "FastEstimationMinBlockSize", "FastEstimationOverlapGrids", "MaxMagnitudeThresholdRatio", "MedianMagnitudeBounds", "IrlsInitialization", "DownsampleMode", "DownsamplingSize", "DownsampleFactor", "RoundDownsampleFactor", "DownsampleSchedule", "MinFeatureRequirement", "MinFeatureCover", "MinFeatureCoverGrid", "ComputeBlurScore", "BlurScoreOptions", "VisualConsistencyOptions", "PatchDescriptorRadius", "DistanceFromBorder", "CornerResponseScale", "VerifyFeatures", "VerificationDistance", "VerifyLongFeatures", "LongFeatureVerificationThreshold", "MaxLongFeatureAcceleration", "VerifyLongFeatureAcceleration", "VerifyLongFeatureTriggerRatio", "HistogramEqualization", "UseSyntheticZeroMotionTracksAllFrames", "UseSyntheticZeroMotionTracksFirstFrame", "GainCorrection", "FastGainCorrection", "GainCorrectionMultipleHypotheses", "GainCorrectionInlierImprovementFrac", "GainCorrectionBrightReference", "GainCorrectionTriggeringRatio", "FracGainFeatureSize", "FracGainStep", "GainCorrectMode", "GainBiasBounds", "ImageFormat", "DescriptorExtractorType", "ComputeDerivativeInPyramid" }, null, new[]{ typeof(global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization), typeof(global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode), typeof(global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode), typeof(global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat), typeof(global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule), global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule.Parser, new[]{ "DownsampleFactor360P", "DownsampleFactor480P", "DownsampleFactor720P", "DownsampleFactor1080P" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions), global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions.Parser, new[]{ "BoxFilterDiam", "RelativeCornernessThreshold", "AbsoluteCornernessThreshold", "MedianPercentile" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions), global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions.Parser, new[]{ "ComputeConsistency", "TinyImageDimension" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Next tag: 33 + /// + public sealed partial class TrackingOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackingOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowComputationReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingOptions(TrackingOptions other) : this() { + _hasBits0 = other._hasBits0; + internalTrackingDirection_ = other.internalTrackingDirection_; + outputFlowDirection_ = other.outputFlowDirection_; + trackingPolicy_ = other.trackingPolicy_; + multiFramesToTrack_ = other.multiFramesToTrack_; + longTracksMaxFrames_ = other.longTracksMaxFrames_; + maxFeatures_ = other.maxFeatures_; + cornerExtractionMethod_ = other.cornerExtractionMethod_; + minEigValSettings_ = other.minEigValSettings_ != null ? other.minEigValSettings_.Clone() : null; + harrisSettings_ = other.harrisSettings_ != null ? other.harrisSettings_.Clone() : null; + fastSettings_ = other.fastSettings_ != null ? other.fastSettings_.Clone() : null; + trackingWindowSize_ = other.trackingWindowSize_; + trackingIterations_ = other.trackingIterations_; + fractionalTrackingDistance_ = other.fractionalTrackingDistance_; + adaptiveTrackingDistance_ = other.adaptiveTrackingDistance_; + minFeatureDistance_ = other.minFeatureDistance_; + distanceDownscaleSqrt_ = other.distanceDownscaleSqrt_; + adaptiveGoodFeaturesToTrack_ = other.adaptiveGoodFeaturesToTrack_; + adaptiveFeaturesBlockSize_ = other.adaptiveFeaturesBlockSize_; + adaptiveFeaturesLevels_ = other.adaptiveFeaturesLevels_; + adaptiveExtractionLevels_ = other.adaptiveExtractionLevels_; + adaptiveExtractionLevelsLowestSize_ = other.adaptiveExtractionLevelsLowestSize_; + syntheticZeroMotionGridStep_ = other.syntheticZeroMotionGridStep_; + wideBaselineMatching_ = other.wideBaselineMatching_; + ratioTestThreshold_ = other.ratioTestThreshold_; + refineWideBaselineMatches_ = other.refineWideBaselineMatches_; + reuseFeaturesMaxFrameDistance_ = other.reuseFeaturesMaxFrameDistance_; + reuseFeaturesMinSurvivedFrac_ = other.reuseFeaturesMinSurvivedFrac_; + useCvTrackingAlgorithm_ = other.useCvTrackingAlgorithm_; + kltTrackerImplementation_ = other.kltTrackerImplementation_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackingOptions Clone() { + return new TrackingOptions(this); + } + + /// Field number for the "internal_tracking_direction" field. + public const int InternalTrackingDirectionFieldNumber = 19; + private readonly static global::Mediapipe.TrackingOptions.Types.FlowDirection InternalTrackingDirectionDefaultValue = global::Mediapipe.TrackingOptions.Types.FlowDirection.Backward; + + private global::Mediapipe.TrackingOptions.Types.FlowDirection internalTrackingDirection_; + /// + /// Flow direction used internally during tracking features. Forward tracking + /// allows reusing tracked features instead of explicitly tracking them in + /// every frame, and can therefore be faster. See the reuse_features_XXX + /// options below. However, if not reusing features, then it is best to match + /// the direction for both internal tracking and output flow, for peformance + /// reasons. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.FlowDirection InternalTrackingDirection { + get { if ((_hasBits0 & 32768) != 0) { return internalTrackingDirection_; } else { return InternalTrackingDirectionDefaultValue; } } + set { + _hasBits0 |= 32768; + internalTrackingDirection_ = value; + } + } + /// Gets whether the "internal_tracking_direction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInternalTrackingDirection { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "internal_tracking_direction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInternalTrackingDirection() { + _hasBits0 &= ~32768; + } + + /// Field number for the "output_flow_direction" field. + public const int OutputFlowDirectionFieldNumber = 20; + private readonly static global::Mediapipe.TrackingOptions.Types.FlowDirection OutputFlowDirectionDefaultValue = global::Mediapipe.TrackingOptions.Types.FlowDirection.Backward; + + private global::Mediapipe.TrackingOptions.Types.FlowDirection outputFlowDirection_; + /// + /// Direction of flow vectors that are computed and output by calls to retrieve + /// region flow, tracked features, etc. Note when this is BACKWARD, then the + /// returned flow for frame N contains features tracked *from* frame N to a + /// previous frame N-k. When this is FORWARD, the flow for frame N contains + /// the flow from features in a previous frame N-k, tracked *to* frame N. + /// Note that the output flow direction can only be set to FORWARD or BACKWARD. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.FlowDirection OutputFlowDirection { + get { if ((_hasBits0 & 65536) != 0) { return outputFlowDirection_; } else { return OutputFlowDirectionDefaultValue; } } + set { + _hasBits0 |= 65536; + outputFlowDirection_ = value; + } + } + /// Gets whether the "output_flow_direction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutputFlowDirection { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "output_flow_direction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutputFlowDirection() { + _hasBits0 &= ~65536; + } + + /// Field number for the "tracking_policy" field. + public const int TrackingPolicyFieldNumber = 25; + private readonly static global::Mediapipe.TrackingOptions.Types.TrackingPolicy TrackingPolicyDefaultValue = global::Mediapipe.TrackingOptions.Types.TrackingPolicy.PolicySingleFrame; + + private global::Mediapipe.TrackingOptions.Types.TrackingPolicy trackingPolicy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.TrackingPolicy TrackingPolicy { + get { if ((_hasBits0 & 2097152) != 0) { return trackingPolicy_; } else { return TrackingPolicyDefaultValue; } } + set { + _hasBits0 |= 2097152; + trackingPolicy_ = value; + } + } + /// Gets whether the "tracking_policy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingPolicy { + get { return (_hasBits0 & 2097152) != 0; } + } + /// Clears the value of the "tracking_policy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingPolicy() { + _hasBits0 &= ~2097152; + } + + /// Field number for the "multi_frames_to_track" field. + public const int MultiFramesToTrackFieldNumber = 1; + private readonly static int MultiFramesToTrackDefaultValue = 1; + + private int multiFramesToTrack_; + /// + /// Number of frame-pairs used for POLICY_MULTI_FRAME, ignored for other + /// policies. + /// Value of 1 means we are tracking features in the current frame, w.r.t. + /// the previous one. Value of 2 denotes tracking of features in current + /// w.r.t the previous one and the one before the previous one, etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MultiFramesToTrack { + get { if ((_hasBits0 & 1) != 0) { return multiFramesToTrack_; } else { return MultiFramesToTrackDefaultValue; } } + set { + _hasBits0 |= 1; + multiFramesToTrack_ = value; + } + } + /// Gets whether the "multi_frames_to_track" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMultiFramesToTrack { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "multi_frames_to_track" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMultiFramesToTrack() { + _hasBits0 &= ~1; + } + + /// Field number for the "long_tracks_max_frames" field. + public const int LongTracksMaxFramesFieldNumber = 26; + private readonly static int LongTracksMaxFramesDefaultValue = 300; + + private int longTracksMaxFrames_; + /// + /// Maximum length of long feature tracks for POLICY_LONG_TRACKS in frames. + /// Note: This maximum is not hard enforced, to avoid that many long + /// tracks are dropped at the same time. Instead if a feature reaches + /// long_tracks_max_frames * 0.8, it will get dropped with a probability of X, + /// where X is calculated, such that 95% of all qualifying features are + /// dropped within the interval [.8, 1.2] * long_tracks_max_frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LongTracksMaxFrames { + get { if ((_hasBits0 & 4194304) != 0) { return longTracksMaxFrames_; } else { return LongTracksMaxFramesDefaultValue; } } + set { + _hasBits0 |= 4194304; + longTracksMaxFrames_ = value; + } + } + /// Gets whether the "long_tracks_max_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLongTracksMaxFrames { + get { return (_hasBits0 & 4194304) != 0; } + } + /// Clears the value of the "long_tracks_max_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLongTracksMaxFrames() { + _hasBits0 &= ~4194304; + } + + /// Field number for the "max_features" field. + public const int MaxFeaturesFieldNumber = 2; + private readonly static int MaxFeaturesDefaultValue = 2000; + + private int maxFeatures_; + /// + /// Hard limit of maximum number of features. Control density of features, with + /// min_feature_distance option. This limit is to guarantee that the + /// run-time of RegionFlowComputation does not spiral out of control. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxFeatures { + get { if ((_hasBits0 & 2) != 0) { return maxFeatures_; } else { return MaxFeaturesDefaultValue; } } + set { + _hasBits0 |= 2; + maxFeatures_ = value; + } + } + /// Gets whether the "max_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxFeatures { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxFeatures() { + _hasBits0 &= ~2; + } + + /// Field number for the "corner_extraction_method" field. + public const int CornerExtractionMethodFieldNumber = 27; + private readonly static global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod CornerExtractionMethodDefaultValue = global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod.ExtractionMinEigVal; + + private global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod cornerExtractionMethod_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod CornerExtractionMethod { + get { if ((_hasBits0 & 8388608) != 0) { return cornerExtractionMethod_; } else { return CornerExtractionMethodDefaultValue; } } + set { + _hasBits0 |= 8388608; + cornerExtractionMethod_ = value; + } + } + /// Gets whether the "corner_extraction_method" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCornerExtractionMethod { + get { return (_hasBits0 & 8388608) != 0; } + } + /// Clears the value of the "corner_extraction_method" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCornerExtractionMethod() { + _hasBits0 &= ~8388608; + } + + /// Field number for the "min_eig_val_settings" field. + public const int MinEigValSettingsFieldNumber = 28; + private global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings minEigValSettings_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings MinEigValSettings { + get { return minEigValSettings_; } + set { + minEigValSettings_ = value; + } + } + + /// Field number for the "harris_settings" field. + public const int HarrisSettingsFieldNumber = 29; + private global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings harrisSettings_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings HarrisSettings { + get { return harrisSettings_; } + set { + harrisSettings_ = value; + } + } + + /// Field number for the "fast_settings" field. + public const int FastSettingsFieldNumber = 31; + private global::Mediapipe.TrackingOptions.Types.FastExtractionSettings fastSettings_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.FastExtractionSettings FastSettings { + get { return fastSettings_; } + set { + fastSettings_ = value; + } + } + + /// Field number for the "tracking_window_size" field. + public const int TrackingWindowSizeFieldNumber = 4; + private readonly static int TrackingWindowSizeDefaultValue = 10; + + private int trackingWindowSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TrackingWindowSize { + get { if ((_hasBits0 & 4) != 0) { return trackingWindowSize_; } else { return TrackingWindowSizeDefaultValue; } } + set { + _hasBits0 |= 4; + trackingWindowSize_ = value; + } + } + /// Gets whether the "tracking_window_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingWindowSize { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "tracking_window_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingWindowSize() { + _hasBits0 &= ~4; + } + + /// Field number for the "tracking_iterations" field. + public const int TrackingIterationsFieldNumber = 5; + private readonly static int TrackingIterationsDefaultValue = 10; + + private int trackingIterations_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TrackingIterations { + get { if ((_hasBits0 & 8) != 0) { return trackingIterations_; } else { return TrackingIterationsDefaultValue; } } + set { + _hasBits0 |= 8; + trackingIterations_ = value; + } + } + /// Gets whether the "tracking_iterations" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingIterations { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "tracking_iterations" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingIterations() { + _hasBits0 &= ~8; + } + + /// Field number for the "fractional_tracking_distance" field. + public const int FractionalTrackingDistanceFieldNumber = 6; + private readonly static float FractionalTrackingDistanceDefaultValue = 0.15F; + + private float fractionalTrackingDistance_; + /// + /// Fractional tracking distance w.r.t. to frame diameter d. The number of + /// pyramid levels l is chosen such that + /// 2^l * tracking_window_size / 2 >= fractional_tracking_distance * d. + /// Therefore, theoretically it is guaranteed that objects moving less than + /// fractional_tracking_distance * d can be tracked. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FractionalTrackingDistance { + get { if ((_hasBits0 & 16) != 0) { return fractionalTrackingDistance_; } else { return FractionalTrackingDistanceDefaultValue; } } + set { + _hasBits0 |= 16; + fractionalTrackingDistance_ = value; + } + } + /// Gets whether the "fractional_tracking_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFractionalTrackingDistance { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "fractional_tracking_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFractionalTrackingDistance() { + _hasBits0 &= ~16; + } + + /// Field number for the "adaptive_tracking_distance" field. + public const int AdaptiveTrackingDistanceFieldNumber = 24; + private readonly static bool AdaptiveTrackingDistanceDefaultValue = false; + + private bool adaptiveTrackingDistance_; + /// + /// If set, modifies tracking distance to be 130% of maximum average + /// tracking distances of previous frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AdaptiveTrackingDistance { + get { if ((_hasBits0 & 1048576) != 0) { return adaptiveTrackingDistance_; } else { return AdaptiveTrackingDistanceDefaultValue; } } + set { + _hasBits0 |= 1048576; + adaptiveTrackingDistance_ = value; + } + } + /// Gets whether the "adaptive_tracking_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveTrackingDistance { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "adaptive_tracking_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveTrackingDistance() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "min_feature_distance" field. + public const int MinFeatureDistanceFieldNumber = 7; + private readonly static float MinFeatureDistanceDefaultValue = 7F; + + private float minFeatureDistance_; + /// + /// Minimum feature distance in pixels. Close features are suppressed. If value + /// < 1, the distance is computed as a fraction of the frame diameter. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinFeatureDistance { + get { if ((_hasBits0 & 32) != 0) { return minFeatureDistance_; } else { return MinFeatureDistanceDefaultValue; } } + set { + _hasBits0 |= 32; + minFeatureDistance_ = value; + } + } + /// Gets whether the "min_feature_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatureDistance { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "min_feature_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatureDistance() { + _hasBits0 &= ~32; + } + + /// Field number for the "distance_downscale_sqrt" field. + public const int DistanceDownscaleSqrtFieldNumber = 21; + private readonly static bool DistanceDownscaleSqrtDefaultValue = true; + + private bool distanceDownscaleSqrt_; + /// + /// By default, when downscaling by factor x, the minimum feature distance + /// is downscaled by a factor of sqrt(x). If set false, no scaling is + /// performed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool DistanceDownscaleSqrt { + get { if ((_hasBits0 & 131072) != 0) { return distanceDownscaleSqrt_; } else { return DistanceDownscaleSqrtDefaultValue; } } + set { + _hasBits0 |= 131072; + distanceDownscaleSqrt_ = value; + } + } + /// Gets whether the "distance_downscale_sqrt" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDistanceDownscaleSqrt { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "distance_downscale_sqrt" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDistanceDownscaleSqrt() { + _hasBits0 &= ~131072; + } + + /// Field number for the "adaptive_good_features_to_track" field. + public const int AdaptiveGoodFeaturesToTrackFieldNumber = 8; + private readonly static bool AdaptiveGoodFeaturesToTrackDefaultValue = true; + + private bool adaptiveGoodFeaturesToTrack_; + /// + /// Uses grid based extraction of features. Quality level is local within a + /// grid cell and results are combined over all cells and multiple scales and + /// grid offsets. + /// Default option, setting it to false is deprecated and will fail. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AdaptiveGoodFeaturesToTrack { + get { if ((_hasBits0 & 64) != 0) { return adaptiveGoodFeaturesToTrack_; } else { return AdaptiveGoodFeaturesToTrackDefaultValue; } } + set { + _hasBits0 |= 64; + adaptiveGoodFeaturesToTrack_ = value; + } + } + /// Gets whether the "adaptive_good_features_to_track" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveGoodFeaturesToTrack { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "adaptive_good_features_to_track" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveGoodFeaturesToTrack() { + _hasBits0 &= ~64; + } + + /// Field number for the "adaptive_features_block_size" field. + public const int AdaptiveFeaturesBlockSizeFieldNumber = 9; + private readonly static float AdaptiveFeaturesBlockSizeDefaultValue = 0.26F; + + private float adaptiveFeaturesBlockSize_; + /// + /// Size of each grid cell. Values < 1 are interpreted to be relative to + /// frame_width_ x frame_height_. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AdaptiveFeaturesBlockSize { + get { if ((_hasBits0 & 128) != 0) { return adaptiveFeaturesBlockSize_; } else { return AdaptiveFeaturesBlockSizeDefaultValue; } } + set { + _hasBits0 |= 128; + adaptiveFeaturesBlockSize_ = value; + } + } + /// Gets whether the "adaptive_features_block_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveFeaturesBlockSize { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "adaptive_features_block_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveFeaturesBlockSize() { + _hasBits0 &= ~128; + } + + /// Field number for the "adaptive_features_levels" field. + public const int AdaptiveFeaturesLevelsFieldNumber = 10; + private readonly static int AdaptiveFeaturesLevelsDefaultValue = 1; + + private int adaptiveFeaturesLevels_; + /// + /// Scales / levels employed for feature extraction. Grid cell size is scaled + /// by 0.5 for each level. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AdaptiveFeaturesLevels { + get { if ((_hasBits0 & 256) != 0) { return adaptiveFeaturesLevels_; } else { return AdaptiveFeaturesLevelsDefaultValue; } } + set { + _hasBits0 |= 256; + adaptiveFeaturesLevels_ = value; + } + } + /// Gets whether the "adaptive_features_levels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveFeaturesLevels { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "adaptive_features_levels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveFeaturesLevels() { + _hasBits0 &= ~256; + } + + /// Field number for the "adaptive_extraction_levels" field. + public const int AdaptiveExtractionLevelsFieldNumber = 22; + private readonly static int AdaptiveExtractionLevelsDefaultValue = 1; + + private int adaptiveExtractionLevels_; + /// + /// If > 1, feature extraction is carried out at multiple scales by downscaling + /// the image repeatedly, extracting features (eigenvalue images) and upscaling + /// them. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AdaptiveExtractionLevels { + get { if ((_hasBits0 & 262144) != 0) { return adaptiveExtractionLevels_; } else { return AdaptiveExtractionLevelsDefaultValue; } } + set { + _hasBits0 |= 262144; + adaptiveExtractionLevels_ = value; + } + } + /// Gets whether the "adaptive_extraction_levels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveExtractionLevels { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "adaptive_extraction_levels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveExtractionLevels() { + _hasBits0 &= ~262144; + } + + /// Field number for the "adaptive_extraction_levels_lowest_size" field. + public const int AdaptiveExtractionLevelsLowestSizeFieldNumber = 23; + private readonly static int AdaptiveExtractionLevelsLowestSizeDefaultValue = 0; + + private int adaptiveExtractionLevelsLowestSize_; + /// + /// Alternate way of specifying extraction levels: number of levels is + /// automatically computed by downsampling the image until its maximum + /// dimension (width or height) reaches this value. Overrides + /// adaptive_extraction_levels if > 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int AdaptiveExtractionLevelsLowestSize { + get { if ((_hasBits0 & 524288) != 0) { return adaptiveExtractionLevelsLowestSize_; } else { return AdaptiveExtractionLevelsLowestSizeDefaultValue; } } + set { + _hasBits0 |= 524288; + adaptiveExtractionLevelsLowestSize_ = value; + } + } + /// Gets whether the "adaptive_extraction_levels_lowest_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveExtractionLevelsLowestSize { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "adaptive_extraction_levels_lowest_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveExtractionLevelsLowestSize() { + _hasBits0 &= ~524288; + } + + /// Field number for the "synthetic_zero_motion_grid_step" field. + public const int SyntheticZeroMotionGridStepFieldNumber = 13; + private readonly static float SyntheticZeroMotionGridStepDefaultValue = 0.04F; + + private float syntheticZeroMotionGridStep_; + /// + /// Grid step-size in fraction of width or height used for creating synthetic + /// zero motion tracks with feature points lying on a grid. Can be set based on + /// desired number of total features as 1/sqrt(num_features), + /// e.g. .04 ~= 1/sqrt(600). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SyntheticZeroMotionGridStep { + get { if ((_hasBits0 & 512) != 0) { return syntheticZeroMotionGridStep_; } else { return SyntheticZeroMotionGridStepDefaultValue; } } + set { + _hasBits0 |= 512; + syntheticZeroMotionGridStep_ = value; + } + } + /// Gets whether the "synthetic_zero_motion_grid_step" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSyntheticZeroMotionGridStep { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "synthetic_zero_motion_grid_step" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSyntheticZeroMotionGridStep() { + _hasBits0 &= ~512; + } + + /// Field number for the "wide_baseline_matching" field. + public const int WideBaselineMatchingFieldNumber = 14; + private readonly static bool WideBaselineMatchingDefaultValue = false; + + private bool wideBaselineMatching_; + /// + /// If set, uses ORB features with brute force matching and ratio test + /// to track frames across larger perspective changes than possible with + /// default KLT features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool WideBaselineMatching { + get { if ((_hasBits0 & 1024) != 0) { return wideBaselineMatching_; } else { return WideBaselineMatchingDefaultValue; } } + set { + _hasBits0 |= 1024; + wideBaselineMatching_ = value; + } + } + /// Gets whether the "wide_baseline_matching" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWideBaselineMatching { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "wide_baseline_matching" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWideBaselineMatching() { + _hasBits0 &= ~1024; + } + + /// Field number for the "ratio_test_threshold" field. + public const int RatioTestThresholdFieldNumber = 15; + private readonly static float RatioTestThresholdDefaultValue = 0.8F; + + private float ratioTestThreshold_; + /// + /// Only brute force matches with + /// best_match_distance < ratio_test_threshold * second_best_match_distance + /// are retained. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RatioTestThreshold { + get { if ((_hasBits0 & 2048) != 0) { return ratioTestThreshold_; } else { return RatioTestThresholdDefaultValue; } } + set { + _hasBits0 |= 2048; + ratioTestThreshold_ = value; + } + } + /// Gets whether the "ratio_test_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRatioTestThreshold { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "ratio_test_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRatioTestThreshold() { + _hasBits0 &= ~2048; + } + + /// Field number for the "refine_wide_baseline_matches" field. + public const int RefineWideBaselineMatchesFieldNumber = 16; + private readonly static bool RefineWideBaselineMatchesDefaultValue = false; + + private bool refineWideBaselineMatches_; + /// + /// Refines wide baseline matches by estimating affine transform to + /// wide-baseline matches which is used to seed initial positions for KLT + /// matches. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RefineWideBaselineMatches { + get { if ((_hasBits0 & 4096) != 0) { return refineWideBaselineMatches_; } else { return RefineWideBaselineMatchesDefaultValue; } } + set { + _hasBits0 |= 4096; + refineWideBaselineMatches_ = value; + } + } + /// Gets whether the "refine_wide_baseline_matches" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRefineWideBaselineMatches { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "refine_wide_baseline_matches" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRefineWideBaselineMatches() { + _hasBits0 &= ~4096; + } + + /// Field number for the "reuse_features_max_frame_distance" field. + public const int ReuseFeaturesMaxFrameDistanceFieldNumber = 17; + private readonly static int ReuseFeaturesMaxFrameDistanceDefaultValue = 0; + + private int reuseFeaturesMaxFrameDistance_; + /// + /// When tracking features, features tracked from frame A to frame B may be + /// reused as the features for frame B when tracking from it (instead of + /// extracting features). The max_frame_distance flag limits the distance + /// between A and B for the features to be reused. Setting it to 0 => no + /// re-use. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ReuseFeaturesMaxFrameDistance { + get { if ((_hasBits0 & 8192) != 0) { return reuseFeaturesMaxFrameDistance_; } else { return ReuseFeaturesMaxFrameDistanceDefaultValue; } } + set { + _hasBits0 |= 8192; + reuseFeaturesMaxFrameDistance_ = value; + } + } + /// Gets whether the "reuse_features_max_frame_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReuseFeaturesMaxFrameDistance { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "reuse_features_max_frame_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReuseFeaturesMaxFrameDistance() { + _hasBits0 &= ~8192; + } + + /// Field number for the "reuse_features_min_survived_frac" field. + public const int ReuseFeaturesMinSurvivedFracFieldNumber = 18; + private readonly static float ReuseFeaturesMinSurvivedFracDefaultValue = 0.7F; + + private float reuseFeaturesMinSurvivedFrac_; + /// + /// In conjunction with above, the features are reused in frame B only if they + /// are at-least this fraction of the original features in frame A. Otherwise + /// they are reset and extracted from scratch. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ReuseFeaturesMinSurvivedFrac { + get { if ((_hasBits0 & 16384) != 0) { return reuseFeaturesMinSurvivedFrac_; } else { return ReuseFeaturesMinSurvivedFracDefaultValue; } } + set { + _hasBits0 |= 16384; + reuseFeaturesMinSurvivedFrac_ = value; + } + } + /// Gets whether the "reuse_features_min_survived_frac" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReuseFeaturesMinSurvivedFrac { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "reuse_features_min_survived_frac" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReuseFeaturesMinSurvivedFrac() { + _hasBits0 &= ~16384; + } + + /// Field number for the "use_cv_tracking_algorithm" field. + public const int UseCvTrackingAlgorithmFieldNumber = 30; + private readonly static bool UseCvTrackingAlgorithmDefaultValue = true; + + private bool useCvTrackingAlgorithm_; + /// + /// If set uses newer OpenCV tracking algorithm. + /// Recommended to be set for all new projects. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseCvTrackingAlgorithm { + get { if ((_hasBits0 & 16777216) != 0) { return useCvTrackingAlgorithm_; } else { return UseCvTrackingAlgorithmDefaultValue; } } + set { + _hasBits0 |= 16777216; + useCvTrackingAlgorithm_ = value; + } + } + /// Gets whether the "use_cv_tracking_algorithm" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseCvTrackingAlgorithm { + get { return (_hasBits0 & 16777216) != 0; } + } + /// Clears the value of the "use_cv_tracking_algorithm" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseCvTrackingAlgorithm() { + _hasBits0 &= ~16777216; + } + + /// Field number for the "klt_tracker_implementation" field. + public const int KltTrackerImplementationFieldNumber = 32; + private readonly static global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation KltTrackerImplementationDefaultValue = global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation.KltOpencv; + + private global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation kltTrackerImplementation_; + /// + /// Implementation choice of KLT tracker. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation KltTrackerImplementation { + get { if ((_hasBits0 & 33554432) != 0) { return kltTrackerImplementation_; } else { return KltTrackerImplementationDefaultValue; } } + set { + _hasBits0 |= 33554432; + kltTrackerImplementation_ = value; + } + } + /// Gets whether the "klt_tracker_implementation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKltTrackerImplementation { + get { return (_hasBits0 & 33554432) != 0; } + } + /// Clears the value of the "klt_tracker_implementation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKltTrackerImplementation() { + _hasBits0 &= ~33554432; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackingOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackingOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InternalTrackingDirection != other.InternalTrackingDirection) return false; + if (OutputFlowDirection != other.OutputFlowDirection) return false; + if (TrackingPolicy != other.TrackingPolicy) return false; + if (MultiFramesToTrack != other.MultiFramesToTrack) return false; + if (LongTracksMaxFrames != other.LongTracksMaxFrames) return false; + if (MaxFeatures != other.MaxFeatures) return false; + if (CornerExtractionMethod != other.CornerExtractionMethod) return false; + if (!object.Equals(MinEigValSettings, other.MinEigValSettings)) return false; + if (!object.Equals(HarrisSettings, other.HarrisSettings)) return false; + if (!object.Equals(FastSettings, other.FastSettings)) return false; + if (TrackingWindowSize != other.TrackingWindowSize) return false; + if (TrackingIterations != other.TrackingIterations) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FractionalTrackingDistance, other.FractionalTrackingDistance)) return false; + if (AdaptiveTrackingDistance != other.AdaptiveTrackingDistance) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinFeatureDistance, other.MinFeatureDistance)) return false; + if (DistanceDownscaleSqrt != other.DistanceDownscaleSqrt) return false; + if (AdaptiveGoodFeaturesToTrack != other.AdaptiveGoodFeaturesToTrack) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AdaptiveFeaturesBlockSize, other.AdaptiveFeaturesBlockSize)) return false; + if (AdaptiveFeaturesLevels != other.AdaptiveFeaturesLevels) return false; + if (AdaptiveExtractionLevels != other.AdaptiveExtractionLevels) return false; + if (AdaptiveExtractionLevelsLowestSize != other.AdaptiveExtractionLevelsLowestSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SyntheticZeroMotionGridStep, other.SyntheticZeroMotionGridStep)) return false; + if (WideBaselineMatching != other.WideBaselineMatching) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RatioTestThreshold, other.RatioTestThreshold)) return false; + if (RefineWideBaselineMatches != other.RefineWideBaselineMatches) return false; + if (ReuseFeaturesMaxFrameDistance != other.ReuseFeaturesMaxFrameDistance) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ReuseFeaturesMinSurvivedFrac, other.ReuseFeaturesMinSurvivedFrac)) return false; + if (UseCvTrackingAlgorithm != other.UseCvTrackingAlgorithm) return false; + if (KltTrackerImplementation != other.KltTrackerImplementation) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasInternalTrackingDirection) hash ^= InternalTrackingDirection.GetHashCode(); + if (HasOutputFlowDirection) hash ^= OutputFlowDirection.GetHashCode(); + if (HasTrackingPolicy) hash ^= TrackingPolicy.GetHashCode(); + if (HasMultiFramesToTrack) hash ^= MultiFramesToTrack.GetHashCode(); + if (HasLongTracksMaxFrames) hash ^= LongTracksMaxFrames.GetHashCode(); + if (HasMaxFeatures) hash ^= MaxFeatures.GetHashCode(); + if (HasCornerExtractionMethod) hash ^= CornerExtractionMethod.GetHashCode(); + if (minEigValSettings_ != null) hash ^= MinEigValSettings.GetHashCode(); + if (harrisSettings_ != null) hash ^= HarrisSettings.GetHashCode(); + if (fastSettings_ != null) hash ^= FastSettings.GetHashCode(); + if (HasTrackingWindowSize) hash ^= TrackingWindowSize.GetHashCode(); + if (HasTrackingIterations) hash ^= TrackingIterations.GetHashCode(); + if (HasFractionalTrackingDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FractionalTrackingDistance); + if (HasAdaptiveTrackingDistance) hash ^= AdaptiveTrackingDistance.GetHashCode(); + if (HasMinFeatureDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinFeatureDistance); + if (HasDistanceDownscaleSqrt) hash ^= DistanceDownscaleSqrt.GetHashCode(); + if (HasAdaptiveGoodFeaturesToTrack) hash ^= AdaptiveGoodFeaturesToTrack.GetHashCode(); + if (HasAdaptiveFeaturesBlockSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AdaptiveFeaturesBlockSize); + if (HasAdaptiveFeaturesLevels) hash ^= AdaptiveFeaturesLevels.GetHashCode(); + if (HasAdaptiveExtractionLevels) hash ^= AdaptiveExtractionLevels.GetHashCode(); + if (HasAdaptiveExtractionLevelsLowestSize) hash ^= AdaptiveExtractionLevelsLowestSize.GetHashCode(); + if (HasSyntheticZeroMotionGridStep) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SyntheticZeroMotionGridStep); + if (HasWideBaselineMatching) hash ^= WideBaselineMatching.GetHashCode(); + if (HasRatioTestThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RatioTestThreshold); + if (HasRefineWideBaselineMatches) hash ^= RefineWideBaselineMatches.GetHashCode(); + if (HasReuseFeaturesMaxFrameDistance) hash ^= ReuseFeaturesMaxFrameDistance.GetHashCode(); + if (HasReuseFeaturesMinSurvivedFrac) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ReuseFeaturesMinSurvivedFrac); + if (HasUseCvTrackingAlgorithm) hash ^= UseCvTrackingAlgorithm.GetHashCode(); + if (HasKltTrackerImplementation) hash ^= KltTrackerImplementation.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMultiFramesToTrack) { + output.WriteRawTag(8); + output.WriteInt32(MultiFramesToTrack); + } + if (HasMaxFeatures) { + output.WriteRawTag(16); + output.WriteInt32(MaxFeatures); + } + if (HasTrackingWindowSize) { + output.WriteRawTag(32); + output.WriteInt32(TrackingWindowSize); + } + if (HasTrackingIterations) { + output.WriteRawTag(40); + output.WriteInt32(TrackingIterations); + } + if (HasFractionalTrackingDistance) { + output.WriteRawTag(53); + output.WriteFloat(FractionalTrackingDistance); + } + if (HasMinFeatureDistance) { + output.WriteRawTag(61); + output.WriteFloat(MinFeatureDistance); + } + if (HasAdaptiveGoodFeaturesToTrack) { + output.WriteRawTag(64); + output.WriteBool(AdaptiveGoodFeaturesToTrack); + } + if (HasAdaptiveFeaturesBlockSize) { + output.WriteRawTag(77); + output.WriteFloat(AdaptiveFeaturesBlockSize); + } + if (HasAdaptiveFeaturesLevels) { + output.WriteRawTag(80); + output.WriteInt32(AdaptiveFeaturesLevels); + } + if (HasSyntheticZeroMotionGridStep) { + output.WriteRawTag(109); + output.WriteFloat(SyntheticZeroMotionGridStep); + } + if (HasWideBaselineMatching) { + output.WriteRawTag(112); + output.WriteBool(WideBaselineMatching); + } + if (HasRatioTestThreshold) { + output.WriteRawTag(125); + output.WriteFloat(RatioTestThreshold); + } + if (HasRefineWideBaselineMatches) { + output.WriteRawTag(128, 1); + output.WriteBool(RefineWideBaselineMatches); + } + if (HasReuseFeaturesMaxFrameDistance) { + output.WriteRawTag(136, 1); + output.WriteInt32(ReuseFeaturesMaxFrameDistance); + } + if (HasReuseFeaturesMinSurvivedFrac) { + output.WriteRawTag(149, 1); + output.WriteFloat(ReuseFeaturesMinSurvivedFrac); + } + if (HasInternalTrackingDirection) { + output.WriteRawTag(152, 1); + output.WriteEnum((int) InternalTrackingDirection); + } + if (HasOutputFlowDirection) { + output.WriteRawTag(160, 1); + output.WriteEnum((int) OutputFlowDirection); + } + if (HasDistanceDownscaleSqrt) { + output.WriteRawTag(168, 1); + output.WriteBool(DistanceDownscaleSqrt); + } + if (HasAdaptiveExtractionLevels) { + output.WriteRawTag(176, 1); + output.WriteInt32(AdaptiveExtractionLevels); + } + if (HasAdaptiveExtractionLevelsLowestSize) { + output.WriteRawTag(184, 1); + output.WriteInt32(AdaptiveExtractionLevelsLowestSize); + } + if (HasAdaptiveTrackingDistance) { + output.WriteRawTag(192, 1); + output.WriteBool(AdaptiveTrackingDistance); + } + if (HasTrackingPolicy) { + output.WriteRawTag(200, 1); + output.WriteEnum((int) TrackingPolicy); + } + if (HasLongTracksMaxFrames) { + output.WriteRawTag(208, 1); + output.WriteInt32(LongTracksMaxFrames); + } + if (HasCornerExtractionMethod) { + output.WriteRawTag(216, 1); + output.WriteEnum((int) CornerExtractionMethod); + } + if (minEigValSettings_ != null) { + output.WriteRawTag(226, 1); + output.WriteMessage(MinEigValSettings); + } + if (harrisSettings_ != null) { + output.WriteRawTag(234, 1); + output.WriteMessage(HarrisSettings); + } + if (HasUseCvTrackingAlgorithm) { + output.WriteRawTag(240, 1); + output.WriteBool(UseCvTrackingAlgorithm); + } + if (fastSettings_ != null) { + output.WriteRawTag(250, 1); + output.WriteMessage(FastSettings); + } + if (HasKltTrackerImplementation) { + output.WriteRawTag(128, 2); + output.WriteEnum((int) KltTrackerImplementation); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMultiFramesToTrack) { + output.WriteRawTag(8); + output.WriteInt32(MultiFramesToTrack); + } + if (HasMaxFeatures) { + output.WriteRawTag(16); + output.WriteInt32(MaxFeatures); + } + if (HasTrackingWindowSize) { + output.WriteRawTag(32); + output.WriteInt32(TrackingWindowSize); + } + if (HasTrackingIterations) { + output.WriteRawTag(40); + output.WriteInt32(TrackingIterations); + } + if (HasFractionalTrackingDistance) { + output.WriteRawTag(53); + output.WriteFloat(FractionalTrackingDistance); + } + if (HasMinFeatureDistance) { + output.WriteRawTag(61); + output.WriteFloat(MinFeatureDistance); + } + if (HasAdaptiveGoodFeaturesToTrack) { + output.WriteRawTag(64); + output.WriteBool(AdaptiveGoodFeaturesToTrack); + } + if (HasAdaptiveFeaturesBlockSize) { + output.WriteRawTag(77); + output.WriteFloat(AdaptiveFeaturesBlockSize); + } + if (HasAdaptiveFeaturesLevels) { + output.WriteRawTag(80); + output.WriteInt32(AdaptiveFeaturesLevels); + } + if (HasSyntheticZeroMotionGridStep) { + output.WriteRawTag(109); + output.WriteFloat(SyntheticZeroMotionGridStep); + } + if (HasWideBaselineMatching) { + output.WriteRawTag(112); + output.WriteBool(WideBaselineMatching); + } + if (HasRatioTestThreshold) { + output.WriteRawTag(125); + output.WriteFloat(RatioTestThreshold); + } + if (HasRefineWideBaselineMatches) { + output.WriteRawTag(128, 1); + output.WriteBool(RefineWideBaselineMatches); + } + if (HasReuseFeaturesMaxFrameDistance) { + output.WriteRawTag(136, 1); + output.WriteInt32(ReuseFeaturesMaxFrameDistance); + } + if (HasReuseFeaturesMinSurvivedFrac) { + output.WriteRawTag(149, 1); + output.WriteFloat(ReuseFeaturesMinSurvivedFrac); + } + if (HasInternalTrackingDirection) { + output.WriteRawTag(152, 1); + output.WriteEnum((int) InternalTrackingDirection); + } + if (HasOutputFlowDirection) { + output.WriteRawTag(160, 1); + output.WriteEnum((int) OutputFlowDirection); + } + if (HasDistanceDownscaleSqrt) { + output.WriteRawTag(168, 1); + output.WriteBool(DistanceDownscaleSqrt); + } + if (HasAdaptiveExtractionLevels) { + output.WriteRawTag(176, 1); + output.WriteInt32(AdaptiveExtractionLevels); + } + if (HasAdaptiveExtractionLevelsLowestSize) { + output.WriteRawTag(184, 1); + output.WriteInt32(AdaptiveExtractionLevelsLowestSize); + } + if (HasAdaptiveTrackingDistance) { + output.WriteRawTag(192, 1); + output.WriteBool(AdaptiveTrackingDistance); + } + if (HasTrackingPolicy) { + output.WriteRawTag(200, 1); + output.WriteEnum((int) TrackingPolicy); + } + if (HasLongTracksMaxFrames) { + output.WriteRawTag(208, 1); + output.WriteInt32(LongTracksMaxFrames); + } + if (HasCornerExtractionMethod) { + output.WriteRawTag(216, 1); + output.WriteEnum((int) CornerExtractionMethod); + } + if (minEigValSettings_ != null) { + output.WriteRawTag(226, 1); + output.WriteMessage(MinEigValSettings); + } + if (harrisSettings_ != null) { + output.WriteRawTag(234, 1); + output.WriteMessage(HarrisSettings); + } + if (HasUseCvTrackingAlgorithm) { + output.WriteRawTag(240, 1); + output.WriteBool(UseCvTrackingAlgorithm); + } + if (fastSettings_ != null) { + output.WriteRawTag(250, 1); + output.WriteMessage(FastSettings); + } + if (HasKltTrackerImplementation) { + output.WriteRawTag(128, 2); + output.WriteEnum((int) KltTrackerImplementation); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasInternalTrackingDirection) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) InternalTrackingDirection); + } + if (HasOutputFlowDirection) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OutputFlowDirection); + } + if (HasTrackingPolicy) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) TrackingPolicy); + } + if (HasMultiFramesToTrack) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MultiFramesToTrack); + } + if (HasLongTracksMaxFrames) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(LongTracksMaxFrames); + } + if (HasMaxFeatures) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxFeatures); + } + if (HasCornerExtractionMethod) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) CornerExtractionMethod); + } + if (minEigValSettings_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(MinEigValSettings); + } + if (harrisSettings_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(HarrisSettings); + } + if (fastSettings_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(FastSettings); + } + if (HasTrackingWindowSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TrackingWindowSize); + } + if (HasTrackingIterations) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TrackingIterations); + } + if (HasFractionalTrackingDistance) { + size += 1 + 4; + } + if (HasAdaptiveTrackingDistance) { + size += 2 + 1; + } + if (HasMinFeatureDistance) { + size += 1 + 4; + } + if (HasDistanceDownscaleSqrt) { + size += 2 + 1; + } + if (HasAdaptiveGoodFeaturesToTrack) { + size += 1 + 1; + } + if (HasAdaptiveFeaturesBlockSize) { + size += 1 + 4; + } + if (HasAdaptiveFeaturesLevels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AdaptiveFeaturesLevels); + } + if (HasAdaptiveExtractionLevels) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(AdaptiveExtractionLevels); + } + if (HasAdaptiveExtractionLevelsLowestSize) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(AdaptiveExtractionLevelsLowestSize); + } + if (HasSyntheticZeroMotionGridStep) { + size += 1 + 4; + } + if (HasWideBaselineMatching) { + size += 1 + 1; + } + if (HasRatioTestThreshold) { + size += 1 + 4; + } + if (HasRefineWideBaselineMatches) { + size += 2 + 1; + } + if (HasReuseFeaturesMaxFrameDistance) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(ReuseFeaturesMaxFrameDistance); + } + if (HasReuseFeaturesMinSurvivedFrac) { + size += 2 + 4; + } + if (HasUseCvTrackingAlgorithm) { + size += 2 + 1; + } + if (HasKltTrackerImplementation) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) KltTrackerImplementation); + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackingOptions other) { + if (other == null) { + return; + } + if (other.HasInternalTrackingDirection) { + InternalTrackingDirection = other.InternalTrackingDirection; + } + if (other.HasOutputFlowDirection) { + OutputFlowDirection = other.OutputFlowDirection; + } + if (other.HasTrackingPolicy) { + TrackingPolicy = other.TrackingPolicy; + } + if (other.HasMultiFramesToTrack) { + MultiFramesToTrack = other.MultiFramesToTrack; + } + if (other.HasLongTracksMaxFrames) { + LongTracksMaxFrames = other.LongTracksMaxFrames; + } + if (other.HasMaxFeatures) { + MaxFeatures = other.MaxFeatures; + } + if (other.HasCornerExtractionMethod) { + CornerExtractionMethod = other.CornerExtractionMethod; + } + if (other.minEigValSettings_ != null) { + if (minEigValSettings_ == null) { + MinEigValSettings = new global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings(); + } + MinEigValSettings.MergeFrom(other.MinEigValSettings); + } + if (other.harrisSettings_ != null) { + if (harrisSettings_ == null) { + HarrisSettings = new global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings(); + } + HarrisSettings.MergeFrom(other.HarrisSettings); + } + if (other.fastSettings_ != null) { + if (fastSettings_ == null) { + FastSettings = new global::Mediapipe.TrackingOptions.Types.FastExtractionSettings(); + } + FastSettings.MergeFrom(other.FastSettings); + } + if (other.HasTrackingWindowSize) { + TrackingWindowSize = other.TrackingWindowSize; + } + if (other.HasTrackingIterations) { + TrackingIterations = other.TrackingIterations; + } + if (other.HasFractionalTrackingDistance) { + FractionalTrackingDistance = other.FractionalTrackingDistance; + } + if (other.HasAdaptiveTrackingDistance) { + AdaptiveTrackingDistance = other.AdaptiveTrackingDistance; + } + if (other.HasMinFeatureDistance) { + MinFeatureDistance = other.MinFeatureDistance; + } + if (other.HasDistanceDownscaleSqrt) { + DistanceDownscaleSqrt = other.DistanceDownscaleSqrt; + } + if (other.HasAdaptiveGoodFeaturesToTrack) { + AdaptiveGoodFeaturesToTrack = other.AdaptiveGoodFeaturesToTrack; + } + if (other.HasAdaptiveFeaturesBlockSize) { + AdaptiveFeaturesBlockSize = other.AdaptiveFeaturesBlockSize; + } + if (other.HasAdaptiveFeaturesLevels) { + AdaptiveFeaturesLevels = other.AdaptiveFeaturesLevels; + } + if (other.HasAdaptiveExtractionLevels) { + AdaptiveExtractionLevels = other.AdaptiveExtractionLevels; + } + if (other.HasAdaptiveExtractionLevelsLowestSize) { + AdaptiveExtractionLevelsLowestSize = other.AdaptiveExtractionLevelsLowestSize; + } + if (other.HasSyntheticZeroMotionGridStep) { + SyntheticZeroMotionGridStep = other.SyntheticZeroMotionGridStep; + } + if (other.HasWideBaselineMatching) { + WideBaselineMatching = other.WideBaselineMatching; + } + if (other.HasRatioTestThreshold) { + RatioTestThreshold = other.RatioTestThreshold; + } + if (other.HasRefineWideBaselineMatches) { + RefineWideBaselineMatches = other.RefineWideBaselineMatches; + } + if (other.HasReuseFeaturesMaxFrameDistance) { + ReuseFeaturesMaxFrameDistance = other.ReuseFeaturesMaxFrameDistance; + } + if (other.HasReuseFeaturesMinSurvivedFrac) { + ReuseFeaturesMinSurvivedFrac = other.ReuseFeaturesMinSurvivedFrac; + } + if (other.HasUseCvTrackingAlgorithm) { + UseCvTrackingAlgorithm = other.UseCvTrackingAlgorithm; + } + if (other.HasKltTrackerImplementation) { + KltTrackerImplementation = other.KltTrackerImplementation; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + MultiFramesToTrack = input.ReadInt32(); + break; + } + case 16: { + MaxFeatures = input.ReadInt32(); + break; + } + case 32: { + TrackingWindowSize = input.ReadInt32(); + break; + } + case 40: { + TrackingIterations = input.ReadInt32(); + break; + } + case 53: { + FractionalTrackingDistance = input.ReadFloat(); + break; + } + case 61: { + MinFeatureDistance = input.ReadFloat(); + break; + } + case 64: { + AdaptiveGoodFeaturesToTrack = input.ReadBool(); + break; + } + case 77: { + AdaptiveFeaturesBlockSize = input.ReadFloat(); + break; + } + case 80: { + AdaptiveFeaturesLevels = input.ReadInt32(); + break; + } + case 109: { + SyntheticZeroMotionGridStep = input.ReadFloat(); + break; + } + case 112: { + WideBaselineMatching = input.ReadBool(); + break; + } + case 125: { + RatioTestThreshold = input.ReadFloat(); + break; + } + case 128: { + RefineWideBaselineMatches = input.ReadBool(); + break; + } + case 136: { + ReuseFeaturesMaxFrameDistance = input.ReadInt32(); + break; + } + case 149: { + ReuseFeaturesMinSurvivedFrac = input.ReadFloat(); + break; + } + case 152: { + InternalTrackingDirection = (global::Mediapipe.TrackingOptions.Types.FlowDirection) input.ReadEnum(); + break; + } + case 160: { + OutputFlowDirection = (global::Mediapipe.TrackingOptions.Types.FlowDirection) input.ReadEnum(); + break; + } + case 168: { + DistanceDownscaleSqrt = input.ReadBool(); + break; + } + case 176: { + AdaptiveExtractionLevels = input.ReadInt32(); + break; + } + case 184: { + AdaptiveExtractionLevelsLowestSize = input.ReadInt32(); + break; + } + case 192: { + AdaptiveTrackingDistance = input.ReadBool(); + break; + } + case 200: { + TrackingPolicy = (global::Mediapipe.TrackingOptions.Types.TrackingPolicy) input.ReadEnum(); + break; + } + case 208: { + LongTracksMaxFrames = input.ReadInt32(); + break; + } + case 216: { + CornerExtractionMethod = (global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod) input.ReadEnum(); + break; + } + case 226: { + if (minEigValSettings_ == null) { + MinEigValSettings = new global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings(); + } + input.ReadMessage(MinEigValSettings); + break; + } + case 234: { + if (harrisSettings_ == null) { + HarrisSettings = new global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings(); + } + input.ReadMessage(HarrisSettings); + break; + } + case 240: { + UseCvTrackingAlgorithm = input.ReadBool(); + break; + } + case 250: { + if (fastSettings_ == null) { + FastSettings = new global::Mediapipe.TrackingOptions.Types.FastExtractionSettings(); + } + input.ReadMessage(FastSettings); + break; + } + case 256: { + KltTrackerImplementation = (global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + MultiFramesToTrack = input.ReadInt32(); + break; + } + case 16: { + MaxFeatures = input.ReadInt32(); + break; + } + case 32: { + TrackingWindowSize = input.ReadInt32(); + break; + } + case 40: { + TrackingIterations = input.ReadInt32(); + break; + } + case 53: { + FractionalTrackingDistance = input.ReadFloat(); + break; + } + case 61: { + MinFeatureDistance = input.ReadFloat(); + break; + } + case 64: { + AdaptiveGoodFeaturesToTrack = input.ReadBool(); + break; + } + case 77: { + AdaptiveFeaturesBlockSize = input.ReadFloat(); + break; + } + case 80: { + AdaptiveFeaturesLevels = input.ReadInt32(); + break; + } + case 109: { + SyntheticZeroMotionGridStep = input.ReadFloat(); + break; + } + case 112: { + WideBaselineMatching = input.ReadBool(); + break; + } + case 125: { + RatioTestThreshold = input.ReadFloat(); + break; + } + case 128: { + RefineWideBaselineMatches = input.ReadBool(); + break; + } + case 136: { + ReuseFeaturesMaxFrameDistance = input.ReadInt32(); + break; + } + case 149: { + ReuseFeaturesMinSurvivedFrac = input.ReadFloat(); + break; + } + case 152: { + InternalTrackingDirection = (global::Mediapipe.TrackingOptions.Types.FlowDirection) input.ReadEnum(); + break; + } + case 160: { + OutputFlowDirection = (global::Mediapipe.TrackingOptions.Types.FlowDirection) input.ReadEnum(); + break; + } + case 168: { + DistanceDownscaleSqrt = input.ReadBool(); + break; + } + case 176: { + AdaptiveExtractionLevels = input.ReadInt32(); + break; + } + case 184: { + AdaptiveExtractionLevelsLowestSize = input.ReadInt32(); + break; + } + case 192: { + AdaptiveTrackingDistance = input.ReadBool(); + break; + } + case 200: { + TrackingPolicy = (global::Mediapipe.TrackingOptions.Types.TrackingPolicy) input.ReadEnum(); + break; + } + case 208: { + LongTracksMaxFrames = input.ReadInt32(); + break; + } + case 216: { + CornerExtractionMethod = (global::Mediapipe.TrackingOptions.Types.CornerExtractionMethod) input.ReadEnum(); + break; + } + case 226: { + if (minEigValSettings_ == null) { + MinEigValSettings = new global::Mediapipe.TrackingOptions.Types.MinEigValExtractionSettings(); + } + input.ReadMessage(MinEigValSettings); + break; + } + case 234: { + if (harrisSettings_ == null) { + HarrisSettings = new global::Mediapipe.TrackingOptions.Types.HarrisExtractionSettings(); + } + input.ReadMessage(HarrisSettings); + break; + } + case 240: { + UseCvTrackingAlgorithm = input.ReadBool(); + break; + } + case 250: { + if (fastSettings_ == null) { + FastSettings = new global::Mediapipe.TrackingOptions.Types.FastExtractionSettings(); + } + input.ReadMessage(FastSettings); + break; + } + case 256: { + KltTrackerImplementation = (global::Mediapipe.TrackingOptions.Types.KltTrackerImplementation) input.ReadEnum(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the TrackingOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Describes direction of flow during feature tracking and for the output + /// region flow. + /// + public enum FlowDirection { + /// + /// Tracks are forward, from frame N-k -> frame N (k > 0). + /// + [pbr::OriginalName("FORWARD")] Forward = 1, + /// + /// Tracks are backward, from frame N -> frame N-k + /// + [pbr::OriginalName("BACKWARD")] Backward = 2, + /// + /// (k > 0). + /// + [pbr::OriginalName("CONSECUTIVELY")] Consecutively = 3, + } + + /// + /// Specifies how a feature is tracked w.r.t. previous or next frames + /// (dependent on the FlowDirection options above). + /// Per default, each frame is tracked w.r.t. a single neighboring frame + /// (TRACK_SINGLE_FRAME). If associations across multiple frames are desired, + /// TRACK_MULTI_FRAME creates multiple results for the current frame, by + /// tracking features w.r.t. multiple neighbors. Number of neighbors is + /// specified by multi_frames_to_track. + /// If long feature tracks are desired (i.e. a track across a frame pair + /// that is identified to belong to an earlier known feature), use + /// TRACK_ACROSS_FRAMES. Maximum track length can be specified by + /// long_tracks_max_frames. + /// + public enum TrackingPolicy { + /// + /// Tracks w.r.t. previous or next frame. + /// + [pbr::OriginalName("POLICY_SINGLE_FRAME")] PolicySingleFrame = 1, + /// + /// Tracks w.r.t. multiple frames. + /// + [pbr::OriginalName("POLICY_MULTI_FRAME")] PolicyMultiFrame = 2, + /// + /// Create long feature tracks. + /// + [pbr::OriginalName("POLICY_LONG_TRACKS")] PolicyLongTracks = 3, + } + + /// + /// Specifies the extraction method for features. + /// + public enum CornerExtractionMethod { + /// + /// Using Harris' approximation of + /// + [pbr::OriginalName("EXTRACTION_HARRIS")] ExtractionHarris = 1, + /// + /// EXTRACTION_MIN_EIG_VAL. + /// + [pbr::OriginalName("EXTRACTION_MIN_EIG_VAL")] ExtractionMinEigVal = 2, + /// + /// Extract using FAST feature detector. + /// + [pbr::OriginalName("EXTRACTION_FAST")] ExtractionFast = 3, + } + + public enum KltTrackerImplementation { + [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, + /// + /// Use OpenCV's implementation of KLT tracker. + /// + [pbr::OriginalName("KLT_OPENCV")] KltOpencv = 1, + } + + /// + /// Settings for above corner extraction methods. + /// + public sealed partial class MinEigValExtractionSettings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MinEigValExtractionSettings()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MinEigValExtractionSettings() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MinEigValExtractionSettings(MinEigValExtractionSettings other) : this() { + _hasBits0 = other._hasBits0; + featureQualityLevel_ = other.featureQualityLevel_; + adaptiveLowestQualityLevel_ = other.adaptiveLowestQualityLevel_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MinEigValExtractionSettings Clone() { + return new MinEigValExtractionSettings(this); + } + + /// Field number for the "feature_quality_level" field. + public const int FeatureQualityLevelFieldNumber = 1; + private readonly static float FeatureQualityLevelDefaultValue = 0.01F; + + private float featureQualityLevel_; + /// + /// Quality level of features (features with + /// min_eig_value < quality_level * max_eig_value are rejected). + /// Here [min|max]_eig_value denote the minimum and maximum eigen value of + /// the auto-correlation matrix of the patch centered at a feature point. The + /// ratio of eigenvalues denotes the "cornerness", lower means more + /// pronounced corners. + /// (see http://en.wikipedia.org/wiki/Harris-Affine for details.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FeatureQualityLevel { + get { if ((_hasBits0 & 1) != 0) { return featureQualityLevel_; } else { return FeatureQualityLevelDefaultValue; } } + set { + _hasBits0 |= 1; + featureQualityLevel_ = value; + } + } + /// Gets whether the "feature_quality_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureQualityLevel { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "feature_quality_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureQualityLevel() { + _hasBits0 &= ~1; + } + + /// Field number for the "adaptive_lowest_quality_level" field. + public const int AdaptiveLowestQualityLevelFieldNumber = 2; + private readonly static float AdaptiveLowestQualityLevelDefaultValue = 8e-05F; + + private float adaptiveLowestQualityLevel_; + /// + /// Features below this quality level are always discarded, even if their + /// score is above feature_quality_level() * local maximum within that grid + /// cell. This prevents us from including very poor features. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AdaptiveLowestQualityLevel { + get { if ((_hasBits0 & 2) != 0) { return adaptiveLowestQualityLevel_; } else { return AdaptiveLowestQualityLevelDefaultValue; } } + set { + _hasBits0 |= 2; + adaptiveLowestQualityLevel_ = value; + } + } + /// Gets whether the "adaptive_lowest_quality_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAdaptiveLowestQualityLevel { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "adaptive_lowest_quality_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAdaptiveLowestQualityLevel() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MinEigValExtractionSettings); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MinEigValExtractionSettings other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FeatureQualityLevel, other.FeatureQualityLevel)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AdaptiveLowestQualityLevel, other.AdaptiveLowestQualityLevel)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFeatureQualityLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FeatureQualityLevel); + if (HasAdaptiveLowestQualityLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AdaptiveLowestQualityLevel); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFeatureQualityLevel) { + output.WriteRawTag(13); + output.WriteFloat(FeatureQualityLevel); + } + if (HasAdaptiveLowestQualityLevel) { + output.WriteRawTag(21); + output.WriteFloat(AdaptiveLowestQualityLevel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFeatureQualityLevel) { + output.WriteRawTag(13); + output.WriteFloat(FeatureQualityLevel); + } + if (HasAdaptiveLowestQualityLevel) { + output.WriteRawTag(21); + output.WriteFloat(AdaptiveLowestQualityLevel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFeatureQualityLevel) { + size += 1 + 4; + } + if (HasAdaptiveLowestQualityLevel) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MinEigValExtractionSettings other) { + if (other == null) { + return; + } + if (other.HasFeatureQualityLevel) { + FeatureQualityLevel = other.FeatureQualityLevel; + } + if (other.HasAdaptiveLowestQualityLevel) { + AdaptiveLowestQualityLevel = other.AdaptiveLowestQualityLevel; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + FeatureQualityLevel = input.ReadFloat(); + break; + } + case 21: { + AdaptiveLowestQualityLevel = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + FeatureQualityLevel = input.ReadFloat(); + break; + } + case 21: { + AdaptiveLowestQualityLevel = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class HarrisExtractionSettings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HarrisExtractionSettings()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HarrisExtractionSettings() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HarrisExtractionSettings(HarrisExtractionSettings other) : this() { + _hasBits0 = other._hasBits0; + featureQualityLevel_ = other.featureQualityLevel_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public HarrisExtractionSettings Clone() { + return new HarrisExtractionSettings(this); + } + + /// Field number for the "feature_quality_level" field. + public const int FeatureQualityLevelFieldNumber = 1; + private readonly static float FeatureQualityLevelDefaultValue = 0.00025F; + + private float featureQualityLevel_; + /// + /// Same as in MinEigValExtractionSettings. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FeatureQualityLevel { + get { if ((_hasBits0 & 1) != 0) { return featureQualityLevel_; } else { return FeatureQualityLevelDefaultValue; } } + set { + _hasBits0 |= 1; + featureQualityLevel_ = value; + } + } + /// Gets whether the "feature_quality_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFeatureQualityLevel { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "feature_quality_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFeatureQualityLevel() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as HarrisExtractionSettings); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(HarrisExtractionSettings other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FeatureQualityLevel, other.FeatureQualityLevel)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFeatureQualityLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FeatureQualityLevel); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFeatureQualityLevel) { + output.WriteRawTag(13); + output.WriteFloat(FeatureQualityLevel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFeatureQualityLevel) { + output.WriteRawTag(13); + output.WriteFloat(FeatureQualityLevel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFeatureQualityLevel) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(HarrisExtractionSettings other) { + if (other == null) { + return; + } + if (other.HasFeatureQualityLevel) { + FeatureQualityLevel = other.FeatureQualityLevel; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + FeatureQualityLevel = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + FeatureQualityLevel = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class FastExtractionSettings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FastExtractionSettings()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FastExtractionSettings() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FastExtractionSettings(FastExtractionSettings other) : this() { + _hasBits0 = other._hasBits0; + threshold_ = other.threshold_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FastExtractionSettings Clone() { + return new FastExtractionSettings(this); + } + + /// Field number for the "threshold" field. + public const int ThresholdFieldNumber = 1; + private readonly static int ThresholdDefaultValue = 10; + + private int threshold_; + /// + /// threshold on difference between intensity of the central pixel and pixels + /// of a circle around this pixel. Empirically, the larger the threshold, the + /// fewer the keypoints will be detected. + /// Default value set as the same with OpenCV. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Threshold { + get { if ((_hasBits0 & 1) != 0) { return threshold_; } else { return ThresholdDefaultValue; } } + set { + _hasBits0 |= 1; + threshold_ = value; + } + } + /// Gets whether the "threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThreshold { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThreshold() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FastExtractionSettings); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FastExtractionSettings other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Threshold != other.Threshold) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasThreshold) hash ^= Threshold.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasThreshold) { + output.WriteRawTag(8); + output.WriteInt32(Threshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasThreshold) { + output.WriteRawTag(8); + output.WriteInt32(Threshold); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasThreshold) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Threshold); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FastExtractionSettings other) { + if (other == null) { + return; + } + if (other.HasThreshold) { + Threshold = other.Threshold; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Threshold = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Threshold = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Next tag: 67 + /// + public sealed partial class RegionFlowComputationOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionFlowComputationOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + private int _hasBits1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowComputationReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowComputationOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowComputationOptions(RegionFlowComputationOptions other) : this() { + _hasBits0 = other._hasBits0; + _hasBits1 = other._hasBits1; + trackingOptions_ = other.trackingOptions_ != null ? other.trackingOptions_.Clone() : null; + minFeatureInliers_ = other.minFeatureInliers_; + relativeMinFeatureInliers_ = other.relativeMinFeatureInliers_; + preBlurSigma_ = other.preBlurSigma_; + ransacRoundsPerRegion_ = other.ransacRoundsPerRegion_; + absoluteInlierErrorThreshold_ = other.absoluteInlierErrorThreshold_; + fracInlierErrorThreshold_ = other.fracInlierErrorThreshold_; + relativeInlierErrorThreshold_ = other.relativeInlierErrorThreshold_; + topInlierSets_ = other.topInlierSets_; + noEstimationMode_ = other.noEstimationMode_; + fastEstimationBlockSize_ = other.fastEstimationBlockSize_; + fastEstimationMinBlockSize_ = other.fastEstimationMinBlockSize_; + fastEstimationOverlapGrids_ = other.fastEstimationOverlapGrids_; + maxMagnitudeThresholdRatio_ = other.maxMagnitudeThresholdRatio_; + medianMagnitudeBounds_ = other.medianMagnitudeBounds_; + irlsInitialization_ = other.irlsInitialization_; + downsampleMode_ = other.downsampleMode_; + downsamplingSize_ = other.downsamplingSize_; + downsampleFactor_ = other.downsampleFactor_; + roundDownsampleFactor_ = other.roundDownsampleFactor_; + downsampleSchedule_ = other.downsampleSchedule_ != null ? other.downsampleSchedule_.Clone() : null; + minFeatureRequirement_ = other.minFeatureRequirement_; + minFeatureCover_ = other.minFeatureCover_; + minFeatureCoverGrid_ = other.minFeatureCoverGrid_; + computeBlurScore_ = other.computeBlurScore_; + blurScoreOptions_ = other.blurScoreOptions_ != null ? other.blurScoreOptions_.Clone() : null; + visualConsistencyOptions_ = other.visualConsistencyOptions_ != null ? other.visualConsistencyOptions_.Clone() : null; + patchDescriptorRadius_ = other.patchDescriptorRadius_; + distanceFromBorder_ = other.distanceFromBorder_; + cornerResponseScale_ = other.cornerResponseScale_; + verifyFeatures_ = other.verifyFeatures_; + verificationDistance_ = other.verificationDistance_; + verifyLongFeatures_ = other.verifyLongFeatures_; + longFeatureVerificationThreshold_ = other.longFeatureVerificationThreshold_; + maxLongFeatureAcceleration_ = other.maxLongFeatureAcceleration_; + verifyLongFeatureAcceleration_ = other.verifyLongFeatureAcceleration_; + verifyLongFeatureTriggerRatio_ = other.verifyLongFeatureTriggerRatio_; + histogramEqualization_ = other.histogramEqualization_; + useSyntheticZeroMotionTracksAllFrames_ = other.useSyntheticZeroMotionTracksAllFrames_; + useSyntheticZeroMotionTracksFirstFrame_ = other.useSyntheticZeroMotionTracksFirstFrame_; + gainCorrection_ = other.gainCorrection_; + fastGainCorrection_ = other.fastGainCorrection_; + gainCorrectionMultipleHypotheses_ = other.gainCorrectionMultipleHypotheses_; + gainCorrectionInlierImprovementFrac_ = other.gainCorrectionInlierImprovementFrac_; + gainCorrectionBrightReference_ = other.gainCorrectionBrightReference_; + gainCorrectionTriggeringRatio_ = other.gainCorrectionTriggeringRatio_; + fracGainFeatureSize_ = other.fracGainFeatureSize_; + fracGainStep_ = other.fracGainStep_; + gainCorrectMode_ = other.gainCorrectMode_; + gainBiasBounds_ = other.gainBiasBounds_ != null ? other.gainBiasBounds_.Clone() : null; + imageFormat_ = other.imageFormat_; + descriptorExtractorType_ = other.descriptorExtractorType_; + computeDerivativeInPyramid_ = other.computeDerivativeInPyramid_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RegionFlowComputationOptions Clone() { + return new RegionFlowComputationOptions(this); + } + + /// Field number for the "tracking_options" field. + public const int TrackingOptionsFieldNumber = 1; + private global::Mediapipe.TrackingOptions trackingOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackingOptions TrackingOptions { + get { return trackingOptions_; } + set { + trackingOptions_ = value; + } + } + + /// Field number for the "min_feature_inliers" field. + public const int MinFeatureInliersFieldNumber = 2; + private readonly static int MinFeatureInliersDefaultValue = 3; + + private int minFeatureInliers_; + /// + /// Features are binned into grids of different resolutions (see + /// fast_estimation_block_size below) and retained if they survive a localized + /// translation based RANSAC algorithm and at the survivors are at least of + /// size min_feature_inliers. Must be at least 3! + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinFeatureInliers { + get { if ((_hasBits0 & 1) != 0) { return minFeatureInliers_; } else { return MinFeatureInliersDefaultValue; } } + set { + _hasBits0 |= 1; + minFeatureInliers_ = value; + } + } + /// Gets whether the "min_feature_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatureInliers { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_feature_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatureInliers() { + _hasBits0 &= ~1; + } + + /// Field number for the "relative_min_feature_inliers" field. + public const int RelativeMinFeatureInliersFieldNumber = 46; + private readonly static float RelativeMinFeatureInliersDefaultValue = 0.2F; + + private float relativeMinFeatureInliers_; + /// + /// Relative number of inlier features w.r.t. average number of features + /// per grid bin. Maximum of both thresholds is used as actual threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RelativeMinFeatureInliers { + get { if ((_hasBits0 & 268435456) != 0) { return relativeMinFeatureInliers_; } else { return RelativeMinFeatureInliersDefaultValue; } } + set { + _hasBits0 |= 268435456; + relativeMinFeatureInliers_ = value; + } + } + /// Gets whether the "relative_min_feature_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRelativeMinFeatureInliers { + get { return (_hasBits0 & 268435456) != 0; } + } + /// Clears the value of the "relative_min_feature_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRelativeMinFeatureInliers() { + _hasBits0 &= ~268435456; + } + + /// Field number for the "pre_blur_sigma" field. + public const int PreBlurSigmaFieldNumber = 33; + private readonly static float PreBlurSigmaDefaultValue = 0.8F; + + private float preBlurSigma_; + /// + /// Pre-blur before computing features to reduce noise. Set to zero for no + /// blurring. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PreBlurSigma { + get { if ((_hasBits0 & 262144) != 0) { return preBlurSigma_; } else { return PreBlurSigmaDefaultValue; } } + set { + _hasBits0 |= 262144; + preBlurSigma_ = value; + } + } + /// Gets whether the "pre_blur_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPreBlurSigma { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "pre_blur_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPreBlurSigma() { + _hasBits0 &= ~262144; + } + + /// Field number for the "ransac_rounds_per_region" field. + public const int RansacRoundsPerRegionFieldNumber = 3; + private readonly static int RansacRoundsPerRegionDefaultValue = 15; + + private int ransacRoundsPerRegion_; + /// + /// Number of ransac rounds to estimate per region flow vector. This could be + /// adaptive, but the required number of rounds is so low, that estimating + /// the bound is more costly than just running it for a fixed number of times. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RansacRoundsPerRegion { + get { if ((_hasBits0 & 2) != 0) { return ransacRoundsPerRegion_; } else { return RansacRoundsPerRegionDefaultValue; } } + set { + _hasBits0 |= 2; + ransacRoundsPerRegion_ = value; + } + } + /// Gets whether the "ransac_rounds_per_region" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRansacRoundsPerRegion { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "ransac_rounds_per_region" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRansacRoundsPerRegion() { + _hasBits0 &= ~2; + } + + /// Field number for the "absolute_inlier_error_threshold" field. + public const int AbsoluteInlierErrorThresholdFieldNumber = 4; + private readonly static float AbsoluteInlierErrorThresholdDefaultValue = 2F; + + private float absoluteInlierErrorThreshold_; + /// + /// Error thresholds for a feature to be considered as an inlier in + /// pixel-distance. The max of all three thresholds below is used as the actual + /// threshold. + /// Absolute in pixels. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AbsoluteInlierErrorThreshold { + get { if ((_hasBits0 & 4) != 0) { return absoluteInlierErrorThreshold_; } else { return AbsoluteInlierErrorThresholdDefaultValue; } } + set { + _hasBits0 |= 4; + absoluteInlierErrorThreshold_ = value; + } + } + /// Gets whether the "absolute_inlier_error_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAbsoluteInlierErrorThreshold { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "absolute_inlier_error_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAbsoluteInlierErrorThreshold() { + _hasBits0 &= ~4; + } + + /// Field number for the "frac_inlier_error_threshold" field. + public const int FracInlierErrorThresholdFieldNumber = 52; + private readonly static float FracInlierErrorThresholdDefaultValue = 0F; + + private float fracInlierErrorThreshold_; + /// + /// Scaled w.r.t. frame diameter. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracInlierErrorThreshold { + get { if ((_hasBits1 & 4) != 0) { return fracInlierErrorThreshold_; } else { return FracInlierErrorThresholdDefaultValue; } } + set { + _hasBits1 |= 4; + fracInlierErrorThreshold_ = value; + } + } + /// Gets whether the "frac_inlier_error_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracInlierErrorThreshold { + get { return (_hasBits1 & 4) != 0; } + } + /// Clears the value of the "frac_inlier_error_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracInlierErrorThreshold() { + _hasBits1 &= ~4; + } + + /// Field number for the "relative_inlier_error_threshold" field. + public const int RelativeInlierErrorThresholdFieldNumber = 44; + private readonly static float RelativeInlierErrorThresholdDefaultValue = 0.1F; + + private float relativeInlierErrorThreshold_; + /// + /// Scaled w.r.t model estimated during each RANSAC round. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RelativeInlierErrorThreshold { + get { if ((_hasBits0 & 67108864) != 0) { return relativeInlierErrorThreshold_; } else { return RelativeInlierErrorThresholdDefaultValue; } } + set { + _hasBits0 |= 67108864; + relativeInlierErrorThreshold_ = value; + } + } + /// Gets whether the "relative_inlier_error_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRelativeInlierErrorThreshold { + get { return (_hasBits0 & 67108864) != 0; } + } + /// Clears the value of the "relative_inlier_error_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRelativeInlierErrorThreshold() { + _hasBits0 &= ~67108864; + } + + /// Field number for the "top_inlier_sets" field. + public const int TopInlierSetsFieldNumber = 45; + private readonly static int TopInlierSetsDefaultValue = 2; + + private int topInlierSets_; + /// + /// Returns for each grid only the top N inlier sets. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TopInlierSets { + get { if ((_hasBits0 & 134217728) != 0) { return topInlierSets_; } else { return TopInlierSetsDefaultValue; } } + set { + _hasBits0 |= 134217728; + topInlierSets_ = value; + } + } + /// Gets whether the "top_inlier_sets" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopInlierSets { + get { return (_hasBits0 & 134217728) != 0; } + } + /// Clears the value of the "top_inlier_sets" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopInlierSets() { + _hasBits0 &= ~134217728; + } + + /// Field number for the "no_estimation_mode" field. + public const int NoEstimationModeFieldNumber = 40; + private readonly static bool NoEstimationModeDefaultValue = false; + + private bool noEstimationMode_; + /// + /// For debugging purposes, uses all tracked features regardless of the above + /// setting. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool NoEstimationMode { + get { if ((_hasBits0 & 16777216) != 0) { return noEstimationMode_; } else { return NoEstimationModeDefaultValue; } } + set { + _hasBits0 |= 16777216; + noEstimationMode_ = value; + } + } + /// Gets whether the "no_estimation_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNoEstimationMode { + get { return (_hasBits0 & 16777216) != 0; } + } + /// Clears the value of the "no_estimation_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNoEstimationMode() { + _hasBits0 &= ~16777216; + } + + /// Field number for the "fast_estimation_block_size" field. + public const int FastEstimationBlockSizeFieldNumber = 6; + private readonly static float FastEstimationBlockSizeDefaultValue = 0.25F; + + private float fastEstimationBlockSize_; + /// + /// Block size in pixels. If fractional block_size is used (0 < size < 1), + /// it is interpreted as fraction of the image dimensions. + /// We use 4 blocks in each dimension by standard. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FastEstimationBlockSize { + get { if ((_hasBits0 & 8) != 0) { return fastEstimationBlockSize_; } else { return FastEstimationBlockSizeDefaultValue; } } + set { + _hasBits0 |= 8; + fastEstimationBlockSize_ = value; + } + } + /// Gets whether the "fast_estimation_block_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFastEstimationBlockSize { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "fast_estimation_block_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFastEstimationBlockSize() { + _hasBits0 &= ~8; + } + + /// Field number for the "fast_estimation_min_block_size" field. + public const int FastEstimationMinBlockSizeFieldNumber = 25; + private readonly static int FastEstimationMinBlockSizeDefaultValue = 100; + + private int fastEstimationMinBlockSize_; + /// + /// Minimum block size in pixels (larger dimension) to perform fast estimation + /// on. Pyramid levels are allocated such that + /// block_size * 0.5^(level - 1) = min_block_size. + /// At least two levels are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FastEstimationMinBlockSize { + get { if ((_hasBits0 & 16384) != 0) { return fastEstimationMinBlockSize_; } else { return FastEstimationMinBlockSizeDefaultValue; } } + set { + _hasBits0 |= 16384; + fastEstimationMinBlockSize_ = value; + } + } + /// Gets whether the "fast_estimation_min_block_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFastEstimationMinBlockSize { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "fast_estimation_min_block_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFastEstimationMinBlockSize() { + _hasBits0 &= ~16384; + } + + /// Field number for the "fast_estimation_overlap_grids" field. + public const int FastEstimationOverlapGridsFieldNumber = 22; + private readonly static int FastEstimationOverlapGridsDefaultValue = 3; + + private int fastEstimationOverlapGrids_; + /// + /// We use overlapping versions of the grid, next parameters specifies how + /// many in each dimensions (total is therefore, the value squared!). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FastEstimationOverlapGrids { + get { if ((_hasBits0 & 4096) != 0) { return fastEstimationOverlapGrids_; } else { return FastEstimationOverlapGridsDefaultValue; } } + set { + _hasBits0 |= 4096; + fastEstimationOverlapGrids_ = value; + } + } + /// Gets whether the "fast_estimation_overlap_grids" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFastEstimationOverlapGrids { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "fast_estimation_overlap_grids" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFastEstimationOverlapGrids() { + _hasBits0 &= ~4096; + } + + /// Field number for the "max_magnitude_threshold_ratio" field. + public const int MaxMagnitudeThresholdRatioFieldNumber = 23; + private readonly static float MaxMagnitudeThresholdRatioDefaultValue = 0.2F; + + private float maxMagnitudeThresholdRatio_; + /// + /// Flow features with motion above this thresholds (w.r.t. frame diameter) + /// are rejected. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxMagnitudeThresholdRatio { + get { if ((_hasBits0 & 8192) != 0) { return maxMagnitudeThresholdRatio_; } else { return MaxMagnitudeThresholdRatioDefaultValue; } } + set { + _hasBits0 |= 8192; + maxMagnitudeThresholdRatio_ = value; + } + } + /// Gets whether the "max_magnitude_threshold_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxMagnitudeThresholdRatio { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "max_magnitude_threshold_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxMagnitudeThresholdRatio() { + _hasBits0 &= ~8192; + } + + /// Field number for the "median_magnitude_bounds" field. + public const int MedianMagnitudeBoundsFieldNumber = 51; + private readonly static float MedianMagnitudeBoundsDefaultValue = 0F; + + private float medianMagnitudeBounds_; + /// + /// Flow features that have a motion that is larger than + /// median_magnitude_bounds times the median magnitude are discarded. + /// If set to zero, test is not enforced. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MedianMagnitudeBounds { + get { if ((_hasBits1 & 2) != 0) { return medianMagnitudeBounds_; } else { return MedianMagnitudeBoundsDefaultValue; } } + set { + _hasBits1 |= 2; + medianMagnitudeBounds_ = value; + } + } + /// Gets whether the "median_magnitude_bounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMedianMagnitudeBounds { + get { return (_hasBits1 & 2) != 0; } + } + /// Clears the value of the "median_magnitude_bounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMedianMagnitudeBounds() { + _hasBits1 &= ~2; + } + + /// Field number for the "irls_initialization" field. + public const int IrlsInitializationFieldNumber = 49; + private readonly static global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization IrlsInitializationDefaultValue = global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization.InitConsistency; + + private global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization irlsInitialization_; + /// + /// If this option is activated, feature's irls weight is initialized to the + /// inverse of its computed flow. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization IrlsInitialization { + get { if ((_hasBits0 & -2147483648) != 0) { return irlsInitialization_; } else { return IrlsInitializationDefaultValue; } } + set { + _hasBits0 |= -2147483648; + irlsInitialization_ = value; + } + } + /// Gets whether the "irls_initialization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsInitialization { + get { return (_hasBits0 & -2147483648) != 0; } + } + /// Clears the value of the "irls_initialization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsInitialization() { + _hasBits0 &= ~-2147483648; + } + + /// Field number for the "downsample_mode" field. + public const int DownsampleModeFieldNumber = 11; + private readonly static global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode DownsampleModeDefaultValue = global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode.DownsampleNone; + + private global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode downsampleMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode DownsampleMode { + get { if ((_hasBits0 & 16) != 0) { return downsampleMode_; } else { return DownsampleModeDefaultValue; } } + set { + _hasBits0 |= 16; + downsampleMode_ = value; + } + } + /// Gets whether the "downsample_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleMode { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "downsample_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleMode() { + _hasBits0 &= ~16; + } + + /// Field number for the "downsampling_size" field. + public const int DownsamplingSizeFieldNumber = 12; + private readonly static int DownsamplingSizeDefaultValue = 256; + + private int downsamplingSize_; + /// + /// Specify the size of either dimension here, the frame will be + /// downsampled to fit downsampling_size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DownsamplingSize { + get { if ((_hasBits0 & 32) != 0) { return downsamplingSize_; } else { return DownsamplingSizeDefaultValue; } } + set { + _hasBits0 |= 32; + downsamplingSize_ = value; + } + } + /// Gets whether the "downsampling_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsamplingSize { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "downsampling_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsamplingSize() { + _hasBits0 &= ~32; + } + + /// Field number for the "downsample_factor" field. + public const int DownsampleFactorFieldNumber = 18; + private readonly static float DownsampleFactorDefaultValue = 2F; + + private float downsampleFactor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor { + get { if ((_hasBits0 & 512) != 0) { return downsampleFactor_; } else { return DownsampleFactorDefaultValue; } } + set { + _hasBits0 |= 512; + downsampleFactor_ = value; + } + } + /// Gets whether the "downsample_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "downsample_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor() { + _hasBits0 &= ~512; + } + + /// Field number for the "round_downsample_factor" field. + public const int RoundDownsampleFactorFieldNumber = 62; + private readonly static bool RoundDownsampleFactorDefaultValue = false; + + private bool roundDownsampleFactor_; + /// + /// If set, we will force the computed downsampling factor to be the nearest + /// integer, resulting in faster downsampling. This will have no effect for + /// DOWNSAMPLE_TO_INPUT_SIZE, DOWNSAMPLE_BY_FACTOR, and DOWNSAMPLE_BY_SCHEDULE, + /// which should have exact values defined. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RoundDownsampleFactor { + get { if ((_hasBits1 & 2048) != 0) { return roundDownsampleFactor_; } else { return RoundDownsampleFactorDefaultValue; } } + set { + _hasBits1 |= 2048; + roundDownsampleFactor_ = value; + } + } + /// Gets whether the "round_downsample_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRoundDownsampleFactor { + get { return (_hasBits1 & 2048) != 0; } + } + /// Clears the value of the "round_downsample_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRoundDownsampleFactor() { + _hasBits1 &= ~2048; + } + + /// Field number for the "downsample_schedule" field. + public const int DownsampleScheduleFieldNumber = 19; + private global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule downsampleSchedule_; + /// + /// Used if downsample_mode is DOWNSAMPLE_BY_SCHEDULE. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule DownsampleSchedule { + get { return downsampleSchedule_; } + set { + downsampleSchedule_ = value; + } + } + + /// Field number for the "min_feature_requirement" field. + public const int MinFeatureRequirementFieldNumber = 13; + private readonly static int MinFeatureRequirementDefaultValue = 20; + + private int minFeatureRequirement_; + /// + /// Minimum number of good features that we require to be present. + /// Without good features, the estimated motion models will do more harm than + /// good, so it is better to use simply the identity transform for this frame, + /// and set the flag unstable_models to true in RegionFlow. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinFeatureRequirement { + get { if ((_hasBits0 & 64) != 0) { return minFeatureRequirement_; } else { return MinFeatureRequirementDefaultValue; } } + set { + _hasBits0 |= 64; + minFeatureRequirement_ = value; + } + } + /// Gets whether the "min_feature_requirement" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatureRequirement { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "min_feature_requirement" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatureRequirement() { + _hasBits0 &= ~64; + } + + /// Field number for the "min_feature_cover" field. + public const int MinFeatureCoverFieldNumber = 14; + private readonly static float MinFeatureCoverDefaultValue = 0.15F; + + private float minFeatureCover_; + /// + /// We also require features to cover a minimum percentage area of the frame. + /// We use downsampling and plot each feature by a 1 in a grid, this is + /// equivalent to plotting each feature by a rectangle in the original frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinFeatureCover { + get { if ((_hasBits0 & 128) != 0) { return minFeatureCover_; } else { return MinFeatureCoverDefaultValue; } } + set { + _hasBits0 |= 128; + minFeatureCover_ = value; + } + } + /// Gets whether the "min_feature_cover" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatureCover { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "min_feature_cover" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatureCover() { + _hasBits0 &= ~128; + } + + /// Field number for the "min_feature_cover_grid" field. + public const int MinFeatureCoverGridFieldNumber = 20; + private readonly static int MinFeatureCoverGridDefaultValue = 8; + + private int minFeatureCoverGrid_; + /// + /// Grid size for above min feature cover. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MinFeatureCoverGrid { + get { if ((_hasBits0 & 1024) != 0) { return minFeatureCoverGrid_; } else { return MinFeatureCoverGridDefaultValue; } } + set { + _hasBits0 |= 1024; + minFeatureCoverGrid_ = value; + } + } + /// Gets whether the "min_feature_cover_grid" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinFeatureCoverGrid { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "min_feature_cover_grid" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinFeatureCoverGrid() { + _hasBits0 &= ~1024; + } + + /// Field number for the "compute_blur_score" field. + public const int ComputeBlurScoreFieldNumber = 17; + private readonly static bool ComputeBlurScoreDefaultValue = false; + + private bool computeBlurScore_; + /// + /// Computes blur score for each frame. Score is proportional to amount of + /// blur present in a frame, i.e. higher scores reflect more blurred frames. + /// Note that the score is dependent on the gradient distribution of the image + /// content, i.e. the score itself is rather meaningless but needs to be + /// compared to scores of neighboring frames. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComputeBlurScore { + get { if ((_hasBits0 & 256) != 0) { return computeBlurScore_; } else { return ComputeBlurScoreDefaultValue; } } + set { + _hasBits0 |= 256; + computeBlurScore_ = value; + } + } + /// Gets whether the "compute_blur_score" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComputeBlurScore { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "compute_blur_score" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComputeBlurScore() { + _hasBits0 &= ~256; + } + + /// Field number for the "blur_score_options" field. + public const int BlurScoreOptionsFieldNumber = 31; + private global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions blurScoreOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions BlurScoreOptions { + get { return blurScoreOptions_; } + set { + blurScoreOptions_ = value; + } + } + + /// Field number for the "visual_consistency_options" field. + public const int VisualConsistencyOptionsFieldNumber = 55; + private global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions visualConsistencyOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions VisualConsistencyOptions { + get { return visualConsistencyOptions_; } + set { + visualConsistencyOptions_ = value; + } + } + + /// Field number for the "patch_descriptor_radius" field. + public const int PatchDescriptorRadiusFieldNumber = 21; + private readonly static int PatchDescriptorRadiusDefaultValue = 3; + + private int patchDescriptorRadius_; + /// + /// Radius of patch descriptor computed during RetrieveRegionFlowFeatureList + /// call. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PatchDescriptorRadius { + get { if ((_hasBits0 & 2048) != 0) { return patchDescriptorRadius_; } else { return PatchDescriptorRadiusDefaultValue; } } + set { + _hasBits0 |= 2048; + patchDescriptorRadius_ = value; + } + } + /// Gets whether the "patch_descriptor_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPatchDescriptorRadius { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "patch_descriptor_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPatchDescriptorRadius() { + _hasBits0 &= ~2048; + } + + /// Field number for the "distance_from_border" field. + public const int DistanceFromBorderFieldNumber = 50; + private readonly static int DistanceFromBorderDefaultValue = 3; + + private int distanceFromBorder_; + /// + /// Minimum distance from image border. Must be greater or equal to + /// patch_descriptor_radius. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DistanceFromBorder { + get { if ((_hasBits1 & 1) != 0) { return distanceFromBorder_; } else { return DistanceFromBorderDefaultValue; } } + set { + _hasBits1 |= 1; + distanceFromBorder_ = value; + } + } + /// Gets whether the "distance_from_border" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDistanceFromBorder { + get { return (_hasBits1 & 1) != 0; } + } + /// Clears the value of the "distance_from_border" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDistanceFromBorder() { + _hasBits1 &= ~1; + } + + /// Field number for the "corner_response_scale" field. + public const int CornerResponseScaleFieldNumber = 26; + private readonly static float CornerResponseScaleDefaultValue = 1500F; + + private float cornerResponseScale_; + /// + /// Corner response is scaled by scalar below and normalized to lie within + /// [0, 1], where 0 is low corner score and 1 high corner score. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CornerResponseScale { + get { if ((_hasBits0 & 32768) != 0) { return cornerResponseScale_; } else { return CornerResponseScaleDefaultValue; } } + set { + _hasBits0 |= 32768; + cornerResponseScale_ = value; + } + } + /// Gets whether the "corner_response_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCornerResponseScale { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "corner_response_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCornerResponseScale() { + _hasBits0 &= ~32768; + } + + /// Field number for the "verify_features" field. + public const int VerifyFeaturesFieldNumber = 27; + private readonly static bool VerifyFeaturesDefaultValue = false; + + private bool verifyFeatures_; + /// + /// Verifies reliablity of features, by back-tracking operation from matched + /// location. If returned location is within verification_distance feature is + /// accepted otherwise discarded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VerifyFeatures { + get { if ((_hasBits0 & 65536) != 0) { return verifyFeatures_; } else { return VerifyFeaturesDefaultValue; } } + set { + _hasBits0 |= 65536; + verifyFeatures_ = value; + } + } + /// Gets whether the "verify_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerifyFeatures { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "verify_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerifyFeatures() { + _hasBits0 &= ~65536; + } + + /// Field number for the "verification_distance" field. + public const int VerificationDistanceFieldNumber = 28; + private readonly static float VerificationDistanceDefaultValue = 0.5F; + + private float verificationDistance_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VerificationDistance { + get { if ((_hasBits0 & 131072) != 0) { return verificationDistance_; } else { return VerificationDistanceDefaultValue; } } + set { + _hasBits0 |= 131072; + verificationDistance_ = value; + } + } + /// Gets whether the "verification_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerificationDistance { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "verification_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerificationDistance() { + _hasBits0 &= ~131072; + } + + /// Field number for the "verify_long_features" field. + public const int VerifyLongFeaturesFieldNumber = 53; + private readonly static bool VerifyLongFeaturesDefaultValue = true; + + private bool verifyLongFeatures_; + /// + /// If set, consistency of long features is verified (in case tracking_policy + /// is set to POLICY_LONG_FEATURES) by extracting a patch + /// around the feature during the very first observation and comparing the + /// matching patching along the long feature trajectory via SSD. If the + /// difference is above the long_feature_verification_threshold the feature is + /// removed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VerifyLongFeatures { + get { if ((_hasBits1 & 8) != 0) { return verifyLongFeatures_; } else { return VerifyLongFeaturesDefaultValue; } } + set { + _hasBits1 |= 8; + verifyLongFeatures_ = value; + } + } + /// Gets whether the "verify_long_features" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerifyLongFeatures { + get { return (_hasBits1 & 8) != 0; } + } + /// Clears the value of the "verify_long_features" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerifyLongFeatures() { + _hasBits1 &= ~8; + } + + /// Field number for the "long_feature_verification_threshold" field. + public const int LongFeatureVerificationThresholdFieldNumber = 54; + private readonly static float LongFeatureVerificationThresholdDefaultValue = 0.04F; + + private float longFeatureVerificationThreshold_; + /// + /// Maximum average per pixel error (in L1 norm) in the normalized intensity + /// domain for matching patches to be considered to be consistent. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LongFeatureVerificationThreshold { + get { if ((_hasBits1 & 16) != 0) { return longFeatureVerificationThreshold_; } else { return LongFeatureVerificationThresholdDefaultValue; } } + set { + _hasBits1 |= 16; + longFeatureVerificationThreshold_ = value; + } + } + /// Gets whether the "long_feature_verification_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLongFeatureVerificationThreshold { + get { return (_hasBits1 & 16) != 0; } + } + /// Clears the value of the "long_feature_verification_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLongFeatureVerificationThreshold() { + _hasBits1 &= ~16; + } + + /// Field number for the "max_long_feature_acceleration" field. + public const int MaxLongFeatureAccelerationFieldNumber = 56; + private readonly static float MaxLongFeatureAccelerationDefaultValue = 5F; + + private float maxLongFeatureAcceleration_; + /// + /// Long features are expected to have limited acceleration over time. + /// If acceleration exceeds specified value based on the setting in + /// verify_long_feature_acceleration either: + /// a) verify_long_feature_acceleration = false + /// A new track is started instead of continuing the old one. + /// The track itself is not removed in this case. + /// + /// b) verify_long_feature_acceleration = true + /// The track is flagged for verification, by back-tracking operation from + /// matched location. If track fails verification test it is + /// discarded. This only triggers if at least + /// verify_long_feature_trigger_ratio of features have been flagged, + /// otherwise option a is used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxLongFeatureAcceleration { + get { if ((_hasBits1 & 32) != 0) { return maxLongFeatureAcceleration_; } else { return MaxLongFeatureAccelerationDefaultValue; } } + set { + _hasBits1 |= 32; + maxLongFeatureAcceleration_ = value; + } + } + /// Gets whether the "max_long_feature_acceleration" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxLongFeatureAcceleration { + get { return (_hasBits1 & 32) != 0; } + } + /// Clears the value of the "max_long_feature_acceleration" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxLongFeatureAcceleration() { + _hasBits1 &= ~32; + } + + /// Field number for the "verify_long_feature_acceleration" field. + public const int VerifyLongFeatureAccelerationFieldNumber = 63; + private readonly static bool VerifyLongFeatureAccelerationDefaultValue = false; + + private bool verifyLongFeatureAcceleration_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool VerifyLongFeatureAcceleration { + get { if ((_hasBits1 & 4096) != 0) { return verifyLongFeatureAcceleration_; } else { return VerifyLongFeatureAccelerationDefaultValue; } } + set { + _hasBits1 |= 4096; + verifyLongFeatureAcceleration_ = value; + } + } + /// Gets whether the "verify_long_feature_acceleration" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerifyLongFeatureAcceleration { + get { return (_hasBits1 & 4096) != 0; } + } + /// Clears the value of the "verify_long_feature_acceleration" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerifyLongFeatureAcceleration() { + _hasBits1 &= ~4096; + } + + /// Field number for the "verify_long_feature_trigger_ratio" field. + public const int VerifyLongFeatureTriggerRatioFieldNumber = 64; + private readonly static float VerifyLongFeatureTriggerRatioDefaultValue = 0F; + + private float verifyLongFeatureTriggerRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VerifyLongFeatureTriggerRatio { + get { if ((_hasBits1 & 8192) != 0) { return verifyLongFeatureTriggerRatio_; } else { return VerifyLongFeatureTriggerRatioDefaultValue; } } + set { + _hasBits1 |= 8192; + verifyLongFeatureTriggerRatio_ = value; + } + } + /// Gets whether the "verify_long_feature_trigger_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVerifyLongFeatureTriggerRatio { + get { return (_hasBits1 & 8192) != 0; } + } + /// Clears the value of the "verify_long_feature_trigger_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVerifyLongFeatureTriggerRatio() { + _hasBits1 &= ~8192; + } + + /// Field number for the "histogram_equalization" field. + public const int HistogramEqualizationFieldNumber = 57; + private readonly static bool HistogramEqualizationDefaultValue = false; + + private bool histogramEqualization_; + /// + /// If true, histogram equalization is performed to the input image sequence + /// before registration. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HistogramEqualization { + get { if ((_hasBits1 & 64) != 0) { return histogramEqualization_; } else { return HistogramEqualizationDefaultValue; } } + set { + _hasBits1 |= 64; + histogramEqualization_ = value; + } + } + /// Gets whether the "histogram_equalization" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHistogramEqualization { + get { return (_hasBits1 & 64) != 0; } + } + /// Clears the value of the "histogram_equalization" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHistogramEqualization() { + _hasBits1 &= ~64; + } + + /// Field number for the "use_synthetic_zero_motion_tracks_all_frames" field. + public const int UseSyntheticZeroMotionTracksAllFramesFieldNumber = 34; + private readonly static bool UseSyntheticZeroMotionTracksAllFramesDefaultValue = false; + + private bool useSyntheticZeroMotionTracksAllFrames_; + /// + /// If true, synthetic region flows with zero motion are used for all (or just + /// the first) frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseSyntheticZeroMotionTracksAllFrames { + get { if ((_hasBits0 & 524288) != 0) { return useSyntheticZeroMotionTracksAllFrames_; } else { return UseSyntheticZeroMotionTracksAllFramesDefaultValue; } } + set { + _hasBits0 |= 524288; + useSyntheticZeroMotionTracksAllFrames_ = value; + } + } + /// Gets whether the "use_synthetic_zero_motion_tracks_all_frames" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseSyntheticZeroMotionTracksAllFrames { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "use_synthetic_zero_motion_tracks_all_frames" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseSyntheticZeroMotionTracksAllFrames() { + _hasBits0 &= ~524288; + } + + /// Field number for the "use_synthetic_zero_motion_tracks_first_frame" field. + public const int UseSyntheticZeroMotionTracksFirstFrameFieldNumber = 35; + private readonly static bool UseSyntheticZeroMotionTracksFirstFrameDefaultValue = false; + + private bool useSyntheticZeroMotionTracksFirstFrame_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UseSyntheticZeroMotionTracksFirstFrame { + get { if ((_hasBits0 & 1048576) != 0) { return useSyntheticZeroMotionTracksFirstFrame_; } else { return UseSyntheticZeroMotionTracksFirstFrameDefaultValue; } } + set { + _hasBits0 |= 1048576; + useSyntheticZeroMotionTracksFirstFrame_ = value; + } + } + /// Gets whether the "use_synthetic_zero_motion_tracks_first_frame" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUseSyntheticZeroMotionTracksFirstFrame { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "use_synthetic_zero_motion_tracks_first_frame" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUseSyntheticZeroMotionTracksFirstFrame() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "gain_correction" field. + public const int GainCorrectionFieldNumber = 36; + private readonly static bool GainCorrectionDefaultValue = false; + + private bool gainCorrection_; + /// + /// Optional gain correction before tracking features. Improves robustness when + /// lighting is changing. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool GainCorrection { + get { if ((_hasBits0 & 2097152) != 0) { return gainCorrection_; } else { return GainCorrectionDefaultValue; } } + set { + _hasBits0 |= 2097152; + gainCorrection_ = value; + } + } + /// Gets whether the "gain_correction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrection { + get { return (_hasBits0 & 2097152) != 0; } + } + /// Clears the value of the "gain_correction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrection() { + _hasBits0 &= ~2097152; + } + + /// Field number for the "fast_gain_correction" field. + public const int FastGainCorrectionFieldNumber = 61; + private readonly static bool FastGainCorrectionDefaultValue = false; + + private bool fastGainCorrection_; + /// + /// If set performs gain correction by simply equalizing mean intensity + /// between frames, instead of using ToneEstimation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FastGainCorrection { + get { if ((_hasBits1 & 1024) != 0) { return fastGainCorrection_; } else { return FastGainCorrectionDefaultValue; } } + set { + _hasBits1 |= 1024; + fastGainCorrection_ = value; + } + } + /// Gets whether the "fast_gain_correction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFastGainCorrection { + get { return (_hasBits1 & 1024) != 0; } + } + /// Clears the value of the "fast_gain_correction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFastGainCorrection() { + _hasBits1 &= ~1024; + } + + /// Field number for the "gain_correction_multiple_hypotheses" field. + public const int GainCorrectionMultipleHypothesesFieldNumber = 47; + private readonly static bool GainCorrectionMultipleHypothesesDefaultValue = true; + + private bool gainCorrectionMultipleHypotheses_; + /// + /// If the multiple hypothesis flag is set, features are tracked using both + /// with and without gain correction, and the hypothesis with more inliers + /// is selected. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool GainCorrectionMultipleHypotheses { + get { if ((_hasBits0 & 536870912) != 0) { return gainCorrectionMultipleHypotheses_; } else { return GainCorrectionMultipleHypothesesDefaultValue; } } + set { + _hasBits0 |= 536870912; + gainCorrectionMultipleHypotheses_ = value; + } + } + /// Gets whether the "gain_correction_multiple_hypotheses" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrectionMultipleHypotheses { + get { return (_hasBits0 & 536870912) != 0; } + } + /// Clears the value of the "gain_correction_multiple_hypotheses" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrectionMultipleHypotheses() { + _hasBits0 &= ~536870912; + } + + /// Field number for the "gain_correction_inlier_improvement_frac" field. + public const int GainCorrectionInlierImprovementFracFieldNumber = 48; + private readonly static float GainCorrectionInlierImprovementFracDefaultValue = 0.1F; + + private float gainCorrectionInlierImprovementFrac_; + /// + /// This flag, when used together with the multiple hypotheses flag, specifies + /// that gain correction should increase the number of inliers by at least this + /// fraction for it to be used instead of default tracking. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GainCorrectionInlierImprovementFrac { + get { if ((_hasBits0 & 1073741824) != 0) { return gainCorrectionInlierImprovementFrac_; } else { return GainCorrectionInlierImprovementFracDefaultValue; } } + set { + _hasBits0 |= 1073741824; + gainCorrectionInlierImprovementFrac_ = value; + } + } + /// Gets whether the "gain_correction_inlier_improvement_frac" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrectionInlierImprovementFrac { + get { return (_hasBits0 & 1073741824) != 0; } + } + /// Clears the value of the "gain_correction_inlier_improvement_frac" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrectionInlierImprovementFrac() { + _hasBits0 &= ~1073741824; + } + + /// Field number for the "gain_correction_bright_reference" field. + public const int GainCorrectionBrightReferenceFieldNumber = 59; + private readonly static bool GainCorrectionBrightReferenceDefaultValue = false; + + private bool gainCorrectionBrightReference_; + /// + /// If set, always uses the brighter frame as reference. This is the + /// preferred direction of correction, to avoid overexposed regions from + /// being corrected which leads to spurious matches. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool GainCorrectionBrightReference { + get { if ((_hasBits1 & 256) != 0) { return gainCorrectionBrightReference_; } else { return GainCorrectionBrightReferenceDefaultValue; } } + set { + _hasBits1 |= 256; + gainCorrectionBrightReference_ = value; + } + } + /// Gets whether the "gain_correction_bright_reference" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrectionBrightReference { + get { return (_hasBits1 & 256) != 0; } + } + /// Clears the value of the "gain_correction_bright_reference" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrectionBrightReference() { + _hasBits1 &= ~256; + } + + /// Field number for the "gain_correction_triggering_ratio" field. + public const int GainCorrectionTriggeringRatioFieldNumber = 60; + private readonly static float GainCorrectionTriggeringRatioDefaultValue = 0F; + + private float gainCorrectionTriggeringRatio_; + /// + /// Only performs gain correction if number of tracked features falls under + /// specified ratio (w.r.t. previous frame). + /// Set to zero, to always perform gain correction if requested. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GainCorrectionTriggeringRatio { + get { if ((_hasBits1 & 512) != 0) { return gainCorrectionTriggeringRatio_; } else { return GainCorrectionTriggeringRatioDefaultValue; } } + set { + _hasBits1 |= 512; + gainCorrectionTriggeringRatio_ = value; + } + } + /// Gets whether the "gain_correction_triggering_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrectionTriggeringRatio { + get { return (_hasBits1 & 512) != 0; } + } + /// Clears the value of the "gain_correction_triggering_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrectionTriggeringRatio() { + _hasBits1 &= ~512; + } + + /// Field number for the "frac_gain_feature_size" field. + public const int FracGainFeatureSizeFieldNumber = 37; + private readonly static float FracGainFeatureSizeDefaultValue = 0.3F; + + private float fracGainFeatureSize_; + /// + /// Gain correction is based on a grid of zero motion features, independent of + /// the underlying motion. Fractional parameter specifies resolution of the + /// grid w.r.t. frame size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracGainFeatureSize { + get { if ((_hasBits0 & 4194304) != 0) { return fracGainFeatureSize_; } else { return FracGainFeatureSizeDefaultValue; } } + set { + _hasBits0 |= 4194304; + fracGainFeatureSize_ = value; + } + } + /// Gets whether the "frac_gain_feature_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracGainFeatureSize { + get { return (_hasBits0 & 4194304) != 0; } + } + /// Clears the value of the "frac_gain_feature_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracGainFeatureSize() { + _hasBits0 &= ~4194304; + } + + /// Field number for the "frac_gain_step" field. + public const int FracGainStepFieldNumber = 38; + private readonly static float FracGainStepDefaultValue = 0.1F; + + private float fracGainStep_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracGainStep { + get { if ((_hasBits0 & 8388608) != 0) { return fracGainStep_; } else { return FracGainStepDefaultValue; } } + set { + _hasBits0 |= 8388608; + fracGainStep_ = value; + } + } + /// Gets whether the "frac_gain_step" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracGainStep { + get { return (_hasBits0 & 8388608) != 0; } + } + /// Clears the value of the "frac_gain_step" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracGainStep() { + _hasBits0 &= ~8388608; + } + + /// Field number for the "gain_correct_mode" field. + public const int GainCorrectModeFieldNumber = 41; + private readonly static global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode GainCorrectModeDefaultValue = global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode.GainCorrectDefaultUser; + + private global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode gainCorrectMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode GainCorrectMode { + get { if ((_hasBits0 & 33554432) != 0) { return gainCorrectMode_; } else { return GainCorrectModeDefaultValue; } } + set { + _hasBits0 |= 33554432; + gainCorrectMode_ = value; + } + } + /// Gets whether the "gain_correct_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainCorrectMode { + get { return (_hasBits0 & 33554432) != 0; } + } + /// Clears the value of the "gain_correct_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainCorrectMode() { + _hasBits0 &= ~33554432; + } + + /// Field number for the "gain_bias_bounds" field. + public const int GainBiasBoundsFieldNumber = 39; + private global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds gainBiasBounds_; + /// + /// Bounds for the estimated model. If not set externally, will be set + /// based on GainCorrectMode. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds GainBiasBounds { + get { return gainBiasBounds_; } + set { + gainBiasBounds_ = value; + } + } + + /// Field number for the "image_format" field. + public const int ImageFormatFieldNumber = 58; + private readonly static global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat ImageFormatDefaultValue = global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat.FormatRgb; + + private global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat imageFormat_; + /// + /// Image format of the input. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat ImageFormat { + get { if ((_hasBits1 & 128) != 0) { return imageFormat_; } else { return ImageFormatDefaultValue; } } + set { + _hasBits1 |= 128; + imageFormat_ = value; + } + } + /// Gets whether the "image_format" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasImageFormat { + get { return (_hasBits1 & 128) != 0; } + } + /// Clears the value of the "image_format" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearImageFormat() { + _hasBits1 &= ~128; + } + + /// Field number for the "descriptor_extractor_type" field. + public const int DescriptorExtractorTypeFieldNumber = 65; + private readonly static global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType DescriptorExtractorTypeDefaultValue = global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType.Orb; + + private global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType descriptorExtractorType_; + /// + /// The descriptor extractor type used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType DescriptorExtractorType { + get { if ((_hasBits1 & 16384) != 0) { return descriptorExtractorType_; } else { return DescriptorExtractorTypeDefaultValue; } } + set { + _hasBits1 |= 16384; + descriptorExtractorType_ = value; + } + } + /// Gets whether the "descriptor_extractor_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDescriptorExtractorType { + get { return (_hasBits1 & 16384) != 0; } + } + /// Clears the value of the "descriptor_extractor_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDescriptorExtractorType() { + _hasBits1 &= ~16384; + } + + /// Field number for the "compute_derivative_in_pyramid" field. + public const int ComputeDerivativeInPyramidFieldNumber = 66; + private readonly static bool ComputeDerivativeInPyramidDefaultValue = true; + + private bool computeDerivativeInPyramid_; + /// + /// Whether to compute derivatives when building the pyramid. When set to + /// true, it's building a Laplacian pyramid. When set to false, it's building + /// a Gaussian pyramid. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComputeDerivativeInPyramid { + get { if ((_hasBits1 & 32768) != 0) { return computeDerivativeInPyramid_; } else { return ComputeDerivativeInPyramidDefaultValue; } } + set { + _hasBits1 |= 32768; + computeDerivativeInPyramid_ = value; + } + } + /// Gets whether the "compute_derivative_in_pyramid" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComputeDerivativeInPyramid { + get { return (_hasBits1 & 32768) != 0; } + } + /// Clears the value of the "compute_derivative_in_pyramid" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComputeDerivativeInPyramid() { + _hasBits1 &= ~32768; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RegionFlowComputationOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RegionFlowComputationOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TrackingOptions, other.TrackingOptions)) return false; + if (MinFeatureInliers != other.MinFeatureInliers) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RelativeMinFeatureInliers, other.RelativeMinFeatureInliers)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PreBlurSigma, other.PreBlurSigma)) return false; + if (RansacRoundsPerRegion != other.RansacRoundsPerRegion) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AbsoluteInlierErrorThreshold, other.AbsoluteInlierErrorThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracInlierErrorThreshold, other.FracInlierErrorThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RelativeInlierErrorThreshold, other.RelativeInlierErrorThreshold)) return false; + if (TopInlierSets != other.TopInlierSets) return false; + if (NoEstimationMode != other.NoEstimationMode) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FastEstimationBlockSize, other.FastEstimationBlockSize)) return false; + if (FastEstimationMinBlockSize != other.FastEstimationMinBlockSize) return false; + if (FastEstimationOverlapGrids != other.FastEstimationOverlapGrids) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxMagnitudeThresholdRatio, other.MaxMagnitudeThresholdRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MedianMagnitudeBounds, other.MedianMagnitudeBounds)) return false; + if (IrlsInitialization != other.IrlsInitialization) return false; + if (DownsampleMode != other.DownsampleMode) return false; + if (DownsamplingSize != other.DownsamplingSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor, other.DownsampleFactor)) return false; + if (RoundDownsampleFactor != other.RoundDownsampleFactor) return false; + if (!object.Equals(DownsampleSchedule, other.DownsampleSchedule)) return false; + if (MinFeatureRequirement != other.MinFeatureRequirement) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinFeatureCover, other.MinFeatureCover)) return false; + if (MinFeatureCoverGrid != other.MinFeatureCoverGrid) return false; + if (ComputeBlurScore != other.ComputeBlurScore) return false; + if (!object.Equals(BlurScoreOptions, other.BlurScoreOptions)) return false; + if (!object.Equals(VisualConsistencyOptions, other.VisualConsistencyOptions)) return false; + if (PatchDescriptorRadius != other.PatchDescriptorRadius) return false; + if (DistanceFromBorder != other.DistanceFromBorder) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CornerResponseScale, other.CornerResponseScale)) return false; + if (VerifyFeatures != other.VerifyFeatures) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VerificationDistance, other.VerificationDistance)) return false; + if (VerifyLongFeatures != other.VerifyLongFeatures) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LongFeatureVerificationThreshold, other.LongFeatureVerificationThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxLongFeatureAcceleration, other.MaxLongFeatureAcceleration)) return false; + if (VerifyLongFeatureAcceleration != other.VerifyLongFeatureAcceleration) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VerifyLongFeatureTriggerRatio, other.VerifyLongFeatureTriggerRatio)) return false; + if (HistogramEqualization != other.HistogramEqualization) return false; + if (UseSyntheticZeroMotionTracksAllFrames != other.UseSyntheticZeroMotionTracksAllFrames) return false; + if (UseSyntheticZeroMotionTracksFirstFrame != other.UseSyntheticZeroMotionTracksFirstFrame) return false; + if (GainCorrection != other.GainCorrection) return false; + if (FastGainCorrection != other.FastGainCorrection) return false; + if (GainCorrectionMultipleHypotheses != other.GainCorrectionMultipleHypotheses) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GainCorrectionInlierImprovementFrac, other.GainCorrectionInlierImprovementFrac)) return false; + if (GainCorrectionBrightReference != other.GainCorrectionBrightReference) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GainCorrectionTriggeringRatio, other.GainCorrectionTriggeringRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracGainFeatureSize, other.FracGainFeatureSize)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracGainStep, other.FracGainStep)) return false; + if (GainCorrectMode != other.GainCorrectMode) return false; + if (!object.Equals(GainBiasBounds, other.GainBiasBounds)) return false; + if (ImageFormat != other.ImageFormat) return false; + if (DescriptorExtractorType != other.DescriptorExtractorType) return false; + if (ComputeDerivativeInPyramid != other.ComputeDerivativeInPyramid) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (trackingOptions_ != null) hash ^= TrackingOptions.GetHashCode(); + if (HasMinFeatureInliers) hash ^= MinFeatureInliers.GetHashCode(); + if (HasRelativeMinFeatureInliers) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RelativeMinFeatureInliers); + if (HasPreBlurSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PreBlurSigma); + if (HasRansacRoundsPerRegion) hash ^= RansacRoundsPerRegion.GetHashCode(); + if (HasAbsoluteInlierErrorThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AbsoluteInlierErrorThreshold); + if (HasFracInlierErrorThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracInlierErrorThreshold); + if (HasRelativeInlierErrorThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RelativeInlierErrorThreshold); + if (HasTopInlierSets) hash ^= TopInlierSets.GetHashCode(); + if (HasNoEstimationMode) hash ^= NoEstimationMode.GetHashCode(); + if (HasFastEstimationBlockSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FastEstimationBlockSize); + if (HasFastEstimationMinBlockSize) hash ^= FastEstimationMinBlockSize.GetHashCode(); + if (HasFastEstimationOverlapGrids) hash ^= FastEstimationOverlapGrids.GetHashCode(); + if (HasMaxMagnitudeThresholdRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxMagnitudeThresholdRatio); + if (HasMedianMagnitudeBounds) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MedianMagnitudeBounds); + if (HasIrlsInitialization) hash ^= IrlsInitialization.GetHashCode(); + if (HasDownsampleMode) hash ^= DownsampleMode.GetHashCode(); + if (HasDownsamplingSize) hash ^= DownsamplingSize.GetHashCode(); + if (HasDownsampleFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor); + if (HasRoundDownsampleFactor) hash ^= RoundDownsampleFactor.GetHashCode(); + if (downsampleSchedule_ != null) hash ^= DownsampleSchedule.GetHashCode(); + if (HasMinFeatureRequirement) hash ^= MinFeatureRequirement.GetHashCode(); + if (HasMinFeatureCover) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinFeatureCover); + if (HasMinFeatureCoverGrid) hash ^= MinFeatureCoverGrid.GetHashCode(); + if (HasComputeBlurScore) hash ^= ComputeBlurScore.GetHashCode(); + if (blurScoreOptions_ != null) hash ^= BlurScoreOptions.GetHashCode(); + if (visualConsistencyOptions_ != null) hash ^= VisualConsistencyOptions.GetHashCode(); + if (HasPatchDescriptorRadius) hash ^= PatchDescriptorRadius.GetHashCode(); + if (HasDistanceFromBorder) hash ^= DistanceFromBorder.GetHashCode(); + if (HasCornerResponseScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CornerResponseScale); + if (HasVerifyFeatures) hash ^= VerifyFeatures.GetHashCode(); + if (HasVerificationDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VerificationDistance); + if (HasVerifyLongFeatures) hash ^= VerifyLongFeatures.GetHashCode(); + if (HasLongFeatureVerificationThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LongFeatureVerificationThreshold); + if (HasMaxLongFeatureAcceleration) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxLongFeatureAcceleration); + if (HasVerifyLongFeatureAcceleration) hash ^= VerifyLongFeatureAcceleration.GetHashCode(); + if (HasVerifyLongFeatureTriggerRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VerifyLongFeatureTriggerRatio); + if (HasHistogramEqualization) hash ^= HistogramEqualization.GetHashCode(); + if (HasUseSyntheticZeroMotionTracksAllFrames) hash ^= UseSyntheticZeroMotionTracksAllFrames.GetHashCode(); + if (HasUseSyntheticZeroMotionTracksFirstFrame) hash ^= UseSyntheticZeroMotionTracksFirstFrame.GetHashCode(); + if (HasGainCorrection) hash ^= GainCorrection.GetHashCode(); + if (HasFastGainCorrection) hash ^= FastGainCorrection.GetHashCode(); + if (HasGainCorrectionMultipleHypotheses) hash ^= GainCorrectionMultipleHypotheses.GetHashCode(); + if (HasGainCorrectionInlierImprovementFrac) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GainCorrectionInlierImprovementFrac); + if (HasGainCorrectionBrightReference) hash ^= GainCorrectionBrightReference.GetHashCode(); + if (HasGainCorrectionTriggeringRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GainCorrectionTriggeringRatio); + if (HasFracGainFeatureSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracGainFeatureSize); + if (HasFracGainStep) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracGainStep); + if (HasGainCorrectMode) hash ^= GainCorrectMode.GetHashCode(); + if (gainBiasBounds_ != null) hash ^= GainBiasBounds.GetHashCode(); + if (HasImageFormat) hash ^= ImageFormat.GetHashCode(); + if (HasDescriptorExtractorType) hash ^= DescriptorExtractorType.GetHashCode(); + if (HasComputeDerivativeInPyramid) hash ^= ComputeDerivativeInPyramid.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (trackingOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackingOptions); + } + if (HasMinFeatureInliers) { + output.WriteRawTag(16); + output.WriteInt32(MinFeatureInliers); + } + if (HasRansacRoundsPerRegion) { + output.WriteRawTag(24); + output.WriteInt32(RansacRoundsPerRegion); + } + if (HasAbsoluteInlierErrorThreshold) { + output.WriteRawTag(37); + output.WriteFloat(AbsoluteInlierErrorThreshold); + } + if (HasFastEstimationBlockSize) { + output.WriteRawTag(53); + output.WriteFloat(FastEstimationBlockSize); + } + if (HasDownsampleMode) { + output.WriteRawTag(88); + output.WriteEnum((int) DownsampleMode); + } + if (HasDownsamplingSize) { + output.WriteRawTag(96); + output.WriteInt32(DownsamplingSize); + } + if (HasMinFeatureRequirement) { + output.WriteRawTag(104); + output.WriteInt32(MinFeatureRequirement); + } + if (HasMinFeatureCover) { + output.WriteRawTag(117); + output.WriteFloat(MinFeatureCover); + } + if (HasComputeBlurScore) { + output.WriteRawTag(136, 1); + output.WriteBool(ComputeBlurScore); + } + if (HasDownsampleFactor) { + output.WriteRawTag(149, 1); + output.WriteFloat(DownsampleFactor); + } + if (downsampleSchedule_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(DownsampleSchedule); + } + if (HasMinFeatureCoverGrid) { + output.WriteRawTag(160, 1); + output.WriteInt32(MinFeatureCoverGrid); + } + if (HasPatchDescriptorRadius) { + output.WriteRawTag(168, 1); + output.WriteInt32(PatchDescriptorRadius); + } + if (HasFastEstimationOverlapGrids) { + output.WriteRawTag(176, 1); + output.WriteInt32(FastEstimationOverlapGrids); + } + if (HasMaxMagnitudeThresholdRatio) { + output.WriteRawTag(189, 1); + output.WriteFloat(MaxMagnitudeThresholdRatio); + } + if (HasFastEstimationMinBlockSize) { + output.WriteRawTag(200, 1); + output.WriteInt32(FastEstimationMinBlockSize); + } + if (HasCornerResponseScale) { + output.WriteRawTag(213, 1); + output.WriteFloat(CornerResponseScale); + } + if (HasVerifyFeatures) { + output.WriteRawTag(216, 1); + output.WriteBool(VerifyFeatures); + } + if (HasVerificationDistance) { + output.WriteRawTag(229, 1); + output.WriteFloat(VerificationDistance); + } + if (blurScoreOptions_ != null) { + output.WriteRawTag(250, 1); + output.WriteMessage(BlurScoreOptions); + } + if (HasPreBlurSigma) { + output.WriteRawTag(141, 2); + output.WriteFloat(PreBlurSigma); + } + if (HasUseSyntheticZeroMotionTracksAllFrames) { + output.WriteRawTag(144, 2); + output.WriteBool(UseSyntheticZeroMotionTracksAllFrames); + } + if (HasUseSyntheticZeroMotionTracksFirstFrame) { + output.WriteRawTag(152, 2); + output.WriteBool(UseSyntheticZeroMotionTracksFirstFrame); + } + if (HasGainCorrection) { + output.WriteRawTag(160, 2); + output.WriteBool(GainCorrection); + } + if (HasFracGainFeatureSize) { + output.WriteRawTag(173, 2); + output.WriteFloat(FracGainFeatureSize); + } + if (HasFracGainStep) { + output.WriteRawTag(181, 2); + output.WriteFloat(FracGainStep); + } + if (gainBiasBounds_ != null) { + output.WriteRawTag(186, 2); + output.WriteMessage(GainBiasBounds); + } + if (HasNoEstimationMode) { + output.WriteRawTag(192, 2); + output.WriteBool(NoEstimationMode); + } + if (HasGainCorrectMode) { + output.WriteRawTag(200, 2); + output.WriteEnum((int) GainCorrectMode); + } + if (HasRelativeInlierErrorThreshold) { + output.WriteRawTag(229, 2); + output.WriteFloat(RelativeInlierErrorThreshold); + } + if (HasTopInlierSets) { + output.WriteRawTag(232, 2); + output.WriteInt32(TopInlierSets); + } + if (HasRelativeMinFeatureInliers) { + output.WriteRawTag(245, 2); + output.WriteFloat(RelativeMinFeatureInliers); + } + if (HasGainCorrectionMultipleHypotheses) { + output.WriteRawTag(248, 2); + output.WriteBool(GainCorrectionMultipleHypotheses); + } + if (HasGainCorrectionInlierImprovementFrac) { + output.WriteRawTag(133, 3); + output.WriteFloat(GainCorrectionInlierImprovementFrac); + } + if (HasIrlsInitialization) { + output.WriteRawTag(136, 3); + output.WriteEnum((int) IrlsInitialization); + } + if (HasDistanceFromBorder) { + output.WriteRawTag(144, 3); + output.WriteInt32(DistanceFromBorder); + } + if (HasMedianMagnitudeBounds) { + output.WriteRawTag(157, 3); + output.WriteFloat(MedianMagnitudeBounds); + } + if (HasFracInlierErrorThreshold) { + output.WriteRawTag(165, 3); + output.WriteFloat(FracInlierErrorThreshold); + } + if (HasVerifyLongFeatures) { + output.WriteRawTag(168, 3); + output.WriteBool(VerifyLongFeatures); + } + if (HasLongFeatureVerificationThreshold) { + output.WriteRawTag(181, 3); + output.WriteFloat(LongFeatureVerificationThreshold); + } + if (visualConsistencyOptions_ != null) { + output.WriteRawTag(186, 3); + output.WriteMessage(VisualConsistencyOptions); + } + if (HasMaxLongFeatureAcceleration) { + output.WriteRawTag(197, 3); + output.WriteFloat(MaxLongFeatureAcceleration); + } + if (HasHistogramEqualization) { + output.WriteRawTag(200, 3); + output.WriteBool(HistogramEqualization); + } + if (HasImageFormat) { + output.WriteRawTag(208, 3); + output.WriteEnum((int) ImageFormat); + } + if (HasGainCorrectionBrightReference) { + output.WriteRawTag(216, 3); + output.WriteBool(GainCorrectionBrightReference); + } + if (HasGainCorrectionTriggeringRatio) { + output.WriteRawTag(229, 3); + output.WriteFloat(GainCorrectionTriggeringRatio); + } + if (HasFastGainCorrection) { + output.WriteRawTag(232, 3); + output.WriteBool(FastGainCorrection); + } + if (HasRoundDownsampleFactor) { + output.WriteRawTag(240, 3); + output.WriteBool(RoundDownsampleFactor); + } + if (HasVerifyLongFeatureAcceleration) { + output.WriteRawTag(248, 3); + output.WriteBool(VerifyLongFeatureAcceleration); + } + if (HasVerifyLongFeatureTriggerRatio) { + output.WriteRawTag(133, 4); + output.WriteFloat(VerifyLongFeatureTriggerRatio); + } + if (HasDescriptorExtractorType) { + output.WriteRawTag(136, 4); + output.WriteEnum((int) DescriptorExtractorType); + } + if (HasComputeDerivativeInPyramid) { + output.WriteRawTag(144, 4); + output.WriteBool(ComputeDerivativeInPyramid); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (trackingOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TrackingOptions); + } + if (HasMinFeatureInliers) { + output.WriteRawTag(16); + output.WriteInt32(MinFeatureInliers); + } + if (HasRansacRoundsPerRegion) { + output.WriteRawTag(24); + output.WriteInt32(RansacRoundsPerRegion); + } + if (HasAbsoluteInlierErrorThreshold) { + output.WriteRawTag(37); + output.WriteFloat(AbsoluteInlierErrorThreshold); + } + if (HasFastEstimationBlockSize) { + output.WriteRawTag(53); + output.WriteFloat(FastEstimationBlockSize); + } + if (HasDownsampleMode) { + output.WriteRawTag(88); + output.WriteEnum((int) DownsampleMode); + } + if (HasDownsamplingSize) { + output.WriteRawTag(96); + output.WriteInt32(DownsamplingSize); + } + if (HasMinFeatureRequirement) { + output.WriteRawTag(104); + output.WriteInt32(MinFeatureRequirement); + } + if (HasMinFeatureCover) { + output.WriteRawTag(117); + output.WriteFloat(MinFeatureCover); + } + if (HasComputeBlurScore) { + output.WriteRawTag(136, 1); + output.WriteBool(ComputeBlurScore); + } + if (HasDownsampleFactor) { + output.WriteRawTag(149, 1); + output.WriteFloat(DownsampleFactor); + } + if (downsampleSchedule_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(DownsampleSchedule); + } + if (HasMinFeatureCoverGrid) { + output.WriteRawTag(160, 1); + output.WriteInt32(MinFeatureCoverGrid); + } + if (HasPatchDescriptorRadius) { + output.WriteRawTag(168, 1); + output.WriteInt32(PatchDescriptorRadius); + } + if (HasFastEstimationOverlapGrids) { + output.WriteRawTag(176, 1); + output.WriteInt32(FastEstimationOverlapGrids); + } + if (HasMaxMagnitudeThresholdRatio) { + output.WriteRawTag(189, 1); + output.WriteFloat(MaxMagnitudeThresholdRatio); + } + if (HasFastEstimationMinBlockSize) { + output.WriteRawTag(200, 1); + output.WriteInt32(FastEstimationMinBlockSize); + } + if (HasCornerResponseScale) { + output.WriteRawTag(213, 1); + output.WriteFloat(CornerResponseScale); + } + if (HasVerifyFeatures) { + output.WriteRawTag(216, 1); + output.WriteBool(VerifyFeatures); + } + if (HasVerificationDistance) { + output.WriteRawTag(229, 1); + output.WriteFloat(VerificationDistance); + } + if (blurScoreOptions_ != null) { + output.WriteRawTag(250, 1); + output.WriteMessage(BlurScoreOptions); + } + if (HasPreBlurSigma) { + output.WriteRawTag(141, 2); + output.WriteFloat(PreBlurSigma); + } + if (HasUseSyntheticZeroMotionTracksAllFrames) { + output.WriteRawTag(144, 2); + output.WriteBool(UseSyntheticZeroMotionTracksAllFrames); + } + if (HasUseSyntheticZeroMotionTracksFirstFrame) { + output.WriteRawTag(152, 2); + output.WriteBool(UseSyntheticZeroMotionTracksFirstFrame); + } + if (HasGainCorrection) { + output.WriteRawTag(160, 2); + output.WriteBool(GainCorrection); + } + if (HasFracGainFeatureSize) { + output.WriteRawTag(173, 2); + output.WriteFloat(FracGainFeatureSize); + } + if (HasFracGainStep) { + output.WriteRawTag(181, 2); + output.WriteFloat(FracGainStep); + } + if (gainBiasBounds_ != null) { + output.WriteRawTag(186, 2); + output.WriteMessage(GainBiasBounds); + } + if (HasNoEstimationMode) { + output.WriteRawTag(192, 2); + output.WriteBool(NoEstimationMode); + } + if (HasGainCorrectMode) { + output.WriteRawTag(200, 2); + output.WriteEnum((int) GainCorrectMode); + } + if (HasRelativeInlierErrorThreshold) { + output.WriteRawTag(229, 2); + output.WriteFloat(RelativeInlierErrorThreshold); + } + if (HasTopInlierSets) { + output.WriteRawTag(232, 2); + output.WriteInt32(TopInlierSets); + } + if (HasRelativeMinFeatureInliers) { + output.WriteRawTag(245, 2); + output.WriteFloat(RelativeMinFeatureInliers); + } + if (HasGainCorrectionMultipleHypotheses) { + output.WriteRawTag(248, 2); + output.WriteBool(GainCorrectionMultipleHypotheses); + } + if (HasGainCorrectionInlierImprovementFrac) { + output.WriteRawTag(133, 3); + output.WriteFloat(GainCorrectionInlierImprovementFrac); + } + if (HasIrlsInitialization) { + output.WriteRawTag(136, 3); + output.WriteEnum((int) IrlsInitialization); + } + if (HasDistanceFromBorder) { + output.WriteRawTag(144, 3); + output.WriteInt32(DistanceFromBorder); + } + if (HasMedianMagnitudeBounds) { + output.WriteRawTag(157, 3); + output.WriteFloat(MedianMagnitudeBounds); + } + if (HasFracInlierErrorThreshold) { + output.WriteRawTag(165, 3); + output.WriteFloat(FracInlierErrorThreshold); + } + if (HasVerifyLongFeatures) { + output.WriteRawTag(168, 3); + output.WriteBool(VerifyLongFeatures); + } + if (HasLongFeatureVerificationThreshold) { + output.WriteRawTag(181, 3); + output.WriteFloat(LongFeatureVerificationThreshold); + } + if (visualConsistencyOptions_ != null) { + output.WriteRawTag(186, 3); + output.WriteMessage(VisualConsistencyOptions); + } + if (HasMaxLongFeatureAcceleration) { + output.WriteRawTag(197, 3); + output.WriteFloat(MaxLongFeatureAcceleration); + } + if (HasHistogramEqualization) { + output.WriteRawTag(200, 3); + output.WriteBool(HistogramEqualization); + } + if (HasImageFormat) { + output.WriteRawTag(208, 3); + output.WriteEnum((int) ImageFormat); + } + if (HasGainCorrectionBrightReference) { + output.WriteRawTag(216, 3); + output.WriteBool(GainCorrectionBrightReference); + } + if (HasGainCorrectionTriggeringRatio) { + output.WriteRawTag(229, 3); + output.WriteFloat(GainCorrectionTriggeringRatio); + } + if (HasFastGainCorrection) { + output.WriteRawTag(232, 3); + output.WriteBool(FastGainCorrection); + } + if (HasRoundDownsampleFactor) { + output.WriteRawTag(240, 3); + output.WriteBool(RoundDownsampleFactor); + } + if (HasVerifyLongFeatureAcceleration) { + output.WriteRawTag(248, 3); + output.WriteBool(VerifyLongFeatureAcceleration); + } + if (HasVerifyLongFeatureTriggerRatio) { + output.WriteRawTag(133, 4); + output.WriteFloat(VerifyLongFeatureTriggerRatio); + } + if (HasDescriptorExtractorType) { + output.WriteRawTag(136, 4); + output.WriteEnum((int) DescriptorExtractorType); + } + if (HasComputeDerivativeInPyramid) { + output.WriteRawTag(144, 4); + output.WriteBool(ComputeDerivativeInPyramid); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (trackingOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrackingOptions); + } + if (HasMinFeatureInliers) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinFeatureInliers); + } + if (HasRelativeMinFeatureInliers) { + size += 2 + 4; + } + if (HasPreBlurSigma) { + size += 2 + 4; + } + if (HasRansacRoundsPerRegion) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RansacRoundsPerRegion); + } + if (HasAbsoluteInlierErrorThreshold) { + size += 1 + 4; + } + if (HasFracInlierErrorThreshold) { + size += 2 + 4; + } + if (HasRelativeInlierErrorThreshold) { + size += 2 + 4; + } + if (HasTopInlierSets) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(TopInlierSets); + } + if (HasNoEstimationMode) { + size += 2 + 1; + } + if (HasFastEstimationBlockSize) { + size += 1 + 4; + } + if (HasFastEstimationMinBlockSize) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FastEstimationMinBlockSize); + } + if (HasFastEstimationOverlapGrids) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FastEstimationOverlapGrids); + } + if (HasMaxMagnitudeThresholdRatio) { + size += 2 + 4; + } + if (HasMedianMagnitudeBounds) { + size += 2 + 4; + } + if (HasIrlsInitialization) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) IrlsInitialization); + } + if (HasDownsampleMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DownsampleMode); + } + if (HasDownsamplingSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DownsamplingSize); + } + if (HasDownsampleFactor) { + size += 2 + 4; + } + if (HasRoundDownsampleFactor) { + size += 2 + 1; + } + if (downsampleSchedule_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(DownsampleSchedule); + } + if (HasMinFeatureRequirement) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinFeatureRequirement); + } + if (HasMinFeatureCover) { + size += 1 + 4; + } + if (HasMinFeatureCoverGrid) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MinFeatureCoverGrid); + } + if (HasComputeBlurScore) { + size += 2 + 1; + } + if (blurScoreOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(BlurScoreOptions); + } + if (visualConsistencyOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(VisualConsistencyOptions); + } + if (HasPatchDescriptorRadius) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(PatchDescriptorRadius); + } + if (HasDistanceFromBorder) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(DistanceFromBorder); + } + if (HasCornerResponseScale) { + size += 2 + 4; + } + if (HasVerifyFeatures) { + size += 2 + 1; + } + if (HasVerificationDistance) { + size += 2 + 4; + } + if (HasVerifyLongFeatures) { + size += 2 + 1; + } + if (HasLongFeatureVerificationThreshold) { + size += 2 + 4; + } + if (HasMaxLongFeatureAcceleration) { + size += 2 + 4; + } + if (HasVerifyLongFeatureAcceleration) { + size += 2 + 1; + } + if (HasVerifyLongFeatureTriggerRatio) { + size += 2 + 4; + } + if (HasHistogramEqualization) { + size += 2 + 1; + } + if (HasUseSyntheticZeroMotionTracksAllFrames) { + size += 2 + 1; + } + if (HasUseSyntheticZeroMotionTracksFirstFrame) { + size += 2 + 1; + } + if (HasGainCorrection) { + size += 2 + 1; + } + if (HasFastGainCorrection) { + size += 2 + 1; + } + if (HasGainCorrectionMultipleHypotheses) { + size += 2 + 1; + } + if (HasGainCorrectionInlierImprovementFrac) { + size += 2 + 4; + } + if (HasGainCorrectionBrightReference) { + size += 2 + 1; + } + if (HasGainCorrectionTriggeringRatio) { + size += 2 + 4; + } + if (HasFracGainFeatureSize) { + size += 2 + 4; + } + if (HasFracGainStep) { + size += 2 + 4; + } + if (HasGainCorrectMode) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) GainCorrectMode); + } + if (gainBiasBounds_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(GainBiasBounds); + } + if (HasImageFormat) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ImageFormat); + } + if (HasDescriptorExtractorType) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) DescriptorExtractorType); + } + if (HasComputeDerivativeInPyramid) { + size += 2 + 1; + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RegionFlowComputationOptions other) { + if (other == null) { + return; + } + if (other.trackingOptions_ != null) { + if (trackingOptions_ == null) { + TrackingOptions = new global::Mediapipe.TrackingOptions(); + } + TrackingOptions.MergeFrom(other.TrackingOptions); + } + if (other.HasMinFeatureInliers) { + MinFeatureInliers = other.MinFeatureInliers; + } + if (other.HasRelativeMinFeatureInliers) { + RelativeMinFeatureInliers = other.RelativeMinFeatureInliers; + } + if (other.HasPreBlurSigma) { + PreBlurSigma = other.PreBlurSigma; + } + if (other.HasRansacRoundsPerRegion) { + RansacRoundsPerRegion = other.RansacRoundsPerRegion; + } + if (other.HasAbsoluteInlierErrorThreshold) { + AbsoluteInlierErrorThreshold = other.AbsoluteInlierErrorThreshold; + } + if (other.HasFracInlierErrorThreshold) { + FracInlierErrorThreshold = other.FracInlierErrorThreshold; + } + if (other.HasRelativeInlierErrorThreshold) { + RelativeInlierErrorThreshold = other.RelativeInlierErrorThreshold; + } + if (other.HasTopInlierSets) { + TopInlierSets = other.TopInlierSets; + } + if (other.HasNoEstimationMode) { + NoEstimationMode = other.NoEstimationMode; + } + if (other.HasFastEstimationBlockSize) { + FastEstimationBlockSize = other.FastEstimationBlockSize; + } + if (other.HasFastEstimationMinBlockSize) { + FastEstimationMinBlockSize = other.FastEstimationMinBlockSize; + } + if (other.HasFastEstimationOverlapGrids) { + FastEstimationOverlapGrids = other.FastEstimationOverlapGrids; + } + if (other.HasMaxMagnitudeThresholdRatio) { + MaxMagnitudeThresholdRatio = other.MaxMagnitudeThresholdRatio; + } + if (other.HasMedianMagnitudeBounds) { + MedianMagnitudeBounds = other.MedianMagnitudeBounds; + } + if (other.HasIrlsInitialization) { + IrlsInitialization = other.IrlsInitialization; + } + if (other.HasDownsampleMode) { + DownsampleMode = other.DownsampleMode; + } + if (other.HasDownsamplingSize) { + DownsamplingSize = other.DownsamplingSize; + } + if (other.HasDownsampleFactor) { + DownsampleFactor = other.DownsampleFactor; + } + if (other.HasRoundDownsampleFactor) { + RoundDownsampleFactor = other.RoundDownsampleFactor; + } + if (other.downsampleSchedule_ != null) { + if (downsampleSchedule_ == null) { + DownsampleSchedule = new global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule(); + } + DownsampleSchedule.MergeFrom(other.DownsampleSchedule); + } + if (other.HasMinFeatureRequirement) { + MinFeatureRequirement = other.MinFeatureRequirement; + } + if (other.HasMinFeatureCover) { + MinFeatureCover = other.MinFeatureCover; + } + if (other.HasMinFeatureCoverGrid) { + MinFeatureCoverGrid = other.MinFeatureCoverGrid; + } + if (other.HasComputeBlurScore) { + ComputeBlurScore = other.ComputeBlurScore; + } + if (other.blurScoreOptions_ != null) { + if (blurScoreOptions_ == null) { + BlurScoreOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions(); + } + BlurScoreOptions.MergeFrom(other.BlurScoreOptions); + } + if (other.visualConsistencyOptions_ != null) { + if (visualConsistencyOptions_ == null) { + VisualConsistencyOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions(); + } + VisualConsistencyOptions.MergeFrom(other.VisualConsistencyOptions); + } + if (other.HasPatchDescriptorRadius) { + PatchDescriptorRadius = other.PatchDescriptorRadius; + } + if (other.HasDistanceFromBorder) { + DistanceFromBorder = other.DistanceFromBorder; + } + if (other.HasCornerResponseScale) { + CornerResponseScale = other.CornerResponseScale; + } + if (other.HasVerifyFeatures) { + VerifyFeatures = other.VerifyFeatures; + } + if (other.HasVerificationDistance) { + VerificationDistance = other.VerificationDistance; + } + if (other.HasVerifyLongFeatures) { + VerifyLongFeatures = other.VerifyLongFeatures; + } + if (other.HasLongFeatureVerificationThreshold) { + LongFeatureVerificationThreshold = other.LongFeatureVerificationThreshold; + } + if (other.HasMaxLongFeatureAcceleration) { + MaxLongFeatureAcceleration = other.MaxLongFeatureAcceleration; + } + if (other.HasVerifyLongFeatureAcceleration) { + VerifyLongFeatureAcceleration = other.VerifyLongFeatureAcceleration; + } + if (other.HasVerifyLongFeatureTriggerRatio) { + VerifyLongFeatureTriggerRatio = other.VerifyLongFeatureTriggerRatio; + } + if (other.HasHistogramEqualization) { + HistogramEqualization = other.HistogramEqualization; + } + if (other.HasUseSyntheticZeroMotionTracksAllFrames) { + UseSyntheticZeroMotionTracksAllFrames = other.UseSyntheticZeroMotionTracksAllFrames; + } + if (other.HasUseSyntheticZeroMotionTracksFirstFrame) { + UseSyntheticZeroMotionTracksFirstFrame = other.UseSyntheticZeroMotionTracksFirstFrame; + } + if (other.HasGainCorrection) { + GainCorrection = other.GainCorrection; + } + if (other.HasFastGainCorrection) { + FastGainCorrection = other.FastGainCorrection; + } + if (other.HasGainCorrectionMultipleHypotheses) { + GainCorrectionMultipleHypotheses = other.GainCorrectionMultipleHypotheses; + } + if (other.HasGainCorrectionInlierImprovementFrac) { + GainCorrectionInlierImprovementFrac = other.GainCorrectionInlierImprovementFrac; + } + if (other.HasGainCorrectionBrightReference) { + GainCorrectionBrightReference = other.GainCorrectionBrightReference; + } + if (other.HasGainCorrectionTriggeringRatio) { + GainCorrectionTriggeringRatio = other.GainCorrectionTriggeringRatio; + } + if (other.HasFracGainFeatureSize) { + FracGainFeatureSize = other.FracGainFeatureSize; + } + if (other.HasFracGainStep) { + FracGainStep = other.FracGainStep; + } + if (other.HasGainCorrectMode) { + GainCorrectMode = other.GainCorrectMode; + } + if (other.gainBiasBounds_ != null) { + if (gainBiasBounds_ == null) { + GainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + GainBiasBounds.MergeFrom(other.GainBiasBounds); + } + if (other.HasImageFormat) { + ImageFormat = other.ImageFormat; + } + if (other.HasDescriptorExtractorType) { + DescriptorExtractorType = other.DescriptorExtractorType; + } + if (other.HasComputeDerivativeInPyramid) { + ComputeDerivativeInPyramid = other.ComputeDerivativeInPyramid; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + if (trackingOptions_ == null) { + TrackingOptions = new global::Mediapipe.TrackingOptions(); + } + input.ReadMessage(TrackingOptions); + break; + } + case 16: { + MinFeatureInliers = input.ReadInt32(); + break; + } + case 24: { + RansacRoundsPerRegion = input.ReadInt32(); + break; + } + case 37: { + AbsoluteInlierErrorThreshold = input.ReadFloat(); + break; + } + case 53: { + FastEstimationBlockSize = input.ReadFloat(); + break; + } + case 88: { + DownsampleMode = (global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode) input.ReadEnum(); + break; + } + case 96: { + DownsamplingSize = input.ReadInt32(); + break; + } + case 104: { + MinFeatureRequirement = input.ReadInt32(); + break; + } + case 117: { + MinFeatureCover = input.ReadFloat(); + break; + } + case 136: { + ComputeBlurScore = input.ReadBool(); + break; + } + case 149: { + DownsampleFactor = input.ReadFloat(); + break; + } + case 154: { + if (downsampleSchedule_ == null) { + DownsampleSchedule = new global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule(); + } + input.ReadMessage(DownsampleSchedule); + break; + } + case 160: { + MinFeatureCoverGrid = input.ReadInt32(); + break; + } + case 168: { + PatchDescriptorRadius = input.ReadInt32(); + break; + } + case 176: { + FastEstimationOverlapGrids = input.ReadInt32(); + break; + } + case 189: { + MaxMagnitudeThresholdRatio = input.ReadFloat(); + break; + } + case 200: { + FastEstimationMinBlockSize = input.ReadInt32(); + break; + } + case 213: { + CornerResponseScale = input.ReadFloat(); + break; + } + case 216: { + VerifyFeatures = input.ReadBool(); + break; + } + case 229: { + VerificationDistance = input.ReadFloat(); + break; + } + case 250: { + if (blurScoreOptions_ == null) { + BlurScoreOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions(); + } + input.ReadMessage(BlurScoreOptions); + break; + } + case 269: { + PreBlurSigma = input.ReadFloat(); + break; + } + case 272: { + UseSyntheticZeroMotionTracksAllFrames = input.ReadBool(); + break; + } + case 280: { + UseSyntheticZeroMotionTracksFirstFrame = input.ReadBool(); + break; + } + case 288: { + GainCorrection = input.ReadBool(); + break; + } + case 301: { + FracGainFeatureSize = input.ReadFloat(); + break; + } + case 309: { + FracGainStep = input.ReadFloat(); + break; + } + case 314: { + if (gainBiasBounds_ == null) { + GainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + input.ReadMessage(GainBiasBounds); + break; + } + case 320: { + NoEstimationMode = input.ReadBool(); + break; + } + case 328: { + GainCorrectMode = (global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode) input.ReadEnum(); + break; + } + case 357: { + RelativeInlierErrorThreshold = input.ReadFloat(); + break; + } + case 360: { + TopInlierSets = input.ReadInt32(); + break; + } + case 373: { + RelativeMinFeatureInliers = input.ReadFloat(); + break; + } + case 376: { + GainCorrectionMultipleHypotheses = input.ReadBool(); + break; + } + case 389: { + GainCorrectionInlierImprovementFrac = input.ReadFloat(); + break; + } + case 392: { + IrlsInitialization = (global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization) input.ReadEnum(); + break; + } + case 400: { + DistanceFromBorder = input.ReadInt32(); + break; + } + case 413: { + MedianMagnitudeBounds = input.ReadFloat(); + break; + } + case 421: { + FracInlierErrorThreshold = input.ReadFloat(); + break; + } + case 424: { + VerifyLongFeatures = input.ReadBool(); + break; + } + case 437: { + LongFeatureVerificationThreshold = input.ReadFloat(); + break; + } + case 442: { + if (visualConsistencyOptions_ == null) { + VisualConsistencyOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions(); + } + input.ReadMessage(VisualConsistencyOptions); + break; + } + case 453: { + MaxLongFeatureAcceleration = input.ReadFloat(); + break; + } + case 456: { + HistogramEqualization = input.ReadBool(); + break; + } + case 464: { + ImageFormat = (global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat) input.ReadEnum(); + break; + } + case 472: { + GainCorrectionBrightReference = input.ReadBool(); + break; + } + case 485: { + GainCorrectionTriggeringRatio = input.ReadFloat(); + break; + } + case 488: { + FastGainCorrection = input.ReadBool(); + break; + } + case 496: { + RoundDownsampleFactor = input.ReadBool(); + break; + } + case 504: { + VerifyLongFeatureAcceleration = input.ReadBool(); + break; + } + case 517: { + VerifyLongFeatureTriggerRatio = input.ReadFloat(); + break; + } + case 520: { + DescriptorExtractorType = (global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType) input.ReadEnum(); + break; + } + case 528: { + ComputeDerivativeInPyramid = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 10: { + if (trackingOptions_ == null) { + TrackingOptions = new global::Mediapipe.TrackingOptions(); + } + input.ReadMessage(TrackingOptions); + break; + } + case 16: { + MinFeatureInliers = input.ReadInt32(); + break; + } + case 24: { + RansacRoundsPerRegion = input.ReadInt32(); + break; + } + case 37: { + AbsoluteInlierErrorThreshold = input.ReadFloat(); + break; + } + case 53: { + FastEstimationBlockSize = input.ReadFloat(); + break; + } + case 88: { + DownsampleMode = (global::Mediapipe.RegionFlowComputationOptions.Types.DownsampleMode) input.ReadEnum(); + break; + } + case 96: { + DownsamplingSize = input.ReadInt32(); + break; + } + case 104: { + MinFeatureRequirement = input.ReadInt32(); + break; + } + case 117: { + MinFeatureCover = input.ReadFloat(); + break; + } + case 136: { + ComputeBlurScore = input.ReadBool(); + break; + } + case 149: { + DownsampleFactor = input.ReadFloat(); + break; + } + case 154: { + if (downsampleSchedule_ == null) { + DownsampleSchedule = new global::Mediapipe.RegionFlowComputationOptions.Types.DownSampleSchedule(); + } + input.ReadMessage(DownsampleSchedule); + break; + } + case 160: { + MinFeatureCoverGrid = input.ReadInt32(); + break; + } + case 168: { + PatchDescriptorRadius = input.ReadInt32(); + break; + } + case 176: { + FastEstimationOverlapGrids = input.ReadInt32(); + break; + } + case 189: { + MaxMagnitudeThresholdRatio = input.ReadFloat(); + break; + } + case 200: { + FastEstimationMinBlockSize = input.ReadInt32(); + break; + } + case 213: { + CornerResponseScale = input.ReadFloat(); + break; + } + case 216: { + VerifyFeatures = input.ReadBool(); + break; + } + case 229: { + VerificationDistance = input.ReadFloat(); + break; + } + case 250: { + if (blurScoreOptions_ == null) { + BlurScoreOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.BlurScoreOptions(); + } + input.ReadMessage(BlurScoreOptions); + break; + } + case 269: { + PreBlurSigma = input.ReadFloat(); + break; + } + case 272: { + UseSyntheticZeroMotionTracksAllFrames = input.ReadBool(); + break; + } + case 280: { + UseSyntheticZeroMotionTracksFirstFrame = input.ReadBool(); + break; + } + case 288: { + GainCorrection = input.ReadBool(); + break; + } + case 301: { + FracGainFeatureSize = input.ReadFloat(); + break; + } + case 309: { + FracGainStep = input.ReadFloat(); + break; + } + case 314: { + if (gainBiasBounds_ == null) { + GainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + input.ReadMessage(GainBiasBounds); + break; + } + case 320: { + NoEstimationMode = input.ReadBool(); + break; + } + case 328: { + GainCorrectMode = (global::Mediapipe.RegionFlowComputationOptions.Types.GainCorrectMode) input.ReadEnum(); + break; + } + case 357: { + RelativeInlierErrorThreshold = input.ReadFloat(); + break; + } + case 360: { + TopInlierSets = input.ReadInt32(); + break; + } + case 373: { + RelativeMinFeatureInliers = input.ReadFloat(); + break; + } + case 376: { + GainCorrectionMultipleHypotheses = input.ReadBool(); + break; + } + case 389: { + GainCorrectionInlierImprovementFrac = input.ReadFloat(); + break; + } + case 392: { + IrlsInitialization = (global::Mediapipe.RegionFlowComputationOptions.Types.IrlsInitialization) input.ReadEnum(); + break; + } + case 400: { + DistanceFromBorder = input.ReadInt32(); + break; + } + case 413: { + MedianMagnitudeBounds = input.ReadFloat(); + break; + } + case 421: { + FracInlierErrorThreshold = input.ReadFloat(); + break; + } + case 424: { + VerifyLongFeatures = input.ReadBool(); + break; + } + case 437: { + LongFeatureVerificationThreshold = input.ReadFloat(); + break; + } + case 442: { + if (visualConsistencyOptions_ == null) { + VisualConsistencyOptions = new global::Mediapipe.RegionFlowComputationOptions.Types.VisualConsistencyOptions(); + } + input.ReadMessage(VisualConsistencyOptions); + break; + } + case 453: { + MaxLongFeatureAcceleration = input.ReadFloat(); + break; + } + case 456: { + HistogramEqualization = input.ReadBool(); + break; + } + case 464: { + ImageFormat = (global::Mediapipe.RegionFlowComputationOptions.Types.ImageFormat) input.ReadEnum(); + break; + } + case 472: { + GainCorrectionBrightReference = input.ReadBool(); + break; + } + case 485: { + GainCorrectionTriggeringRatio = input.ReadFloat(); + break; + } + case 488: { + FastGainCorrection = input.ReadBool(); + break; + } + case 496: { + RoundDownsampleFactor = input.ReadBool(); + break; + } + case 504: { + VerifyLongFeatureAcceleration = input.ReadBool(); + break; + } + case 517: { + VerifyLongFeatureTriggerRatio = input.ReadFloat(); + break; + } + case 520: { + DescriptorExtractorType = (global::Mediapipe.RegionFlowComputationOptions.Types.DescriptorExtractorType) input.ReadEnum(); + break; + } + case 528: { + ComputeDerivativeInPyramid = input.ReadBool(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + #region Nested types + /// Container for nested types declared in the RegionFlowComputationOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Determines how irls weights for computed features are initialized. + /// In general, more stable features are given higher weight. + /// + public enum IrlsInitialization { + /// + /// All weights equal 1 + /// + [pbr::OriginalName("INIT_UNIFORM")] InitUniform = 1, + /// + /// Feature's irls weight is initialized to a value in [0, 2] + /// indicating how consistent the feature's motion is w.r.t. neighboring + /// features (high values = very consistent). Determined by counting how + /// often a feature is part of the inlier set for a particular bin. + /// + [pbr::OriginalName("INIT_CONSISTENCY")] InitConsistency = 2, + } + + /// + /// We support down-sampling of an incoming frame before running the + /// resolution dependent part of the region flow computation (feature + /// extraction and tracking if desired). + /// Note that in all downsampling modes except for DOWNSAMPLE_TO_INPUT_SIZE, + /// for uneven dimensions after downsampling, we always round up to + /// the nearest even dimension, i.e. 350p with a downsample_factor of 2.0 + /// would expect an input of size 176p. + /// + public enum DownsampleMode { + /// + /// No downsampling. + /// + [pbr::OriginalName("DOWNSAMPLE_NONE")] DownsampleNone = 1, + /// + /// Downsizes the input frame such that frame_size == downsampling_size, + /// where frame_size := max(width, height). + /// + [pbr::OriginalName("DOWNSAMPLE_TO_MAX_SIZE")] DownsampleToMaxSize = 2, + /// + /// Downsizes frame by pre-defined factor, downsample_factor below. + /// + [pbr::OriginalName("DOWNSAMPLE_BY_FACTOR")] DownsampleByFactor = 3, + /// + /// Downsampling based on downsampling schedule, see DownsampleSchedule below + /// for details. + /// + [pbr::OriginalName("DOWNSAMPLE_BY_SCHEDULE")] DownsampleBySchedule = 4, + /// + /// Downsizes the input frame such that frame_size == downsampling_size, + /// where frame_size := min(width, height). + /// + [pbr::OriginalName("DOWNSAMPLE_TO_MIN_SIZE")] DownsampleToMinSize = 5, + /// + /// Input frame is assumed to be already downsampled by the factor specified + /// by downsample_factor below. For example if the original frame is 720p, + /// and downsample_factor is set to 2.0, then we expect as input 360p. + /// + [pbr::OriginalName("DOWNSAMPLE_TO_INPUT_SIZE")] DownsampleToInputSize = 6, + } + + public enum GainCorrectMode { + /// + /// Uses default or user supplied bounds, + /// + [pbr::OriginalName("GAIN_CORRECT_DEFAULT_USER")] GainCorrectDefaultUser = 1, + /// + /// i.e. gain_bias_bounds is left untouched. + /// + [pbr::OriginalName("GAIN_CORRECT_VIDEO")] GainCorrectVideo = 2, + /// + /// Uses most relaxed settings to track + /// + [pbr::OriginalName("GAIN_CORRECT_HDR")] GainCorrectHdr = 3, + /// + /// across HDR frames, taken at different + /// exposures. + /// + [pbr::OriginalName("GAIN_CORRECT_PHOTO_BURST")] GainCorrectPhotoBurst = 4, + } + + /// + /// Supported image formats. All images are converted to grayscale + /// before processing. These image formats only concern AddImage. + /// IMPORTANT: All the Retrieve* methods expect RGB when the descriptors + /// are computed. + /// + public enum ImageFormat { + [pbr::OriginalName("FORMAT_GRAYSCALE")] FormatGrayscale = 1, + [pbr::OriginalName("FORMAT_RGB")] FormatRgb = 2, + [pbr::OriginalName("FORMAT_RGBA")] FormatRgba = 3, + [pbr::OriginalName("FORMAT_BGR")] FormatBgr = 4, + [pbr::OriginalName("FORMAT_BGRA")] FormatBgra = 5, + } + + public enum DescriptorExtractorType { + /// + /// http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.370.4395&rep=rep1&type=pdf + /// + [pbr::OriginalName("ORB")] Orb = 0, + } + + /// + /// Downsampling schedule. Frame sizes up to which a particular downsampling + /// factor is applied. Factor chosen by comparing actual frame area against + /// standard area (standard_width * standard_height), where standard_width = + /// 16/9 X standard_height. + /// + public sealed partial class DownSampleSchedule : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DownSampleSchedule()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowComputationOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DownSampleSchedule() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DownSampleSchedule(DownSampleSchedule other) : this() { + _hasBits0 = other._hasBits0; + downsampleFactor360P_ = other.downsampleFactor360P_; + downsampleFactor480P_ = other.downsampleFactor480P_; + downsampleFactor720P_ = other.downsampleFactor720P_; + downsampleFactor1080P_ = other.downsampleFactor1080P_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DownSampleSchedule Clone() { + return new DownSampleSchedule(this); + } + + /// Field number for the "downsample_factor_360p" field. + public const int DownsampleFactor360PFieldNumber = 1; + private readonly static float DownsampleFactor360PDefaultValue = 1F; + + private float downsampleFactor360P_; + /// + /// For <= 360p. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor360P { + get { if ((_hasBits0 & 1) != 0) { return downsampleFactor360P_; } else { return DownsampleFactor360PDefaultValue; } } + set { + _hasBits0 |= 1; + downsampleFactor360P_ = value; + } + } + /// Gets whether the "downsample_factor_360p" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor360P { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "downsample_factor_360p" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor360P() { + _hasBits0 &= ~1; + } + + /// Field number for the "downsample_factor_480p" field. + public const int DownsampleFactor480PFieldNumber = 2; + private readonly static float DownsampleFactor480PDefaultValue = 1F; + + private float downsampleFactor480P_; + /// + /// For <= 480p. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor480P { + get { if ((_hasBits0 & 2) != 0) { return downsampleFactor480P_; } else { return DownsampleFactor480PDefaultValue; } } + set { + _hasBits0 |= 2; + downsampleFactor480P_ = value; + } + } + /// Gets whether the "downsample_factor_480p" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor480P { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "downsample_factor_480p" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor480P() { + _hasBits0 &= ~2; + } + + /// Field number for the "downsample_factor_720p" field. + public const int DownsampleFactor720PFieldNumber = 3; + private readonly static float DownsampleFactor720PDefaultValue = 2F; + + private float downsampleFactor720P_; + /// + /// For <= 720p. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor720P { + get { if ((_hasBits0 & 4) != 0) { return downsampleFactor720P_; } else { return DownsampleFactor720PDefaultValue; } } + set { + _hasBits0 |= 4; + downsampleFactor720P_ = value; + } + } + /// Gets whether the "downsample_factor_720p" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor720P { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "downsample_factor_720p" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor720P() { + _hasBits0 &= ~4; + } + + /// Field number for the "downsample_factor_1080p" field. + public const int DownsampleFactor1080PFieldNumber = 4; + private readonly static float DownsampleFactor1080PDefaultValue = 2F; + + private float downsampleFactor1080P_; + /// + /// >= 720p. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor1080P { + get { if ((_hasBits0 & 8) != 0) { return downsampleFactor1080P_; } else { return DownsampleFactor1080PDefaultValue; } } + set { + _hasBits0 |= 8; + downsampleFactor1080P_ = value; + } + } + /// Gets whether the "downsample_factor_1080p" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor1080P { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "downsample_factor_1080p" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor1080P() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DownSampleSchedule); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DownSampleSchedule other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor360P, other.DownsampleFactor360P)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor480P, other.DownsampleFactor480P)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor720P, other.DownsampleFactor720P)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor1080P, other.DownsampleFactor1080P)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDownsampleFactor360P) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor360P); + if (HasDownsampleFactor480P) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor480P); + if (HasDownsampleFactor720P) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor720P); + if (HasDownsampleFactor1080P) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor1080P); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDownsampleFactor360P) { + output.WriteRawTag(13); + output.WriteFloat(DownsampleFactor360P); + } + if (HasDownsampleFactor480P) { + output.WriteRawTag(21); + output.WriteFloat(DownsampleFactor480P); + } + if (HasDownsampleFactor720P) { + output.WriteRawTag(29); + output.WriteFloat(DownsampleFactor720P); + } + if (HasDownsampleFactor1080P) { + output.WriteRawTag(37); + output.WriteFloat(DownsampleFactor1080P); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDownsampleFactor360P) { + output.WriteRawTag(13); + output.WriteFloat(DownsampleFactor360P); + } + if (HasDownsampleFactor480P) { + output.WriteRawTag(21); + output.WriteFloat(DownsampleFactor480P); + } + if (HasDownsampleFactor720P) { + output.WriteRawTag(29); + output.WriteFloat(DownsampleFactor720P); + } + if (HasDownsampleFactor1080P) { + output.WriteRawTag(37); + output.WriteFloat(DownsampleFactor1080P); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDownsampleFactor360P) { + size += 1 + 4; + } + if (HasDownsampleFactor480P) { + size += 1 + 4; + } + if (HasDownsampleFactor720P) { + size += 1 + 4; + } + if (HasDownsampleFactor1080P) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DownSampleSchedule other) { + if (other == null) { + return; + } + if (other.HasDownsampleFactor360P) { + DownsampleFactor360P = other.DownsampleFactor360P; + } + if (other.HasDownsampleFactor480P) { + DownsampleFactor480P = other.DownsampleFactor480P; + } + if (other.HasDownsampleFactor720P) { + DownsampleFactor720P = other.DownsampleFactor720P; + } + if (other.HasDownsampleFactor1080P) { + DownsampleFactor1080P = other.DownsampleFactor1080P; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + DownsampleFactor360P = input.ReadFloat(); + break; + } + case 21: { + DownsampleFactor480P = input.ReadFloat(); + break; + } + case 29: { + DownsampleFactor720P = input.ReadFloat(); + break; + } + case 37: { + DownsampleFactor1080P = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + DownsampleFactor360P = input.ReadFloat(); + break; + } + case 21: { + DownsampleFactor480P = input.ReadFloat(); + break; + } + case 29: { + DownsampleFactor720P = input.ReadFloat(); + break; + } + case 37: { + DownsampleFactor1080P = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class BlurScoreOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BlurScoreOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowComputationOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlurScoreOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlurScoreOptions(BlurScoreOptions other) : this() { + _hasBits0 = other._hasBits0; + boxFilterDiam_ = other.boxFilterDiam_; + relativeCornernessThreshold_ = other.relativeCornernessThreshold_; + absoluteCornernessThreshold_ = other.absoluteCornernessThreshold_; + medianPercentile_ = other.medianPercentile_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BlurScoreOptions Clone() { + return new BlurScoreOptions(this); + } + + /// Field number for the "box_filter_diam" field. + public const int BoxFilterDiamFieldNumber = 1; + private readonly static int BoxFilterDiamDefaultValue = 3; + + private int boxFilterDiam_; + /// + /// Blur score is only computed over image regions of high cornerness + /// (as blur in any direction will always alter these regions). First, the + /// corner image (smallest eigenvalue of 2nd moment matrix) is box filtered, + /// and then thresholded. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int BoxFilterDiam { + get { if ((_hasBits0 & 1) != 0) { return boxFilterDiam_; } else { return BoxFilterDiamDefaultValue; } } + set { + _hasBits0 |= 1; + boxFilterDiam_ = value; + } + } + /// Gets whether the "box_filter_diam" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoxFilterDiam { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "box_filter_diam" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxFilterDiam() { + _hasBits0 &= ~1; + } + + /// Field number for the "relative_cornerness_threshold" field. + public const int RelativeCornernessThresholdFieldNumber = 2; + private readonly static float RelativeCornernessThresholdDefaultValue = 0.03F; + + private float relativeCornernessThreshold_; + /// + /// Specifies relative (w.r.t. maximum) and absolute corneress threshold + /// for threshold operation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RelativeCornernessThreshold { + get { if ((_hasBits0 & 2) != 0) { return relativeCornernessThreshold_; } else { return RelativeCornernessThresholdDefaultValue; } } + set { + _hasBits0 |= 2; + relativeCornernessThreshold_ = value; + } + } + /// Gets whether the "relative_cornerness_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRelativeCornernessThreshold { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "relative_cornerness_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRelativeCornernessThreshold() { + _hasBits0 &= ~2; + } + + /// Field number for the "absolute_cornerness_threshold" field. + public const int AbsoluteCornernessThresholdFieldNumber = 3; + private readonly static float AbsoluteCornernessThresholdDefaultValue = 0.0001F; + + private float absoluteCornernessThreshold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AbsoluteCornernessThreshold { + get { if ((_hasBits0 & 4) != 0) { return absoluteCornernessThreshold_; } else { return AbsoluteCornernessThresholdDefaultValue; } } + set { + _hasBits0 |= 4; + absoluteCornernessThreshold_ = value; + } + } + /// Gets whether the "absolute_cornerness_threshold" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAbsoluteCornernessThreshold { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "absolute_cornerness_threshold" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAbsoluteCornernessThreshold() { + _hasBits0 &= ~4; + } + + /// Field number for the "median_percentile" field. + public const int MedianPercentileFieldNumber = 5; + private readonly static float MedianPercentileDefaultValue = 0.85F; + + private float medianPercentile_; + /// + /// Blur score is defined as 1.0 / <median cornerness>, where + /// <median cornerness> is the n-th percentile of the cornerness evaluated + /// over the image regions of high corness as specified above. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MedianPercentile { + get { if ((_hasBits0 & 8) != 0) { return medianPercentile_; } else { return MedianPercentileDefaultValue; } } + set { + _hasBits0 |= 8; + medianPercentile_ = value; + } + } + /// Gets whether the "median_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMedianPercentile { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "median_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMedianPercentile() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BlurScoreOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BlurScoreOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BoxFilterDiam != other.BoxFilterDiam) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RelativeCornernessThreshold, other.RelativeCornernessThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AbsoluteCornernessThreshold, other.AbsoluteCornernessThreshold)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MedianPercentile, other.MedianPercentile)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBoxFilterDiam) hash ^= BoxFilterDiam.GetHashCode(); + if (HasRelativeCornernessThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RelativeCornernessThreshold); + if (HasAbsoluteCornernessThreshold) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AbsoluteCornernessThreshold); + if (HasMedianPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MedianPercentile); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBoxFilterDiam) { + output.WriteRawTag(8); + output.WriteInt32(BoxFilterDiam); + } + if (HasRelativeCornernessThreshold) { + output.WriteRawTag(21); + output.WriteFloat(RelativeCornernessThreshold); + } + if (HasAbsoluteCornernessThreshold) { + output.WriteRawTag(29); + output.WriteFloat(AbsoluteCornernessThreshold); + } + if (HasMedianPercentile) { + output.WriteRawTag(45); + output.WriteFloat(MedianPercentile); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBoxFilterDiam) { + output.WriteRawTag(8); + output.WriteInt32(BoxFilterDiam); + } + if (HasRelativeCornernessThreshold) { + output.WriteRawTag(21); + output.WriteFloat(RelativeCornernessThreshold); + } + if (HasAbsoluteCornernessThreshold) { + output.WriteRawTag(29); + output.WriteFloat(AbsoluteCornernessThreshold); + } + if (HasMedianPercentile) { + output.WriteRawTag(45); + output.WriteFloat(MedianPercentile); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBoxFilterDiam) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxFilterDiam); + } + if (HasRelativeCornernessThreshold) { + size += 1 + 4; + } + if (HasAbsoluteCornernessThreshold) { + size += 1 + 4; + } + if (HasMedianPercentile) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BlurScoreOptions other) { + if (other == null) { + return; + } + if (other.HasBoxFilterDiam) { + BoxFilterDiam = other.BoxFilterDiam; + } + if (other.HasRelativeCornernessThreshold) { + RelativeCornernessThreshold = other.RelativeCornernessThreshold; + } + if (other.HasAbsoluteCornernessThreshold) { + AbsoluteCornernessThreshold = other.AbsoluteCornernessThreshold; + } + if (other.HasMedianPercentile) { + MedianPercentile = other.MedianPercentile; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BoxFilterDiam = input.ReadInt32(); + break; + } + case 21: { + RelativeCornernessThreshold = input.ReadFloat(); + break; + } + case 29: { + AbsoluteCornernessThreshold = input.ReadFloat(); + break; + } + case 45: { + MedianPercentile = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + BoxFilterDiam = input.ReadInt32(); + break; + } + case 21: { + RelativeCornernessThreshold = input.ReadFloat(); + break; + } + case 29: { + AbsoluteCornernessThreshold = input.ReadFloat(); + break; + } + case 45: { + MedianPercentile = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Determines how/if visual consistency is computed. If activated, + /// computes the absolute *change* in visual difference between two adjancent + /// frame pairs, i.e. the modulus of the 2nd derivative of the frame + /// appearance. Stores result in RegionFlowFeatureList::visual_consistency. + /// + public sealed partial class VisualConsistencyOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VisualConsistencyOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RegionFlowComputationOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualConsistencyOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualConsistencyOptions(VisualConsistencyOptions other) : this() { + _hasBits0 = other._hasBits0; + computeConsistency_ = other.computeConsistency_; + tinyImageDimension_ = other.tinyImageDimension_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VisualConsistencyOptions Clone() { + return new VisualConsistencyOptions(this); + } + + /// Field number for the "compute_consistency" field. + public const int ComputeConsistencyFieldNumber = 1; + private readonly static bool ComputeConsistencyDefaultValue = true; + + private bool computeConsistency_; + /// + /// Computation of visual consistency is only performed if activated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComputeConsistency { + get { if ((_hasBits0 & 1) != 0) { return computeConsistency_; } else { return ComputeConsistencyDefaultValue; } } + set { + _hasBits0 |= 1; + computeConsistency_ = value; + } + } + /// Gets whether the "compute_consistency" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComputeConsistency { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "compute_consistency" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComputeConsistency() { + _hasBits0 &= ~1; + } + + /// Field number for the "tiny_image_dimension" field. + public const int TinyImageDimensionFieldNumber = 2; + private readonly static int TinyImageDimensionDefaultValue = 20; + + private int tinyImageDimension_; + /// + /// Incoming color or gray scale image is scaled to a tiny square image of + /// the specified dimension. Used to compare adjacent images via SSD. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TinyImageDimension { + get { if ((_hasBits0 & 2) != 0) { return tinyImageDimension_; } else { return TinyImageDimensionDefaultValue; } } + set { + _hasBits0 |= 2; + tinyImageDimension_ = value; + } + } + /// Gets whether the "tiny_image_dimension" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTinyImageDimension { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "tiny_image_dimension" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTinyImageDimension() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VisualConsistencyOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VisualConsistencyOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ComputeConsistency != other.ComputeConsistency) return false; + if (TinyImageDimension != other.TinyImageDimension) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasComputeConsistency) hash ^= ComputeConsistency.GetHashCode(); + if (HasTinyImageDimension) hash ^= TinyImageDimension.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasComputeConsistency) { + output.WriteRawTag(8); + output.WriteBool(ComputeConsistency); + } + if (HasTinyImageDimension) { + output.WriteRawTag(16); + output.WriteInt32(TinyImageDimension); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasComputeConsistency) { + output.WriteRawTag(8); + output.WriteBool(ComputeConsistency); + } + if (HasTinyImageDimension) { + output.WriteRawTag(16); + output.WriteInt32(TinyImageDimension); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasComputeConsistency) { + size += 1 + 1; + } + if (HasTinyImageDimension) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TinyImageDimension); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VisualConsistencyOptions other) { + if (other == null) { + return; + } + if (other.HasComputeConsistency) { + ComputeConsistency = other.ComputeConsistency; + } + if (other.HasTinyImageDimension) { + TinyImageDimension = other.TinyImageDimension; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ComputeConsistency = input.ReadBool(); + break; + } + case 16: { + TinyImageDimension = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ComputeConsistency = input.ReadBool(); + break; + } + case 16: { + TinyImageDimension = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs.meta new file mode 100644 index 0000000..c841c38 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RegionFlowComputation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c974ef9b94a68d89ba49e8500e44f51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs new file mode 100644 index 0000000..293343a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs @@ -0,0 +1,5924 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/render_data.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/render_data.proto + public static partial class RenderDataReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/render_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RenderDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiBtZWRpYXBpcGUvdXRpbC9yZW5kZXJfZGF0YS5wcm90bxIJbWVkaWFwaXBl", + "GhptZWRpYXBpcGUvdXRpbC9jb2xvci5wcm90byKNAQoKUmVuZGVyRGF0YRI3", + "ChJyZW5kZXJfYW5ub3RhdGlvbnMYASADKAsyGy5tZWRpYXBpcGUuUmVuZGVy", + "QW5ub3RhdGlvbhITCgtzY2VuZV9jbGFzcxgCIAEoCRIxCg5zY2VuZV92aWV3", + "cG9ydBgDIAEoCzIZLm1lZGlhcGlwZS5SZW5kZXJWaWV3cG9ydCL6EQoQUmVu", + "ZGVyQW5ub3RhdGlvbhI6CglyZWN0YW5nbGUYASABKAsyJS5tZWRpYXBpcGUu", + "UmVuZGVyQW5ub3RhdGlvbi5SZWN0YW5nbGVIABJHChBmaWxsZWRfcmVjdGFu", + "Z2xlGAIgASgLMisubWVkaWFwaXBlLlJlbmRlckFubm90YXRpb24uRmlsbGVk", + "UmVjdGFuZ2xlSAASMAoEb3ZhbBgDIAEoCzIgLm1lZGlhcGlwZS5SZW5kZXJB", + "bm5vdGF0aW9uLk92YWxIABI9CgtmaWxsZWRfb3ZhbBgEIAEoCzImLm1lZGlh", + "cGlwZS5SZW5kZXJBbm5vdGF0aW9uLkZpbGxlZE92YWxIABIyCgVwb2ludBgF", + "IAEoCzIhLm1lZGlhcGlwZS5SZW5kZXJBbm5vdGF0aW9uLlBvaW50SAASMAoE", + "bGluZRgGIAEoCzIgLm1lZGlhcGlwZS5SZW5kZXJBbm5vdGF0aW9uLkxpbmVI", + "ABIyCgVhcnJvdxgHIAEoCzIhLm1lZGlhcGlwZS5SZW5kZXJBbm5vdGF0aW9u", + "LkFycm93SAASMAoEdGV4dBgIIAEoCzIgLm1lZGlhcGlwZS5SZW5kZXJBbm5v", + "dGF0aW9uLlRleHRIABJJChFyb3VuZGVkX3JlY3RhbmdsZRgJIAEoCzIsLm1l", + "ZGlhcGlwZS5SZW5kZXJBbm5vdGF0aW9uLlJvdW5kZWRSZWN0YW5nbGVIABJW", + "ChhmaWxsZWRfcm91bmRlZF9yZWN0YW5nbGUYCiABKAsyMi5tZWRpYXBpcGUu", + "UmVuZGVyQW5ub3RhdGlvbi5GaWxsZWRSb3VuZGVkUmVjdGFuZ2xlSAASQQoN", + "Z3JhZGllbnRfbGluZRgOIAEoCzIoLm1lZGlhcGlwZS5SZW5kZXJBbm5vdGF0", + "aW9uLkdyYWRpZW50TGluZUgAEhQKCXRoaWNrbmVzcxgLIAEoAToBMRIfCgVj", + "b2xvchgMIAEoCzIQLm1lZGlhcGlwZS5Db2xvchIRCglzY2VuZV90YWcYDSAB", + "KAkajgEKCVJlY3RhbmdsZRIMCgRsZWZ0GAEgASgBEgsKA3RvcBgCIAEoARIN", + "CgVyaWdodBgDIAEoARIOCgZib3R0b20YBCABKAESGQoKbm9ybWFsaXplZBgF", + "IAEoCDoFZmFsc2USEAoIcm90YXRpb24YBiABKAESGgoSdG9wX2xlZnRfdGhp", + "Y2tuZXNzGAcgASgBGnEKD0ZpbGxlZFJlY3RhbmdsZRI4CglyZWN0YW5nbGUY", + "ASABKAsyJS5tZWRpYXBpcGUuUmVuZGVyQW5ub3RhdGlvbi5SZWN0YW5nbGUS", + "JAoKZmlsbF9jb2xvchgCIAEoCzIQLm1lZGlhcGlwZS5Db2xvchp8ChBSb3Vu", + "ZGVkUmVjdGFuZ2xlEjgKCXJlY3RhbmdsZRgBIAEoCzIlLm1lZGlhcGlwZS5S", + "ZW5kZXJBbm5vdGF0aW9uLlJlY3RhbmdsZRIYCg1jb3JuZXJfcmFkaXVzGAIg", + "ASgFOgEwEhQKCWxpbmVfdHlwZRgDIAEoBToBNBqHAQoWRmlsbGVkUm91bmRl", + "ZFJlY3RhbmdsZRJHChFyb3VuZGVkX3JlY3RhbmdsZRgBIAEoCzIsLm1lZGlh", + "cGlwZS5SZW5kZXJBbm5vdGF0aW9uLlJvdW5kZWRSZWN0YW5nbGUSJAoKZmls", + "bF9jb2xvchgCIAEoCzIQLm1lZGlhcGlwZS5Db2xvchpACgRPdmFsEjgKCXJl", + "Y3RhbmdsZRgBIAEoCzIlLm1lZGlhcGlwZS5SZW5kZXJBbm5vdGF0aW9uLlJl", + "Y3RhbmdsZRpiCgpGaWxsZWRPdmFsEi4KBG92YWwYASABKAsyIC5tZWRpYXBp", + "cGUuUmVuZGVyQW5ub3RhdGlvbi5PdmFsEiQKCmZpbGxfY29sb3IYAiABKAsy", + "EC5tZWRpYXBpcGUuQ29sb3IaOAoFUG9pbnQSCQoBeBgBIAEoARIJCgF5GAIg", + "ASgBEhkKCm5vcm1hbGl6ZWQYAyABKAg6BWZhbHNlGtYBCgRMaW5lEg8KB3hf", + "c3RhcnQYASABKAESDwoHeV9zdGFydBgCIAEoARINCgV4X2VuZBgDIAEoARIN", + "CgV5X2VuZBgEIAEoARIZCgpub3JtYWxpemVkGAUgASgIOgVmYWxzZRJDCgls", + "aW5lX3R5cGUYBiABKA4yKS5tZWRpYXBpcGUuUmVuZGVyQW5ub3RhdGlvbi5M", + "aW5lLkxpbmVUeXBlOgVTT0xJRCIuCghMaW5lVHlwZRILCgdVTktOT1dOEAAS", + "CQoFU09MSUQQARIKCgZEQVNIRUQQAhqtAQoMR3JhZGllbnRMaW5lEg8KB3hf", + "c3RhcnQYASABKAESDwoHeV9zdGFydBgCIAEoARINCgV4X2VuZBgDIAEoARIN", + "CgV5X2VuZBgEIAEoARIZCgpub3JtYWxpemVkGAUgASgIOgVmYWxzZRIgCgZj", + "b2xvcjEYBiABKAsyEC5tZWRpYXBpcGUuQ29sb3ISIAoGY29sb3IyGAcgASgL", + "MhAubWVkaWFwaXBlLkNvbG9yGmIKBUFycm93Eg8KB3hfc3RhcnQYASABKAES", + "DwoHeV9zdGFydBgCIAEoARINCgV4X2VuZBgDIAEoARINCgV5X2VuZBgEIAEo", + "ARIZCgpub3JtYWxpemVkGAUgASgIOgVmYWxzZRqSAgoEVGV4dBIUCgxkaXNw", + "bGF5X3RleHQYASABKAkSDAoEbGVmdBgCIAEoARIQCghiYXNlbGluZRgDIAEo", + "ARIWCgtmb250X2hlaWdodBgEIAEoAToBOBIZCgpub3JtYWxpemVkGAUgASgI", + "OgVmYWxzZRIUCglmb250X2ZhY2UYBiABKAU6ATASIgoTY2VudGVyX2hvcml6", + "b250YWxseRgHIAEoCDoFZmFsc2USIAoRY2VudGVyX3ZlcnRpY2FsbHkYCCAB", + "KAg6BWZhbHNlEhwKEW91dGxpbmVfdGhpY2tuZXNzGAsgASgBOgEwEicKDW91", + "dGxpbmVfY29sb3IYDCABKAsyEC5tZWRpYXBpcGUuQ29sb3JCBgoEZGF0YSJb", + "Cg5SZW5kZXJWaWV3cG9ydBIKCgJpZBgBIAEoCRIQCgh3aWR0aF9weBgCIAEo", + "BRIRCgloZWlnaHRfcHgYAyABKAUSGAoQY29tcG9zZV9vbl92aWRlbxgEIAEo", + "CA==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.ColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderData), global::Mediapipe.RenderData.Parser, new[]{ "RenderAnnotations", "SceneClass", "SceneViewport" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation), global::Mediapipe.RenderAnnotation.Parser, new[]{ "Rectangle", "FilledRectangle", "Oval", "FilledOval", "Point", "Line", "Arrow", "Text", "RoundedRectangle", "FilledRoundedRectangle", "GradientLine", "Thickness", "Color", "SceneTag" }, new[]{ "Data" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Rectangle), global::Mediapipe.RenderAnnotation.Types.Rectangle.Parser, new[]{ "Left", "Top", "Right", "Bottom", "Normalized", "Rotation", "TopLeftThickness" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.FilledRectangle), global::Mediapipe.RenderAnnotation.Types.FilledRectangle.Parser, new[]{ "Rectangle", "FillColor" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.RoundedRectangle), global::Mediapipe.RenderAnnotation.Types.RoundedRectangle.Parser, new[]{ "Rectangle", "CornerRadius", "LineType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle), global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle.Parser, new[]{ "RoundedRectangle", "FillColor" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Oval), global::Mediapipe.RenderAnnotation.Types.Oval.Parser, new[]{ "Rectangle" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.FilledOval), global::Mediapipe.RenderAnnotation.Types.FilledOval.Parser, new[]{ "Oval", "FillColor" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Point), global::Mediapipe.RenderAnnotation.Types.Point.Parser, new[]{ "X", "Y", "Normalized" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Line), global::Mediapipe.RenderAnnotation.Types.Line.Parser, new[]{ "XStart", "YStart", "XEnd", "YEnd", "Normalized", "LineType" }, null, new[]{ typeof(global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.GradientLine), global::Mediapipe.RenderAnnotation.Types.GradientLine.Parser, new[]{ "XStart", "YStart", "XEnd", "YEnd", "Normalized", "Color1", "Color2" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Arrow), global::Mediapipe.RenderAnnotation.Types.Arrow.Parser, new[]{ "XStart", "YStart", "XEnd", "YEnd", "Normalized" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderAnnotation.Types.Text), global::Mediapipe.RenderAnnotation.Types.Text.Parser, new[]{ "DisplayText", "Left", "Baseline", "FontHeight", "Normalized", "FontFace", "CenterHorizontally", "CenterVertically", "OutlineThickness", "OutlineColor" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.RenderViewport), global::Mediapipe.RenderViewport.Parser, new[]{ "Id", "WidthPx", "HeightPx", "ComposeOnVideo" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// A RenderData is a collection of multiple RenderAnnotations. For example, a + /// face can be rendered using a group of annotations: a bounding box around the + /// face (rectangle) and annotations for various face parts such as eyes, nose + /// etc (2D points). + /// + public sealed partial class RenderData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RenderData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderData(RenderData other) : this() { + renderAnnotations_ = other.renderAnnotations_.Clone(); + sceneClass_ = other.sceneClass_; + sceneViewport_ = other.sceneViewport_ != null ? other.sceneViewport_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderData Clone() { + return new RenderData(this); + } + + /// Field number for the "render_annotations" field. + public const int RenderAnnotationsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_renderAnnotations_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.RenderAnnotation.Parser); + private readonly pbc::RepeatedField renderAnnotations_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField RenderAnnotations { + get { return renderAnnotations_; } + } + + /// Field number for the "scene_class" field. + public const int SceneClassFieldNumber = 2; + private readonly static string SceneClassDefaultValue = ""; + + private string sceneClass_; + /// + /// An optional string that uniquely identifies this class of annotations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SceneClass { + get { return sceneClass_ ?? SceneClassDefaultValue; } + set { + sceneClass_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "scene_class" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSceneClass { + get { return sceneClass_ != null; } + } + /// Clears the value of the "scene_class" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSceneClass() { + sceneClass_ = null; + } + + /// Field number for the "scene_viewport" field. + public const int SceneViewportFieldNumber = 3; + private global::Mediapipe.RenderViewport sceneViewport_; + /// + /// An optional viewport to which this set of annotations are intended to be + /// rendered. If left unset, the annotations are meant to render overtop of the + /// existing camera feed in the "main" viewport. If set, the annotations are to + /// be rendered in a separate viewport. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderViewport SceneViewport { + get { return sceneViewport_; } + set { + sceneViewport_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RenderData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RenderData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!renderAnnotations_.Equals(other.renderAnnotations_)) return false; + if (SceneClass != other.SceneClass) return false; + if (!object.Equals(SceneViewport, other.SceneViewport)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= renderAnnotations_.GetHashCode(); + if (HasSceneClass) hash ^= SceneClass.GetHashCode(); + if (sceneViewport_ != null) hash ^= SceneViewport.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + renderAnnotations_.WriteTo(output, _repeated_renderAnnotations_codec); + if (HasSceneClass) { + output.WriteRawTag(18); + output.WriteString(SceneClass); + } + if (sceneViewport_ != null) { + output.WriteRawTag(26); + output.WriteMessage(SceneViewport); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + renderAnnotations_.WriteTo(ref output, _repeated_renderAnnotations_codec); + if (HasSceneClass) { + output.WriteRawTag(18); + output.WriteString(SceneClass); + } + if (sceneViewport_ != null) { + output.WriteRawTag(26); + output.WriteMessage(SceneViewport); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += renderAnnotations_.CalculateSize(_repeated_renderAnnotations_codec); + if (HasSceneClass) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SceneClass); + } + if (sceneViewport_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(SceneViewport); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RenderData other) { + if (other == null) { + return; + } + renderAnnotations_.Add(other.renderAnnotations_); + if (other.HasSceneClass) { + SceneClass = other.SceneClass; + } + if (other.sceneViewport_ != null) { + if (sceneViewport_ == null) { + SceneViewport = new global::Mediapipe.RenderViewport(); + } + SceneViewport.MergeFrom(other.SceneViewport); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + renderAnnotations_.AddEntriesFrom(input, _repeated_renderAnnotations_codec); + break; + } + case 18: { + SceneClass = input.ReadString(); + break; + } + case 26: { + if (sceneViewport_ == null) { + SceneViewport = new global::Mediapipe.RenderViewport(); + } + input.ReadMessage(SceneViewport); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + renderAnnotations_.AddEntriesFrom(ref input, _repeated_renderAnnotations_codec); + break; + } + case 18: { + SceneClass = input.ReadString(); + break; + } + case 26: { + if (sceneViewport_ == null) { + SceneViewport = new global::Mediapipe.RenderViewport(); + } + input.ReadMessage(SceneViewport); + break; + } + } + } + } + #endif + + } + + public sealed partial class RenderAnnotation : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RenderAnnotation()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderDataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderAnnotation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderAnnotation(RenderAnnotation other) : this() { + _hasBits0 = other._hasBits0; + thickness_ = other.thickness_; + color_ = other.color_ != null ? other.color_.Clone() : null; + sceneTag_ = other.sceneTag_; + switch (other.DataCase) { + case DataOneofCase.Rectangle: + Rectangle = other.Rectangle.Clone(); + break; + case DataOneofCase.FilledRectangle: + FilledRectangle = other.FilledRectangle.Clone(); + break; + case DataOneofCase.Oval: + Oval = other.Oval.Clone(); + break; + case DataOneofCase.FilledOval: + FilledOval = other.FilledOval.Clone(); + break; + case DataOneofCase.Point: + Point = other.Point.Clone(); + break; + case DataOneofCase.Line: + Line = other.Line.Clone(); + break; + case DataOneofCase.Arrow: + Arrow = other.Arrow.Clone(); + break; + case DataOneofCase.Text: + Text = other.Text.Clone(); + break; + case DataOneofCase.RoundedRectangle: + RoundedRectangle = other.RoundedRectangle.Clone(); + break; + case DataOneofCase.FilledRoundedRectangle: + FilledRoundedRectangle = other.FilledRoundedRectangle.Clone(); + break; + case DataOneofCase.GradientLine: + GradientLine = other.GradientLine.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderAnnotation Clone() { + return new RenderAnnotation(this); + } + + /// Field number for the "rectangle" field. + public const int RectangleFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Rectangle Rectangle { + get { return dataCase_ == DataOneofCase.Rectangle ? (global::Mediapipe.RenderAnnotation.Types.Rectangle) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Rectangle; + } + } + + /// Field number for the "filled_rectangle" field. + public const int FilledRectangleFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.FilledRectangle FilledRectangle { + get { return dataCase_ == DataOneofCase.FilledRectangle ? (global::Mediapipe.RenderAnnotation.Types.FilledRectangle) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.FilledRectangle; + } + } + + /// Field number for the "oval" field. + public const int OvalFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Oval Oval { + get { return dataCase_ == DataOneofCase.Oval ? (global::Mediapipe.RenderAnnotation.Types.Oval) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Oval; + } + } + + /// Field number for the "filled_oval" field. + public const int FilledOvalFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.FilledOval FilledOval { + get { return dataCase_ == DataOneofCase.FilledOval ? (global::Mediapipe.RenderAnnotation.Types.FilledOval) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.FilledOval; + } + } + + /// Field number for the "point" field. + public const int PointFieldNumber = 5; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Point Point { + get { return dataCase_ == DataOneofCase.Point ? (global::Mediapipe.RenderAnnotation.Types.Point) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Point; + } + } + + /// Field number for the "line" field. + public const int LineFieldNumber = 6; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Line Line { + get { return dataCase_ == DataOneofCase.Line ? (global::Mediapipe.RenderAnnotation.Types.Line) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Line; + } + } + + /// Field number for the "arrow" field. + public const int ArrowFieldNumber = 7; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Arrow Arrow { + get { return dataCase_ == DataOneofCase.Arrow ? (global::Mediapipe.RenderAnnotation.Types.Arrow) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Arrow; + } + } + + /// Field number for the "text" field. + public const int TextFieldNumber = 8; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Text Text { + get { return dataCase_ == DataOneofCase.Text ? (global::Mediapipe.RenderAnnotation.Types.Text) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Text; + } + } + + /// Field number for the "rounded_rectangle" field. + public const int RoundedRectangleFieldNumber = 9; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.RoundedRectangle RoundedRectangle { + get { return dataCase_ == DataOneofCase.RoundedRectangle ? (global::Mediapipe.RenderAnnotation.Types.RoundedRectangle) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.RoundedRectangle; + } + } + + /// Field number for the "filled_rounded_rectangle" field. + public const int FilledRoundedRectangleFieldNumber = 10; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle FilledRoundedRectangle { + get { return dataCase_ == DataOneofCase.FilledRoundedRectangle ? (global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.FilledRoundedRectangle; + } + } + + /// Field number for the "gradient_line" field. + public const int GradientLineFieldNumber = 14; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.GradientLine GradientLine { + get { return dataCase_ == DataOneofCase.GradientLine ? (global::Mediapipe.RenderAnnotation.Types.GradientLine) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.GradientLine; + } + } + + /// Field number for the "thickness" field. + public const int ThicknessFieldNumber = 11; + private readonly static double ThicknessDefaultValue = 1D; + + private double thickness_; + /// + /// Thickness for drawing the annotation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Thickness { + get { if ((_hasBits0 & 1) != 0) { return thickness_; } else { return ThicknessDefaultValue; } } + set { + _hasBits0 |= 1; + thickness_ = value; + } + } + /// Gets whether the "thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasThickness { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearThickness() { + _hasBits0 &= ~1; + } + + /// Field number for the "color" field. + public const int ColorFieldNumber = 12; + private global::Mediapipe.Color color_; + /// + /// Color for drawing the annotation. For FilledRectangle and FilledOval, this + /// color is used only for drawing the boundary. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color { + get { return color_; } + set { + color_ = value; + } + } + + /// Field number for the "scene_tag" field. + public const int SceneTagFieldNumber = 13; + private readonly static string SceneTagDefaultValue = ""; + + private string sceneTag_; + /// + /// A hint regarding what this annotation is for. Should be unique across all + /// annotation types. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SceneTag { + get { return sceneTag_ ?? SceneTagDefaultValue; } + set { + sceneTag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "scene_tag" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSceneTag { + get { return sceneTag_ != null; } + } + /// Clears the value of the "scene_tag" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSceneTag() { + sceneTag_ = null; + } + + private object data_; + /// Enum of possible cases for the "data" oneof. + public enum DataOneofCase { + None = 0, + Rectangle = 1, + FilledRectangle = 2, + Oval = 3, + FilledOval = 4, + Point = 5, + Line = 6, + Arrow = 7, + Text = 8, + RoundedRectangle = 9, + FilledRoundedRectangle = 10, + GradientLine = 14, + } + private DataOneofCase dataCase_ = DataOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DataOneofCase DataCase { + get { return dataCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearData() { + dataCase_ = DataOneofCase.None; + data_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RenderAnnotation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RenderAnnotation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Rectangle, other.Rectangle)) return false; + if (!object.Equals(FilledRectangle, other.FilledRectangle)) return false; + if (!object.Equals(Oval, other.Oval)) return false; + if (!object.Equals(FilledOval, other.FilledOval)) return false; + if (!object.Equals(Point, other.Point)) return false; + if (!object.Equals(Line, other.Line)) return false; + if (!object.Equals(Arrow, other.Arrow)) return false; + if (!object.Equals(Text, other.Text)) return false; + if (!object.Equals(RoundedRectangle, other.RoundedRectangle)) return false; + if (!object.Equals(FilledRoundedRectangle, other.FilledRoundedRectangle)) return false; + if (!object.Equals(GradientLine, other.GradientLine)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Thickness, other.Thickness)) return false; + if (!object.Equals(Color, other.Color)) return false; + if (SceneTag != other.SceneTag) return false; + if (DataCase != other.DataCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (dataCase_ == DataOneofCase.Rectangle) hash ^= Rectangle.GetHashCode(); + if (dataCase_ == DataOneofCase.FilledRectangle) hash ^= FilledRectangle.GetHashCode(); + if (dataCase_ == DataOneofCase.Oval) hash ^= Oval.GetHashCode(); + if (dataCase_ == DataOneofCase.FilledOval) hash ^= FilledOval.GetHashCode(); + if (dataCase_ == DataOneofCase.Point) hash ^= Point.GetHashCode(); + if (dataCase_ == DataOneofCase.Line) hash ^= Line.GetHashCode(); + if (dataCase_ == DataOneofCase.Arrow) hash ^= Arrow.GetHashCode(); + if (dataCase_ == DataOneofCase.Text) hash ^= Text.GetHashCode(); + if (dataCase_ == DataOneofCase.RoundedRectangle) hash ^= RoundedRectangle.GetHashCode(); + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) hash ^= FilledRoundedRectangle.GetHashCode(); + if (dataCase_ == DataOneofCase.GradientLine) hash ^= GradientLine.GetHashCode(); + if (HasThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Thickness); + if (color_ != null) hash ^= Color.GetHashCode(); + if (HasSceneTag) hash ^= SceneTag.GetHashCode(); + hash ^= (int) dataCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (dataCase_ == DataOneofCase.Rectangle) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (dataCase_ == DataOneofCase.FilledRectangle) { + output.WriteRawTag(18); + output.WriteMessage(FilledRectangle); + } + if (dataCase_ == DataOneofCase.Oval) { + output.WriteRawTag(26); + output.WriteMessage(Oval); + } + if (dataCase_ == DataOneofCase.FilledOval) { + output.WriteRawTag(34); + output.WriteMessage(FilledOval); + } + if (dataCase_ == DataOneofCase.Point) { + output.WriteRawTag(42); + output.WriteMessage(Point); + } + if (dataCase_ == DataOneofCase.Line) { + output.WriteRawTag(50); + output.WriteMessage(Line); + } + if (dataCase_ == DataOneofCase.Arrow) { + output.WriteRawTag(58); + output.WriteMessage(Arrow); + } + if (dataCase_ == DataOneofCase.Text) { + output.WriteRawTag(66); + output.WriteMessage(Text); + } + if (dataCase_ == DataOneofCase.RoundedRectangle) { + output.WriteRawTag(74); + output.WriteMessage(RoundedRectangle); + } + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) { + output.WriteRawTag(82); + output.WriteMessage(FilledRoundedRectangle); + } + if (HasThickness) { + output.WriteRawTag(89); + output.WriteDouble(Thickness); + } + if (color_ != null) { + output.WriteRawTag(98); + output.WriteMessage(Color); + } + if (HasSceneTag) { + output.WriteRawTag(106); + output.WriteString(SceneTag); + } + if (dataCase_ == DataOneofCase.GradientLine) { + output.WriteRawTag(114); + output.WriteMessage(GradientLine); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (dataCase_ == DataOneofCase.Rectangle) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (dataCase_ == DataOneofCase.FilledRectangle) { + output.WriteRawTag(18); + output.WriteMessage(FilledRectangle); + } + if (dataCase_ == DataOneofCase.Oval) { + output.WriteRawTag(26); + output.WriteMessage(Oval); + } + if (dataCase_ == DataOneofCase.FilledOval) { + output.WriteRawTag(34); + output.WriteMessage(FilledOval); + } + if (dataCase_ == DataOneofCase.Point) { + output.WriteRawTag(42); + output.WriteMessage(Point); + } + if (dataCase_ == DataOneofCase.Line) { + output.WriteRawTag(50); + output.WriteMessage(Line); + } + if (dataCase_ == DataOneofCase.Arrow) { + output.WriteRawTag(58); + output.WriteMessage(Arrow); + } + if (dataCase_ == DataOneofCase.Text) { + output.WriteRawTag(66); + output.WriteMessage(Text); + } + if (dataCase_ == DataOneofCase.RoundedRectangle) { + output.WriteRawTag(74); + output.WriteMessage(RoundedRectangle); + } + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) { + output.WriteRawTag(82); + output.WriteMessage(FilledRoundedRectangle); + } + if (HasThickness) { + output.WriteRawTag(89); + output.WriteDouble(Thickness); + } + if (color_ != null) { + output.WriteRawTag(98); + output.WriteMessage(Color); + } + if (HasSceneTag) { + output.WriteRawTag(106); + output.WriteString(SceneTag); + } + if (dataCase_ == DataOneofCase.GradientLine) { + output.WriteRawTag(114); + output.WriteMessage(GradientLine); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (dataCase_ == DataOneofCase.Rectangle) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rectangle); + } + if (dataCase_ == DataOneofCase.FilledRectangle) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FilledRectangle); + } + if (dataCase_ == DataOneofCase.Oval) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Oval); + } + if (dataCase_ == DataOneofCase.FilledOval) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FilledOval); + } + if (dataCase_ == DataOneofCase.Point) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Point); + } + if (dataCase_ == DataOneofCase.Line) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Line); + } + if (dataCase_ == DataOneofCase.Arrow) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Arrow); + } + if (dataCase_ == DataOneofCase.Text) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Text); + } + if (dataCase_ == DataOneofCase.RoundedRectangle) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RoundedRectangle); + } + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FilledRoundedRectangle); + } + if (dataCase_ == DataOneofCase.GradientLine) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GradientLine); + } + if (HasThickness) { + size += 1 + 8; + } + if (color_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color); + } + if (HasSceneTag) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SceneTag); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RenderAnnotation other) { + if (other == null) { + return; + } + if (other.HasThickness) { + Thickness = other.Thickness; + } + if (other.color_ != null) { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + Color.MergeFrom(other.Color); + } + if (other.HasSceneTag) { + SceneTag = other.SceneTag; + } + switch (other.DataCase) { + case DataOneofCase.Rectangle: + if (Rectangle == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + Rectangle.MergeFrom(other.Rectangle); + break; + case DataOneofCase.FilledRectangle: + if (FilledRectangle == null) { + FilledRectangle = new global::Mediapipe.RenderAnnotation.Types.FilledRectangle(); + } + FilledRectangle.MergeFrom(other.FilledRectangle); + break; + case DataOneofCase.Oval: + if (Oval == null) { + Oval = new global::Mediapipe.RenderAnnotation.Types.Oval(); + } + Oval.MergeFrom(other.Oval); + break; + case DataOneofCase.FilledOval: + if (FilledOval == null) { + FilledOval = new global::Mediapipe.RenderAnnotation.Types.FilledOval(); + } + FilledOval.MergeFrom(other.FilledOval); + break; + case DataOneofCase.Point: + if (Point == null) { + Point = new global::Mediapipe.RenderAnnotation.Types.Point(); + } + Point.MergeFrom(other.Point); + break; + case DataOneofCase.Line: + if (Line == null) { + Line = new global::Mediapipe.RenderAnnotation.Types.Line(); + } + Line.MergeFrom(other.Line); + break; + case DataOneofCase.Arrow: + if (Arrow == null) { + Arrow = new global::Mediapipe.RenderAnnotation.Types.Arrow(); + } + Arrow.MergeFrom(other.Arrow); + break; + case DataOneofCase.Text: + if (Text == null) { + Text = new global::Mediapipe.RenderAnnotation.Types.Text(); + } + Text.MergeFrom(other.Text); + break; + case DataOneofCase.RoundedRectangle: + if (RoundedRectangle == null) { + RoundedRectangle = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + } + RoundedRectangle.MergeFrom(other.RoundedRectangle); + break; + case DataOneofCase.FilledRoundedRectangle: + if (FilledRoundedRectangle == null) { + FilledRoundedRectangle = new global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle(); + } + FilledRoundedRectangle.MergeFrom(other.FilledRoundedRectangle); + break; + case DataOneofCase.GradientLine: + if (GradientLine == null) { + GradientLine = new global::Mediapipe.RenderAnnotation.Types.GradientLine(); + } + GradientLine.MergeFrom(other.GradientLine); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Mediapipe.RenderAnnotation.Types.Rectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + if (dataCase_ == DataOneofCase.Rectangle) { + subBuilder.MergeFrom(Rectangle); + } + input.ReadMessage(subBuilder); + Rectangle = subBuilder; + break; + } + case 18: { + global::Mediapipe.RenderAnnotation.Types.FilledRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledRectangle(); + if (dataCase_ == DataOneofCase.FilledRectangle) { + subBuilder.MergeFrom(FilledRectangle); + } + input.ReadMessage(subBuilder); + FilledRectangle = subBuilder; + break; + } + case 26: { + global::Mediapipe.RenderAnnotation.Types.Oval subBuilder = new global::Mediapipe.RenderAnnotation.Types.Oval(); + if (dataCase_ == DataOneofCase.Oval) { + subBuilder.MergeFrom(Oval); + } + input.ReadMessage(subBuilder); + Oval = subBuilder; + break; + } + case 34: { + global::Mediapipe.RenderAnnotation.Types.FilledOval subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledOval(); + if (dataCase_ == DataOneofCase.FilledOval) { + subBuilder.MergeFrom(FilledOval); + } + input.ReadMessage(subBuilder); + FilledOval = subBuilder; + break; + } + case 42: { + global::Mediapipe.RenderAnnotation.Types.Point subBuilder = new global::Mediapipe.RenderAnnotation.Types.Point(); + if (dataCase_ == DataOneofCase.Point) { + subBuilder.MergeFrom(Point); + } + input.ReadMessage(subBuilder); + Point = subBuilder; + break; + } + case 50: { + global::Mediapipe.RenderAnnotation.Types.Line subBuilder = new global::Mediapipe.RenderAnnotation.Types.Line(); + if (dataCase_ == DataOneofCase.Line) { + subBuilder.MergeFrom(Line); + } + input.ReadMessage(subBuilder); + Line = subBuilder; + break; + } + case 58: { + global::Mediapipe.RenderAnnotation.Types.Arrow subBuilder = new global::Mediapipe.RenderAnnotation.Types.Arrow(); + if (dataCase_ == DataOneofCase.Arrow) { + subBuilder.MergeFrom(Arrow); + } + input.ReadMessage(subBuilder); + Arrow = subBuilder; + break; + } + case 66: { + global::Mediapipe.RenderAnnotation.Types.Text subBuilder = new global::Mediapipe.RenderAnnotation.Types.Text(); + if (dataCase_ == DataOneofCase.Text) { + subBuilder.MergeFrom(Text); + } + input.ReadMessage(subBuilder); + Text = subBuilder; + break; + } + case 74: { + global::Mediapipe.RenderAnnotation.Types.RoundedRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + if (dataCase_ == DataOneofCase.RoundedRectangle) { + subBuilder.MergeFrom(RoundedRectangle); + } + input.ReadMessage(subBuilder); + RoundedRectangle = subBuilder; + break; + } + case 82: { + global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle(); + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) { + subBuilder.MergeFrom(FilledRoundedRectangle); + } + input.ReadMessage(subBuilder); + FilledRoundedRectangle = subBuilder; + break; + } + case 89: { + Thickness = input.ReadDouble(); + break; + } + case 98: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 106: { + SceneTag = input.ReadString(); + break; + } + case 114: { + global::Mediapipe.RenderAnnotation.Types.GradientLine subBuilder = new global::Mediapipe.RenderAnnotation.Types.GradientLine(); + if (dataCase_ == DataOneofCase.GradientLine) { + subBuilder.MergeFrom(GradientLine); + } + input.ReadMessage(subBuilder); + GradientLine = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Mediapipe.RenderAnnotation.Types.Rectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + if (dataCase_ == DataOneofCase.Rectangle) { + subBuilder.MergeFrom(Rectangle); + } + input.ReadMessage(subBuilder); + Rectangle = subBuilder; + break; + } + case 18: { + global::Mediapipe.RenderAnnotation.Types.FilledRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledRectangle(); + if (dataCase_ == DataOneofCase.FilledRectangle) { + subBuilder.MergeFrom(FilledRectangle); + } + input.ReadMessage(subBuilder); + FilledRectangle = subBuilder; + break; + } + case 26: { + global::Mediapipe.RenderAnnotation.Types.Oval subBuilder = new global::Mediapipe.RenderAnnotation.Types.Oval(); + if (dataCase_ == DataOneofCase.Oval) { + subBuilder.MergeFrom(Oval); + } + input.ReadMessage(subBuilder); + Oval = subBuilder; + break; + } + case 34: { + global::Mediapipe.RenderAnnotation.Types.FilledOval subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledOval(); + if (dataCase_ == DataOneofCase.FilledOval) { + subBuilder.MergeFrom(FilledOval); + } + input.ReadMessage(subBuilder); + FilledOval = subBuilder; + break; + } + case 42: { + global::Mediapipe.RenderAnnotation.Types.Point subBuilder = new global::Mediapipe.RenderAnnotation.Types.Point(); + if (dataCase_ == DataOneofCase.Point) { + subBuilder.MergeFrom(Point); + } + input.ReadMessage(subBuilder); + Point = subBuilder; + break; + } + case 50: { + global::Mediapipe.RenderAnnotation.Types.Line subBuilder = new global::Mediapipe.RenderAnnotation.Types.Line(); + if (dataCase_ == DataOneofCase.Line) { + subBuilder.MergeFrom(Line); + } + input.ReadMessage(subBuilder); + Line = subBuilder; + break; + } + case 58: { + global::Mediapipe.RenderAnnotation.Types.Arrow subBuilder = new global::Mediapipe.RenderAnnotation.Types.Arrow(); + if (dataCase_ == DataOneofCase.Arrow) { + subBuilder.MergeFrom(Arrow); + } + input.ReadMessage(subBuilder); + Arrow = subBuilder; + break; + } + case 66: { + global::Mediapipe.RenderAnnotation.Types.Text subBuilder = new global::Mediapipe.RenderAnnotation.Types.Text(); + if (dataCase_ == DataOneofCase.Text) { + subBuilder.MergeFrom(Text); + } + input.ReadMessage(subBuilder); + Text = subBuilder; + break; + } + case 74: { + global::Mediapipe.RenderAnnotation.Types.RoundedRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + if (dataCase_ == DataOneofCase.RoundedRectangle) { + subBuilder.MergeFrom(RoundedRectangle); + } + input.ReadMessage(subBuilder); + RoundedRectangle = subBuilder; + break; + } + case 82: { + global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle subBuilder = new global::Mediapipe.RenderAnnotation.Types.FilledRoundedRectangle(); + if (dataCase_ == DataOneofCase.FilledRoundedRectangle) { + subBuilder.MergeFrom(FilledRoundedRectangle); + } + input.ReadMessage(subBuilder); + FilledRoundedRectangle = subBuilder; + break; + } + case 89: { + Thickness = input.ReadDouble(); + break; + } + case 98: { + if (color_ == null) { + Color = new global::Mediapipe.Color(); + } + input.ReadMessage(Color); + break; + } + case 106: { + SceneTag = input.ReadString(); + break; + } + case 114: { + global::Mediapipe.RenderAnnotation.Types.GradientLine subBuilder = new global::Mediapipe.RenderAnnotation.Types.GradientLine(); + if (dataCase_ == DataOneofCase.GradientLine) { + subBuilder.MergeFrom(GradientLine); + } + input.ReadMessage(subBuilder); + GradientLine = subBuilder; + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RenderAnnotation message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class Rectangle : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rectangle()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rectangle() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rectangle(Rectangle other) : this() { + _hasBits0 = other._hasBits0; + left_ = other.left_; + top_ = other.top_; + right_ = other.right_; + bottom_ = other.bottom_; + normalized_ = other.normalized_; + rotation_ = other.rotation_; + topLeftThickness_ = other.topLeftThickness_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Rectangle Clone() { + return new Rectangle(this); + } + + /// Field number for the "left" field. + public const int LeftFieldNumber = 1; + private readonly static double LeftDefaultValue = 0D; + + private double left_; + /// + /// Left and top refer to the x and y coordinates of the top-left corner + /// of rectangle, whereas right and bottom refer to the x and y coordinates + /// of the bottom-right corner of rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Left { + get { if ((_hasBits0 & 1) != 0) { return left_; } else { return LeftDefaultValue; } } + set { + _hasBits0 |= 1; + left_ = value; + } + } + /// Gets whether the "left" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeft { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "left" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeft() { + _hasBits0 &= ~1; + } + + /// Field number for the "top" field. + public const int TopFieldNumber = 2; + private readonly static double TopDefaultValue = 0D; + + private double top_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Top { + get { if ((_hasBits0 & 2) != 0) { return top_; } else { return TopDefaultValue; } } + set { + _hasBits0 |= 2; + top_ = value; + } + } + /// Gets whether the "top" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTop { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "top" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTop() { + _hasBits0 &= ~2; + } + + /// Field number for the "right" field. + public const int RightFieldNumber = 3; + private readonly static double RightDefaultValue = 0D; + + private double right_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Right { + get { if ((_hasBits0 & 4) != 0) { return right_; } else { return RightDefaultValue; } } + set { + _hasBits0 |= 4; + right_ = value; + } + } + /// Gets whether the "right" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "right" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRight() { + _hasBits0 &= ~4; + } + + /// Field number for the "bottom" field. + public const int BottomFieldNumber = 4; + private readonly static double BottomDefaultValue = 0D; + + private double bottom_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Bottom { + get { if ((_hasBits0 & 8) != 0) { return bottom_; } else { return BottomDefaultValue; } } + set { + _hasBits0 |= 8; + bottom_ = value; + } + } + /// Gets whether the "bottom" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBottom { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "bottom" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBottom() { + _hasBits0 &= ~8; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 5; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 16) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 16; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~16; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 6; + private readonly static double RotationDefaultValue = 0D; + + private double rotation_; + /// + /// Rotation in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Rotation { + get { if ((_hasBits0 & 32) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 32; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~32; + } + + /// Field number for the "top_left_thickness" field. + public const int TopLeftThicknessFieldNumber = 7; + private readonly static double TopLeftThicknessDefaultValue = 0D; + + private double topLeftThickness_; + /// + /// Radius of top left corner circle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double TopLeftThickness { + get { if ((_hasBits0 & 64) != 0) { return topLeftThickness_; } else { return TopLeftThicknessDefaultValue; } } + set { + _hasBits0 |= 64; + topLeftThickness_ = value; + } + } + /// Gets whether the "top_left_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTopLeftThickness { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "top_left_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTopLeftThickness() { + _hasBits0 &= ~64; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Rectangle); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Rectangle other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Left, other.Left)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Top, other.Top)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Right, other.Right)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Bottom, other.Bottom)) return false; + if (Normalized != other.Normalized) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TopLeftThickness, other.TopLeftThickness)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasLeft) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Left); + if (HasTop) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Top); + if (HasRight) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Right); + if (HasBottom) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Bottom); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Rotation); + if (HasTopLeftThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TopLeftThickness); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasLeft) { + output.WriteRawTag(9); + output.WriteDouble(Left); + } + if (HasTop) { + output.WriteRawTag(17); + output.WriteDouble(Top); + } + if (HasRight) { + output.WriteRawTag(25); + output.WriteDouble(Right); + } + if (HasBottom) { + output.WriteRawTag(33); + output.WriteDouble(Bottom); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasRotation) { + output.WriteRawTag(49); + output.WriteDouble(Rotation); + } + if (HasTopLeftThickness) { + output.WriteRawTag(57); + output.WriteDouble(TopLeftThickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasLeft) { + output.WriteRawTag(9); + output.WriteDouble(Left); + } + if (HasTop) { + output.WriteRawTag(17); + output.WriteDouble(Top); + } + if (HasRight) { + output.WriteRawTag(25); + output.WriteDouble(Right); + } + if (HasBottom) { + output.WriteRawTag(33); + output.WriteDouble(Bottom); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasRotation) { + output.WriteRawTag(49); + output.WriteDouble(Rotation); + } + if (HasTopLeftThickness) { + output.WriteRawTag(57); + output.WriteDouble(TopLeftThickness); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasLeft) { + size += 1 + 8; + } + if (HasTop) { + size += 1 + 8; + } + if (HasRight) { + size += 1 + 8; + } + if (HasBottom) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (HasRotation) { + size += 1 + 8; + } + if (HasTopLeftThickness) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Rectangle other) { + if (other == null) { + return; + } + if (other.HasLeft) { + Left = other.Left; + } + if (other.HasTop) { + Top = other.Top; + } + if (other.HasRight) { + Right = other.Right; + } + if (other.HasBottom) { + Bottom = other.Bottom; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.HasTopLeftThickness) { + TopLeftThickness = other.TopLeftThickness; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + Left = input.ReadDouble(); + break; + } + case 17: { + Top = input.ReadDouble(); + break; + } + case 25: { + Right = input.ReadDouble(); + break; + } + case 33: { + Bottom = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 49: { + Rotation = input.ReadDouble(); + break; + } + case 57: { + TopLeftThickness = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Left = input.ReadDouble(); + break; + } + case 17: { + Top = input.ReadDouble(); + break; + } + case 25: { + Right = input.ReadDouble(); + break; + } + case 33: { + Bottom = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 49: { + Rotation = input.ReadDouble(); + break; + } + case 57: { + TopLeftThickness = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + public sealed partial class FilledRectangle : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilledRectangle()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRectangle() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRectangle(FilledRectangle other) : this() { + rectangle_ = other.rectangle_ != null ? other.rectangle_.Clone() : null; + fillColor_ = other.fillColor_ != null ? other.fillColor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRectangle Clone() { + return new FilledRectangle(this); + } + + /// Field number for the "rectangle" field. + public const int RectangleFieldNumber = 1; + private global::Mediapipe.RenderAnnotation.Types.Rectangle rectangle_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Rectangle Rectangle { + get { return rectangle_; } + set { + rectangle_ = value; + } + } + + /// Field number for the "fill_color" field. + public const int FillColorFieldNumber = 2; + private global::Mediapipe.Color fillColor_; + /// + /// Color to fill in the rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color FillColor { + get { return fillColor_; } + set { + fillColor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FilledRectangle); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FilledRectangle other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Rectangle, other.Rectangle)) return false; + if (!object.Equals(FillColor, other.FillColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (rectangle_ != null) hash ^= Rectangle.GetHashCode(); + if (fillColor_ != null) hash ^= FillColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (rectangle_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rectangle); + } + if (fillColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FillColor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FilledRectangle other) { + if (other == null) { + return; + } + if (other.rectangle_ != null) { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + Rectangle.MergeFrom(other.Rectangle); + } + if (other.fillColor_ != null) { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + FillColor.MergeFrom(other.FillColor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + } + #endif + + } + + public sealed partial class RoundedRectangle : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RoundedRectangle()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoundedRectangle() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoundedRectangle(RoundedRectangle other) : this() { + _hasBits0 = other._hasBits0; + rectangle_ = other.rectangle_ != null ? other.rectangle_.Clone() : null; + cornerRadius_ = other.cornerRadius_; + lineType_ = other.lineType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RoundedRectangle Clone() { + return new RoundedRectangle(this); + } + + /// Field number for the "rectangle" field. + public const int RectangleFieldNumber = 1; + private global::Mediapipe.RenderAnnotation.Types.Rectangle rectangle_; + /// + /// A rounded rectangle is specified by a rectangle and a corner radius to + /// round each corner by. A corner radius of 0 implies a standard non-rounded + /// rectangle (i.e. sharp edges) but as the radius increases proportionally + /// to the width and height of the overall rectangle size, the corners + /// increasingly round. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Rectangle Rectangle { + get { return rectangle_; } + set { + rectangle_ = value; + } + } + + /// Field number for the "corner_radius" field. + public const int CornerRadiusFieldNumber = 2; + private readonly static int CornerRadiusDefaultValue = 0; + + private int cornerRadius_; + /// + /// The radius of the round corners. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CornerRadius { + get { if ((_hasBits0 & 1) != 0) { return cornerRadius_; } else { return CornerRadiusDefaultValue; } } + set { + _hasBits0 |= 1; + cornerRadius_ = value; + } + } + /// Gets whether the "corner_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCornerRadius { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "corner_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCornerRadius() { + _hasBits0 &= ~1; + } + + /// Field number for the "line_type" field. + public const int LineTypeFieldNumber = 3; + private readonly static int LineTypeDefaultValue = 4; + + private int lineType_; + /// + /// Use one of the following: + /// -1: a filled line (FILLED) + /// 4: a 4-connected line (LINE_4) + /// 8: a 8-connected line (LINE_8) + /// 16: an antialiased line (LINE_AA). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int LineType { + get { if ((_hasBits0 & 2) != 0) { return lineType_; } else { return LineTypeDefaultValue; } } + set { + _hasBits0 |= 2; + lineType_ = value; + } + } + /// Gets whether the "line_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLineType { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "line_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLineType() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RoundedRectangle); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RoundedRectangle other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Rectangle, other.Rectangle)) return false; + if (CornerRadius != other.CornerRadius) return false; + if (LineType != other.LineType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (rectangle_ != null) hash ^= Rectangle.GetHashCode(); + if (HasCornerRadius) hash ^= CornerRadius.GetHashCode(); + if (HasLineType) hash ^= LineType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (HasCornerRadius) { + output.WriteRawTag(16); + output.WriteInt32(CornerRadius); + } + if (HasLineType) { + output.WriteRawTag(24); + output.WriteInt32(LineType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (HasCornerRadius) { + output.WriteRawTag(16); + output.WriteInt32(CornerRadius); + } + if (HasLineType) { + output.WriteRawTag(24); + output.WriteInt32(LineType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (rectangle_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rectangle); + } + if (HasCornerRadius) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CornerRadius); + } + if (HasLineType) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LineType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RoundedRectangle other) { + if (other == null) { + return; + } + if (other.rectangle_ != null) { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + Rectangle.MergeFrom(other.Rectangle); + } + if (other.HasCornerRadius) { + CornerRadius = other.CornerRadius; + } + if (other.HasLineType) { + LineType = other.LineType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + case 16: { + CornerRadius = input.ReadInt32(); + break; + } + case 24: { + LineType = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + case 16: { + CornerRadius = input.ReadInt32(); + break; + } + case 24: { + LineType = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class FilledRoundedRectangle : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilledRoundedRectangle()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRoundedRectangle() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRoundedRectangle(FilledRoundedRectangle other) : this() { + roundedRectangle_ = other.roundedRectangle_ != null ? other.roundedRectangle_.Clone() : null; + fillColor_ = other.fillColor_ != null ? other.fillColor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledRoundedRectangle Clone() { + return new FilledRoundedRectangle(this); + } + + /// Field number for the "rounded_rectangle" field. + public const int RoundedRectangleFieldNumber = 1; + private global::Mediapipe.RenderAnnotation.Types.RoundedRectangle roundedRectangle_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.RoundedRectangle RoundedRectangle { + get { return roundedRectangle_; } + set { + roundedRectangle_ = value; + } + } + + /// Field number for the "fill_color" field. + public const int FillColorFieldNumber = 2; + private global::Mediapipe.Color fillColor_; + /// + /// Color to fill in the rounded rectangle. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color FillColor { + get { return fillColor_; } + set { + fillColor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FilledRoundedRectangle); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FilledRoundedRectangle other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(RoundedRectangle, other.RoundedRectangle)) return false; + if (!object.Equals(FillColor, other.FillColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (roundedRectangle_ != null) hash ^= RoundedRectangle.GetHashCode(); + if (fillColor_ != null) hash ^= FillColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (roundedRectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(RoundedRectangle); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (roundedRectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(RoundedRectangle); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (roundedRectangle_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RoundedRectangle); + } + if (fillColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FillColor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FilledRoundedRectangle other) { + if (other == null) { + return; + } + if (other.roundedRectangle_ != null) { + if (roundedRectangle_ == null) { + RoundedRectangle = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + } + RoundedRectangle.MergeFrom(other.RoundedRectangle); + } + if (other.fillColor_ != null) { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + FillColor.MergeFrom(other.FillColor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (roundedRectangle_ == null) { + RoundedRectangle = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + } + input.ReadMessage(RoundedRectangle); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (roundedRectangle_ == null) { + RoundedRectangle = new global::Mediapipe.RenderAnnotation.Types.RoundedRectangle(); + } + input.ReadMessage(RoundedRectangle); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + } + #endif + + } + + public sealed partial class Oval : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Oval()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Oval() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Oval(Oval other) : this() { + rectangle_ = other.rectangle_ != null ? other.rectangle_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Oval Clone() { + return new Oval(this); + } + + /// Field number for the "rectangle" field. + public const int RectangleFieldNumber = 1; + private global::Mediapipe.RenderAnnotation.Types.Rectangle rectangle_; + /// + /// An oval is specified by the rectangle that encloses the oval. For + /// example, a circle with center at (x,y) and radius r can be specified as a + /// Rectangle with left = x - r, right = y - r, and width = height = 2 * r. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Rectangle Rectangle { + get { return rectangle_; } + set { + rectangle_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Oval); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Oval other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Rectangle, other.Rectangle)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (rectangle_ != null) hash ^= Rectangle.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (rectangle_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Rectangle); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (rectangle_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rectangle); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Oval other) { + if (other == null) { + return; + } + if (other.rectangle_ != null) { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + Rectangle.MergeFrom(other.Rectangle); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (rectangle_ == null) { + Rectangle = new global::Mediapipe.RenderAnnotation.Types.Rectangle(); + } + input.ReadMessage(Rectangle); + break; + } + } + } + } + #endif + + } + + public sealed partial class FilledOval : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilledOval()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledOval() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledOval(FilledOval other) : this() { + oval_ = other.oval_ != null ? other.oval_.Clone() : null; + fillColor_ = other.fillColor_ != null ? other.fillColor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FilledOval Clone() { + return new FilledOval(this); + } + + /// Field number for the "oval" field. + public const int OvalFieldNumber = 1; + private global::Mediapipe.RenderAnnotation.Types.Oval oval_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Oval Oval { + get { return oval_; } + set { + oval_ = value; + } + } + + /// Field number for the "fill_color" field. + public const int FillColorFieldNumber = 2; + private global::Mediapipe.Color fillColor_; + /// + /// Color to fill in the oval. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color FillColor { + get { return fillColor_; } + set { + fillColor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FilledOval); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FilledOval other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Oval, other.Oval)) return false; + if (!object.Equals(FillColor, other.FillColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (oval_ != null) hash ^= Oval.GetHashCode(); + if (fillColor_ != null) hash ^= FillColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (oval_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Oval); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (oval_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Oval); + } + if (fillColor_ != null) { + output.WriteRawTag(18); + output.WriteMessage(FillColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (oval_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Oval); + } + if (fillColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(FillColor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FilledOval other) { + if (other == null) { + return; + } + if (other.oval_ != null) { + if (oval_ == null) { + Oval = new global::Mediapipe.RenderAnnotation.Types.Oval(); + } + Oval.MergeFrom(other.Oval); + } + if (other.fillColor_ != null) { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + FillColor.MergeFrom(other.FillColor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (oval_ == null) { + Oval = new global::Mediapipe.RenderAnnotation.Types.Oval(); + } + input.ReadMessage(Oval); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (oval_ == null) { + Oval = new global::Mediapipe.RenderAnnotation.Types.Oval(); + } + input.ReadMessage(Oval); + break; + } + case 18: { + if (fillColor_ == null) { + FillColor = new global::Mediapipe.Color(); + } + input.ReadMessage(FillColor); + break; + } + } + } + } + #endif + + } + + public sealed partial class Point : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Point()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point(Point other) : this() { + _hasBits0 = other._hasBits0; + x_ = other.x_; + y_ = other.y_; + normalized_ = other.normalized_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Point Clone() { + return new Point(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private readonly static double XDefaultValue = 0D; + + private double x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double X { + get { if ((_hasBits0 & 1) != 0) { return x_; } else { return XDefaultValue; } } + set { + _hasBits0 |= 1; + x_ = value; + } + } + /// Gets whether the "x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearX() { + _hasBits0 &= ~1; + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private readonly static double YDefaultValue = 0D; + + private double y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Y { + get { if ((_hasBits0 & 2) != 0) { return y_; } else { return YDefaultValue; } } + set { + _hasBits0 |= 2; + y_ = value; + } + } + /// Gets whether the "y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearY() { + _hasBits0 &= ~2; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 3; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 4) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 4; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Point); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Point other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(X, other.X)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Y, other.Y)) return false; + if (Normalized != other.Normalized) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(X); + if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Y); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasX) { + output.WriteRawTag(9); + output.WriteDouble(X); + } + if (HasY) { + output.WriteRawTag(17); + output.WriteDouble(Y); + } + if (HasNormalized) { + output.WriteRawTag(24); + output.WriteBool(Normalized); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasX) { + output.WriteRawTag(9); + output.WriteDouble(X); + } + if (HasY) { + output.WriteRawTag(17); + output.WriteDouble(Y); + } + if (HasNormalized) { + output.WriteRawTag(24); + output.WriteBool(Normalized); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasX) { + size += 1 + 8; + } + if (HasY) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Point other) { + if (other == null) { + return; + } + if (other.HasX) { + X = other.X; + } + if (other.HasY) { + Y = other.Y; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + X = input.ReadDouble(); + break; + } + case 17: { + Y = input.ReadDouble(); + break; + } + case 24: { + Normalized = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + X = input.ReadDouble(); + break; + } + case 17: { + Y = input.ReadDouble(); + break; + } + case 24: { + Normalized = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Line : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Line()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Line() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Line(Line other) : this() { + _hasBits0 = other._hasBits0; + xStart_ = other.xStart_; + yStart_ = other.yStart_; + xEnd_ = other.xEnd_; + yEnd_ = other.yEnd_; + normalized_ = other.normalized_; + lineType_ = other.lineType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Line Clone() { + return new Line(this); + } + + /// Field number for the "x_start" field. + public const int XStartFieldNumber = 1; + private readonly static double XStartDefaultValue = 0D; + + private double xStart_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XStart { + get { if ((_hasBits0 & 1) != 0) { return xStart_; } else { return XStartDefaultValue; } } + set { + _hasBits0 |= 1; + xStart_ = value; + } + } + /// Gets whether the "x_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXStart { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXStart() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_start" field. + public const int YStartFieldNumber = 2; + private readonly static double YStartDefaultValue = 0D; + + private double yStart_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YStart { + get { if ((_hasBits0 & 2) != 0) { return yStart_; } else { return YStartDefaultValue; } } + set { + _hasBits0 |= 2; + yStart_ = value; + } + } + /// Gets whether the "y_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYStart { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYStart() { + _hasBits0 &= ~2; + } + + /// Field number for the "x_end" field. + public const int XEndFieldNumber = 3; + private readonly static double XEndDefaultValue = 0D; + + private double xEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XEnd { + get { if ((_hasBits0 & 4) != 0) { return xEnd_; } else { return XEndDefaultValue; } } + set { + _hasBits0 |= 4; + xEnd_ = value; + } + } + /// Gets whether the "x_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXEnd { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "x_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXEnd() { + _hasBits0 &= ~4; + } + + /// Field number for the "y_end" field. + public const int YEndFieldNumber = 4; + private readonly static double YEndDefaultValue = 0D; + + private double yEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YEnd { + get { if ((_hasBits0 & 8) != 0) { return yEnd_; } else { return YEndDefaultValue; } } + set { + _hasBits0 |= 8; + yEnd_ = value; + } + } + /// Gets whether the "y_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYEnd { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "y_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYEnd() { + _hasBits0 &= ~8; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 5; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 16) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 16; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~16; + } + + /// Field number for the "line_type" field. + public const int LineTypeFieldNumber = 6; + private readonly static global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType LineTypeDefaultValue = global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType.Solid; + + private global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType lineType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType LineType { + get { if ((_hasBits0 & 32) != 0) { return lineType_; } else { return LineTypeDefaultValue; } } + set { + _hasBits0 |= 32; + lineType_ = value; + } + } + /// Gets whether the "line_type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLineType { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "line_type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLineType() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Line); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Line other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XStart, other.XStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YStart, other.YStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XEnd, other.XEnd)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YEnd, other.YEnd)) return false; + if (Normalized != other.Normalized) return false; + if (LineType != other.LineType) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XStart); + if (HasYStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YStart); + if (HasXEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XEnd); + if (HasYEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YEnd); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (HasLineType) hash ^= LineType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasLineType) { + output.WriteRawTag(48); + output.WriteEnum((int) LineType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasLineType) { + output.WriteRawTag(48); + output.WriteEnum((int) LineType); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXStart) { + size += 1 + 8; + } + if (HasYStart) { + size += 1 + 8; + } + if (HasXEnd) { + size += 1 + 8; + } + if (HasYEnd) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (HasLineType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LineType); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Line other) { + if (other == null) { + return; + } + if (other.HasXStart) { + XStart = other.XStart; + } + if (other.HasYStart) { + YStart = other.YStart; + } + if (other.HasXEnd) { + XEnd = other.XEnd; + } + if (other.HasYEnd) { + YEnd = other.YEnd; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + if (other.HasLineType) { + LineType = other.LineType; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 48: { + LineType = (global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 48: { + LineType = (global::Mediapipe.RenderAnnotation.Types.Line.Types.LineType) input.ReadEnum(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Line message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum LineType { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("SOLID")] Solid = 1, + [pbr::OriginalName("DASHED")] Dashed = 2, + } + + } + #endregion + + } + + public sealed partial class GradientLine : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GradientLine()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GradientLine() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GradientLine(GradientLine other) : this() { + _hasBits0 = other._hasBits0; + xStart_ = other.xStart_; + yStart_ = other.yStart_; + xEnd_ = other.xEnd_; + yEnd_ = other.yEnd_; + normalized_ = other.normalized_; + color1_ = other.color1_ != null ? other.color1_.Clone() : null; + color2_ = other.color2_ != null ? other.color2_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GradientLine Clone() { + return new GradientLine(this); + } + + /// Field number for the "x_start" field. + public const int XStartFieldNumber = 1; + private readonly static double XStartDefaultValue = 0D; + + private double xStart_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XStart { + get { if ((_hasBits0 & 1) != 0) { return xStart_; } else { return XStartDefaultValue; } } + set { + _hasBits0 |= 1; + xStart_ = value; + } + } + /// Gets whether the "x_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXStart { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXStart() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_start" field. + public const int YStartFieldNumber = 2; + private readonly static double YStartDefaultValue = 0D; + + private double yStart_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YStart { + get { if ((_hasBits0 & 2) != 0) { return yStart_; } else { return YStartDefaultValue; } } + set { + _hasBits0 |= 2; + yStart_ = value; + } + } + /// Gets whether the "y_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYStart { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYStart() { + _hasBits0 &= ~2; + } + + /// Field number for the "x_end" field. + public const int XEndFieldNumber = 3; + private readonly static double XEndDefaultValue = 0D; + + private double xEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XEnd { + get { if ((_hasBits0 & 4) != 0) { return xEnd_; } else { return XEndDefaultValue; } } + set { + _hasBits0 |= 4; + xEnd_ = value; + } + } + /// Gets whether the "x_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXEnd { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "x_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXEnd() { + _hasBits0 &= ~4; + } + + /// Field number for the "y_end" field. + public const int YEndFieldNumber = 4; + private readonly static double YEndDefaultValue = 0D; + + private double yEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YEnd { + get { if ((_hasBits0 & 8) != 0) { return yEnd_; } else { return YEndDefaultValue; } } + set { + _hasBits0 |= 8; + yEnd_ = value; + } + } + /// Gets whether the "y_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYEnd { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "y_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYEnd() { + _hasBits0 &= ~8; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 5; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 16) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 16; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~16; + } + + /// Field number for the "color1" field. + public const int Color1FieldNumber = 6; + private global::Mediapipe.Color color1_; + /// + /// Linearly interpolate between color1 and color2 along the line. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color1 { + get { return color1_; } + set { + color1_ = value; + } + } + + /// Field number for the "color2" field. + public const int Color2FieldNumber = 7; + private global::Mediapipe.Color color2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color Color2 { + get { return color2_; } + set { + color2_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GradientLine); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GradientLine other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XStart, other.XStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YStart, other.YStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XEnd, other.XEnd)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YEnd, other.YEnd)) return false; + if (Normalized != other.Normalized) return false; + if (!object.Equals(Color1, other.Color1)) return false; + if (!object.Equals(Color2, other.Color2)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XStart); + if (HasYStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YStart); + if (HasXEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XEnd); + if (HasYEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YEnd); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (color1_ != null) hash ^= Color1.GetHashCode(); + if (color2_ != null) hash ^= Color2.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (color1_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Color1); + } + if (color2_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Color2); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (color1_ != null) { + output.WriteRawTag(50); + output.WriteMessage(Color1); + } + if (color2_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Color2); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXStart) { + size += 1 + 8; + } + if (HasYStart) { + size += 1 + 8; + } + if (HasXEnd) { + size += 1 + 8; + } + if (HasYEnd) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (color1_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color1); + } + if (color2_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color2); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GradientLine other) { + if (other == null) { + return; + } + if (other.HasXStart) { + XStart = other.XStart; + } + if (other.HasYStart) { + YStart = other.YStart; + } + if (other.HasXEnd) { + XEnd = other.XEnd; + } + if (other.HasYEnd) { + YEnd = other.YEnd; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + if (other.color1_ != null) { + if (color1_ == null) { + Color1 = new global::Mediapipe.Color(); + } + Color1.MergeFrom(other.Color1); + } + if (other.color2_ != null) { + if (color2_ == null) { + Color2 = new global::Mediapipe.Color(); + } + Color2.MergeFrom(other.Color2); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 50: { + if (color1_ == null) { + Color1 = new global::Mediapipe.Color(); + } + input.ReadMessage(Color1); + break; + } + case 58: { + if (color2_ == null) { + Color2 = new global::Mediapipe.Color(); + } + input.ReadMessage(Color2); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 50: { + if (color1_ == null) { + Color1 = new global::Mediapipe.Color(); + } + input.ReadMessage(Color1); + break; + } + case 58: { + if (color2_ == null) { + Color2 = new global::Mediapipe.Color(); + } + input.ReadMessage(Color2); + break; + } + } + } + } + #endif + + } + + public sealed partial class Arrow : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Arrow()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Arrow() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Arrow(Arrow other) : this() { + _hasBits0 = other._hasBits0; + xStart_ = other.xStart_; + yStart_ = other.yStart_; + xEnd_ = other.xEnd_; + yEnd_ = other.yEnd_; + normalized_ = other.normalized_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Arrow Clone() { + return new Arrow(this); + } + + /// Field number for the "x_start" field. + public const int XStartFieldNumber = 1; + private readonly static double XStartDefaultValue = 0D; + + private double xStart_; + /// + /// The arrow head will be drawn at (x_end, y_end). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XStart { + get { if ((_hasBits0 & 1) != 0) { return xStart_; } else { return XStartDefaultValue; } } + set { + _hasBits0 |= 1; + xStart_ = value; + } + } + /// Gets whether the "x_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXStart { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "x_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXStart() { + _hasBits0 &= ~1; + } + + /// Field number for the "y_start" field. + public const int YStartFieldNumber = 2; + private readonly static double YStartDefaultValue = 0D; + + private double yStart_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YStart { + get { if ((_hasBits0 & 2) != 0) { return yStart_; } else { return YStartDefaultValue; } } + set { + _hasBits0 |= 2; + yStart_ = value; + } + } + /// Gets whether the "y_start" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYStart { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "y_start" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYStart() { + _hasBits0 &= ~2; + } + + /// Field number for the "x_end" field. + public const int XEndFieldNumber = 3; + private readonly static double XEndDefaultValue = 0D; + + private double xEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double XEnd { + get { if ((_hasBits0 & 4) != 0) { return xEnd_; } else { return XEndDefaultValue; } } + set { + _hasBits0 |= 4; + xEnd_ = value; + } + } + /// Gets whether the "x_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasXEnd { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "x_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearXEnd() { + _hasBits0 &= ~4; + } + + /// Field number for the "y_end" field. + public const int YEndFieldNumber = 4; + private readonly static double YEndDefaultValue = 0D; + + private double yEnd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double YEnd { + get { if ((_hasBits0 & 8) != 0) { return yEnd_; } else { return YEndDefaultValue; } } + set { + _hasBits0 |= 8; + yEnd_ = value; + } + } + /// Gets whether the "y_end" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasYEnd { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "y_end" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearYEnd() { + _hasBits0 &= ~8; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 5; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 16) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 16; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~16; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Arrow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Arrow other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XStart, other.XStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YStart, other.YStart)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(XEnd, other.XEnd)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(YEnd, other.YEnd)) return false; + if (Normalized != other.Normalized) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasXStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XStart); + if (HasYStart) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YStart); + if (HasXEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XEnd); + if (HasYEnd) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YEnd); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasXStart) { + output.WriteRawTag(9); + output.WriteDouble(XStart); + } + if (HasYStart) { + output.WriteRawTag(17); + output.WriteDouble(YStart); + } + if (HasXEnd) { + output.WriteRawTag(25); + output.WriteDouble(XEnd); + } + if (HasYEnd) { + output.WriteRawTag(33); + output.WriteDouble(YEnd); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasXStart) { + size += 1 + 8; + } + if (HasYStart) { + size += 1 + 8; + } + if (HasXEnd) { + size += 1 + 8; + } + if (HasYEnd) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Arrow other) { + if (other == null) { + return; + } + if (other.HasXStart) { + XStart = other.XStart; + } + if (other.HasYStart) { + YStart = other.YStart; + } + if (other.HasXEnd) { + XEnd = other.XEnd; + } + if (other.HasYEnd) { + YEnd = other.YEnd; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + XStart = input.ReadDouble(); + break; + } + case 17: { + YStart = input.ReadDouble(); + break; + } + case 25: { + XEnd = input.ReadDouble(); + break; + } + case 33: { + YEnd = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Text : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Text()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderAnnotation.Descriptor.NestedTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Text() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Text(Text other) : this() { + _hasBits0 = other._hasBits0; + displayText_ = other.displayText_; + left_ = other.left_; + baseline_ = other.baseline_; + fontHeight_ = other.fontHeight_; + normalized_ = other.normalized_; + fontFace_ = other.fontFace_; + centerHorizontally_ = other.centerHorizontally_; + centerVertically_ = other.centerVertically_; + outlineThickness_ = other.outlineThickness_; + outlineColor_ = other.outlineColor_ != null ? other.outlineColor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Text Clone() { + return new Text(this); + } + + /// Field number for the "display_text" field. + public const int DisplayTextFieldNumber = 1; + private readonly static string DisplayTextDefaultValue = ""; + + private string displayText_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayText { + get { return displayText_ ?? DisplayTextDefaultValue; } + set { + displayText_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "display_text" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisplayText { + get { return displayText_ != null; } + } + /// Clears the value of the "display_text" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisplayText() { + displayText_ = null; + } + + /// Field number for the "left" field. + public const int LeftFieldNumber = 2; + private readonly static double LeftDefaultValue = 0D; + + private double left_; + /// + /// The location to render the text. Left and baseline refer to the x and y + /// coordinates of the start location of text respectively. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Left { + get { if ((_hasBits0 & 1) != 0) { return left_; } else { return LeftDefaultValue; } } + set { + _hasBits0 |= 1; + left_ = value; + } + } + /// Gets whether the "left" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLeft { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "left" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLeft() { + _hasBits0 &= ~1; + } + + /// Field number for the "baseline" field. + public const int BaselineFieldNumber = 3; + private readonly static double BaselineDefaultValue = 0D; + + private double baseline_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double Baseline { + get { if ((_hasBits0 & 2) != 0) { return baseline_; } else { return BaselineDefaultValue; } } + set { + _hasBits0 |= 2; + baseline_ = value; + } + } + /// Gets whether the "baseline" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBaseline { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "baseline" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBaseline() { + _hasBits0 &= ~2; + } + + /// Field number for the "font_height" field. + public const int FontHeightFieldNumber = 4; + private readonly static double FontHeightDefaultValue = 8D; + + private double fontHeight_; + /// + /// The height of the text from top to baseline. When normalized=true, font + /// height is specified wrt the image height. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double FontHeight { + get { if ((_hasBits0 & 4) != 0) { return fontHeight_; } else { return FontHeightDefaultValue; } } + set { + _hasBits0 |= 4; + fontHeight_ = value; + } + } + /// Gets whether the "font_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFontHeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "font_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFontHeight() { + _hasBits0 &= ~4; + } + + /// Field number for the "normalized" field. + public const int NormalizedFieldNumber = 5; + private readonly static bool NormalizedDefaultValue = false; + + private bool normalized_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Normalized { + get { if ((_hasBits0 & 8) != 0) { return normalized_; } else { return NormalizedDefaultValue; } } + set { + _hasBits0 |= 8; + normalized_ = value; + } + } + /// Gets whether the "normalized" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNormalized { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "normalized" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNormalized() { + _hasBits0 &= ~8; + } + + /// Field number for the "font_face" field. + public const int FontFaceFieldNumber = 6; + private readonly static int FontFaceDefaultValue = 0; + + private int fontFace_; + /// + /// Specifies the font for the text. Font must be one of the following from + /// OpenCV: + /// cv::FONT_HERSHEY_SIMPLEX (0) + /// cv::FONT_HERSHEY_PLAIN (1) + /// cv::FONT_HERSHEY_DUPLEX (2) + /// cv::FONT_HERSHEY_COMPLEX (3) + /// cv::FONT_HERSHEY_TRIPLEX (4) + /// cv::FONT_HERSHEY_COMPLEX_SMALL (5) + /// cv::FONT_HERSHEY_SCRIPT_SIMPLEX (6) + /// cv::FONT_HERSHEY_SCRIPT_COMPLEX (7) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int FontFace { + get { if ((_hasBits0 & 16) != 0) { return fontFace_; } else { return FontFaceDefaultValue; } } + set { + _hasBits0 |= 16; + fontFace_ = value; + } + } + /// Gets whether the "font_face" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFontFace { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "font_face" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFontFace() { + _hasBits0 &= ~16; + } + + /// Field number for the "center_horizontally" field. + public const int CenterHorizontallyFieldNumber = 7; + private readonly static bool CenterHorizontallyDefaultValue = false; + + private bool centerHorizontally_; + /// + /// Options to center text around the anchor point (left, baseline) by + /// taking into account font shape, size and text length (e.g., + /// [left, baseline] represent [center_x, center_y]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CenterHorizontally { + get { if ((_hasBits0 & 32) != 0) { return centerHorizontally_; } else { return CenterHorizontallyDefaultValue; } } + set { + _hasBits0 |= 32; + centerHorizontally_ = value; + } + } + /// Gets whether the "center_horizontally" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCenterHorizontally { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "center_horizontally" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCenterHorizontally() { + _hasBits0 &= ~32; + } + + /// Field number for the "center_vertically" field. + public const int CenterVerticallyFieldNumber = 8; + private readonly static bool CenterVerticallyDefaultValue = false; + + private bool centerVertically_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool CenterVertically { + get { if ((_hasBits0 & 64) != 0) { return centerVertically_; } else { return CenterVerticallyDefaultValue; } } + set { + _hasBits0 |= 64; + centerVertically_ = value; + } + } + /// Gets whether the "center_vertically" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCenterVertically { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "center_vertically" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCenterVertically() { + _hasBits0 &= ~64; + } + + /// Field number for the "outline_thickness" field. + public const int OutlineThicknessFieldNumber = 11; + private readonly static double OutlineThicknessDefaultValue = 0D; + + private double outlineThickness_; + /// + /// Thickness of the text outline. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double OutlineThickness { + get { if ((_hasBits0 & 128) != 0) { return outlineThickness_; } else { return OutlineThicknessDefaultValue; } } + set { + _hasBits0 |= 128; + outlineThickness_ = value; + } + } + /// Gets whether the "outline_thickness" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOutlineThickness { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "outline_thickness" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOutlineThickness() { + _hasBits0 &= ~128; + } + + /// Field number for the "outline_color" field. + public const int OutlineColorFieldNumber = 12; + private global::Mediapipe.Color outlineColor_; + /// + /// Color of the text outline. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Color OutlineColor { + get { return outlineColor_; } + set { + outlineColor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Text); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Text other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DisplayText != other.DisplayText) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Left, other.Left)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Baseline, other.Baseline)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FontHeight, other.FontHeight)) return false; + if (Normalized != other.Normalized) return false; + if (FontFace != other.FontFace) return false; + if (CenterHorizontally != other.CenterHorizontally) return false; + if (CenterVertically != other.CenterVertically) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OutlineThickness, other.OutlineThickness)) return false; + if (!object.Equals(OutlineColor, other.OutlineColor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasDisplayText) hash ^= DisplayText.GetHashCode(); + if (HasLeft) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Left); + if (HasBaseline) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Baseline); + if (HasFontHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FontHeight); + if (HasNormalized) hash ^= Normalized.GetHashCode(); + if (HasFontFace) hash ^= FontFace.GetHashCode(); + if (HasCenterHorizontally) hash ^= CenterHorizontally.GetHashCode(); + if (HasCenterVertically) hash ^= CenterVertically.GetHashCode(); + if (HasOutlineThickness) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OutlineThickness); + if (outlineColor_ != null) hash ^= OutlineColor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasDisplayText) { + output.WriteRawTag(10); + output.WriteString(DisplayText); + } + if (HasLeft) { + output.WriteRawTag(17); + output.WriteDouble(Left); + } + if (HasBaseline) { + output.WriteRawTag(25); + output.WriteDouble(Baseline); + } + if (HasFontHeight) { + output.WriteRawTag(33); + output.WriteDouble(FontHeight); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasFontFace) { + output.WriteRawTag(48); + output.WriteInt32(FontFace); + } + if (HasCenterHorizontally) { + output.WriteRawTag(56); + output.WriteBool(CenterHorizontally); + } + if (HasCenterVertically) { + output.WriteRawTag(64); + output.WriteBool(CenterVertically); + } + if (HasOutlineThickness) { + output.WriteRawTag(89); + output.WriteDouble(OutlineThickness); + } + if (outlineColor_ != null) { + output.WriteRawTag(98); + output.WriteMessage(OutlineColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDisplayText) { + output.WriteRawTag(10); + output.WriteString(DisplayText); + } + if (HasLeft) { + output.WriteRawTag(17); + output.WriteDouble(Left); + } + if (HasBaseline) { + output.WriteRawTag(25); + output.WriteDouble(Baseline); + } + if (HasFontHeight) { + output.WriteRawTag(33); + output.WriteDouble(FontHeight); + } + if (HasNormalized) { + output.WriteRawTag(40); + output.WriteBool(Normalized); + } + if (HasFontFace) { + output.WriteRawTag(48); + output.WriteInt32(FontFace); + } + if (HasCenterHorizontally) { + output.WriteRawTag(56); + output.WriteBool(CenterHorizontally); + } + if (HasCenterVertically) { + output.WriteRawTag(64); + output.WriteBool(CenterVertically); + } + if (HasOutlineThickness) { + output.WriteRawTag(89); + output.WriteDouble(OutlineThickness); + } + if (outlineColor_ != null) { + output.WriteRawTag(98); + output.WriteMessage(OutlineColor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasDisplayText) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayText); + } + if (HasLeft) { + size += 1 + 8; + } + if (HasBaseline) { + size += 1 + 8; + } + if (HasFontHeight) { + size += 1 + 8; + } + if (HasNormalized) { + size += 1 + 1; + } + if (HasFontFace) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FontFace); + } + if (HasCenterHorizontally) { + size += 1 + 1; + } + if (HasCenterVertically) { + size += 1 + 1; + } + if (HasOutlineThickness) { + size += 1 + 8; + } + if (outlineColor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OutlineColor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Text other) { + if (other == null) { + return; + } + if (other.HasDisplayText) { + DisplayText = other.DisplayText; + } + if (other.HasLeft) { + Left = other.Left; + } + if (other.HasBaseline) { + Baseline = other.Baseline; + } + if (other.HasFontHeight) { + FontHeight = other.FontHeight; + } + if (other.HasNormalized) { + Normalized = other.Normalized; + } + if (other.HasFontFace) { + FontFace = other.FontFace; + } + if (other.HasCenterHorizontally) { + CenterHorizontally = other.CenterHorizontally; + } + if (other.HasCenterVertically) { + CenterVertically = other.CenterVertically; + } + if (other.HasOutlineThickness) { + OutlineThickness = other.OutlineThickness; + } + if (other.outlineColor_ != null) { + if (outlineColor_ == null) { + OutlineColor = new global::Mediapipe.Color(); + } + OutlineColor.MergeFrom(other.OutlineColor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + DisplayText = input.ReadString(); + break; + } + case 17: { + Left = input.ReadDouble(); + break; + } + case 25: { + Baseline = input.ReadDouble(); + break; + } + case 33: { + FontHeight = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 48: { + FontFace = input.ReadInt32(); + break; + } + case 56: { + CenterHorizontally = input.ReadBool(); + break; + } + case 64: { + CenterVertically = input.ReadBool(); + break; + } + case 89: { + OutlineThickness = input.ReadDouble(); + break; + } + case 98: { + if (outlineColor_ == null) { + OutlineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(OutlineColor); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + DisplayText = input.ReadString(); + break; + } + case 17: { + Left = input.ReadDouble(); + break; + } + case 25: { + Baseline = input.ReadDouble(); + break; + } + case 33: { + FontHeight = input.ReadDouble(); + break; + } + case 40: { + Normalized = input.ReadBool(); + break; + } + case 48: { + FontFace = input.ReadInt32(); + break; + } + case 56: { + CenterHorizontally = input.ReadBool(); + break; + } + case 64: { + CenterVertically = input.ReadBool(); + break; + } + case 89: { + OutlineThickness = input.ReadDouble(); + break; + } + case 98: { + if (outlineColor_ == null) { + OutlineColor = new global::Mediapipe.Color(); + } + input.ReadMessage(OutlineColor); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Represents a destination viewport to render annotations into, when specified + /// in RenderData. + /// + public sealed partial class RenderViewport : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RenderViewport()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.RenderDataReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderViewport() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderViewport(RenderViewport other) : this() { + _hasBits0 = other._hasBits0; + id_ = other.id_; + widthPx_ = other.widthPx_; + heightPx_ = other.heightPx_; + composeOnVideo_ = other.composeOnVideo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RenderViewport Clone() { + return new RenderViewport(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private readonly static string IdDefaultValue = ""; + + private string id_; + /// + /// A unique identifier for this viewport. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Id { + get { return id_ ?? IdDefaultValue; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasId { + get { return id_ != null; } + } + /// Clears the value of the "id" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearId() { + id_ = null; + } + + /// Field number for the "width_px" field. + public const int WidthPxFieldNumber = 2; + private readonly static int WidthPxDefaultValue = 0; + + private int widthPx_; + /// + /// The width and height of this viewport in absolute pixels. + /// Normalized coordinates on annotations destined for this viewport as + /// normalized relative to these absolute pixel dimensions. + /// Camera feeds destined for this viewport will be rescaled to match these + /// dimensions. + /// Note: It is not expected that mid-stream resizing should be possible -- + /// the visualizer is epxected to use the first dimensions it sees for a given + /// viewport and ignore any ignore subsequent changes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int WidthPx { + get { if ((_hasBits0 & 1) != 0) { return widthPx_; } else { return WidthPxDefaultValue; } } + set { + _hasBits0 |= 1; + widthPx_ = value; + } + } + /// Gets whether the "width_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidthPx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "width_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidthPx() { + _hasBits0 &= ~1; + } + + /// Field number for the "height_px" field. + public const int HeightPxFieldNumber = 3; + private readonly static int HeightPxDefaultValue = 0; + + private int heightPx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int HeightPx { + get { if ((_hasBits0 & 2) != 0) { return heightPx_; } else { return HeightPxDefaultValue; } } + set { + _hasBits0 |= 2; + heightPx_ = value; + } + } + /// Gets whether the "height_px" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeightPx { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "height_px" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeightPx() { + _hasBits0 &= ~2; + } + + /// Field number for the "compose_on_video" field. + public const int ComposeOnVideoFieldNumber = 4; + private readonly static bool ComposeOnVideoDefaultValue = false; + + private bool composeOnVideo_; + /// + /// Set to true if this viewport should render its annotations overtop of a + /// (rescaled to width/height) copy of the camera feed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComposeOnVideo { + get { if ((_hasBits0 & 4) != 0) { return composeOnVideo_; } else { return ComposeOnVideoDefaultValue; } } + set { + _hasBits0 |= 4; + composeOnVideo_ = value; + } + } + /// Gets whether the "compose_on_video" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComposeOnVideo { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "compose_on_video" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComposeOnVideo() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RenderViewport); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RenderViewport other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (WidthPx != other.WidthPx) return false; + if (HeightPx != other.HeightPx) return false; + if (ComposeOnVideo != other.ComposeOnVideo) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasId) hash ^= Id.GetHashCode(); + if (HasWidthPx) hash ^= WidthPx.GetHashCode(); + if (HasHeightPx) hash ^= HeightPx.GetHashCode(); + if (HasComposeOnVideo) hash ^= ComposeOnVideo.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasId) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (HasWidthPx) { + output.WriteRawTag(16); + output.WriteInt32(WidthPx); + } + if (HasHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(HeightPx); + } + if (HasComposeOnVideo) { + output.WriteRawTag(32); + output.WriteBool(ComposeOnVideo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasId) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (HasWidthPx) { + output.WriteRawTag(16); + output.WriteInt32(WidthPx); + } + if (HasHeightPx) { + output.WriteRawTag(24); + output.WriteInt32(HeightPx); + } + if (HasComposeOnVideo) { + output.WriteRawTag(32); + output.WriteBool(ComposeOnVideo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasId) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (HasWidthPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(WidthPx); + } + if (HasHeightPx) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(HeightPx); + } + if (HasComposeOnVideo) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RenderViewport other) { + if (other == null) { + return; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasWidthPx) { + WidthPx = other.WidthPx; + } + if (other.HasHeightPx) { + HeightPx = other.HeightPx; + } + if (other.HasComposeOnVideo) { + ComposeOnVideo = other.ComposeOnVideo; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 16: { + WidthPx = input.ReadInt32(); + break; + } + case 24: { + HeightPx = input.ReadInt32(); + break; + } + case 32: { + ComposeOnVideo = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 16: { + WidthPx = input.ReadInt32(); + break; + } + case 24: { + HeightPx = input.ReadInt32(); + break; + } + case 32: { + ComposeOnVideo = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs.meta new file mode 100644 index 0000000..cdeb187 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/RenderData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6475269ad8c98711994a2d30d2e61e4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs new file mode 100644 index 0000000..67da21c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs @@ -0,0 +1,3948 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/tone_estimation.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/tone_estimation.proto + public static partial class ToneEstimationReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/tone_estimation.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ToneEstimationReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci1tZWRpYXBpcGUvdXRpbC90cmFja2luZy90b25lX2VzdGltYXRpb24ucHJv", + "dG8SCW1lZGlhcGlwZRopbWVkaWFwaXBlL3V0aWwvdHJhY2tpbmcvdG9uZV9t", + "b2RlbHMucHJvdG8ilwUKClRvbmVDaGFuZ2USKwoJZ2Fpbl9iaWFzGAEgASgL", + "MhgubWVkaWFwaXBlLkdhaW5CaWFzTW9kZWwSKgoGYWZmaW5lGAIgASgLMhou", + "bWVkaWFwaXBlLkFmZmluZVRvbmVNb2RlbBI6ChFtaXh0dXJlX2dhaW5fYmlh", + "cxgDIAEoCzIfLm1lZGlhcGlwZS5NaXh0dXJlR2FpbkJpYXNNb2RlbBI5Cg5t", + "aXh0dXJlX2FmZmluZRgEIAEoCzIhLm1lZGlhcGlwZS5NaXh0dXJlQWZmaW5l", + "VG9uZU1vZGVsEhwKFG1peHR1cmVfZG9tYWluX3NpZ21hGAUgASgCEhcKDGZy", + "YWNfY2xpcHBlZBgGIAEoAjoBMBIWCg5sb3dfcGVyY2VudGlsZRgIIAEoAhIa", + "ChJsb3dfbWlkX3BlcmNlbnRpbGUYCSABKAISFgoObWlkX3BlcmNlbnRpbGUY", + "CiABKAISGwoTaGlnaF9taWRfcGVyY2VudGlsZRgLIAEoAhIXCg9oaWdoX3Bl", + "cmNlbnRpbGUYDCABKAISGQoKbG9nX2RvbWFpbhgNIAEoCDoFZmFsc2USLwoE", + "dHlwZRgOIAEoDjIaLm1lZGlhcGlwZS5Ub25lQ2hhbmdlLlR5cGU6BVZBTElE", + "Ej0KD3N0YWJpbGl0eV9zdGF0cxgPIAEoCzIkLm1lZGlhcGlwZS5Ub25lQ2hh", + "bmdlLlN0YWJpbGl0eVN0YXRzGlUKDlN0YWJpbGl0eVN0YXRzEhMKC251bV9p", + "bmxpZXJzGAEgASgFEhcKD2lubGllcl9mcmFjdGlvbhgCIAEoAhIVCg1pbmxp", + "ZXJfd2VpZ2h0GAMgASgBIh4KBFR5cGUSCQoFVkFMSUQQABILCgdJTlZBTElE", + "EAoi0gEKEFRvbmVNYXRjaE9wdGlvbnMSIgoUbWluX21hdGNoX3BlcmNlbnRp", + "bGUYASABKAI6BDAuMDESIgoUbWF4X21hdGNoX3BlcmNlbnRpbGUYAiABKAI6", + "BDAuOTkSIgoWbWF0Y2hfcGVyY2VudGlsZV9zdGVwcxgDIAEoBToCMTASGAoM", + "cGF0Y2hfcmFkaXVzGAQgASgFOgIxOBIdChBtYXhfZnJhY19jbGlwcGVkGAUg", + "ASgCOgMwLjQSGQoKbG9nX2RvbWFpbhgIIAEoCDoFZmFsc2UiiQEKD0NsaXBN", + "YXNrT3B0aW9ucxIaCgxtaW5fZXhwb3N1cmUYASABKAI6BDAuMDISGgoMbWF4", + "X2V4cG9zdXJlGAIgASgCOgQwLjk4Eh8KFG1heF9jbGlwcGVkX2NoYW5uZWxz", + "GAQgASgFOgExEh0KEmNsaXBfbWFza19kaWFtZXRlchgFIAEoBToBNSKBBwoV", + "VG9uZUVzdGltYXRpb25PcHRpb25zEjcKEnRvbmVfbWF0Y2hfb3B0aW9ucxgB", + "IAEoCzIbLm1lZGlhcGlwZS5Ub25lTWF0Y2hPcHRpb25zEjUKEWNsaXBfbWFz", + "a19vcHRpb25zGAIgASgLMhoubWVkaWFwaXBlLkNsaXBNYXNrT3B0aW9ucxIi", + "ChRzdGF0c19sb3dfcGVyY2VudGlsZRgDIAEoAjoEMC4wNRIlChhzdGF0c19s", + "b3dfbWlkX3BlcmNlbnRpbGUYBCABKAI6AzAuMhIhChRzdGF0c19taWRfcGVy", + "Y2VudGlsZRgFIAEoAjoDMC41EiYKGXN0YXRzX2hpZ2hfbWlkX3BlcmNlbnRp", + "bGUYBiABKAI6AzAuOBIjChVzdGF0c19oaWdoX3BlcmNlbnRpbGUYByABKAI6", + "BDAuOTUSGwoPaXJsc19pdGVyYXRpb25zGAggASgFOgIxMBJQChdzdGFibGVf", + "Z2Fpbl9iaWFzX2JvdW5kcxgJIAEoCzIvLm1lZGlhcGlwZS5Ub25lRXN0aW1h", + "dGlvbk9wdGlvbnMuR2FpbkJpYXNCb3VuZHMSWQoPZG93bnNhbXBsZV9tb2Rl", + "GAogASgOMi8ubWVkaWFwaXBlLlRvbmVFc3RpbWF0aW9uT3B0aW9ucy5Eb3du", + "c2FtcGxlTW9kZToPRE9XTlNBTVBMRV9OT05FEh4KEWRvd25zYW1wbGluZ19z", + "aXplGAsgASgFOgMyNTYSHAoRZG93bnNhbXBsZV9mYWN0b3IYDCABKAI6ATIa", + "uwEKDkdhaW5CaWFzQm91bmRzEiEKE21pbl9pbmxpZXJfZnJhY3Rpb24YASAB", + "KAI6BDAuNzUSHgoRbWluX2lubGllcl93ZWlnaHQYAiABKAI6AzAuNRIYCgps", + "b3dlcl9nYWluGAMgASgCOgQwLjc1EhkKCnVwcGVyX2dhaW4YBCABKAI6BTEu", + "MzM0EhgKCmxvd2VyX2JpYXMYBSABKAI6BC0wLjISFwoKdXBwZXJfYmlhcxgG", + "IAEoAjoDMC4yIncKDkRvd25zYW1wbGVNb2RlEhMKD0RPV05TQU1QTEVfTk9O", + "RRABEhoKFkRPV05TQU1QTEVfVE9fTUFYX1NJWkUQAhIYChRET1dOU0FNUExF", + "X0JZX0ZBQ1RPUhADEhoKFkRPV05TQU1QTEVfVE9fTUlOX1NJWkUQBCIvCglU", + "b25lTWF0Y2gSEAoIY3Vycl92YWwYASABKAISEAoIcHJldl92YWwYAiABKAIi", + "UgoOUGF0Y2hUb25lTWF0Y2gSKAoKdG9uZV9tYXRjaBgBIAMoCzIULm1lZGlh", + "cGlwZS5Ub25lTWF0Y2gSFgoLaXJsc193ZWlnaHQYAiABKAI6ATE=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.ToneModelsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneChange), global::Mediapipe.ToneChange.Parser, new[]{ "GainBias", "Affine", "MixtureGainBias", "MixtureAffine", "MixtureDomainSigma", "FracClipped", "LowPercentile", "LowMidPercentile", "MidPercentile", "HighMidPercentile", "HighPercentile", "LogDomain", "Type", "StabilityStats" }, null, new[]{ typeof(global::Mediapipe.ToneChange.Types.Type) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneChange.Types.StabilityStats), global::Mediapipe.ToneChange.Types.StabilityStats.Parser, new[]{ "NumInliers", "InlierFraction", "InlierWeight" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneMatchOptions), global::Mediapipe.ToneMatchOptions.Parser, new[]{ "MinMatchPercentile", "MaxMatchPercentile", "MatchPercentileSteps", "PatchRadius", "MaxFracClipped", "LogDomain" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ClipMaskOptions), global::Mediapipe.ClipMaskOptions.Parser, new[]{ "MinExposure", "MaxExposure", "MaxClippedChannels", "ClipMaskDiameter" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneEstimationOptions), global::Mediapipe.ToneEstimationOptions.Parser, new[]{ "ToneMatchOptions", "ClipMaskOptions", "StatsLowPercentile", "StatsLowMidPercentile", "StatsMidPercentile", "StatsHighMidPercentile", "StatsHighPercentile", "IrlsIterations", "StableGainBiasBounds", "DownsampleMode", "DownsamplingSize", "DownsampleFactor" }, null, new[]{ typeof(global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds), global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds.Parser, new[]{ "MinInlierFraction", "MinInlierWeight", "LowerGain", "UpperGain", "LowerBias", "UpperBias" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.ToneMatch), global::Mediapipe.ToneMatch.Parser, new[]{ "CurrVal", "PrevVal" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.PatchToneMatch), global::Mediapipe.PatchToneMatch.Parser, new[]{ "ToneMatch", "IrlsWeight" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Capture tone change between two frames and per-frame tone statistics. + /// The estimated tone change describes the transformation of color intensities + /// from the current to the previous frame. + /// Next tag: 16 + /// + public sealed partial class ToneChange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ToneChange()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneChange() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneChange(ToneChange other) : this() { + _hasBits0 = other._hasBits0; + gainBias_ = other.gainBias_ != null ? other.gainBias_.Clone() : null; + affine_ = other.affine_ != null ? other.affine_.Clone() : null; + mixtureGainBias_ = other.mixtureGainBias_ != null ? other.mixtureGainBias_.Clone() : null; + mixtureAffine_ = other.mixtureAffine_ != null ? other.mixtureAffine_.Clone() : null; + mixtureDomainSigma_ = other.mixtureDomainSigma_; + fracClipped_ = other.fracClipped_; + lowPercentile_ = other.lowPercentile_; + lowMidPercentile_ = other.lowMidPercentile_; + midPercentile_ = other.midPercentile_; + highMidPercentile_ = other.highMidPercentile_; + highPercentile_ = other.highPercentile_; + logDomain_ = other.logDomain_; + type_ = other.type_; + stabilityStats_ = other.stabilityStats_ != null ? other.stabilityStats_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneChange Clone() { + return new ToneChange(this); + } + + /// Field number for the "gain_bias" field. + public const int GainBiasFieldNumber = 1; + private global::Mediapipe.GainBiasModel gainBias_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.GainBiasModel GainBias { + get { return gainBias_; } + set { + gainBias_ = value; + } + } + + /// Field number for the "affine" field. + public const int AffineFieldNumber = 2; + private global::Mediapipe.AffineToneModel affine_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.AffineToneModel Affine { + get { return affine_; } + set { + affine_ = value; + } + } + + /// Field number for the "mixture_gain_bias" field. + public const int MixtureGainBiasFieldNumber = 3; + private global::Mediapipe.MixtureGainBiasModel mixtureGainBias_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MixtureGainBiasModel MixtureGainBias { + get { return mixtureGainBias_; } + set { + mixtureGainBias_ = value; + } + } + + /// Field number for the "mixture_affine" field. + public const int MixtureAffineFieldNumber = 4; + private global::Mediapipe.MixtureAffineToneModel mixtureAffine_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MixtureAffineToneModel MixtureAffine { + get { return mixtureAffine_; } + set { + mixtureAffine_ = value; + } + } + + /// Field number for the "mixture_domain_sigma" field. + public const int MixtureDomainSigmaFieldNumber = 5; + private readonly static float MixtureDomainSigmaDefaultValue = 0F; + + private float mixtureDomainSigma_; + /// + /// TODO: Implement. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MixtureDomainSigma { + get { if ((_hasBits0 & 1) != 0) { return mixtureDomainSigma_; } else { return MixtureDomainSigmaDefaultValue; } } + set { + _hasBits0 |= 1; + mixtureDomainSigma_ = value; + } + } + /// Gets whether the "mixture_domain_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMixtureDomainSigma { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "mixture_domain_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMixtureDomainSigma() { + _hasBits0 &= ~1; + } + + /// Field number for the "frac_clipped" field. + public const int FracClippedFieldNumber = 6; + private readonly static float FracClippedDefaultValue = 0F; + + private float fracClipped_; + /// + /// Fraction of clipped pixels in [0, 1]. + /// A pixel is considered clipped if more than + /// ToneEstimationOptions::max_clipped_channels are over- + /// or under exposed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float FracClipped { + get { if ((_hasBits0 & 2) != 0) { return fracClipped_; } else { return FracClippedDefaultValue; } } + set { + _hasBits0 |= 2; + fracClipped_ = value; + } + } + /// Gets whether the "frac_clipped" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFracClipped { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "frac_clipped" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFracClipped() { + _hasBits0 &= ~2; + } + + /// Field number for the "low_percentile" field. + public const int LowPercentileFieldNumber = 8; + private readonly static float LowPercentileDefaultValue = 0F; + + private float lowPercentile_; + /// + /// [low|mid|high]_percentile's. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowPercentile { + get { if ((_hasBits0 & 4) != 0) { return lowPercentile_; } else { return LowPercentileDefaultValue; } } + set { + _hasBits0 |= 4; + lowPercentile_ = value; + } + } + /// Gets whether the "low_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowPercentile { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "low_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowPercentile() { + _hasBits0 &= ~4; + } + + /// Field number for the "low_mid_percentile" field. + public const int LowMidPercentileFieldNumber = 9; + private readonly static float LowMidPercentileDefaultValue = 0F; + + private float lowMidPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowMidPercentile { + get { if ((_hasBits0 & 8) != 0) { return lowMidPercentile_; } else { return LowMidPercentileDefaultValue; } } + set { + _hasBits0 |= 8; + lowMidPercentile_ = value; + } + } + /// Gets whether the "low_mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowMidPercentile { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "low_mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowMidPercentile() { + _hasBits0 &= ~8; + } + + /// Field number for the "mid_percentile" field. + public const int MidPercentileFieldNumber = 10; + private readonly static float MidPercentileDefaultValue = 0F; + + private float midPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MidPercentile { + get { if ((_hasBits0 & 16) != 0) { return midPercentile_; } else { return MidPercentileDefaultValue; } } + set { + _hasBits0 |= 16; + midPercentile_ = value; + } + } + /// Gets whether the "mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMidPercentile { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMidPercentile() { + _hasBits0 &= ~16; + } + + /// Field number for the "high_mid_percentile" field. + public const int HighMidPercentileFieldNumber = 11; + private readonly static float HighMidPercentileDefaultValue = 0F; + + private float highMidPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HighMidPercentile { + get { if ((_hasBits0 & 32) != 0) { return highMidPercentile_; } else { return HighMidPercentileDefaultValue; } } + set { + _hasBits0 |= 32; + highMidPercentile_ = value; + } + } + /// Gets whether the "high_mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHighMidPercentile { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "high_mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHighMidPercentile() { + _hasBits0 &= ~32; + } + + /// Field number for the "high_percentile" field. + public const int HighPercentileFieldNumber = 12; + private readonly static float HighPercentileDefaultValue = 0F; + + private float highPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HighPercentile { + get { if ((_hasBits0 & 64) != 0) { return highPercentile_; } else { return HighPercentileDefaultValue; } } + set { + _hasBits0 |= 64; + highPercentile_ = value; + } + } + /// Gets whether the "high_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHighPercentile { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "high_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHighPercentile() { + _hasBits0 &= ~64; + } + + /// Field number for the "log_domain" field. + public const int LogDomainFieldNumber = 13; + private readonly static bool LogDomainDefaultValue = false; + + private bool logDomain_; + /// + /// If set, all models are estimated in log domain, specifically + /// intensity I is transformed via log(1.0 + I) := I' + /// Consequently after apply the models, intensity needs to be transformed + /// back to visible range via exp(I') - 1.0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool LogDomain { + get { if ((_hasBits0 & 128) != 0) { return logDomain_; } else { return LogDomainDefaultValue; } } + set { + _hasBits0 |= 128; + logDomain_ = value; + } + } + /// Gets whether the "log_domain" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLogDomain { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "log_domain" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLogDomain() { + _hasBits0 &= ~128; + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 14; + private readonly static global::Mediapipe.ToneChange.Types.Type TypeDefaultValue = global::Mediapipe.ToneChange.Types.Type.Valid; + + private global::Mediapipe.ToneChange.Types.Type type_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneChange.Types.Type Type { + get { if ((_hasBits0 & 256) != 0) { return type_; } else { return TypeDefaultValue; } } + set { + _hasBits0 |= 256; + type_ = value; + } + } + /// Gets whether the "type" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasType { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "type" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearType() { + _hasBits0 &= ~256; + } + + /// Field number for the "stability_stats" field. + public const int StabilityStatsFieldNumber = 15; + private global::Mediapipe.ToneChange.Types.StabilityStats stabilityStats_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneChange.Types.StabilityStats StabilityStats { + get { return stabilityStats_; } + set { + stabilityStats_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ToneChange); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ToneChange other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(GainBias, other.GainBias)) return false; + if (!object.Equals(Affine, other.Affine)) return false; + if (!object.Equals(MixtureGainBias, other.MixtureGainBias)) return false; + if (!object.Equals(MixtureAffine, other.MixtureAffine)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MixtureDomainSigma, other.MixtureDomainSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FracClipped, other.FracClipped)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowPercentile, other.LowPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowMidPercentile, other.LowMidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MidPercentile, other.MidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HighMidPercentile, other.HighMidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HighPercentile, other.HighPercentile)) return false; + if (LogDomain != other.LogDomain) return false; + if (Type != other.Type) return false; + if (!object.Equals(StabilityStats, other.StabilityStats)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (gainBias_ != null) hash ^= GainBias.GetHashCode(); + if (affine_ != null) hash ^= Affine.GetHashCode(); + if (mixtureGainBias_ != null) hash ^= MixtureGainBias.GetHashCode(); + if (mixtureAffine_ != null) hash ^= MixtureAffine.GetHashCode(); + if (HasMixtureDomainSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MixtureDomainSigma); + if (HasFracClipped) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FracClipped); + if (HasLowPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowPercentile); + if (HasLowMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowMidPercentile); + if (HasMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MidPercentile); + if (HasHighMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HighMidPercentile); + if (HasHighPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HighPercentile); + if (HasLogDomain) hash ^= LogDomain.GetHashCode(); + if (HasType) hash ^= Type.GetHashCode(); + if (stabilityStats_ != null) hash ^= StabilityStats.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (gainBias_ != null) { + output.WriteRawTag(10); + output.WriteMessage(GainBias); + } + if (affine_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Affine); + } + if (mixtureGainBias_ != null) { + output.WriteRawTag(26); + output.WriteMessage(MixtureGainBias); + } + if (mixtureAffine_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MixtureAffine); + } + if (HasMixtureDomainSigma) { + output.WriteRawTag(45); + output.WriteFloat(MixtureDomainSigma); + } + if (HasFracClipped) { + output.WriteRawTag(53); + output.WriteFloat(FracClipped); + } + if (HasLowPercentile) { + output.WriteRawTag(69); + output.WriteFloat(LowPercentile); + } + if (HasLowMidPercentile) { + output.WriteRawTag(77); + output.WriteFloat(LowMidPercentile); + } + if (HasMidPercentile) { + output.WriteRawTag(85); + output.WriteFloat(MidPercentile); + } + if (HasHighMidPercentile) { + output.WriteRawTag(93); + output.WriteFloat(HighMidPercentile); + } + if (HasHighPercentile) { + output.WriteRawTag(101); + output.WriteFloat(HighPercentile); + } + if (HasLogDomain) { + output.WriteRawTag(104); + output.WriteBool(LogDomain); + } + if (HasType) { + output.WriteRawTag(112); + output.WriteEnum((int) Type); + } + if (stabilityStats_ != null) { + output.WriteRawTag(122); + output.WriteMessage(StabilityStats); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (gainBias_ != null) { + output.WriteRawTag(10); + output.WriteMessage(GainBias); + } + if (affine_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Affine); + } + if (mixtureGainBias_ != null) { + output.WriteRawTag(26); + output.WriteMessage(MixtureGainBias); + } + if (mixtureAffine_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MixtureAffine); + } + if (HasMixtureDomainSigma) { + output.WriteRawTag(45); + output.WriteFloat(MixtureDomainSigma); + } + if (HasFracClipped) { + output.WriteRawTag(53); + output.WriteFloat(FracClipped); + } + if (HasLowPercentile) { + output.WriteRawTag(69); + output.WriteFloat(LowPercentile); + } + if (HasLowMidPercentile) { + output.WriteRawTag(77); + output.WriteFloat(LowMidPercentile); + } + if (HasMidPercentile) { + output.WriteRawTag(85); + output.WriteFloat(MidPercentile); + } + if (HasHighMidPercentile) { + output.WriteRawTag(93); + output.WriteFloat(HighMidPercentile); + } + if (HasHighPercentile) { + output.WriteRawTag(101); + output.WriteFloat(HighPercentile); + } + if (HasLogDomain) { + output.WriteRawTag(104); + output.WriteBool(LogDomain); + } + if (HasType) { + output.WriteRawTag(112); + output.WriteEnum((int) Type); + } + if (stabilityStats_ != null) { + output.WriteRawTag(122); + output.WriteMessage(StabilityStats); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (gainBias_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GainBias); + } + if (affine_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Affine); + } + if (mixtureGainBias_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MixtureGainBias); + } + if (mixtureAffine_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MixtureAffine); + } + if (HasMixtureDomainSigma) { + size += 1 + 4; + } + if (HasFracClipped) { + size += 1 + 4; + } + if (HasLowPercentile) { + size += 1 + 4; + } + if (HasLowMidPercentile) { + size += 1 + 4; + } + if (HasMidPercentile) { + size += 1 + 4; + } + if (HasHighMidPercentile) { + size += 1 + 4; + } + if (HasHighPercentile) { + size += 1 + 4; + } + if (HasLogDomain) { + size += 1 + 1; + } + if (HasType) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (stabilityStats_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StabilityStats); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ToneChange other) { + if (other == null) { + return; + } + if (other.gainBias_ != null) { + if (gainBias_ == null) { + GainBias = new global::Mediapipe.GainBiasModel(); + } + GainBias.MergeFrom(other.GainBias); + } + if (other.affine_ != null) { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineToneModel(); + } + Affine.MergeFrom(other.Affine); + } + if (other.mixtureGainBias_ != null) { + if (mixtureGainBias_ == null) { + MixtureGainBias = new global::Mediapipe.MixtureGainBiasModel(); + } + MixtureGainBias.MergeFrom(other.MixtureGainBias); + } + if (other.mixtureAffine_ != null) { + if (mixtureAffine_ == null) { + MixtureAffine = new global::Mediapipe.MixtureAffineToneModel(); + } + MixtureAffine.MergeFrom(other.MixtureAffine); + } + if (other.HasMixtureDomainSigma) { + MixtureDomainSigma = other.MixtureDomainSigma; + } + if (other.HasFracClipped) { + FracClipped = other.FracClipped; + } + if (other.HasLowPercentile) { + LowPercentile = other.LowPercentile; + } + if (other.HasLowMidPercentile) { + LowMidPercentile = other.LowMidPercentile; + } + if (other.HasMidPercentile) { + MidPercentile = other.MidPercentile; + } + if (other.HasHighMidPercentile) { + HighMidPercentile = other.HighMidPercentile; + } + if (other.HasHighPercentile) { + HighPercentile = other.HighPercentile; + } + if (other.HasLogDomain) { + LogDomain = other.LogDomain; + } + if (other.HasType) { + Type = other.Type; + } + if (other.stabilityStats_ != null) { + if (stabilityStats_ == null) { + StabilityStats = new global::Mediapipe.ToneChange.Types.StabilityStats(); + } + StabilityStats.MergeFrom(other.StabilityStats); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (gainBias_ == null) { + GainBias = new global::Mediapipe.GainBiasModel(); + } + input.ReadMessage(GainBias); + break; + } + case 18: { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineToneModel(); + } + input.ReadMessage(Affine); + break; + } + case 26: { + if (mixtureGainBias_ == null) { + MixtureGainBias = new global::Mediapipe.MixtureGainBiasModel(); + } + input.ReadMessage(MixtureGainBias); + break; + } + case 34: { + if (mixtureAffine_ == null) { + MixtureAffine = new global::Mediapipe.MixtureAffineToneModel(); + } + input.ReadMessage(MixtureAffine); + break; + } + case 45: { + MixtureDomainSigma = input.ReadFloat(); + break; + } + case 53: { + FracClipped = input.ReadFloat(); + break; + } + case 69: { + LowPercentile = input.ReadFloat(); + break; + } + case 77: { + LowMidPercentile = input.ReadFloat(); + break; + } + case 85: { + MidPercentile = input.ReadFloat(); + break; + } + case 93: { + HighMidPercentile = input.ReadFloat(); + break; + } + case 101: { + HighPercentile = input.ReadFloat(); + break; + } + case 104: { + LogDomain = input.ReadBool(); + break; + } + case 112: { + Type = (global::Mediapipe.ToneChange.Types.Type) input.ReadEnum(); + break; + } + case 122: { + if (stabilityStats_ == null) { + StabilityStats = new global::Mediapipe.ToneChange.Types.StabilityStats(); + } + input.ReadMessage(StabilityStats); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (gainBias_ == null) { + GainBias = new global::Mediapipe.GainBiasModel(); + } + input.ReadMessage(GainBias); + break; + } + case 18: { + if (affine_ == null) { + Affine = new global::Mediapipe.AffineToneModel(); + } + input.ReadMessage(Affine); + break; + } + case 26: { + if (mixtureGainBias_ == null) { + MixtureGainBias = new global::Mediapipe.MixtureGainBiasModel(); + } + input.ReadMessage(MixtureGainBias); + break; + } + case 34: { + if (mixtureAffine_ == null) { + MixtureAffine = new global::Mediapipe.MixtureAffineToneModel(); + } + input.ReadMessage(MixtureAffine); + break; + } + case 45: { + MixtureDomainSigma = input.ReadFloat(); + break; + } + case 53: { + FracClipped = input.ReadFloat(); + break; + } + case 69: { + LowPercentile = input.ReadFloat(); + break; + } + case 77: { + LowMidPercentile = input.ReadFloat(); + break; + } + case 85: { + MidPercentile = input.ReadFloat(); + break; + } + case 93: { + HighMidPercentile = input.ReadFloat(); + break; + } + case 101: { + HighPercentile = input.ReadFloat(); + break; + } + case 104: { + LogDomain = input.ReadBool(); + break; + } + case 112: { + Type = (global::Mediapipe.ToneChange.Types.Type) input.ReadEnum(); + break; + } + case 122: { + if (stabilityStats_ == null) { + StabilityStats = new global::Mediapipe.ToneChange.Types.StabilityStats(); + } + input.ReadMessage(StabilityStats); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ToneChange message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// ToneChange type indicates whether highest degree of freedom (DOF) + /// model estimation was deemed stable, in which case ToneChange::Type is set + /// to VALID. + /// If a model was deemed not stable (according to *StabilityBounds in + /// ToneEstimationOptions), it is set to the lower dof type which was deemed + /// stable. + /// + public enum Type { + [pbr::OriginalName("VALID")] Valid = 0, + /// + /// Identity model, gain bias unrealiable. + /// + [pbr::OriginalName("INVALID")] Invalid = 10, + } + + /// + /// Stats based on stability analysis. + /// + public sealed partial class StabilityStats : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StabilityStats()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneChange.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilityStats() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilityStats(StabilityStats other) : this() { + _hasBits0 = other._hasBits0; + numInliers_ = other.numInliers_; + inlierFraction_ = other.inlierFraction_; + inlierWeight_ = other.inlierWeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StabilityStats Clone() { + return new StabilityStats(this); + } + + /// Field number for the "num_inliers" field. + public const int NumInliersFieldNumber = 1; + private readonly static int NumInliersDefaultValue = 0; + + private int numInliers_; + /// + /// Number of tone matches that were iniliers (used for tone estimation). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NumInliers { + get { if ((_hasBits0 & 1) != 0) { return numInliers_; } else { return NumInliersDefaultValue; } } + set { + _hasBits0 |= 1; + numInliers_ = value; + } + } + /// Gets whether the "num_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasNumInliers { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "num_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearNumInliers() { + _hasBits0 &= ~1; + } + + /// Field number for the "inlier_fraction" field. + public const int InlierFractionFieldNumber = 2; + private readonly static float InlierFractionDefaultValue = 0F; + + private float inlierFraction_; + /// + /// Fraction of tone matches that were inliers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierFraction { + get { if ((_hasBits0 & 2) != 0) { return inlierFraction_; } else { return InlierFractionDefaultValue; } } + set { + _hasBits0 |= 2; + inlierFraction_ = value; + } + } + /// Gets whether the "inlier_fraction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierFraction { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "inlier_fraction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierFraction() { + _hasBits0 &= ~2; + } + + /// Field number for the "inlier_weight" field. + public const int InlierWeightFieldNumber = 3; + private readonly static double InlierWeightDefaultValue = 0D; + + private double inlierWeight_; + /// + /// Total IRLS weight summed over all inliers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double InlierWeight { + get { if ((_hasBits0 & 4) != 0) { return inlierWeight_; } else { return InlierWeightDefaultValue; } } + set { + _hasBits0 |= 4; + inlierWeight_ = value; + } + } + /// Gets whether the "inlier_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierWeight { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "inlier_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierWeight() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StabilityStats); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StabilityStats other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumInliers != other.NumInliers) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierFraction, other.InlierFraction)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(InlierWeight, other.InlierWeight)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasNumInliers) hash ^= NumInliers.GetHashCode(); + if (HasInlierFraction) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierFraction); + if (HasInlierWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(InlierWeight); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasNumInliers) { + output.WriteRawTag(8); + output.WriteInt32(NumInliers); + } + if (HasInlierFraction) { + output.WriteRawTag(21); + output.WriteFloat(InlierFraction); + } + if (HasInlierWeight) { + output.WriteRawTag(25); + output.WriteDouble(InlierWeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNumInliers) { + output.WriteRawTag(8); + output.WriteInt32(NumInliers); + } + if (HasInlierFraction) { + output.WriteRawTag(21); + output.WriteFloat(InlierFraction); + } + if (HasInlierWeight) { + output.WriteRawTag(25); + output.WriteDouble(InlierWeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasNumInliers) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumInliers); + } + if (HasInlierFraction) { + size += 1 + 4; + } + if (HasInlierWeight) { + size += 1 + 8; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StabilityStats other) { + if (other == null) { + return; + } + if (other.HasNumInliers) { + NumInliers = other.NumInliers; + } + if (other.HasInlierFraction) { + InlierFraction = other.InlierFraction; + } + if (other.HasInlierWeight) { + InlierWeight = other.InlierWeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumInliers = input.ReadInt32(); + break; + } + case 21: { + InlierFraction = input.ReadFloat(); + break; + } + case 25: { + InlierWeight = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NumInliers = input.ReadInt32(); + break; + } + case 21: { + InlierFraction = input.ReadFloat(); + break; + } + case 25: { + InlierWeight = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + public sealed partial class ToneMatchOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ToneMatchOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatchOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatchOptions(ToneMatchOptions other) : this() { + _hasBits0 = other._hasBits0; + minMatchPercentile_ = other.minMatchPercentile_; + maxMatchPercentile_ = other.maxMatchPercentile_; + matchPercentileSteps_ = other.matchPercentileSteps_; + patchRadius_ = other.patchRadius_; + maxFracClipped_ = other.maxFracClipped_; + logDomain_ = other.logDomain_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatchOptions Clone() { + return new ToneMatchOptions(this); + } + + /// Field number for the "min_match_percentile" field. + public const int MinMatchPercentileFieldNumber = 1; + private readonly static float MinMatchPercentileDefaultValue = 0.01F; + + private float minMatchPercentile_; + /// + /// ToneChange's are fit to ToneMatches extracted from matching patches, using + /// order statistics of their corresponding intensities. Matches are defined by + /// having the same percentile of ordered intensities. If any member of the + /// ToneMatch is below under or above over-exposed the match is discarded + /// (based on parameters min and max_exposure above). + /// Matches are extracted from min_match_percentile to max_match_percentile in + /// #match_percentile_steps equidistant steps. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinMatchPercentile { + get { if ((_hasBits0 & 1) != 0) { return minMatchPercentile_; } else { return MinMatchPercentileDefaultValue; } } + set { + _hasBits0 |= 1; + minMatchPercentile_ = value; + } + } + /// Gets whether the "min_match_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinMatchPercentile { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_match_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinMatchPercentile() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_match_percentile" field. + public const int MaxMatchPercentileFieldNumber = 2; + private readonly static float MaxMatchPercentileDefaultValue = 0.99F; + + private float maxMatchPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxMatchPercentile { + get { if ((_hasBits0 & 2) != 0) { return maxMatchPercentile_; } else { return MaxMatchPercentileDefaultValue; } } + set { + _hasBits0 |= 2; + maxMatchPercentile_ = value; + } + } + /// Gets whether the "max_match_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxMatchPercentile { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_match_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxMatchPercentile() { + _hasBits0 &= ~2; + } + + /// Field number for the "match_percentile_steps" field. + public const int MatchPercentileStepsFieldNumber = 3; + private readonly static int MatchPercentileStepsDefaultValue = 10; + + private int matchPercentileSteps_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MatchPercentileSteps { + get { if ((_hasBits0 & 4) != 0) { return matchPercentileSteps_; } else { return MatchPercentileStepsDefaultValue; } } + set { + _hasBits0 |= 4; + matchPercentileSteps_ = value; + } + } + /// Gets whether the "match_percentile_steps" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMatchPercentileSteps { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "match_percentile_steps" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMatchPercentileSteps() { + _hasBits0 &= ~4; + } + + /// Field number for the "patch_radius" field. + public const int PatchRadiusFieldNumber = 4; + private readonly static int PatchRadiusDefaultValue = 18; + + private int patchRadius_; + /// + /// Patch radius from which order statistics are collected. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PatchRadius { + get { if ((_hasBits0 & 8) != 0) { return patchRadius_; } else { return PatchRadiusDefaultValue; } } + set { + _hasBits0 |= 8; + patchRadius_ = value; + } + } + /// Gets whether the "patch_radius" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPatchRadius { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "patch_radius" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPatchRadius() { + _hasBits0 &= ~8; + } + + /// Field number for the "max_frac_clipped" field. + public const int MaxFracClippedFieldNumber = 5; + private readonly static float MaxFracClippedDefaultValue = 0.4F; + + private float maxFracClipped_; + /// + /// Only matches with not too many pixels over- or underexposed are used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxFracClipped { + get { if ((_hasBits0 & 16) != 0) { return maxFracClipped_; } else { return MaxFracClippedDefaultValue; } } + set { + _hasBits0 |= 16; + maxFracClipped_ = value; + } + } + /// Gets whether the "max_frac_clipped" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxFracClipped { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "max_frac_clipped" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxFracClipped() { + _hasBits0 &= ~16; + } + + /// Field number for the "log_domain" field. + public const int LogDomainFieldNumber = 8; + private readonly static bool LogDomainDefaultValue = false; + + private bool logDomain_; + /// + /// If set matches will be collected in the log domain. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool LogDomain { + get { if ((_hasBits0 & 32) != 0) { return logDomain_; } else { return LogDomainDefaultValue; } } + set { + _hasBits0 |= 32; + logDomain_ = value; + } + } + /// Gets whether the "log_domain" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLogDomain { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "log_domain" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLogDomain() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ToneMatchOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ToneMatchOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinMatchPercentile, other.MinMatchPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxMatchPercentile, other.MaxMatchPercentile)) return false; + if (MatchPercentileSteps != other.MatchPercentileSteps) return false; + if (PatchRadius != other.PatchRadius) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxFracClipped, other.MaxFracClipped)) return false; + if (LogDomain != other.LogDomain) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinMatchPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinMatchPercentile); + if (HasMaxMatchPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxMatchPercentile); + if (HasMatchPercentileSteps) hash ^= MatchPercentileSteps.GetHashCode(); + if (HasPatchRadius) hash ^= PatchRadius.GetHashCode(); + if (HasMaxFracClipped) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxFracClipped); + if (HasLogDomain) hash ^= LogDomain.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinMatchPercentile) { + output.WriteRawTag(13); + output.WriteFloat(MinMatchPercentile); + } + if (HasMaxMatchPercentile) { + output.WriteRawTag(21); + output.WriteFloat(MaxMatchPercentile); + } + if (HasMatchPercentileSteps) { + output.WriteRawTag(24); + output.WriteInt32(MatchPercentileSteps); + } + if (HasPatchRadius) { + output.WriteRawTag(32); + output.WriteInt32(PatchRadius); + } + if (HasMaxFracClipped) { + output.WriteRawTag(45); + output.WriteFloat(MaxFracClipped); + } + if (HasLogDomain) { + output.WriteRawTag(64); + output.WriteBool(LogDomain); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinMatchPercentile) { + output.WriteRawTag(13); + output.WriteFloat(MinMatchPercentile); + } + if (HasMaxMatchPercentile) { + output.WriteRawTag(21); + output.WriteFloat(MaxMatchPercentile); + } + if (HasMatchPercentileSteps) { + output.WriteRawTag(24); + output.WriteInt32(MatchPercentileSteps); + } + if (HasPatchRadius) { + output.WriteRawTag(32); + output.WriteInt32(PatchRadius); + } + if (HasMaxFracClipped) { + output.WriteRawTag(45); + output.WriteFloat(MaxFracClipped); + } + if (HasLogDomain) { + output.WriteRawTag(64); + output.WriteBool(LogDomain); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinMatchPercentile) { + size += 1 + 4; + } + if (HasMaxMatchPercentile) { + size += 1 + 4; + } + if (HasMatchPercentileSteps) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MatchPercentileSteps); + } + if (HasPatchRadius) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PatchRadius); + } + if (HasMaxFracClipped) { + size += 1 + 4; + } + if (HasLogDomain) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ToneMatchOptions other) { + if (other == null) { + return; + } + if (other.HasMinMatchPercentile) { + MinMatchPercentile = other.MinMatchPercentile; + } + if (other.HasMaxMatchPercentile) { + MaxMatchPercentile = other.MaxMatchPercentile; + } + if (other.HasMatchPercentileSteps) { + MatchPercentileSteps = other.MatchPercentileSteps; + } + if (other.HasPatchRadius) { + PatchRadius = other.PatchRadius; + } + if (other.HasMaxFracClipped) { + MaxFracClipped = other.MaxFracClipped; + } + if (other.HasLogDomain) { + LogDomain = other.LogDomain; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinMatchPercentile = input.ReadFloat(); + break; + } + case 21: { + MaxMatchPercentile = input.ReadFloat(); + break; + } + case 24: { + MatchPercentileSteps = input.ReadInt32(); + break; + } + case 32: { + PatchRadius = input.ReadInt32(); + break; + } + case 45: { + MaxFracClipped = input.ReadFloat(); + break; + } + case 64: { + LogDomain = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinMatchPercentile = input.ReadFloat(); + break; + } + case 21: { + MaxMatchPercentile = input.ReadFloat(); + break; + } + case 24: { + MatchPercentileSteps = input.ReadInt32(); + break; + } + case 32: { + PatchRadius = input.ReadInt32(); + break; + } + case 45: { + MaxFracClipped = input.ReadFloat(); + break; + } + case 64: { + LogDomain = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ClipMaskOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClipMaskOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipMaskOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipMaskOptions(ClipMaskOptions other) : this() { + _hasBits0 = other._hasBits0; + minExposure_ = other.minExposure_; + maxExposure_ = other.maxExposure_; + maxClippedChannels_ = other.maxClippedChannels_; + clipMaskDiameter_ = other.clipMaskDiameter_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ClipMaskOptions Clone() { + return new ClipMaskOptions(this); + } + + /// Field number for the "min_exposure" field. + public const int MinExposureFieldNumber = 1; + private readonly static float MinExposureDefaultValue = 0.02F; + + private float minExposure_; + /// + /// Over/Under exposure setting. Pixels that are clipped due to limited + /// dynamic range are masked out from analysis. Values specified w.r.t. + /// [0, 1] range. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinExposure { + get { if ((_hasBits0 & 1) != 0) { return minExposure_; } else { return MinExposureDefaultValue; } } + set { + _hasBits0 |= 1; + minExposure_ = value; + } + } + /// Gets whether the "min_exposure" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinExposure { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_exposure" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinExposure() { + _hasBits0 &= ~1; + } + + /// Field number for the "max_exposure" field. + public const int MaxExposureFieldNumber = 2; + private readonly static float MaxExposureDefaultValue = 0.98F; + + private float maxExposure_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MaxExposure { + get { if ((_hasBits0 & 2) != 0) { return maxExposure_; } else { return MaxExposureDefaultValue; } } + set { + _hasBits0 |= 2; + maxExposure_ = value; + } + } + /// Gets whether the "max_exposure" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxExposure { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "max_exposure" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxExposure() { + _hasBits0 &= ~2; + } + + /// Field number for the "max_clipped_channels" field. + public const int MaxClippedChannelsFieldNumber = 4; + private readonly static int MaxClippedChannelsDefaultValue = 1; + + private int maxClippedChannels_; + /// + /// A pixel can have clipped color values in atmost max_clipped_channels before + /// it will be labeled as clipped. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxClippedChannels { + get { if ((_hasBits0 & 4) != 0) { return maxClippedChannels_; } else { return MaxClippedChannelsDefaultValue; } } + set { + _hasBits0 |= 4; + maxClippedChannels_ = value; + } + } + /// Gets whether the "max_clipped_channels" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxClippedChannels { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "max_clipped_channels" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxClippedChannels() { + _hasBits0 &= ~4; + } + + /// Field number for the "clip_mask_diameter" field. + public const int ClipMaskDiameterFieldNumber = 5; + private readonly static int ClipMaskDiameterDefaultValue = 5; + + private int clipMaskDiameter_; + /// + /// Over-exposure tends to show blooming (neighboring pixels are affected by + /// over-exposure as well). For robustness mask of clipped pixels is dilated + /// with structuring element of diameter clip_mask_diam. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ClipMaskDiameter { + get { if ((_hasBits0 & 8) != 0) { return clipMaskDiameter_; } else { return ClipMaskDiameterDefaultValue; } } + set { + _hasBits0 |= 8; + clipMaskDiameter_ = value; + } + } + /// Gets whether the "clip_mask_diameter" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasClipMaskDiameter { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "clip_mask_diameter" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearClipMaskDiameter() { + _hasBits0 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ClipMaskOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ClipMaskOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinExposure, other.MinExposure)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxExposure, other.MaxExposure)) return false; + if (MaxClippedChannels != other.MaxClippedChannels) return false; + if (ClipMaskDiameter != other.ClipMaskDiameter) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinExposure) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinExposure); + if (HasMaxExposure) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxExposure); + if (HasMaxClippedChannels) hash ^= MaxClippedChannels.GetHashCode(); + if (HasClipMaskDiameter) hash ^= ClipMaskDiameter.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinExposure) { + output.WriteRawTag(13); + output.WriteFloat(MinExposure); + } + if (HasMaxExposure) { + output.WriteRawTag(21); + output.WriteFloat(MaxExposure); + } + if (HasMaxClippedChannels) { + output.WriteRawTag(32); + output.WriteInt32(MaxClippedChannels); + } + if (HasClipMaskDiameter) { + output.WriteRawTag(40); + output.WriteInt32(ClipMaskDiameter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinExposure) { + output.WriteRawTag(13); + output.WriteFloat(MinExposure); + } + if (HasMaxExposure) { + output.WriteRawTag(21); + output.WriteFloat(MaxExposure); + } + if (HasMaxClippedChannels) { + output.WriteRawTag(32); + output.WriteInt32(MaxClippedChannels); + } + if (HasClipMaskDiameter) { + output.WriteRawTag(40); + output.WriteInt32(ClipMaskDiameter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinExposure) { + size += 1 + 4; + } + if (HasMaxExposure) { + size += 1 + 4; + } + if (HasMaxClippedChannels) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxClippedChannels); + } + if (HasClipMaskDiameter) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ClipMaskDiameter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ClipMaskOptions other) { + if (other == null) { + return; + } + if (other.HasMinExposure) { + MinExposure = other.MinExposure; + } + if (other.HasMaxExposure) { + MaxExposure = other.MaxExposure; + } + if (other.HasMaxClippedChannels) { + MaxClippedChannels = other.MaxClippedChannels; + } + if (other.HasClipMaskDiameter) { + ClipMaskDiameter = other.ClipMaskDiameter; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinExposure = input.ReadFloat(); + break; + } + case 21: { + MaxExposure = input.ReadFloat(); + break; + } + case 32: { + MaxClippedChannels = input.ReadInt32(); + break; + } + case 40: { + ClipMaskDiameter = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinExposure = input.ReadFloat(); + break; + } + case 21: { + MaxExposure = input.ReadFloat(); + break; + } + case 32: { + MaxClippedChannels = input.ReadInt32(); + break; + } + case 40: { + ClipMaskDiameter = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// Next tag: 13 + /// + public sealed partial class ToneEstimationOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ToneEstimationOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneEstimationOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneEstimationOptions(ToneEstimationOptions other) : this() { + _hasBits0 = other._hasBits0; + toneMatchOptions_ = other.toneMatchOptions_ != null ? other.toneMatchOptions_.Clone() : null; + clipMaskOptions_ = other.clipMaskOptions_ != null ? other.clipMaskOptions_.Clone() : null; + statsLowPercentile_ = other.statsLowPercentile_; + statsLowMidPercentile_ = other.statsLowMidPercentile_; + statsMidPercentile_ = other.statsMidPercentile_; + statsHighMidPercentile_ = other.statsHighMidPercentile_; + statsHighPercentile_ = other.statsHighPercentile_; + irlsIterations_ = other.irlsIterations_; + stableGainBiasBounds_ = other.stableGainBiasBounds_ != null ? other.stableGainBiasBounds_.Clone() : null; + downsampleMode_ = other.downsampleMode_; + downsamplingSize_ = other.downsamplingSize_; + downsampleFactor_ = other.downsampleFactor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneEstimationOptions Clone() { + return new ToneEstimationOptions(this); + } + + /// Field number for the "tone_match_options" field. + public const int ToneMatchOptionsFieldNumber = 1; + private global::Mediapipe.ToneMatchOptions toneMatchOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneMatchOptions ToneMatchOptions { + get { return toneMatchOptions_; } + set { + toneMatchOptions_ = value; + } + } + + /// Field number for the "clip_mask_options" field. + public const int ClipMaskOptionsFieldNumber = 2; + private global::Mediapipe.ClipMaskOptions clipMaskOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ClipMaskOptions ClipMaskOptions { + get { return clipMaskOptions_; } + set { + clipMaskOptions_ = value; + } + } + + /// Field number for the "stats_low_percentile" field. + public const int StatsLowPercentileFieldNumber = 3; + private readonly static float StatsLowPercentileDefaultValue = 0.05F; + + private float statsLowPercentile_; + /// + /// Percentiles for tone statistics. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StatsLowPercentile { + get { if ((_hasBits0 & 1) != 0) { return statsLowPercentile_; } else { return StatsLowPercentileDefaultValue; } } + set { + _hasBits0 |= 1; + statsLowPercentile_ = value; + } + } + /// Gets whether the "stats_low_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatsLowPercentile { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "stats_low_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatsLowPercentile() { + _hasBits0 &= ~1; + } + + /// Field number for the "stats_low_mid_percentile" field. + public const int StatsLowMidPercentileFieldNumber = 4; + private readonly static float StatsLowMidPercentileDefaultValue = 0.2F; + + private float statsLowMidPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StatsLowMidPercentile { + get { if ((_hasBits0 & 2) != 0) { return statsLowMidPercentile_; } else { return StatsLowMidPercentileDefaultValue; } } + set { + _hasBits0 |= 2; + statsLowMidPercentile_ = value; + } + } + /// Gets whether the "stats_low_mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatsLowMidPercentile { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "stats_low_mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatsLowMidPercentile() { + _hasBits0 &= ~2; + } + + /// Field number for the "stats_mid_percentile" field. + public const int StatsMidPercentileFieldNumber = 5; + private readonly static float StatsMidPercentileDefaultValue = 0.5F; + + private float statsMidPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StatsMidPercentile { + get { if ((_hasBits0 & 4) != 0) { return statsMidPercentile_; } else { return StatsMidPercentileDefaultValue; } } + set { + _hasBits0 |= 4; + statsMidPercentile_ = value; + } + } + /// Gets whether the "stats_mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatsMidPercentile { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "stats_mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatsMidPercentile() { + _hasBits0 &= ~4; + } + + /// Field number for the "stats_high_mid_percentile" field. + public const int StatsHighMidPercentileFieldNumber = 6; + private readonly static float StatsHighMidPercentileDefaultValue = 0.8F; + + private float statsHighMidPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StatsHighMidPercentile { + get { if ((_hasBits0 & 8) != 0) { return statsHighMidPercentile_; } else { return StatsHighMidPercentileDefaultValue; } } + set { + _hasBits0 |= 8; + statsHighMidPercentile_ = value; + } + } + /// Gets whether the "stats_high_mid_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatsHighMidPercentile { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "stats_high_mid_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatsHighMidPercentile() { + _hasBits0 &= ~8; + } + + /// Field number for the "stats_high_percentile" field. + public const int StatsHighPercentileFieldNumber = 7; + private readonly static float StatsHighPercentileDefaultValue = 0.95F; + + private float statsHighPercentile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StatsHighPercentile { + get { if ((_hasBits0 & 16) != 0) { return statsHighPercentile_; } else { return StatsHighPercentileDefaultValue; } } + set { + _hasBits0 |= 16; + statsHighPercentile_ = value; + } + } + /// Gets whether the "stats_high_percentile" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStatsHighPercentile { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "stats_high_percentile" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStatsHighPercentile() { + _hasBits0 &= ~16; + } + + /// Field number for the "irls_iterations" field. + public const int IrlsIterationsFieldNumber = 8; + private readonly static int IrlsIterationsDefaultValue = 10; + + private int irlsIterations_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int IrlsIterations { + get { if ((_hasBits0 & 32) != 0) { return irlsIterations_; } else { return IrlsIterationsDefaultValue; } } + set { + _hasBits0 |= 32; + irlsIterations_ = value; + } + } + /// Gets whether the "irls_iterations" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsIterations { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "irls_iterations" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsIterations() { + _hasBits0 &= ~32; + } + + /// Field number for the "stable_gain_bias_bounds" field. + public const int StableGainBiasBoundsFieldNumber = 9; + private global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds stableGainBiasBounds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds StableGainBiasBounds { + get { return stableGainBiasBounds_; } + set { + stableGainBiasBounds_ = value; + } + } + + /// Field number for the "downsample_mode" field. + public const int DownsampleModeFieldNumber = 10; + private readonly static global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode DownsampleModeDefaultValue = global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode.DownsampleNone; + + private global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode downsampleMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode DownsampleMode { + get { if ((_hasBits0 & 64) != 0) { return downsampleMode_; } else { return DownsampleModeDefaultValue; } } + set { + _hasBits0 |= 64; + downsampleMode_ = value; + } + } + /// Gets whether the "downsample_mode" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleMode { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "downsample_mode" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleMode() { + _hasBits0 &= ~64; + } + + /// Field number for the "downsampling_size" field. + public const int DownsamplingSizeFieldNumber = 11; + private readonly static int DownsamplingSizeDefaultValue = 256; + + private int downsamplingSize_; + /// + /// Specify the size of either dimension here, the frame will be + /// downsampled to fit downsampling_size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int DownsamplingSize { + get { if ((_hasBits0 & 128) != 0) { return downsamplingSize_; } else { return DownsamplingSizeDefaultValue; } } + set { + _hasBits0 |= 128; + downsamplingSize_ = value; + } + } + /// Gets whether the "downsampling_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsamplingSize { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "downsampling_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsamplingSize() { + _hasBits0 &= ~128; + } + + /// Field number for the "downsample_factor" field. + public const int DownsampleFactorFieldNumber = 12; + private readonly static float DownsampleFactorDefaultValue = 2F; + + private float downsampleFactor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DownsampleFactor { + get { if ((_hasBits0 & 256) != 0) { return downsampleFactor_; } else { return DownsampleFactorDefaultValue; } } + set { + _hasBits0 |= 256; + downsampleFactor_ = value; + } + } + /// Gets whether the "downsample_factor" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDownsampleFactor { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "downsample_factor" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDownsampleFactor() { + _hasBits0 &= ~256; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ToneEstimationOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ToneEstimationOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ToneMatchOptions, other.ToneMatchOptions)) return false; + if (!object.Equals(ClipMaskOptions, other.ClipMaskOptions)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StatsLowPercentile, other.StatsLowPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StatsLowMidPercentile, other.StatsLowMidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StatsMidPercentile, other.StatsMidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StatsHighMidPercentile, other.StatsHighMidPercentile)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StatsHighPercentile, other.StatsHighPercentile)) return false; + if (IrlsIterations != other.IrlsIterations) return false; + if (!object.Equals(StableGainBiasBounds, other.StableGainBiasBounds)) return false; + if (DownsampleMode != other.DownsampleMode) return false; + if (DownsamplingSize != other.DownsamplingSize) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DownsampleFactor, other.DownsampleFactor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (toneMatchOptions_ != null) hash ^= ToneMatchOptions.GetHashCode(); + if (clipMaskOptions_ != null) hash ^= ClipMaskOptions.GetHashCode(); + if (HasStatsLowPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StatsLowPercentile); + if (HasStatsLowMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StatsLowMidPercentile); + if (HasStatsMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StatsMidPercentile); + if (HasStatsHighMidPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StatsHighMidPercentile); + if (HasStatsHighPercentile) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StatsHighPercentile); + if (HasIrlsIterations) hash ^= IrlsIterations.GetHashCode(); + if (stableGainBiasBounds_ != null) hash ^= StableGainBiasBounds.GetHashCode(); + if (HasDownsampleMode) hash ^= DownsampleMode.GetHashCode(); + if (HasDownsamplingSize) hash ^= DownsamplingSize.GetHashCode(); + if (HasDownsampleFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DownsampleFactor); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (toneMatchOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ToneMatchOptions); + } + if (clipMaskOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ClipMaskOptions); + } + if (HasStatsLowPercentile) { + output.WriteRawTag(29); + output.WriteFloat(StatsLowPercentile); + } + if (HasStatsLowMidPercentile) { + output.WriteRawTag(37); + output.WriteFloat(StatsLowMidPercentile); + } + if (HasStatsMidPercentile) { + output.WriteRawTag(45); + output.WriteFloat(StatsMidPercentile); + } + if (HasStatsHighMidPercentile) { + output.WriteRawTag(53); + output.WriteFloat(StatsHighMidPercentile); + } + if (HasStatsHighPercentile) { + output.WriteRawTag(61); + output.WriteFloat(StatsHighPercentile); + } + if (HasIrlsIterations) { + output.WriteRawTag(64); + output.WriteInt32(IrlsIterations); + } + if (stableGainBiasBounds_ != null) { + output.WriteRawTag(74); + output.WriteMessage(StableGainBiasBounds); + } + if (HasDownsampleMode) { + output.WriteRawTag(80); + output.WriteEnum((int) DownsampleMode); + } + if (HasDownsamplingSize) { + output.WriteRawTag(88); + output.WriteInt32(DownsamplingSize); + } + if (HasDownsampleFactor) { + output.WriteRawTag(101); + output.WriteFloat(DownsampleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (toneMatchOptions_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ToneMatchOptions); + } + if (clipMaskOptions_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ClipMaskOptions); + } + if (HasStatsLowPercentile) { + output.WriteRawTag(29); + output.WriteFloat(StatsLowPercentile); + } + if (HasStatsLowMidPercentile) { + output.WriteRawTag(37); + output.WriteFloat(StatsLowMidPercentile); + } + if (HasStatsMidPercentile) { + output.WriteRawTag(45); + output.WriteFloat(StatsMidPercentile); + } + if (HasStatsHighMidPercentile) { + output.WriteRawTag(53); + output.WriteFloat(StatsHighMidPercentile); + } + if (HasStatsHighPercentile) { + output.WriteRawTag(61); + output.WriteFloat(StatsHighPercentile); + } + if (HasIrlsIterations) { + output.WriteRawTag(64); + output.WriteInt32(IrlsIterations); + } + if (stableGainBiasBounds_ != null) { + output.WriteRawTag(74); + output.WriteMessage(StableGainBiasBounds); + } + if (HasDownsampleMode) { + output.WriteRawTag(80); + output.WriteEnum((int) DownsampleMode); + } + if (HasDownsamplingSize) { + output.WriteRawTag(88); + output.WriteInt32(DownsamplingSize); + } + if (HasDownsampleFactor) { + output.WriteRawTag(101); + output.WriteFloat(DownsampleFactor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (toneMatchOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ToneMatchOptions); + } + if (clipMaskOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClipMaskOptions); + } + if (HasStatsLowPercentile) { + size += 1 + 4; + } + if (HasStatsLowMidPercentile) { + size += 1 + 4; + } + if (HasStatsMidPercentile) { + size += 1 + 4; + } + if (HasStatsHighMidPercentile) { + size += 1 + 4; + } + if (HasStatsHighPercentile) { + size += 1 + 4; + } + if (HasIrlsIterations) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IrlsIterations); + } + if (stableGainBiasBounds_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StableGainBiasBounds); + } + if (HasDownsampleMode) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DownsampleMode); + } + if (HasDownsamplingSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DownsamplingSize); + } + if (HasDownsampleFactor) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ToneEstimationOptions other) { + if (other == null) { + return; + } + if (other.toneMatchOptions_ != null) { + if (toneMatchOptions_ == null) { + ToneMatchOptions = new global::Mediapipe.ToneMatchOptions(); + } + ToneMatchOptions.MergeFrom(other.ToneMatchOptions); + } + if (other.clipMaskOptions_ != null) { + if (clipMaskOptions_ == null) { + ClipMaskOptions = new global::Mediapipe.ClipMaskOptions(); + } + ClipMaskOptions.MergeFrom(other.ClipMaskOptions); + } + if (other.HasStatsLowPercentile) { + StatsLowPercentile = other.StatsLowPercentile; + } + if (other.HasStatsLowMidPercentile) { + StatsLowMidPercentile = other.StatsLowMidPercentile; + } + if (other.HasStatsMidPercentile) { + StatsMidPercentile = other.StatsMidPercentile; + } + if (other.HasStatsHighMidPercentile) { + StatsHighMidPercentile = other.StatsHighMidPercentile; + } + if (other.HasStatsHighPercentile) { + StatsHighPercentile = other.StatsHighPercentile; + } + if (other.HasIrlsIterations) { + IrlsIterations = other.IrlsIterations; + } + if (other.stableGainBiasBounds_ != null) { + if (stableGainBiasBounds_ == null) { + StableGainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + StableGainBiasBounds.MergeFrom(other.StableGainBiasBounds); + } + if (other.HasDownsampleMode) { + DownsampleMode = other.DownsampleMode; + } + if (other.HasDownsamplingSize) { + DownsamplingSize = other.DownsamplingSize; + } + if (other.HasDownsampleFactor) { + DownsampleFactor = other.DownsampleFactor; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (toneMatchOptions_ == null) { + ToneMatchOptions = new global::Mediapipe.ToneMatchOptions(); + } + input.ReadMessage(ToneMatchOptions); + break; + } + case 18: { + if (clipMaskOptions_ == null) { + ClipMaskOptions = new global::Mediapipe.ClipMaskOptions(); + } + input.ReadMessage(ClipMaskOptions); + break; + } + case 29: { + StatsLowPercentile = input.ReadFloat(); + break; + } + case 37: { + StatsLowMidPercentile = input.ReadFloat(); + break; + } + case 45: { + StatsMidPercentile = input.ReadFloat(); + break; + } + case 53: { + StatsHighMidPercentile = input.ReadFloat(); + break; + } + case 61: { + StatsHighPercentile = input.ReadFloat(); + break; + } + case 64: { + IrlsIterations = input.ReadInt32(); + break; + } + case 74: { + if (stableGainBiasBounds_ == null) { + StableGainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + input.ReadMessage(StableGainBiasBounds); + break; + } + case 80: { + DownsampleMode = (global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode) input.ReadEnum(); + break; + } + case 88: { + DownsamplingSize = input.ReadInt32(); + break; + } + case 101: { + DownsampleFactor = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (toneMatchOptions_ == null) { + ToneMatchOptions = new global::Mediapipe.ToneMatchOptions(); + } + input.ReadMessage(ToneMatchOptions); + break; + } + case 18: { + if (clipMaskOptions_ == null) { + ClipMaskOptions = new global::Mediapipe.ClipMaskOptions(); + } + input.ReadMessage(ClipMaskOptions); + break; + } + case 29: { + StatsLowPercentile = input.ReadFloat(); + break; + } + case 37: { + StatsLowMidPercentile = input.ReadFloat(); + break; + } + case 45: { + StatsMidPercentile = input.ReadFloat(); + break; + } + case 53: { + StatsHighMidPercentile = input.ReadFloat(); + break; + } + case 61: { + StatsHighPercentile = input.ReadFloat(); + break; + } + case 64: { + IrlsIterations = input.ReadInt32(); + break; + } + case 74: { + if (stableGainBiasBounds_ == null) { + StableGainBiasBounds = new global::Mediapipe.ToneEstimationOptions.Types.GainBiasBounds(); + } + input.ReadMessage(StableGainBiasBounds); + break; + } + case 80: { + DownsampleMode = (global::Mediapipe.ToneEstimationOptions.Types.DownsampleMode) input.ReadEnum(); + break; + } + case 88: { + DownsamplingSize = input.ReadInt32(); + break; + } + case 101: { + DownsampleFactor = input.ReadFloat(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the ToneEstimationOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// We support down-sampling of an incoming frame before running the + /// resolution dependent part of the tone estimation. + /// tracking if desired). + /// + public enum DownsampleMode { + /// + /// no downsampling. + /// + [pbr::OriginalName("DOWNSAMPLE_NONE")] DownsampleNone = 1, + /// + /// downsizes frame such that frame_size == + /// + [pbr::OriginalName("DOWNSAMPLE_TO_MAX_SIZE")] DownsampleToMaxSize = 2, + /// + /// downsampling_size. + /// frame_size := max(width, height). + /// + [pbr::OriginalName("DOWNSAMPLE_BY_FACTOR")] DownsampleByFactor = 3, + /// + /// downsizes frame such that frame_size == + /// + [pbr::OriginalName("DOWNSAMPLE_TO_MIN_SIZE")] DownsampleToMinSize = 4, + } + + public sealed partial class GainBiasBounds : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GainBiasBounds()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasBounds() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasBounds(GainBiasBounds other) : this() { + _hasBits0 = other._hasBits0; + minInlierFraction_ = other.minInlierFraction_; + minInlierWeight_ = other.minInlierWeight_; + lowerGain_ = other.lowerGain_; + upperGain_ = other.upperGain_; + lowerBias_ = other.lowerBias_; + upperBias_ = other.upperBias_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasBounds Clone() { + return new GainBiasBounds(this); + } + + /// Field number for the "min_inlier_fraction" field. + public const int MinInlierFractionFieldNumber = 1; + private readonly static float MinInlierFractionDefaultValue = 0.75F; + + private float minInlierFraction_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierFraction { + get { if ((_hasBits0 & 1) != 0) { return minInlierFraction_; } else { return MinInlierFractionDefaultValue; } } + set { + _hasBits0 |= 1; + minInlierFraction_ = value; + } + } + /// Gets whether the "min_inlier_fraction" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierFraction { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "min_inlier_fraction" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierFraction() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_inlier_weight" field. + public const int MinInlierWeightFieldNumber = 2; + private readonly static float MinInlierWeightDefaultValue = 0.5F; + + private float minInlierWeight_; + /// + /// Accept 2% intensity difference as valid inlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierWeight { + get { if ((_hasBits0 & 2) != 0) { return minInlierWeight_; } else { return MinInlierWeightDefaultValue; } } + set { + _hasBits0 |= 2; + minInlierWeight_ = value; + } + } + /// Gets whether the "min_inlier_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierWeight { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_inlier_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierWeight() { + _hasBits0 &= ~2; + } + + /// Field number for the "lower_gain" field. + public const int LowerGainFieldNumber = 3; + private readonly static float LowerGainDefaultValue = 0.75F; + + private float lowerGain_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowerGain { + get { if ((_hasBits0 & 4) != 0) { return lowerGain_; } else { return LowerGainDefaultValue; } } + set { + _hasBits0 |= 4; + lowerGain_ = value; + } + } + /// Gets whether the "lower_gain" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowerGain { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "lower_gain" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowerGain() { + _hasBits0 &= ~4; + } + + /// Field number for the "upper_gain" field. + public const int UpperGainFieldNumber = 4; + private readonly static float UpperGainDefaultValue = 1.334F; + + private float upperGain_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float UpperGain { + get { if ((_hasBits0 & 8) != 0) { return upperGain_; } else { return UpperGainDefaultValue; } } + set { + _hasBits0 |= 8; + upperGain_ = value; + } + } + /// Gets whether the "upper_gain" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpperGain { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "upper_gain" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpperGain() { + _hasBits0 &= ~8; + } + + /// Field number for the "lower_bias" field. + public const int LowerBiasFieldNumber = 5; + private readonly static float LowerBiasDefaultValue = -0.2F; + + private float lowerBias_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowerBias { + get { if ((_hasBits0 & 16) != 0) { return lowerBias_; } else { return LowerBiasDefaultValue; } } + set { + _hasBits0 |= 16; + lowerBias_ = value; + } + } + /// Gets whether the "lower_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowerBias { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "lower_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowerBias() { + _hasBits0 &= ~16; + } + + /// Field number for the "upper_bias" field. + public const int UpperBiasFieldNumber = 6; + private readonly static float UpperBiasDefaultValue = 0.2F; + + private float upperBias_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float UpperBias { + get { if ((_hasBits0 & 32) != 0) { return upperBias_; } else { return UpperBiasDefaultValue; } } + set { + _hasBits0 |= 32; + upperBias_ = value; + } + } + /// Gets whether the "upper_bias" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUpperBias { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "upper_bias" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUpperBias() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GainBiasBounds); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GainBiasBounds other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierFraction, other.MinInlierFraction)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierWeight, other.MinInlierWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowerGain, other.LowerGain)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpperGain, other.UpperGain)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowerBias, other.LowerBias)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpperBias, other.UpperBias)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMinInlierFraction) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierFraction); + if (HasMinInlierWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierWeight); + if (HasLowerGain) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowerGain); + if (HasUpperGain) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpperGain); + if (HasLowerBias) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowerBias); + if (HasUpperBias) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpperBias); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMinInlierFraction) { + output.WriteRawTag(13); + output.WriteFloat(MinInlierFraction); + } + if (HasMinInlierWeight) { + output.WriteRawTag(21); + output.WriteFloat(MinInlierWeight); + } + if (HasLowerGain) { + output.WriteRawTag(29); + output.WriteFloat(LowerGain); + } + if (HasUpperGain) { + output.WriteRawTag(37); + output.WriteFloat(UpperGain); + } + if (HasLowerBias) { + output.WriteRawTag(45); + output.WriteFloat(LowerBias); + } + if (HasUpperBias) { + output.WriteRawTag(53); + output.WriteFloat(UpperBias); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMinInlierFraction) { + output.WriteRawTag(13); + output.WriteFloat(MinInlierFraction); + } + if (HasMinInlierWeight) { + output.WriteRawTag(21); + output.WriteFloat(MinInlierWeight); + } + if (HasLowerGain) { + output.WriteRawTag(29); + output.WriteFloat(LowerGain); + } + if (HasUpperGain) { + output.WriteRawTag(37); + output.WriteFloat(UpperGain); + } + if (HasLowerBias) { + output.WriteRawTag(45); + output.WriteFloat(LowerBias); + } + if (HasUpperBias) { + output.WriteRawTag(53); + output.WriteFloat(UpperBias); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMinInlierFraction) { + size += 1 + 4; + } + if (HasMinInlierWeight) { + size += 1 + 4; + } + if (HasLowerGain) { + size += 1 + 4; + } + if (HasUpperGain) { + size += 1 + 4; + } + if (HasLowerBias) { + size += 1 + 4; + } + if (HasUpperBias) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GainBiasBounds other) { + if (other == null) { + return; + } + if (other.HasMinInlierFraction) { + MinInlierFraction = other.MinInlierFraction; + } + if (other.HasMinInlierWeight) { + MinInlierWeight = other.MinInlierWeight; + } + if (other.HasLowerGain) { + LowerGain = other.LowerGain; + } + if (other.HasUpperGain) { + UpperGain = other.UpperGain; + } + if (other.HasLowerBias) { + LowerBias = other.LowerBias; + } + if (other.HasUpperBias) { + UpperBias = other.UpperBias; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + MinInlierFraction = input.ReadFloat(); + break; + } + case 21: { + MinInlierWeight = input.ReadFloat(); + break; + } + case 29: { + LowerGain = input.ReadFloat(); + break; + } + case 37: { + UpperGain = input.ReadFloat(); + break; + } + case 45: { + LowerBias = input.ReadFloat(); + break; + } + case 53: { + UpperBias = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + MinInlierFraction = input.ReadFloat(); + break; + } + case 21: { + MinInlierWeight = input.ReadFloat(); + break; + } + case 29: { + LowerGain = input.ReadFloat(); + break; + } + case 37: { + UpperGain = input.ReadFloat(); + break; + } + case 45: { + LowerBias = input.ReadFloat(); + break; + } + case 53: { + UpperBias = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + public sealed partial class ToneMatch : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ToneMatch()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatch() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatch(ToneMatch other) : this() { + _hasBits0 = other._hasBits0; + currVal_ = other.currVal_; + prevVal_ = other.prevVal_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ToneMatch Clone() { + return new ToneMatch(this); + } + + /// Field number for the "curr_val" field. + public const int CurrValFieldNumber = 1; + private readonly static float CurrValDefaultValue = 0F; + + private float currVal_; + /// + /// Intensity in current frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float CurrVal { + get { if ((_hasBits0 & 1) != 0) { return currVal_; } else { return CurrValDefaultValue; } } + set { + _hasBits0 |= 1; + currVal_ = value; + } + } + /// Gets whether the "curr_val" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCurrVal { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "curr_val" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCurrVal() { + _hasBits0 &= ~1; + } + + /// Field number for the "prev_val" field. + public const int PrevValFieldNumber = 2; + private readonly static float PrevValDefaultValue = 0F; + + private float prevVal_; + /// + /// Matching intensity in previous frame. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PrevVal { + get { if ((_hasBits0 & 2) != 0) { return prevVal_; } else { return PrevValDefaultValue; } } + set { + _hasBits0 |= 2; + prevVal_ = value; + } + } + /// Gets whether the "prev_val" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPrevVal { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "prev_val" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPrevVal() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ToneMatch); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ToneMatch other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(CurrVal, other.CurrVal)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PrevVal, other.PrevVal)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasCurrVal) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(CurrVal); + if (HasPrevVal) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PrevVal); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasCurrVal) { + output.WriteRawTag(13); + output.WriteFloat(CurrVal); + } + if (HasPrevVal) { + output.WriteRawTag(21); + output.WriteFloat(PrevVal); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCurrVal) { + output.WriteRawTag(13); + output.WriteFloat(CurrVal); + } + if (HasPrevVal) { + output.WriteRawTag(21); + output.WriteFloat(PrevVal); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasCurrVal) { + size += 1 + 4; + } + if (HasPrevVal) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ToneMatch other) { + if (other == null) { + return; + } + if (other.HasCurrVal) { + CurrVal = other.CurrVal; + } + if (other.HasPrevVal) { + PrevVal = other.PrevVal; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + CurrVal = input.ReadFloat(); + break; + } + case 21: { + PrevVal = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + CurrVal = input.ReadFloat(); + break; + } + case 21: { + PrevVal = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class PatchToneMatch : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PatchToneMatch()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneEstimationReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchToneMatch() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchToneMatch(PatchToneMatch other) : this() { + _hasBits0 = other._hasBits0; + toneMatch_ = other.toneMatch_.Clone(); + irlsWeight_ = other.irlsWeight_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public PatchToneMatch Clone() { + return new PatchToneMatch(this); + } + + /// Field number for the "tone_match" field. + public const int ToneMatchFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_toneMatch_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.ToneMatch.Parser); + private readonly pbc::RepeatedField toneMatch_ = new pbc::RepeatedField(); + /// + /// Several intensity matches computed from equal percentiles of matching patch + /// pairs. No number or particular ordering is assumed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ToneMatch { + get { return toneMatch_; } + } + + /// Field number for the "irls_weight" field. + public const int IrlsWeightFieldNumber = 2; + private readonly static float IrlsWeightDefaultValue = 1F; + + private float irlsWeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IrlsWeight { + get { if ((_hasBits0 & 1) != 0) { return irlsWeight_; } else { return IrlsWeightDefaultValue; } } + set { + _hasBits0 |= 1; + irlsWeight_ = value; + } + } + /// Gets whether the "irls_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsWeight { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "irls_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsWeight() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as PatchToneMatch); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(PatchToneMatch other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!toneMatch_.Equals(other.toneMatch_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IrlsWeight, other.IrlsWeight)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= toneMatch_.GetHashCode(); + if (HasIrlsWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IrlsWeight); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + toneMatch_.WriteTo(output, _repeated_toneMatch_codec); + if (HasIrlsWeight) { + output.WriteRawTag(21); + output.WriteFloat(IrlsWeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + toneMatch_.WriteTo(ref output, _repeated_toneMatch_codec); + if (HasIrlsWeight) { + output.WriteRawTag(21); + output.WriteFloat(IrlsWeight); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += toneMatch_.CalculateSize(_repeated_toneMatch_codec); + if (HasIrlsWeight) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(PatchToneMatch other) { + if (other == null) { + return; + } + toneMatch_.Add(other.toneMatch_); + if (other.HasIrlsWeight) { + IrlsWeight = other.IrlsWeight; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + toneMatch_.AddEntriesFrom(input, _repeated_toneMatch_codec); + break; + } + case 21: { + IrlsWeight = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + toneMatch_.AddEntriesFrom(ref input, _repeated_toneMatch_codec); + break; + } + case 21: { + IrlsWeight = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs.meta new file mode 100644 index 0000000..e3fe6d4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneEstimation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 097c28f091eabcad5bb2fac4b84b083f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs new file mode 100644 index 0000000..bb107ab --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs @@ -0,0 +1,1671 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/tone_models.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/tone_models.proto + public static partial class ToneModelsReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/tone_models.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ToneModelsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiltZWRpYXBpcGUvdXRpbC90cmFja2luZy90b25lX21vZGVscy5wcm90bxIJ", + "bWVkaWFwaXBlIocBCg1HYWluQmlhc01vZGVsEhIKB2dhaW5fYzEYASABKAI6", + "ATESEgoHYmlhc19jMRgCIAEoAjoBMBISCgdnYWluX2MyGAMgASgCOgExEhIK", + "B2JpYXNfYzIYBCABKAI6ATASEgoHZ2Fpbl9jMxgFIAEoAjoBMRISCgdiaWFz", + "X2MzGAYgASgCOgEwIj8KFE1peHR1cmVHYWluQmlhc01vZGVsEicKBW1vZGVs", + "GAEgAygLMhgubWVkaWFwaXBlLkdhaW5CaWFzTW9kZWwi3QEKD0FmZmluZVRv", + "bmVNb2RlbBIPCgRnXzAwGAEgASgCOgExEg8KBGdfMDEYAiABKAI6ATASDwoE", + "Z18wMhgDIAEoAjoBMBIPCgRnXzAzGAQgASgCOgEwEg8KBGdfMTAYBSABKAI6", + "ATASDwoEZ18xMRgGIAEoAjoBMRIPCgRnXzEyGAcgASgCOgEwEg8KBGdfMTMY", + "CCABKAI6ATASDwoEZ18yMBgJIAEoAjoBMBIPCgRnXzIxGAogASgCOgEwEg8K", + "BGdfMjIYCyABKAI6ATESDwoEZ18yMxgMIAEoAjoBMCJDChZNaXh0dXJlQWZm", + "aW5lVG9uZU1vZGVsEikKBW1vZGVsGAEgAygLMhoubWVkaWFwaXBlLkFmZmlu", + "ZVRvbmVNb2RlbA==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.GainBiasModel), global::Mediapipe.GainBiasModel.Parser, new[]{ "GainC1", "BiasC1", "GainC2", "BiasC2", "GainC3", "BiasC3" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MixtureGainBiasModel), global::Mediapipe.MixtureGainBiasModel.Parser, new[]{ "Model" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.AffineToneModel), global::Mediapipe.AffineToneModel.Parser, new[]{ "G00", "G01", "G02", "G03", "G10", "G11", "G12", "G13", "G20", "G21", "G22", "G23" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MixtureAffineToneModel), global::Mediapipe.MixtureAffineToneModel.Parser, new[]{ "Model" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Transforms a 3D color vector x = (c1, c2, c3) according to + /// [ gain_c1 0 0 bias_c1 * [ c1 + /// 0 gain_c2 0 bias_c2 c2 + /// 0 0 gain_c3 bias_c3 ] c3 + /// 1 ] + /// + public sealed partial class GainBiasModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GainBiasModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneModelsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasModel(GainBiasModel other) : this() { + _hasBits0 = other._hasBits0; + gainC1_ = other.gainC1_; + biasC1_ = other.biasC1_; + gainC2_ = other.gainC2_; + biasC2_ = other.biasC2_; + gainC3_ = other.gainC3_; + biasC3_ = other.biasC3_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GainBiasModel Clone() { + return new GainBiasModel(this); + } + + /// Field number for the "gain_c1" field. + public const int GainC1FieldNumber = 1; + private readonly static float GainC1DefaultValue = 1F; + + private float gainC1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GainC1 { + get { if ((_hasBits0 & 1) != 0) { return gainC1_; } else { return GainC1DefaultValue; } } + set { + _hasBits0 |= 1; + gainC1_ = value; + } + } + /// Gets whether the "gain_c1" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainC1 { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "gain_c1" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainC1() { + _hasBits0 &= ~1; + } + + /// Field number for the "bias_c1" field. + public const int BiasC1FieldNumber = 2; + private readonly static float BiasC1DefaultValue = 0F; + + private float biasC1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BiasC1 { + get { if ((_hasBits0 & 2) != 0) { return biasC1_; } else { return BiasC1DefaultValue; } } + set { + _hasBits0 |= 2; + biasC1_ = value; + } + } + /// Gets whether the "bias_c1" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBiasC1 { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "bias_c1" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBiasC1() { + _hasBits0 &= ~2; + } + + /// Field number for the "gain_c2" field. + public const int GainC2FieldNumber = 3; + private readonly static float GainC2DefaultValue = 1F; + + private float gainC2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GainC2 { + get { if ((_hasBits0 & 4) != 0) { return gainC2_; } else { return GainC2DefaultValue; } } + set { + _hasBits0 |= 4; + gainC2_ = value; + } + } + /// Gets whether the "gain_c2" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainC2 { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "gain_c2" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainC2() { + _hasBits0 &= ~4; + } + + /// Field number for the "bias_c2" field. + public const int BiasC2FieldNumber = 4; + private readonly static float BiasC2DefaultValue = 0F; + + private float biasC2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BiasC2 { + get { if ((_hasBits0 & 8) != 0) { return biasC2_; } else { return BiasC2DefaultValue; } } + set { + _hasBits0 |= 8; + biasC2_ = value; + } + } + /// Gets whether the "bias_c2" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBiasC2 { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "bias_c2" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBiasC2() { + _hasBits0 &= ~8; + } + + /// Field number for the "gain_c3" field. + public const int GainC3FieldNumber = 5; + private readonly static float GainC3DefaultValue = 1F; + + private float gainC3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float GainC3 { + get { if ((_hasBits0 & 16) != 0) { return gainC3_; } else { return GainC3DefaultValue; } } + set { + _hasBits0 |= 16; + gainC3_ = value; + } + } + /// Gets whether the "gain_c3" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasGainC3 { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "gain_c3" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearGainC3() { + _hasBits0 &= ~16; + } + + /// Field number for the "bias_c3" field. + public const int BiasC3FieldNumber = 6; + private readonly static float BiasC3DefaultValue = 0F; + + private float biasC3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BiasC3 { + get { if ((_hasBits0 & 32) != 0) { return biasC3_; } else { return BiasC3DefaultValue; } } + set { + _hasBits0 |= 32; + biasC3_ = value; + } + } + /// Gets whether the "bias_c3" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBiasC3 { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "bias_c3" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBiasC3() { + _hasBits0 &= ~32; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GainBiasModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GainBiasModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GainC1, other.GainC1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BiasC1, other.BiasC1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GainC2, other.GainC2)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BiasC2, other.BiasC2)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GainC3, other.GainC3)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BiasC3, other.BiasC3)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasGainC1) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GainC1); + if (HasBiasC1) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasC1); + if (HasGainC2) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GainC2); + if (HasBiasC2) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasC2); + if (HasGainC3) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GainC3); + if (HasBiasC3) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasC3); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasGainC1) { + output.WriteRawTag(13); + output.WriteFloat(GainC1); + } + if (HasBiasC1) { + output.WriteRawTag(21); + output.WriteFloat(BiasC1); + } + if (HasGainC2) { + output.WriteRawTag(29); + output.WriteFloat(GainC2); + } + if (HasBiasC2) { + output.WriteRawTag(37); + output.WriteFloat(BiasC2); + } + if (HasGainC3) { + output.WriteRawTag(45); + output.WriteFloat(GainC3); + } + if (HasBiasC3) { + output.WriteRawTag(53); + output.WriteFloat(BiasC3); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasGainC1) { + output.WriteRawTag(13); + output.WriteFloat(GainC1); + } + if (HasBiasC1) { + output.WriteRawTag(21); + output.WriteFloat(BiasC1); + } + if (HasGainC2) { + output.WriteRawTag(29); + output.WriteFloat(GainC2); + } + if (HasBiasC2) { + output.WriteRawTag(37); + output.WriteFloat(BiasC2); + } + if (HasGainC3) { + output.WriteRawTag(45); + output.WriteFloat(GainC3); + } + if (HasBiasC3) { + output.WriteRawTag(53); + output.WriteFloat(BiasC3); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasGainC1) { + size += 1 + 4; + } + if (HasBiasC1) { + size += 1 + 4; + } + if (HasGainC2) { + size += 1 + 4; + } + if (HasBiasC2) { + size += 1 + 4; + } + if (HasGainC3) { + size += 1 + 4; + } + if (HasBiasC3) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GainBiasModel other) { + if (other == null) { + return; + } + if (other.HasGainC1) { + GainC1 = other.GainC1; + } + if (other.HasBiasC1) { + BiasC1 = other.BiasC1; + } + if (other.HasGainC2) { + GainC2 = other.GainC2; + } + if (other.HasBiasC2) { + BiasC2 = other.BiasC2; + } + if (other.HasGainC3) { + GainC3 = other.GainC3; + } + if (other.HasBiasC3) { + BiasC3 = other.BiasC3; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + GainC1 = input.ReadFloat(); + break; + } + case 21: { + BiasC1 = input.ReadFloat(); + break; + } + case 29: { + GainC2 = input.ReadFloat(); + break; + } + case 37: { + BiasC2 = input.ReadFloat(); + break; + } + case 45: { + GainC3 = input.ReadFloat(); + break; + } + case 53: { + BiasC3 = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + GainC1 = input.ReadFloat(); + break; + } + case 21: { + BiasC1 = input.ReadFloat(); + break; + } + case 29: { + GainC2 = input.ReadFloat(); + break; + } + case 37: { + BiasC2 = input.ReadFloat(); + break; + } + case 45: { + GainC3 = input.ReadFloat(); + break; + } + case 53: { + BiasC3 = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MixtureGainBiasModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureGainBiasModel()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneModelsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureGainBiasModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureGainBiasModel(MixtureGainBiasModel other) : this() { + model_ = other.model_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureGainBiasModel Clone() { + return new MixtureGainBiasModel(this); + } + + /// Field number for the "model" field. + public const int ModelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_model_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.GainBiasModel.Parser); + private readonly pbc::RepeatedField model_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Model { + get { return model_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureGainBiasModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureGainBiasModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!model_.Equals(other.model_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= model_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + model_.WriteTo(output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + model_.WriteTo(ref output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += model_.CalculateSize(_repeated_model_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureGainBiasModel other) { + if (other == null) { + return; + } + model_.Add(other.model_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + model_.AddEntriesFrom(input, _repeated_model_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + model_.AddEntriesFrom(ref input, _repeated_model_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Transforms a 3D color vector x = (c1, c2, c3) according to + /// [ g_00 g_01 g_02 g_03 * [ c1 + /// g_10 g_11 g_12 g_13 c2 + /// g_20 g_21 g_22 g_23 ] c3 + /// 1 ] + /// + public sealed partial class AffineToneModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AffineToneModel()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneModelsReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineToneModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineToneModel(AffineToneModel other) : this() { + _hasBits0 = other._hasBits0; + g00_ = other.g00_; + g01_ = other.g01_; + g02_ = other.g02_; + g03_ = other.g03_; + g10_ = other.g10_; + g11_ = other.g11_; + g12_ = other.g12_; + g13_ = other.g13_; + g20_ = other.g20_; + g21_ = other.g21_; + g22_ = other.g22_; + g23_ = other.g23_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public AffineToneModel Clone() { + return new AffineToneModel(this); + } + + /// Field number for the "g_00" field. + public const int G00FieldNumber = 1; + private readonly static float G00DefaultValue = 1F; + + private float g00_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G00 { + get { if ((_hasBits0 & 1) != 0) { return g00_; } else { return G00DefaultValue; } } + set { + _hasBits0 |= 1; + g00_ = value; + } + } + /// Gets whether the "g_00" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG00 { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "g_00" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG00() { + _hasBits0 &= ~1; + } + + /// Field number for the "g_01" field. + public const int G01FieldNumber = 2; + private readonly static float G01DefaultValue = 0F; + + private float g01_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G01 { + get { if ((_hasBits0 & 2) != 0) { return g01_; } else { return G01DefaultValue; } } + set { + _hasBits0 |= 2; + g01_ = value; + } + } + /// Gets whether the "g_01" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG01 { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "g_01" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG01() { + _hasBits0 &= ~2; + } + + /// Field number for the "g_02" field. + public const int G02FieldNumber = 3; + private readonly static float G02DefaultValue = 0F; + + private float g02_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G02 { + get { if ((_hasBits0 & 4) != 0) { return g02_; } else { return G02DefaultValue; } } + set { + _hasBits0 |= 4; + g02_ = value; + } + } + /// Gets whether the "g_02" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG02 { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "g_02" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG02() { + _hasBits0 &= ~4; + } + + /// Field number for the "g_03" field. + public const int G03FieldNumber = 4; + private readonly static float G03DefaultValue = 0F; + + private float g03_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G03 { + get { if ((_hasBits0 & 8) != 0) { return g03_; } else { return G03DefaultValue; } } + set { + _hasBits0 |= 8; + g03_ = value; + } + } + /// Gets whether the "g_03" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG03 { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "g_03" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG03() { + _hasBits0 &= ~8; + } + + /// Field number for the "g_10" field. + public const int G10FieldNumber = 5; + private readonly static float G10DefaultValue = 0F; + + private float g10_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G10 { + get { if ((_hasBits0 & 16) != 0) { return g10_; } else { return G10DefaultValue; } } + set { + _hasBits0 |= 16; + g10_ = value; + } + } + /// Gets whether the "g_10" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG10 { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "g_10" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG10() { + _hasBits0 &= ~16; + } + + /// Field number for the "g_11" field. + public const int G11FieldNumber = 6; + private readonly static float G11DefaultValue = 1F; + + private float g11_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G11 { + get { if ((_hasBits0 & 32) != 0) { return g11_; } else { return G11DefaultValue; } } + set { + _hasBits0 |= 32; + g11_ = value; + } + } + /// Gets whether the "g_11" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG11 { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "g_11" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG11() { + _hasBits0 &= ~32; + } + + /// Field number for the "g_12" field. + public const int G12FieldNumber = 7; + private readonly static float G12DefaultValue = 0F; + + private float g12_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G12 { + get { if ((_hasBits0 & 64) != 0) { return g12_; } else { return G12DefaultValue; } } + set { + _hasBits0 |= 64; + g12_ = value; + } + } + /// Gets whether the "g_12" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG12 { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "g_12" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG12() { + _hasBits0 &= ~64; + } + + /// Field number for the "g_13" field. + public const int G13FieldNumber = 8; + private readonly static float G13DefaultValue = 0F; + + private float g13_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G13 { + get { if ((_hasBits0 & 128) != 0) { return g13_; } else { return G13DefaultValue; } } + set { + _hasBits0 |= 128; + g13_ = value; + } + } + /// Gets whether the "g_13" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG13 { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "g_13" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG13() { + _hasBits0 &= ~128; + } + + /// Field number for the "g_20" field. + public const int G20FieldNumber = 9; + private readonly static float G20DefaultValue = 0F; + + private float g20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G20 { + get { if ((_hasBits0 & 256) != 0) { return g20_; } else { return G20DefaultValue; } } + set { + _hasBits0 |= 256; + g20_ = value; + } + } + /// Gets whether the "g_20" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG20 { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "g_20" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG20() { + _hasBits0 &= ~256; + } + + /// Field number for the "g_21" field. + public const int G21FieldNumber = 10; + private readonly static float G21DefaultValue = 0F; + + private float g21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G21 { + get { if ((_hasBits0 & 512) != 0) { return g21_; } else { return G21DefaultValue; } } + set { + _hasBits0 |= 512; + g21_ = value; + } + } + /// Gets whether the "g_21" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG21 { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "g_21" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG21() { + _hasBits0 &= ~512; + } + + /// Field number for the "g_22" field. + public const int G22FieldNumber = 11; + private readonly static float G22DefaultValue = 1F; + + private float g22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G22 { + get { if ((_hasBits0 & 1024) != 0) { return g22_; } else { return G22DefaultValue; } } + set { + _hasBits0 |= 1024; + g22_ = value; + } + } + /// Gets whether the "g_22" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG22 { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "g_22" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG22() { + _hasBits0 &= ~1024; + } + + /// Field number for the "g_23" field. + public const int G23FieldNumber = 12; + private readonly static float G23DefaultValue = 0F; + + private float g23_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float G23 { + get { if ((_hasBits0 & 2048) != 0) { return g23_; } else { return G23DefaultValue; } } + set { + _hasBits0 |= 2048; + g23_ = value; + } + } + /// Gets whether the "g_23" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasG23 { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "g_23" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearG23() { + _hasBits0 &= ~2048; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as AffineToneModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(AffineToneModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G00, other.G00)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G01, other.G01)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G02, other.G02)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G03, other.G03)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G10, other.G10)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G11, other.G11)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G12, other.G12)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G13, other.G13)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G20, other.G20)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G21, other.G21)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G22, other.G22)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(G23, other.G23)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasG00) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G00); + if (HasG01) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G01); + if (HasG02) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G02); + if (HasG03) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G03); + if (HasG10) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G10); + if (HasG11) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G11); + if (HasG12) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G12); + if (HasG13) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G13); + if (HasG20) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G20); + if (HasG21) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G21); + if (HasG22) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G22); + if (HasG23) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(G23); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasG00) { + output.WriteRawTag(13); + output.WriteFloat(G00); + } + if (HasG01) { + output.WriteRawTag(21); + output.WriteFloat(G01); + } + if (HasG02) { + output.WriteRawTag(29); + output.WriteFloat(G02); + } + if (HasG03) { + output.WriteRawTag(37); + output.WriteFloat(G03); + } + if (HasG10) { + output.WriteRawTag(45); + output.WriteFloat(G10); + } + if (HasG11) { + output.WriteRawTag(53); + output.WriteFloat(G11); + } + if (HasG12) { + output.WriteRawTag(61); + output.WriteFloat(G12); + } + if (HasG13) { + output.WriteRawTag(69); + output.WriteFloat(G13); + } + if (HasG20) { + output.WriteRawTag(77); + output.WriteFloat(G20); + } + if (HasG21) { + output.WriteRawTag(85); + output.WriteFloat(G21); + } + if (HasG22) { + output.WriteRawTag(93); + output.WriteFloat(G22); + } + if (HasG23) { + output.WriteRawTag(101); + output.WriteFloat(G23); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasG00) { + output.WriteRawTag(13); + output.WriteFloat(G00); + } + if (HasG01) { + output.WriteRawTag(21); + output.WriteFloat(G01); + } + if (HasG02) { + output.WriteRawTag(29); + output.WriteFloat(G02); + } + if (HasG03) { + output.WriteRawTag(37); + output.WriteFloat(G03); + } + if (HasG10) { + output.WriteRawTag(45); + output.WriteFloat(G10); + } + if (HasG11) { + output.WriteRawTag(53); + output.WriteFloat(G11); + } + if (HasG12) { + output.WriteRawTag(61); + output.WriteFloat(G12); + } + if (HasG13) { + output.WriteRawTag(69); + output.WriteFloat(G13); + } + if (HasG20) { + output.WriteRawTag(77); + output.WriteFloat(G20); + } + if (HasG21) { + output.WriteRawTag(85); + output.WriteFloat(G21); + } + if (HasG22) { + output.WriteRawTag(93); + output.WriteFloat(G22); + } + if (HasG23) { + output.WriteRawTag(101); + output.WriteFloat(G23); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasG00) { + size += 1 + 4; + } + if (HasG01) { + size += 1 + 4; + } + if (HasG02) { + size += 1 + 4; + } + if (HasG03) { + size += 1 + 4; + } + if (HasG10) { + size += 1 + 4; + } + if (HasG11) { + size += 1 + 4; + } + if (HasG12) { + size += 1 + 4; + } + if (HasG13) { + size += 1 + 4; + } + if (HasG20) { + size += 1 + 4; + } + if (HasG21) { + size += 1 + 4; + } + if (HasG22) { + size += 1 + 4; + } + if (HasG23) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(AffineToneModel other) { + if (other == null) { + return; + } + if (other.HasG00) { + G00 = other.G00; + } + if (other.HasG01) { + G01 = other.G01; + } + if (other.HasG02) { + G02 = other.G02; + } + if (other.HasG03) { + G03 = other.G03; + } + if (other.HasG10) { + G10 = other.G10; + } + if (other.HasG11) { + G11 = other.G11; + } + if (other.HasG12) { + G12 = other.G12; + } + if (other.HasG13) { + G13 = other.G13; + } + if (other.HasG20) { + G20 = other.G20; + } + if (other.HasG21) { + G21 = other.G21; + } + if (other.HasG22) { + G22 = other.G22; + } + if (other.HasG23) { + G23 = other.G23; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + G00 = input.ReadFloat(); + break; + } + case 21: { + G01 = input.ReadFloat(); + break; + } + case 29: { + G02 = input.ReadFloat(); + break; + } + case 37: { + G03 = input.ReadFloat(); + break; + } + case 45: { + G10 = input.ReadFloat(); + break; + } + case 53: { + G11 = input.ReadFloat(); + break; + } + case 61: { + G12 = input.ReadFloat(); + break; + } + case 69: { + G13 = input.ReadFloat(); + break; + } + case 77: { + G20 = input.ReadFloat(); + break; + } + case 85: { + G21 = input.ReadFloat(); + break; + } + case 93: { + G22 = input.ReadFloat(); + break; + } + case 101: { + G23 = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + G00 = input.ReadFloat(); + break; + } + case 21: { + G01 = input.ReadFloat(); + break; + } + case 29: { + G02 = input.ReadFloat(); + break; + } + case 37: { + G03 = input.ReadFloat(); + break; + } + case 45: { + G10 = input.ReadFloat(); + break; + } + case 53: { + G11 = input.ReadFloat(); + break; + } + case 61: { + G12 = input.ReadFloat(); + break; + } + case 69: { + G13 = input.ReadFloat(); + break; + } + case 77: { + G20 = input.ReadFloat(); + break; + } + case 85: { + G21 = input.ReadFloat(); + break; + } + case 93: { + G22 = input.ReadFloat(); + break; + } + case 101: { + G23 = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MixtureAffineToneModel : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixtureAffineToneModel()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.ToneModelsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffineToneModel() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffineToneModel(MixtureAffineToneModel other) : this() { + model_ = other.model_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixtureAffineToneModel Clone() { + return new MixtureAffineToneModel(this); + } + + /// Field number for the "model" field. + public const int ModelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_model_codec + = pb::FieldCodec.ForMessage(10, global::Mediapipe.AffineToneModel.Parser); + private readonly pbc::RepeatedField model_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Model { + get { return model_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixtureAffineToneModel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixtureAffineToneModel other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!model_.Equals(other.model_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= model_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + model_.WriteTo(output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + model_.WriteTo(ref output, _repeated_model_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += model_.CalculateSize(_repeated_model_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixtureAffineToneModel other) { + if (other == null) { + return; + } + model_.Add(other.model_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + model_.AddEntriesFrom(input, _repeated_model_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + model_.AddEntriesFrom(ref input, _repeated_model_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs.meta new file mode 100644 index 0000000..1d3e4ce --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/ToneModels.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c23572ae7139b1d628be8d85e782a0ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs new file mode 100644 index 0000000..7098237 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs @@ -0,0 +1,314 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/tracked_detection_manager_config.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/tracked_detection_manager_config.proto + public static partial class TrackedDetectionManagerConfigReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/tracked_detection_manager_config.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TrackedDetectionManagerConfigReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj5tZWRpYXBpcGUvdXRpbC90cmFja2luZy90cmFja2VkX2RldGVjdGlvbl9t", + "YW5hZ2VyX2NvbmZpZy5wcm90bxIJbWVkaWFwaXBlIn4KHVRyYWNrZWREZXRl", + "Y3Rpb25NYW5hZ2VyQ29uZmlnEisKIGlzX3NhbWVfZGV0ZWN0aW9uX21heF9h", + "cmVhX3JhdGlvGAEgASgCOgEzEjAKI2lzX3NhbWVfZGV0ZWN0aW9uX21pbl9v", + "dmVybGFwX3JhdGlvGAIgASgCOgMwLjU=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackedDetectionManagerConfig), global::Mediapipe.TrackedDetectionManagerConfig.Parser, new[]{ "IsSameDetectionMaxAreaRatio", "IsSameDetectionMinOverlapRatio" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TrackedDetectionManagerConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackedDetectionManagerConfig()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackedDetectionManagerConfigReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerConfig(TrackedDetectionManagerConfig other) : this() { + _hasBits0 = other._hasBits0; + isSameDetectionMaxAreaRatio_ = other.isSameDetectionMaxAreaRatio_; + isSameDetectionMinOverlapRatio_ = other.isSameDetectionMinOverlapRatio_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackedDetectionManagerConfig Clone() { + return new TrackedDetectionManagerConfig(this); + } + + /// Field number for the "is_same_detection_max_area_ratio" field. + public const int IsSameDetectionMaxAreaRatioFieldNumber = 1; + private readonly static float IsSameDetectionMaxAreaRatioDefaultValue = 3F; + + private float isSameDetectionMaxAreaRatio_; + /// + /// When we compare two detection boxes, if the ratio of the area is + /// larger than is_same_detection_max_area_ratio, we consider them being + /// different detections. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IsSameDetectionMaxAreaRatio { + get { if ((_hasBits0 & 1) != 0) { return isSameDetectionMaxAreaRatio_; } else { return IsSameDetectionMaxAreaRatioDefaultValue; } } + set { + _hasBits0 |= 1; + isSameDetectionMaxAreaRatio_ = value; + } + } + /// Gets whether the "is_same_detection_max_area_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIsSameDetectionMaxAreaRatio { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "is_same_detection_max_area_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIsSameDetectionMaxAreaRatio() { + _hasBits0 &= ~1; + } + + /// Field number for the "is_same_detection_min_overlap_ratio" field. + public const int IsSameDetectionMinOverlapRatioFieldNumber = 2; + private readonly static float IsSameDetectionMinOverlapRatioDefaultValue = 0.5F; + + private float isSameDetectionMinOverlapRatio_; + /// + /// When we compare two detection boxes, if the overlap ratio is larger + /// than is_same_detection_min_overlap_ratio, we consider them being + /// same detection. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float IsSameDetectionMinOverlapRatio { + get { if ((_hasBits0 & 2) != 0) { return isSameDetectionMinOverlapRatio_; } else { return IsSameDetectionMinOverlapRatioDefaultValue; } } + set { + _hasBits0 |= 2; + isSameDetectionMinOverlapRatio_ = value; + } + } + /// Gets whether the "is_same_detection_min_overlap_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIsSameDetectionMinOverlapRatio { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "is_same_detection_min_overlap_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIsSameDetectionMinOverlapRatio() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackedDetectionManagerConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackedDetectionManagerConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IsSameDetectionMaxAreaRatio, other.IsSameDetectionMaxAreaRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IsSameDetectionMinOverlapRatio, other.IsSameDetectionMinOverlapRatio)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIsSameDetectionMaxAreaRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IsSameDetectionMaxAreaRatio); + if (HasIsSameDetectionMinOverlapRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IsSameDetectionMinOverlapRatio); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIsSameDetectionMaxAreaRatio) { + output.WriteRawTag(13); + output.WriteFloat(IsSameDetectionMaxAreaRatio); + } + if (HasIsSameDetectionMinOverlapRatio) { + output.WriteRawTag(21); + output.WriteFloat(IsSameDetectionMinOverlapRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIsSameDetectionMaxAreaRatio) { + output.WriteRawTag(13); + output.WriteFloat(IsSameDetectionMaxAreaRatio); + } + if (HasIsSameDetectionMinOverlapRatio) { + output.WriteRawTag(21); + output.WriteFloat(IsSameDetectionMinOverlapRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIsSameDetectionMaxAreaRatio) { + size += 1 + 4; + } + if (HasIsSameDetectionMinOverlapRatio) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackedDetectionManagerConfig other) { + if (other == null) { + return; + } + if (other.HasIsSameDetectionMaxAreaRatio) { + IsSameDetectionMaxAreaRatio = other.IsSameDetectionMaxAreaRatio; + } + if (other.HasIsSameDetectionMinOverlapRatio) { + IsSameDetectionMinOverlapRatio = other.IsSameDetectionMinOverlapRatio; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + IsSameDetectionMaxAreaRatio = input.ReadFloat(); + break; + } + case 21: { + IsSameDetectionMinOverlapRatio = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + IsSameDetectionMaxAreaRatio = input.ReadFloat(); + break; + } + case 21: { + IsSameDetectionMinOverlapRatio = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs.meta new file mode 100644 index 0000000..aa845fa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/TrackedDetectionManagerConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a0b46e7057165fc38579405ceeefffa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs new file mode 100644 index 0000000..14525f7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs @@ -0,0 +1,6210 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mediapipe/util/tracking/tracking.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Mediapipe { + + /// Holder for reflection information generated from mediapipe/util/tracking/tracking.proto + public static partial class TrackingReflection { + + #region Descriptor + /// File descriptor for mediapipe/util/tracking/tracking.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TrackingReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZtZWRpYXBpcGUvdXRpbC90cmFja2luZy90cmFja2luZy5wcm90bxIJbWVk", + "aWFwaXBlGittZWRpYXBpcGUvdXRpbC90cmFja2luZy9tb3Rpb25fbW9kZWxz", + "LnByb3RvIuUICg5Nb3Rpb25Cb3hTdGF0ZRINCgVwb3NfeBgBIAEoAhINCgVw", + "b3NfeRgCIAEoAhINCgV3aWR0aBgDIAEoAhIOCgZoZWlnaHQYBCABKAISEAoF", + "c2NhbGUYBSABKAI6ATESEwoIcm90YXRpb24YHiABKAI6ATASLAoEcXVhZBgi", + "IAEoCzIeLm1lZGlhcGlwZS5Nb3Rpb25Cb3hTdGF0ZS5RdWFkEhQKDGFzcGVj", + "dF9yYXRpbxgjIAEoAhIfChByZXF1ZXN0X2dyb3VwaW5nGCUgASgIOgVmYWxz", + "ZRItCg5wbnBfaG9tb2dyYXBoeRgkIAEoCzIVLm1lZGlhcGlwZS5Ib21vZ3Jh", + "cGh5EgoKAmR4GAcgASgCEgoKAmR5GAggASgCEhYKDmtpbmV0aWNfZW5lcmd5", + "GBEgASgCEhQKDHByaW9yX3dlaWdodBgJIAEoAhJKCgx0cmFja19zdGF0dXMY", + "CiABKA4yJS5tZWRpYXBpcGUuTW90aW9uQm94U3RhdGUuVHJhY2tTdGF0dXM6", + "DUJPWF9VTlRSQUNLRUQSIwoXc3BhdGlhbF9wcmlvcl9ncmlkX3NpemUYCyAB", + "KAU6AjEwEhkKDXNwYXRpYWxfcHJpb3IYDCADKAJCAhABEh4KEnNwYXRpYWxf", + "Y29uZmlkZW5jZRgNIAMoAkICEAESEgoKcHJpb3JfZGlmZhgOIAEoAhIYChBt", + "b3Rpb25fZGlzcGFyaXR5GA8gASgCEiEKGWJhY2tncm91bmRfZGlzY3JpbWlu", + "YXRpb24YECABKAISFwoPaW5saWVyX2NlbnRlcl94GBIgASgCEhcKD2lubGll", + "cl9jZW50ZXJfeRgTIAEoAhISCgppbmxpZXJfc3VtGBggASgCEhQKDGlubGll", + "cl9yYXRpbxgZIAEoAhIUCgxpbmxpZXJfd2lkdGgYFiABKAISFQoNaW5saWVy", + "X2hlaWdodBgXIAEoAhIWCgppbmxpZXJfaWRzGBogAygNQgIQARIfChNpbmxp", + "ZXJfaWRfbWF0Y2hfcG9zGB8gAygNQgIQARIZCg1pbmxpZXJfbGVuZ3RoGBsg", + "AygNQgIQARIXCgtvdXRsaWVyX2lkcxgcIAMoDUICEAESIAoUb3V0bGllcl9p", + "ZF9tYXRjaF9wb3MYICADKA1CAhABEhsKE3RyYWNraW5nX2NvbmZpZGVuY2UY", + "ISABKAISMwoIaW50ZXJuYWwYHSABKAsyIS5tZWRpYXBpcGUuTW90aW9uQm94", + "SW50ZXJuYWxTdGF0ZRoYCgRRdWFkEhAKCHZlcnRpY2VzGAEgAygCIocBCgtU", + "cmFja1N0YXR1cxIRCg1CT1hfVU5UUkFDS0VEEAASDQoJQk9YX0VNUFRZEAES", + "EwoPQk9YX05PX0ZFQVRVUkVTEAISDwoLQk9YX1RSQUNLRUQQAxISCg5CT1hf", + "RFVQTElDQVRFRBAEEhwKGEJPWF9UUkFDS0VEX09VVF9PRl9CT1VORBAFSgQI", + "FBAVSgQIFRAWIrwBChZNb3Rpb25Cb3hJbnRlcm5hbFN0YXRlEhEKBXBvc194", + "GAEgAygCQgIQARIRCgVwb3NfeRgCIAMoAkICEAESDgoCZHgYAyADKAJCAhAB", + "Eg4KAmR5GAQgAygCQgIQARIVCgljYW1lcmFfZHgYBSADKAJCAhABEhUKCWNh", + "bWVyYV9keRgGIAMoAkICEAESFAoIdHJhY2tfaWQYByADKAVCAhABEhgKDGlu", + "bGllcl9zY29yZRgIIAMoAkICEAEinRMKEFRyYWNrU3RlcE9wdGlvbnMSYgoQ", + "dHJhY2tpbmdfZGVncmVlcxgcIAEoDjIrLm1lZGlhcGlwZS5UcmFja1N0ZXBP", + "cHRpb25zLlRyYWNraW5nRGVncmVlczobVFJBQ0tJTkdfREVHUkVFX1RSQU5T", + "TEFUSU9OEiYKF3RyYWNrX29iamVjdF9hbmRfY2FtZXJhGCAgASgIOgVmYWxz", + "ZRIaCg9pcmxzX2l0ZXJhdGlvbnMYASABKAU6ATUSGwoNc3BhdGlhbF9zaWdt", + "YRgCIAEoAjoEMC4xNRIfChBtaW5fbW90aW9uX3NpZ21hGAMgASgCOgUwLjAw", + "MhIiChVyZWxhdGl2ZV9tb3Rpb25fc2lnbWEYBCABKAI6AzAuMxIpChptb3Rp", + "b25fZGlzcGFyaXR5X2xvd19sZXZlbBgGIAEoAjoFMC4wMDgSKgobbW90aW9u", + "X2Rpc3Bhcml0eV9oaWdoX2xldmVsGAcgASgCOgUwLjAxNhIcCg9kaXNwYXJp", + "dHlfZGVjYXkYCCABKAI6AzAuOBIgChNtb3Rpb25fcHJpb3Jfd2VpZ2h0GAkg", + "ASgCOgMwLjISMgojYmFja2dyb3VuZF9kaXNjcmltaW5hdGlvbl9sb3dfbGV2", + "ZWwYCiABKAI6BTAuMDA0EjMKJGJhY2tncm91bmRfZGlzY3JpbWluYXRpb25f", + "aGlnaF9sZXZlbBgLIAEoAjoFMC4wMDgSLAofaW5saWVyX2NlbnRlcl9yZWxh", + "dGl2ZV9kaXN0YW5jZRgMIAEoAjoDMC4xEiAKE2lubGllcl9zcHJpbmdfZm9y", + "Y2UYDSABKAI6AzAuMxItCiBraW5ldGljX2NlbnRlcl9yZWxhdGl2ZV9kaXN0", + "YW5jZRgOIAEoAjoDMC40EiEKFGtpbmV0aWNfc3ByaW5nX2ZvcmNlGA8gASgC", + "OgMwLjUSNgona2luZXRpY19zcHJpbmdfZm9yY2VfbWluX2tpbmV0aWNfZW5l", + "cmd5GBUgASgCOgUwLjAwMxIjChZ2ZWxvY2l0eV91cGRhdGVfd2VpZ2h0GBAg", + "ASgCOgMwLjcSHgoSbWF4X3RyYWNrX2ZhaWx1cmVzGBEgASgFOgIxMBIcCg5l", + "eHBhbnNpb25fc2l6ZRgSIAEoAjoEMC4wNRIeChFpbmxpZXJfbG93X3dlaWdo", + "dBgTIAEoAjoDMjUwEh8KEmlubGllcl9oaWdoX3dlaWdodBgUIAEoAjoDNTAw", + "EiIKFGtpbmV0aWNfZW5lcmd5X2RlY2F5GBYgASgCOgQwLjk4EiIKFXByaW9y", + "X3dlaWdodF9pbmNyZWFzZRgXIAEoAjoDMC4yEiEKEmxvd19raW5ldGljX2Vu", + "ZXJneRgYIAEoAjoFMC4wMDESIgoTaGlnaF9raW5ldGljX2VuZXJneRgZIAEo", + "AjoFMC4wMDQSJAoVcmV0dXJuX2ludGVybmFsX3N0YXRlGBogASgIOgVmYWxz", + "ZRIzCiV1c2VfcG9zdF9lc3RpbWF0aW9uX3dlaWdodHNfZm9yX3N0YXRlGB0g", + "ASgIOgR0cnVlEiQKFWNvbXB1dGVfc3BhdGlhbF9wcmlvchgbIAEoCDoFZmFs", + "c2USSwoTaXJsc19pbml0aWFsaXphdGlvbhgeIAEoCzIuLm1lZGlhcGlwZS5U", + "cmFja1N0ZXBPcHRpb25zLklybHNJbml0aWFsaXphdGlvbhIrChxzdGF0aWNf", + "bW90aW9uX3RlbXBvcmFsX3JhdGlvGCEgASgCOgUwLjAwMxJuCiZjYW5jZWxf", + "dHJhY2tpbmdfd2l0aF9vY2NsdXNpb25fb3B0aW9ucxgiIAEoCzI+Lm1lZGlh", + "cGlwZS5UcmFja1N0ZXBPcHRpb25zLkNhbmNlbFRyYWNraW5nV2l0aE9jY2x1", + "c2lvbk9wdGlvbnMSLwojb2JqZWN0X3NpbWlsYXJpdHlfbWluX2NvbnRkX2lu", + "bGllcnMYIyABKAU6AjMwEiYKGGJveF9zaW1pbGFyaXR5X21heF9zY2FsZRgk", + "IAEoAjoEMS4wNRIoChtib3hfc2ltaWxhcml0eV9tYXhfcm90YXRpb24YJSAB", + "KAI6AzAuMhImChlxdWFkX2hvbW9ncmFwaHlfbWF4X3NjYWxlGCYgASgCOgMx", + "LjISKQoccXVhZF9ob21vZ3JhcGh5X21heF9yb3RhdGlvbhgnIAEoAjoDMC4z", + "EkcKEWNhbWVyYV9pbnRyaW5zaWNzGCggASgLMiwubWVkaWFwaXBlLlRyYWNr", + "U3RlcE9wdGlvbnMuQ2FtZXJhSW50cmluc2ljcxIiChNmb3JjZWRfcG5wX3Ry", + "YWNraW5nGCkgASgIOgVmYWxzZRpZChJJcmxzSW5pdGlhbGl6YXRpb24SGAoJ", + "YWN0aXZhdGVkGAEgASgIOgVmYWxzZRISCgZyb3VuZHMYAiABKAU6AjUwEhUK", + "BmN1dG9mZhgDIAEoAjoFMC4wMDUagQEKIkNhbmNlbFRyYWNraW5nV2l0aE9j", + "Y2x1c2lvbk9wdGlvbnMSGAoJYWN0aXZhdGVkGAEgASgIOgVmYWxzZRIiChVt", + "aW5fbW90aW9uX2NvbnRpbnVpdHkYAiABKAI6AzAuNBIdChBtaW5faW5saWVy", + "X3JhdGlvGAMgASgCOgMwLjEafAoQQ2FtZXJhSW50cmluc2ljcxIKCgJmeBgB", + "IAEoAhIKCgJmeRgCIAEoAhIKCgJjeBgDIAEoAhIKCgJjeRgEIAEoAhIKCgJr", + "MBgFIAEoAhIKCgJrMRgGIAEoAhIKCgJrMhgHIAEoAhIJCgF3GAggASgFEgkK", + "AWgYCSABKAUi5gIKD1RyYWNraW5nRGVncmVlcxIfChtUUkFDS0lOR19ERUdS", + "RUVfVFJBTlNMQVRJT04QABIgChxUUkFDS0lOR19ERUdSRUVfQ0FNRVJBX1ND", + "QUxFEAESIwofVFJBQ0tJTkdfREVHUkVFX0NBTUVSQV9ST1RBVElPThACEikK", + "JVRSQUNLSU5HX0RFR1JFRV9DQU1FUkFfUk9UQVRJT05fU0NBTEUQAxImCiJU", + "UkFDS0lOR19ERUdSRUVfQ0FNRVJBX1BFUlNQRUNUSVZFEAQSIAocVFJBQ0tJ", + "TkdfREVHUkVFX09CSkVDVF9TQ0FMRRAFEiMKH1RSQUNLSU5HX0RFR1JFRV9P", + "QkpFQ1RfUk9UQVRJT04QBhIpCiVUUkFDS0lOR19ERUdSRUVfT0JKRUNUX1JP", + "VEFUSU9OX1NDQUxFEAcSJgoiVFJBQ0tJTkdfREVHUkVFX09CSkVDVF9QRVJT", + "UEVDVElWRRAI")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Mediapipe.MotionModelsReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionBoxState), global::Mediapipe.MotionBoxState.Parser, new[]{ "PosX", "PosY", "Width", "Height", "Scale", "Rotation", "Quad", "AspectRatio", "RequestGrouping", "PnpHomography", "Dx", "Dy", "KineticEnergy", "PriorWeight", "TrackStatus", "SpatialPriorGridSize", "SpatialPrior", "SpatialConfidence", "PriorDiff", "MotionDisparity", "BackgroundDiscrimination", "InlierCenterX", "InlierCenterY", "InlierSum", "InlierRatio", "InlierWidth", "InlierHeight", "InlierIds", "InlierIdMatchPos", "InlierLength", "OutlierIds", "OutlierIdMatchPos", "TrackingConfidence", "Internal" }, null, new[]{ typeof(global::Mediapipe.MotionBoxState.Types.TrackStatus) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionBoxState.Types.Quad), global::Mediapipe.MotionBoxState.Types.Quad.Parser, new[]{ "Vertices" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.MotionBoxInternalState), global::Mediapipe.MotionBoxInternalState.Parser, new[]{ "PosX", "PosY", "Dx", "Dy", "CameraDx", "CameraDy", "TrackId", "InlierScore" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackStepOptions), global::Mediapipe.TrackStepOptions.Parser, new[]{ "TrackingDegrees", "TrackObjectAndCamera", "IrlsIterations", "SpatialSigma", "MinMotionSigma", "RelativeMotionSigma", "MotionDisparityLowLevel", "MotionDisparityHighLevel", "DisparityDecay", "MotionPriorWeight", "BackgroundDiscriminationLowLevel", "BackgroundDiscriminationHighLevel", "InlierCenterRelativeDistance", "InlierSpringForce", "KineticCenterRelativeDistance", "KineticSpringForce", "KineticSpringForceMinKineticEnergy", "VelocityUpdateWeight", "MaxTrackFailures", "ExpansionSize", "InlierLowWeight", "InlierHighWeight", "KineticEnergyDecay", "PriorWeightIncrease", "LowKineticEnergy", "HighKineticEnergy", "ReturnInternalState", "UsePostEstimationWeightsForState", "ComputeSpatialPrior", "IrlsInitialization", "StaticMotionTemporalRatio", "CancelTrackingWithOcclusionOptions", "ObjectSimilarityMinContdInliers", "BoxSimilarityMaxScale", "BoxSimilarityMaxRotation", "QuadHomographyMaxScale", "QuadHomographyMaxRotation", "CameraIntrinsics", "ForcedPnpTracking" }, null, new[]{ typeof(global::Mediapipe.TrackStepOptions.Types.TrackingDegrees) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackStepOptions.Types.IrlsInitialization), global::Mediapipe.TrackStepOptions.Types.IrlsInitialization.Parser, new[]{ "Activated", "Rounds", "Cutoff" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions), global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions.Parser, new[]{ "Activated", "MinMotionContinuity", "MinInlierRatio" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics), global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics.Parser, new[]{ "Fx", "Fy", "Cx", "Cy", "K0", "K1", "K2", "W", "H" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Next tag: 38 + /// + public sealed partial class MotionBoxState : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionBoxState()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxState(MotionBoxState other) : this() { + _hasBits0 = other._hasBits0; + posX_ = other.posX_; + posY_ = other.posY_; + width_ = other.width_; + height_ = other.height_; + scale_ = other.scale_; + rotation_ = other.rotation_; + quad_ = other.quad_ != null ? other.quad_.Clone() : null; + aspectRatio_ = other.aspectRatio_; + requestGrouping_ = other.requestGrouping_; + pnpHomography_ = other.pnpHomography_ != null ? other.pnpHomography_.Clone() : null; + dx_ = other.dx_; + dy_ = other.dy_; + kineticEnergy_ = other.kineticEnergy_; + priorWeight_ = other.priorWeight_; + trackStatus_ = other.trackStatus_; + spatialPriorGridSize_ = other.spatialPriorGridSize_; + spatialPrior_ = other.spatialPrior_.Clone(); + spatialConfidence_ = other.spatialConfidence_.Clone(); + priorDiff_ = other.priorDiff_; + motionDisparity_ = other.motionDisparity_; + backgroundDiscrimination_ = other.backgroundDiscrimination_; + inlierCenterX_ = other.inlierCenterX_; + inlierCenterY_ = other.inlierCenterY_; + inlierSum_ = other.inlierSum_; + inlierRatio_ = other.inlierRatio_; + inlierWidth_ = other.inlierWidth_; + inlierHeight_ = other.inlierHeight_; + inlierIds_ = other.inlierIds_.Clone(); + inlierIdMatchPos_ = other.inlierIdMatchPos_.Clone(); + inlierLength_ = other.inlierLength_.Clone(); + outlierIds_ = other.outlierIds_.Clone(); + outlierIdMatchPos_ = other.outlierIdMatchPos_.Clone(); + trackingConfidence_ = other.trackingConfidence_; + internal_ = other.internal_ != null ? other.internal_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxState Clone() { + return new MotionBoxState(this); + } + + /// Field number for the "pos_x" field. + public const int PosXFieldNumber = 1; + private readonly static float PosXDefaultValue = 0F; + + private float posX_; + /// + /// Position (top-left corner) and fixed size of the current MotionBox, + /// specified w.r.t. normalized domain (in [0, 1] along both dimensions). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PosX { + get { if ((_hasBits0 & 1) != 0) { return posX_; } else { return PosXDefaultValue; } } + set { + _hasBits0 |= 1; + posX_ = value; + } + } + /// Gets whether the "pos_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPosX { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "pos_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPosX() { + _hasBits0 &= ~1; + } + + /// Field number for the "pos_y" field. + public const int PosYFieldNumber = 2; + private readonly static float PosYDefaultValue = 0F; + + private float posY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PosY { + get { if ((_hasBits0 & 2) != 0) { return posY_; } else { return PosYDefaultValue; } } + set { + _hasBits0 |= 2; + posY_ = value; + } + } + /// Gets whether the "pos_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPosY { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "pos_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPosY() { + _hasBits0 &= ~2; + } + + /// Field number for the "width" field. + public const int WidthFieldNumber = 3; + private readonly static float WidthDefaultValue = 0F; + + private float width_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Width { + get { if ((_hasBits0 & 4) != 0) { return width_; } else { return WidthDefaultValue; } } + set { + _hasBits0 |= 4; + width_ = value; + } + } + /// Gets whether the "width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasWidth { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearWidth() { + _hasBits0 &= ~4; + } + + /// Field number for the "height" field. + public const int HeightFieldNumber = 4; + private readonly static float HeightDefaultValue = 0F; + + private float height_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Height { + get { if ((_hasBits0 & 8) != 0) { return height_; } else { return HeightDefaultValue; } } + set { + _hasBits0 |= 8; + height_ = value; + } + } + /// Gets whether the "height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHeight { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHeight() { + _hasBits0 &= ~8; + } + + /// Field number for the "scale" field. + public const int ScaleFieldNumber = 5; + private readonly static float ScaleDefaultValue = 1F; + + private float scale_; + /// + /// Optional degrees of freedom; scale and rotation w.r.t. center of the box, + /// i.e. [pos_x, pos_y] + 0.5 * [width, height]. + /// To activate see TrackStepOptions::TrackingDegrees. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Scale { + get { if ((_hasBits0 & 16) != 0) { return scale_; } else { return ScaleDefaultValue; } } + set { + _hasBits0 |= 16; + scale_ = value; + } + } + /// Gets whether the "scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasScale { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearScale() { + _hasBits0 &= ~16; + } + + /// Field number for the "rotation" field. + public const int RotationFieldNumber = 30; + private readonly static float RotationDefaultValue = 0F; + + private float rotation_; + /// + /// in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Rotation { + get { if ((_hasBits0 & 1048576) != 0) { return rotation_; } else { return RotationDefaultValue; } } + set { + _hasBits0 |= 1048576; + rotation_ = value; + } + } + /// Gets whether the "rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRotation { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRotation() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "quad" field. + public const int QuadFieldNumber = 34; + private global::Mediapipe.MotionBoxState.Types.Quad quad_; + /// + /// This field is only used when we try to track under + /// TRACKING_DEGREE_OBJECT_PERSPECTIVE. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionBoxState.Types.Quad Quad { + get { return quad_; } + set { + quad_ = value; + } + } + + /// Field number for the "aspect_ratio" field. + public const int AspectRatioFieldNumber = 35; + private readonly static float AspectRatioDefaultValue = 0F; + + private float aspectRatio_; + /// + /// Aspect ratio (width / height) for the tracked rectangle in physical space. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float AspectRatio { + get { if ((_hasBits0 & 4194304) != 0) { return aspectRatio_; } else { return AspectRatioDefaultValue; } } + set { + _hasBits0 |= 4194304; + aspectRatio_ = value; + } + } + /// Gets whether the "aspect_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasAspectRatio { + get { return (_hasBits0 & 4194304) != 0; } + } + /// Clears the value of the "aspect_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearAspectRatio() { + _hasBits0 &= ~4194304; + } + + /// Field number for the "request_grouping" field. + public const int RequestGroupingFieldNumber = 37; + private readonly static bool RequestGroupingDefaultValue = false; + + private bool requestGrouping_; + /// + /// Whether we want this box to be potentially grouped with other boxes + /// to track together. This is useful for tracking small boxes that lie + /// on a plane. For example, when we detect a plane, + /// track the plane, then all boxes within the plane can share the same + /// homography transform. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool RequestGrouping { + get { if ((_hasBits0 & 8388608) != 0) { return requestGrouping_; } else { return RequestGroupingDefaultValue; } } + set { + _hasBits0 |= 8388608; + requestGrouping_ = value; + } + } + /// Gets whether the "request_grouping" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRequestGrouping { + get { return (_hasBits0 & 8388608) != 0; } + } + /// Clears the value of the "request_grouping" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRequestGrouping() { + _hasBits0 &= ~8388608; + } + + /// Field number for the "pnp_homography" field. + public const int PnpHomographyFieldNumber = 36; + private global::Mediapipe.Homography pnpHomography_; + /// + /// For quad tracking using pnp solver, + /// Whether we use perspective-n-points to track quad between frames. + /// That mode requires: + /// 1. The quad which is being tracked is an rectangle in the physical world. + /// 2. The `asepct_ratio` field has to be set in MotionBoxState. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.Homography PnpHomography { + get { return pnpHomography_; } + set { + pnpHomography_ = value; + } + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 7; + private readonly static float DxDefaultValue = 0F; + + private float dx_; + /// + /// Object velocity in x and y, specified as normalized spatial unit per + /// standard frame period (here calibrated w.r.t. kTrackingDefaultFps = 30 + /// FPS), that is 33.3 ms. Object velocity refers to velocity after + /// subtracting camera motion. + /// If current frame period is 66.67 ms (i.e. 15 fps); actual velocity is + /// obtained by multipling with a factor of 2. Similar for 60 fps factor + /// is 0.5f. + /// Standard frame period is chosen for legacy reasons to keep TrackStepOptions + /// defaults. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dx { + get { if ((_hasBits0 & 32) != 0) { return dx_; } else { return DxDefaultValue; } } + set { + _hasBits0 |= 32; + dx_ = value; + } + } + /// Gets whether the "dx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDx { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "dx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDx() { + _hasBits0 &= ~32; + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 8; + private readonly static float DyDefaultValue = 0F; + + private float dy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Dy { + get { if ((_hasBits0 & 64) != 0) { return dy_; } else { return DyDefaultValue; } } + set { + _hasBits0 |= 64; + dy_ = value; + } + } + /// Gets whether the "dy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDy { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "dy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDy() { + _hasBits0 &= ~64; + } + + /// Field number for the "kinetic_energy" field. + public const int KineticEnergyFieldNumber = 17; + private readonly static float KineticEnergyDefaultValue = 0F; + + private float kineticEnergy_; + /// + /// Weighted average of object velocity magnitude of inlier points (expressed + /// in normalized spatial units per standard frame period). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float KineticEnergy { + get { if ((_hasBits0 & 8192) != 0) { return kineticEnergy_; } else { return KineticEnergyDefaultValue; } } + set { + _hasBits0 |= 8192; + kineticEnergy_ = value; + } + } + /// Gets whether the "kinetic_energy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKineticEnergy { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "kinetic_energy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKineticEnergy() { + _hasBits0 &= ~8192; + } + + /// Field number for the "prior_weight" field. + public const int PriorWeightFieldNumber = 9; + private readonly static float PriorWeightDefaultValue = 0F; + + private float priorWeight_; + /// + /// Specifies how valid the prior was in the last step. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PriorWeight { + get { if ((_hasBits0 & 128) != 0) { return priorWeight_; } else { return PriorWeightDefaultValue; } } + set { + _hasBits0 |= 128; + priorWeight_ = value; + } + } + /// Gets whether the "prior_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPriorWeight { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "prior_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPriorWeight() { + _hasBits0 &= ~128; + } + + /// Field number for the "track_status" field. + public const int TrackStatusFieldNumber = 10; + private readonly static global::Mediapipe.MotionBoxState.Types.TrackStatus TrackStatusDefaultValue = global::Mediapipe.MotionBoxState.Types.TrackStatus.BoxUntracked; + + private global::Mediapipe.MotionBoxState.Types.TrackStatus trackStatus_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionBoxState.Types.TrackStatus TrackStatus { + get { if ((_hasBits0 & 256) != 0) { return trackStatus_; } else { return TrackStatusDefaultValue; } } + set { + _hasBits0 |= 256; + trackStatus_ = value; + } + } + /// Gets whether the "track_status" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackStatus { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "track_status" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackStatus() { + _hasBits0 &= ~256; + } + + /// Field number for the "spatial_prior_grid_size" field. + public const int SpatialPriorGridSizeFieldNumber = 11; + private readonly static int SpatialPriorGridSizeDefaultValue = 10; + + private int spatialPriorGridSize_; + /// + /// Spatial prior (presence of inliers, i.e. where is the object located within + /// the box that is currently being tracked) as a pair of + /// a) prior (in [0, 1]) and + /// b) confidence (number of features converted to score within + /// [0, 1]). + /// Prior is defined over a grid of size spatial_prior_grid_size x + /// spatial_prior_grid_size. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SpatialPriorGridSize { + get { if ((_hasBits0 & 512) != 0) { return spatialPriorGridSize_; } else { return SpatialPriorGridSizeDefaultValue; } } + set { + _hasBits0 |= 512; + spatialPriorGridSize_ = value; + } + } + /// Gets whether the "spatial_prior_grid_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSpatialPriorGridSize { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "spatial_prior_grid_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSpatialPriorGridSize() { + _hasBits0 &= ~512; + } + + /// Field number for the "spatial_prior" field. + public const int SpatialPriorFieldNumber = 12; + private static readonly pb::FieldCodec _repeated_spatialPrior_codec + = pb::FieldCodec.ForFloat(98); + private readonly pbc::RepeatedField spatialPrior_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SpatialPrior { + get { return spatialPrior_; } + } + + /// Field number for the "spatial_confidence" field. + public const int SpatialConfidenceFieldNumber = 13; + private static readonly pb::FieldCodec _repeated_spatialConfidence_codec + = pb::FieldCodec.ForFloat(106); + private readonly pbc::RepeatedField spatialConfidence_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField SpatialConfidence { + get { return spatialConfidence_; } + } + + /// Field number for the "prior_diff" field. + public const int PriorDiffFieldNumber = 14; + private readonly static float PriorDiffDefaultValue = 0F; + + private float priorDiff_; + /// + /// Difference score between previous prior and current prior (in [0, 1]). + /// Currently not used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PriorDiff { + get { if ((_hasBits0 & 1024) != 0) { return priorDiff_; } else { return PriorDiffDefaultValue; } } + set { + _hasBits0 |= 1024; + priorDiff_ = value; + } + } + /// Gets whether the "prior_diff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPriorDiff { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "prior_diff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPriorDiff() { + _hasBits0 &= ~1024; + } + + /// Field number for the "motion_disparity" field. + public const int MotionDisparityFieldNumber = 15; + private readonly static float MotionDisparityDefaultValue = 0F; + + private float motionDisparity_; + /// + /// Score determining how much predicted motion disagrees with measured motion. + /// If measured motion deviates strongly from predicted motion, disparity is + /// +/-1, if motion agrees with predicted motion, disparity is 0. + /// Sign indicates measured motion is accelerating (> 0) + /// or de-accelerating (< 0) w.r.t. predicted motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MotionDisparity { + get { if ((_hasBits0 & 2048) != 0) { return motionDisparity_; } else { return MotionDisparityDefaultValue; } } + set { + _hasBits0 |= 2048; + motionDisparity_ = value; + } + } + /// Gets whether the "motion_disparity" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionDisparity { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "motion_disparity" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionDisparity() { + _hasBits0 &= ~2048; + } + + /// Field number for the "background_discrimination" field. + public const int BackgroundDiscriminationFieldNumber = 16; + private readonly static float BackgroundDiscriminationDefaultValue = 0F; + + private float backgroundDiscrimination_; + /// + /// Score determining how discriminative estimated motion model is. + /// In [0, 1] where 0 no discrimination w.r.t. background and 1 + /// high discrimination. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BackgroundDiscrimination { + get { if ((_hasBits0 & 4096) != 0) { return backgroundDiscrimination_; } else { return BackgroundDiscriminationDefaultValue; } } + set { + _hasBits0 |= 4096; + backgroundDiscrimination_ = value; + } + } + /// Gets whether the "background_discrimination" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBackgroundDiscrimination { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "background_discrimination" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBackgroundDiscrimination() { + _hasBits0 &= ~4096; + } + + /// Field number for the "inlier_center_x" field. + public const int InlierCenterXFieldNumber = 18; + private readonly static float InlierCenterXDefaultValue = 0F; + + private float inlierCenterX_; + /// + /// Center of mass for inliers after tracking (center of feature that were used + /// for motion estimation) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierCenterX { + get { if ((_hasBits0 & 16384) != 0) { return inlierCenterX_; } else { return InlierCenterXDefaultValue; } } + set { + _hasBits0 |= 16384; + inlierCenterX_ = value; + } + } + /// Gets whether the "inlier_center_x" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierCenterX { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "inlier_center_x" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierCenterX() { + _hasBits0 &= ~16384; + } + + /// Field number for the "inlier_center_y" field. + public const int InlierCenterYFieldNumber = 19; + private readonly static float InlierCenterYDefaultValue = 0F; + + private float inlierCenterY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierCenterY { + get { if ((_hasBits0 & 32768) != 0) { return inlierCenterY_; } else { return InlierCenterYDefaultValue; } } + set { + _hasBits0 |= 32768; + inlierCenterY_ = value; + } + } + /// Gets whether the "inlier_center_y" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierCenterY { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "inlier_center_y" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierCenterY() { + _hasBits0 &= ~32768; + } + + /// Field number for the "inlier_sum" field. + public const int InlierSumFieldNumber = 24; + private readonly static float InlierSumDefaultValue = 0F; + + private float inlierSum_; + /// + /// Approximate number of inliers (each features scores a zero [outlier] + /// or one [inlier]). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierSum { + get { if ((_hasBits0 & 262144) != 0) { return inlierSum_; } else { return InlierSumDefaultValue; } } + set { + _hasBits0 |= 262144; + inlierSum_ = value; + } + } + /// Gets whether the "inlier_sum" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierSum { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "inlier_sum" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierSum() { + _hasBits0 &= ~262144; + } + + /// Field number for the "inlier_ratio" field. + public const int InlierRatioFieldNumber = 25; + private readonly static float InlierRatioDefaultValue = 0F; + + private float inlierRatio_; + /// + /// Ratio of above inlier_sum to average inlier_sum across last states. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierRatio { + get { if ((_hasBits0 & 524288) != 0) { return inlierRatio_; } else { return InlierRatioDefaultValue; } } + set { + _hasBits0 |= 524288; + inlierRatio_ = value; + } + } + /// Gets whether the "inlier_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierRatio { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "inlier_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierRatio() { + _hasBits0 &= ~524288; + } + + /// Field number for the "inlier_width" field. + public const int InlierWidthFieldNumber = 22; + private readonly static float InlierWidthDefaultValue = 0F; + + private float inlierWidth_; + /// + /// Extent (width and height of inliers). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierWidth { + get { if ((_hasBits0 & 65536) != 0) { return inlierWidth_; } else { return InlierWidthDefaultValue; } } + set { + _hasBits0 |= 65536; + inlierWidth_ = value; + } + } + /// Gets whether the "inlier_width" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierWidth { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "inlier_width" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierWidth() { + _hasBits0 &= ~65536; + } + + /// Field number for the "inlier_height" field. + public const int InlierHeightFieldNumber = 23; + private readonly static float InlierHeightDefaultValue = 0F; + + private float inlierHeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierHeight { + get { if ((_hasBits0 & 131072) != 0) { return inlierHeight_; } else { return InlierHeightDefaultValue; } } + set { + _hasBits0 |= 131072; + inlierHeight_ = value; + } + } + /// Gets whether the "inlier_height" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierHeight { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "inlier_height" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierHeight() { + _hasBits0 &= ~131072; + } + + /// Field number for the "inlier_ids" field. + public const int InlierIdsFieldNumber = 26; + private static readonly pb::FieldCodec _repeated_inlierIds_codec + = pb::FieldCodec.ForUInt32(210); + private readonly pbc::RepeatedField inlierIds_ = new pbc::RepeatedField(); + /// + /// Set of current inlier tracking ids. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InlierIds { + get { return inlierIds_; } + } + + /// Field number for the "inlier_id_match_pos" field. + public const int InlierIdMatchPosFieldNumber = 31; + private static readonly pb::FieldCodec _repeated_inlierIdMatchPos_codec + = pb::FieldCodec.ForUInt32(250); + private readonly pbc::RepeatedField inlierIdMatchPos_ = new pbc::RepeatedField(); + /// + /// Corresponding x,y coordinates for each inlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InlierIdMatchPos { + get { return inlierIdMatchPos_; } + } + + /// Field number for the "inlier_length" field. + public const int InlierLengthFieldNumber = 27; + private static readonly pb::FieldCodec _repeated_inlierLength_codec + = pb::FieldCodec.ForUInt32(218); + private readonly pbc::RepeatedField inlierLength_ = new pbc::RepeatedField(); + /// + /// Corresponding inlier score (currently: length of inlier observed). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InlierLength { + get { return inlierLength_; } + } + + /// Field number for the "outlier_ids" field. + public const int OutlierIdsFieldNumber = 28; + private static readonly pb::FieldCodec _repeated_outlierIds_codec + = pb::FieldCodec.ForUInt32(226); + private readonly pbc::RepeatedField outlierIds_ = new pbc::RepeatedField(); + /// + /// Set of outlier ids. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutlierIds { + get { return outlierIds_; } + } + + /// Field number for the "outlier_id_match_pos" field. + public const int OutlierIdMatchPosFieldNumber = 32; + private static readonly pb::FieldCodec _repeated_outlierIdMatchPos_codec + = pb::FieldCodec.ForUInt32(258); + private readonly pbc::RepeatedField outlierIdMatchPos_ = new pbc::RepeatedField(); + /// + /// Corresponding x,y coordinates for each outlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField OutlierIdMatchPos { + get { return outlierIdMatchPos_; } + } + + /// Field number for the "tracking_confidence" field. + public const int TrackingConfidenceFieldNumber = 33; + private readonly static float TrackingConfidenceDefaultValue = 0F; + + private float trackingConfidence_; + /// + /// Confidence of box tracked in the range [0, 1], with 0 being least + /// confident, and 1 being most confident. A reasonable threshold is 0.5 + /// to filter out unconfident boxes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float TrackingConfidence { + get { if ((_hasBits0 & 2097152) != 0) { return trackingConfidence_; } else { return TrackingConfidenceDefaultValue; } } + set { + _hasBits0 |= 2097152; + trackingConfidence_ = value; + } + } + /// Gets whether the "tracking_confidence" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingConfidence { + get { return (_hasBits0 & 2097152) != 0; } + } + /// Clears the value of the "tracking_confidence" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingConfidence() { + _hasBits0 &= ~2097152; + } + + /// Field number for the "internal" field. + public const int InternalFieldNumber = 29; + private global::Mediapipe.MotionBoxInternalState internal_; + /// + /// Additional internal state. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.MotionBoxInternalState Internal { + get { return internal_; } + set { + internal_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionBoxState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionBoxState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PosX, other.PosX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PosY, other.PosY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Width, other.Width)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Height, other.Height)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Scale, other.Scale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Rotation, other.Rotation)) return false; + if (!object.Equals(Quad, other.Quad)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AspectRatio, other.AspectRatio)) return false; + if (RequestGrouping != other.RequestGrouping) return false; + if (!object.Equals(PnpHomography, other.PnpHomography)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dx, other.Dx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Dy, other.Dy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KineticEnergy, other.KineticEnergy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PriorWeight, other.PriorWeight)) return false; + if (TrackStatus != other.TrackStatus) return false; + if (SpatialPriorGridSize != other.SpatialPriorGridSize) return false; + if(!spatialPrior_.Equals(other.spatialPrior_)) return false; + if(!spatialConfidence_.Equals(other.spatialConfidence_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PriorDiff, other.PriorDiff)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MotionDisparity, other.MotionDisparity)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BackgroundDiscrimination, other.BackgroundDiscrimination)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierCenterX, other.InlierCenterX)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierCenterY, other.InlierCenterY)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierSum, other.InlierSum)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierRatio, other.InlierRatio)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierWidth, other.InlierWidth)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierHeight, other.InlierHeight)) return false; + if(!inlierIds_.Equals(other.inlierIds_)) return false; + if(!inlierIdMatchPos_.Equals(other.inlierIdMatchPos_)) return false; + if(!inlierLength_.Equals(other.inlierLength_)) return false; + if(!outlierIds_.Equals(other.outlierIds_)) return false; + if(!outlierIdMatchPos_.Equals(other.outlierIdMatchPos_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TrackingConfidence, other.TrackingConfidence)) return false; + if (!object.Equals(Internal, other.Internal)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasPosX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PosX); + if (HasPosY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PosY); + if (HasWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Width); + if (HasHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Height); + if (HasScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Scale); + if (HasRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotation); + if (quad_ != null) hash ^= Quad.GetHashCode(); + if (HasAspectRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AspectRatio); + if (HasRequestGrouping) hash ^= RequestGrouping.GetHashCode(); + if (pnpHomography_ != null) hash ^= PnpHomography.GetHashCode(); + if (HasDx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dx); + if (HasDy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Dy); + if (HasKineticEnergy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KineticEnergy); + if (HasPriorWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PriorWeight); + if (HasTrackStatus) hash ^= TrackStatus.GetHashCode(); + if (HasSpatialPriorGridSize) hash ^= SpatialPriorGridSize.GetHashCode(); + hash ^= spatialPrior_.GetHashCode(); + hash ^= spatialConfidence_.GetHashCode(); + if (HasPriorDiff) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PriorDiff); + if (HasMotionDisparity) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MotionDisparity); + if (HasBackgroundDiscrimination) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BackgroundDiscrimination); + if (HasInlierCenterX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierCenterX); + if (HasInlierCenterY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierCenterY); + if (HasInlierSum) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierSum); + if (HasInlierRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierRatio); + if (HasInlierWidth) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierWidth); + if (HasInlierHeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierHeight); + hash ^= inlierIds_.GetHashCode(); + hash ^= inlierIdMatchPos_.GetHashCode(); + hash ^= inlierLength_.GetHashCode(); + hash ^= outlierIds_.GetHashCode(); + hash ^= outlierIdMatchPos_.GetHashCode(); + if (HasTrackingConfidence) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TrackingConfidence); + if (internal_ != null) hash ^= Internal.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasPosX) { + output.WriteRawTag(13); + output.WriteFloat(PosX); + } + if (HasPosY) { + output.WriteRawTag(21); + output.WriteFloat(PosY); + } + if (HasWidth) { + output.WriteRawTag(29); + output.WriteFloat(Width); + } + if (HasHeight) { + output.WriteRawTag(37); + output.WriteFloat(Height); + } + if (HasScale) { + output.WriteRawTag(45); + output.WriteFloat(Scale); + } + if (HasDx) { + output.WriteRawTag(61); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(69); + output.WriteFloat(Dy); + } + if (HasPriorWeight) { + output.WriteRawTag(77); + output.WriteFloat(PriorWeight); + } + if (HasTrackStatus) { + output.WriteRawTag(80); + output.WriteEnum((int) TrackStatus); + } + if (HasSpatialPriorGridSize) { + output.WriteRawTag(88); + output.WriteInt32(SpatialPriorGridSize); + } + spatialPrior_.WriteTo(output, _repeated_spatialPrior_codec); + spatialConfidence_.WriteTo(output, _repeated_spatialConfidence_codec); + if (HasPriorDiff) { + output.WriteRawTag(117); + output.WriteFloat(PriorDiff); + } + if (HasMotionDisparity) { + output.WriteRawTag(125); + output.WriteFloat(MotionDisparity); + } + if (HasBackgroundDiscrimination) { + output.WriteRawTag(133, 1); + output.WriteFloat(BackgroundDiscrimination); + } + if (HasKineticEnergy) { + output.WriteRawTag(141, 1); + output.WriteFloat(KineticEnergy); + } + if (HasInlierCenterX) { + output.WriteRawTag(149, 1); + output.WriteFloat(InlierCenterX); + } + if (HasInlierCenterY) { + output.WriteRawTag(157, 1); + output.WriteFloat(InlierCenterY); + } + if (HasInlierWidth) { + output.WriteRawTag(181, 1); + output.WriteFloat(InlierWidth); + } + if (HasInlierHeight) { + output.WriteRawTag(189, 1); + output.WriteFloat(InlierHeight); + } + if (HasInlierSum) { + output.WriteRawTag(197, 1); + output.WriteFloat(InlierSum); + } + if (HasInlierRatio) { + output.WriteRawTag(205, 1); + output.WriteFloat(InlierRatio); + } + inlierIds_.WriteTo(output, _repeated_inlierIds_codec); + inlierLength_.WriteTo(output, _repeated_inlierLength_codec); + outlierIds_.WriteTo(output, _repeated_outlierIds_codec); + if (internal_ != null) { + output.WriteRawTag(234, 1); + output.WriteMessage(Internal); + } + if (HasRotation) { + output.WriteRawTag(245, 1); + output.WriteFloat(Rotation); + } + inlierIdMatchPos_.WriteTo(output, _repeated_inlierIdMatchPos_codec); + outlierIdMatchPos_.WriteTo(output, _repeated_outlierIdMatchPos_codec); + if (HasTrackingConfidence) { + output.WriteRawTag(141, 2); + output.WriteFloat(TrackingConfidence); + } + if (quad_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(Quad); + } + if (HasAspectRatio) { + output.WriteRawTag(157, 2); + output.WriteFloat(AspectRatio); + } + if (pnpHomography_ != null) { + output.WriteRawTag(162, 2); + output.WriteMessage(PnpHomography); + } + if (HasRequestGrouping) { + output.WriteRawTag(168, 2); + output.WriteBool(RequestGrouping); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPosX) { + output.WriteRawTag(13); + output.WriteFloat(PosX); + } + if (HasPosY) { + output.WriteRawTag(21); + output.WriteFloat(PosY); + } + if (HasWidth) { + output.WriteRawTag(29); + output.WriteFloat(Width); + } + if (HasHeight) { + output.WriteRawTag(37); + output.WriteFloat(Height); + } + if (HasScale) { + output.WriteRawTag(45); + output.WriteFloat(Scale); + } + if (HasDx) { + output.WriteRawTag(61); + output.WriteFloat(Dx); + } + if (HasDy) { + output.WriteRawTag(69); + output.WriteFloat(Dy); + } + if (HasPriorWeight) { + output.WriteRawTag(77); + output.WriteFloat(PriorWeight); + } + if (HasTrackStatus) { + output.WriteRawTag(80); + output.WriteEnum((int) TrackStatus); + } + if (HasSpatialPriorGridSize) { + output.WriteRawTag(88); + output.WriteInt32(SpatialPriorGridSize); + } + spatialPrior_.WriteTo(ref output, _repeated_spatialPrior_codec); + spatialConfidence_.WriteTo(ref output, _repeated_spatialConfidence_codec); + if (HasPriorDiff) { + output.WriteRawTag(117); + output.WriteFloat(PriorDiff); + } + if (HasMotionDisparity) { + output.WriteRawTag(125); + output.WriteFloat(MotionDisparity); + } + if (HasBackgroundDiscrimination) { + output.WriteRawTag(133, 1); + output.WriteFloat(BackgroundDiscrimination); + } + if (HasKineticEnergy) { + output.WriteRawTag(141, 1); + output.WriteFloat(KineticEnergy); + } + if (HasInlierCenterX) { + output.WriteRawTag(149, 1); + output.WriteFloat(InlierCenterX); + } + if (HasInlierCenterY) { + output.WriteRawTag(157, 1); + output.WriteFloat(InlierCenterY); + } + if (HasInlierWidth) { + output.WriteRawTag(181, 1); + output.WriteFloat(InlierWidth); + } + if (HasInlierHeight) { + output.WriteRawTag(189, 1); + output.WriteFloat(InlierHeight); + } + if (HasInlierSum) { + output.WriteRawTag(197, 1); + output.WriteFloat(InlierSum); + } + if (HasInlierRatio) { + output.WriteRawTag(205, 1); + output.WriteFloat(InlierRatio); + } + inlierIds_.WriteTo(ref output, _repeated_inlierIds_codec); + inlierLength_.WriteTo(ref output, _repeated_inlierLength_codec); + outlierIds_.WriteTo(ref output, _repeated_outlierIds_codec); + if (internal_ != null) { + output.WriteRawTag(234, 1); + output.WriteMessage(Internal); + } + if (HasRotation) { + output.WriteRawTag(245, 1); + output.WriteFloat(Rotation); + } + inlierIdMatchPos_.WriteTo(ref output, _repeated_inlierIdMatchPos_codec); + outlierIdMatchPos_.WriteTo(ref output, _repeated_outlierIdMatchPos_codec); + if (HasTrackingConfidence) { + output.WriteRawTag(141, 2); + output.WriteFloat(TrackingConfidence); + } + if (quad_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(Quad); + } + if (HasAspectRatio) { + output.WriteRawTag(157, 2); + output.WriteFloat(AspectRatio); + } + if (pnpHomography_ != null) { + output.WriteRawTag(162, 2); + output.WriteMessage(PnpHomography); + } + if (HasRequestGrouping) { + output.WriteRawTag(168, 2); + output.WriteBool(RequestGrouping); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasPosX) { + size += 1 + 4; + } + if (HasPosY) { + size += 1 + 4; + } + if (HasWidth) { + size += 1 + 4; + } + if (HasHeight) { + size += 1 + 4; + } + if (HasScale) { + size += 1 + 4; + } + if (HasRotation) { + size += 2 + 4; + } + if (quad_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Quad); + } + if (HasAspectRatio) { + size += 2 + 4; + } + if (HasRequestGrouping) { + size += 2 + 1; + } + if (pnpHomography_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(PnpHomography); + } + if (HasDx) { + size += 1 + 4; + } + if (HasDy) { + size += 1 + 4; + } + if (HasKineticEnergy) { + size += 2 + 4; + } + if (HasPriorWeight) { + size += 1 + 4; + } + if (HasTrackStatus) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TrackStatus); + } + if (HasSpatialPriorGridSize) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SpatialPriorGridSize); + } + size += spatialPrior_.CalculateSize(_repeated_spatialPrior_codec); + size += spatialConfidence_.CalculateSize(_repeated_spatialConfidence_codec); + if (HasPriorDiff) { + size += 1 + 4; + } + if (HasMotionDisparity) { + size += 1 + 4; + } + if (HasBackgroundDiscrimination) { + size += 2 + 4; + } + if (HasInlierCenterX) { + size += 2 + 4; + } + if (HasInlierCenterY) { + size += 2 + 4; + } + if (HasInlierSum) { + size += 2 + 4; + } + if (HasInlierRatio) { + size += 2 + 4; + } + if (HasInlierWidth) { + size += 2 + 4; + } + if (HasInlierHeight) { + size += 2 + 4; + } + size += inlierIds_.CalculateSize(_repeated_inlierIds_codec); + size += inlierIdMatchPos_.CalculateSize(_repeated_inlierIdMatchPos_codec); + size += inlierLength_.CalculateSize(_repeated_inlierLength_codec); + size += outlierIds_.CalculateSize(_repeated_outlierIds_codec); + size += outlierIdMatchPos_.CalculateSize(_repeated_outlierIdMatchPos_codec); + if (HasTrackingConfidence) { + size += 2 + 4; + } + if (internal_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Internal); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionBoxState other) { + if (other == null) { + return; + } + if (other.HasPosX) { + PosX = other.PosX; + } + if (other.HasPosY) { + PosY = other.PosY; + } + if (other.HasWidth) { + Width = other.Width; + } + if (other.HasHeight) { + Height = other.Height; + } + if (other.HasScale) { + Scale = other.Scale; + } + if (other.HasRotation) { + Rotation = other.Rotation; + } + if (other.quad_ != null) { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + Quad.MergeFrom(other.Quad); + } + if (other.HasAspectRatio) { + AspectRatio = other.AspectRatio; + } + if (other.HasRequestGrouping) { + RequestGrouping = other.RequestGrouping; + } + if (other.pnpHomography_ != null) { + if (pnpHomography_ == null) { + PnpHomography = new global::Mediapipe.Homography(); + } + PnpHomography.MergeFrom(other.PnpHomography); + } + if (other.HasDx) { + Dx = other.Dx; + } + if (other.HasDy) { + Dy = other.Dy; + } + if (other.HasKineticEnergy) { + KineticEnergy = other.KineticEnergy; + } + if (other.HasPriorWeight) { + PriorWeight = other.PriorWeight; + } + if (other.HasTrackStatus) { + TrackStatus = other.TrackStatus; + } + if (other.HasSpatialPriorGridSize) { + SpatialPriorGridSize = other.SpatialPriorGridSize; + } + spatialPrior_.Add(other.spatialPrior_); + spatialConfidence_.Add(other.spatialConfidence_); + if (other.HasPriorDiff) { + PriorDiff = other.PriorDiff; + } + if (other.HasMotionDisparity) { + MotionDisparity = other.MotionDisparity; + } + if (other.HasBackgroundDiscrimination) { + BackgroundDiscrimination = other.BackgroundDiscrimination; + } + if (other.HasInlierCenterX) { + InlierCenterX = other.InlierCenterX; + } + if (other.HasInlierCenterY) { + InlierCenterY = other.InlierCenterY; + } + if (other.HasInlierSum) { + InlierSum = other.InlierSum; + } + if (other.HasInlierRatio) { + InlierRatio = other.InlierRatio; + } + if (other.HasInlierWidth) { + InlierWidth = other.InlierWidth; + } + if (other.HasInlierHeight) { + InlierHeight = other.InlierHeight; + } + inlierIds_.Add(other.inlierIds_); + inlierIdMatchPos_.Add(other.inlierIdMatchPos_); + inlierLength_.Add(other.inlierLength_); + outlierIds_.Add(other.outlierIds_); + outlierIdMatchPos_.Add(other.outlierIdMatchPos_); + if (other.HasTrackingConfidence) { + TrackingConfidence = other.TrackingConfidence; + } + if (other.internal_ != null) { + if (internal_ == null) { + Internal = new global::Mediapipe.MotionBoxInternalState(); + } + Internal.MergeFrom(other.Internal); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + PosX = input.ReadFloat(); + break; + } + case 21: { + PosY = input.ReadFloat(); + break; + } + case 29: { + Width = input.ReadFloat(); + break; + } + case 37: { + Height = input.ReadFloat(); + break; + } + case 45: { + Scale = input.ReadFloat(); + break; + } + case 61: { + Dx = input.ReadFloat(); + break; + } + case 69: { + Dy = input.ReadFloat(); + break; + } + case 77: { + PriorWeight = input.ReadFloat(); + break; + } + case 80: { + TrackStatus = (global::Mediapipe.MotionBoxState.Types.TrackStatus) input.ReadEnum(); + break; + } + case 88: { + SpatialPriorGridSize = input.ReadInt32(); + break; + } + case 98: + case 101: { + spatialPrior_.AddEntriesFrom(input, _repeated_spatialPrior_codec); + break; + } + case 106: + case 109: { + spatialConfidence_.AddEntriesFrom(input, _repeated_spatialConfidence_codec); + break; + } + case 117: { + PriorDiff = input.ReadFloat(); + break; + } + case 125: { + MotionDisparity = input.ReadFloat(); + break; + } + case 133: { + BackgroundDiscrimination = input.ReadFloat(); + break; + } + case 141: { + KineticEnergy = input.ReadFloat(); + break; + } + case 149: { + InlierCenterX = input.ReadFloat(); + break; + } + case 157: { + InlierCenterY = input.ReadFloat(); + break; + } + case 181: { + InlierWidth = input.ReadFloat(); + break; + } + case 189: { + InlierHeight = input.ReadFloat(); + break; + } + case 197: { + InlierSum = input.ReadFloat(); + break; + } + case 205: { + InlierRatio = input.ReadFloat(); + break; + } + case 210: + case 208: { + inlierIds_.AddEntriesFrom(input, _repeated_inlierIds_codec); + break; + } + case 218: + case 216: { + inlierLength_.AddEntriesFrom(input, _repeated_inlierLength_codec); + break; + } + case 226: + case 224: { + outlierIds_.AddEntriesFrom(input, _repeated_outlierIds_codec); + break; + } + case 234: { + if (internal_ == null) { + Internal = new global::Mediapipe.MotionBoxInternalState(); + } + input.ReadMessage(Internal); + break; + } + case 245: { + Rotation = input.ReadFloat(); + break; + } + case 250: + case 248: { + inlierIdMatchPos_.AddEntriesFrom(input, _repeated_inlierIdMatchPos_codec); + break; + } + case 258: + case 256: { + outlierIdMatchPos_.AddEntriesFrom(input, _repeated_outlierIdMatchPos_codec); + break; + } + case 269: { + TrackingConfidence = input.ReadFloat(); + break; + } + case 274: { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + input.ReadMessage(Quad); + break; + } + case 285: { + AspectRatio = input.ReadFloat(); + break; + } + case 290: { + if (pnpHomography_ == null) { + PnpHomography = new global::Mediapipe.Homography(); + } + input.ReadMessage(PnpHomography); + break; + } + case 296: { + RequestGrouping = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + PosX = input.ReadFloat(); + break; + } + case 21: { + PosY = input.ReadFloat(); + break; + } + case 29: { + Width = input.ReadFloat(); + break; + } + case 37: { + Height = input.ReadFloat(); + break; + } + case 45: { + Scale = input.ReadFloat(); + break; + } + case 61: { + Dx = input.ReadFloat(); + break; + } + case 69: { + Dy = input.ReadFloat(); + break; + } + case 77: { + PriorWeight = input.ReadFloat(); + break; + } + case 80: { + TrackStatus = (global::Mediapipe.MotionBoxState.Types.TrackStatus) input.ReadEnum(); + break; + } + case 88: { + SpatialPriorGridSize = input.ReadInt32(); + break; + } + case 98: + case 101: { + spatialPrior_.AddEntriesFrom(ref input, _repeated_spatialPrior_codec); + break; + } + case 106: + case 109: { + spatialConfidence_.AddEntriesFrom(ref input, _repeated_spatialConfidence_codec); + break; + } + case 117: { + PriorDiff = input.ReadFloat(); + break; + } + case 125: { + MotionDisparity = input.ReadFloat(); + break; + } + case 133: { + BackgroundDiscrimination = input.ReadFloat(); + break; + } + case 141: { + KineticEnergy = input.ReadFloat(); + break; + } + case 149: { + InlierCenterX = input.ReadFloat(); + break; + } + case 157: { + InlierCenterY = input.ReadFloat(); + break; + } + case 181: { + InlierWidth = input.ReadFloat(); + break; + } + case 189: { + InlierHeight = input.ReadFloat(); + break; + } + case 197: { + InlierSum = input.ReadFloat(); + break; + } + case 205: { + InlierRatio = input.ReadFloat(); + break; + } + case 210: + case 208: { + inlierIds_.AddEntriesFrom(ref input, _repeated_inlierIds_codec); + break; + } + case 218: + case 216: { + inlierLength_.AddEntriesFrom(ref input, _repeated_inlierLength_codec); + break; + } + case 226: + case 224: { + outlierIds_.AddEntriesFrom(ref input, _repeated_outlierIds_codec); + break; + } + case 234: { + if (internal_ == null) { + Internal = new global::Mediapipe.MotionBoxInternalState(); + } + input.ReadMessage(Internal); + break; + } + case 245: { + Rotation = input.ReadFloat(); + break; + } + case 250: + case 248: { + inlierIdMatchPos_.AddEntriesFrom(ref input, _repeated_inlierIdMatchPos_codec); + break; + } + case 258: + case 256: { + outlierIdMatchPos_.AddEntriesFrom(ref input, _repeated_outlierIdMatchPos_codec); + break; + } + case 269: { + TrackingConfidence = input.ReadFloat(); + break; + } + case 274: { + if (quad_ == null) { + Quad = new global::Mediapipe.MotionBoxState.Types.Quad(); + } + input.ReadMessage(Quad); + break; + } + case 285: { + AspectRatio = input.ReadFloat(); + break; + } + case 290: { + if (pnpHomography_ == null) { + PnpHomography = new global::Mediapipe.Homography(); + } + input.ReadMessage(PnpHomography); + break; + } + case 296: { + RequestGrouping = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the MotionBoxState message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Tracking status indicating result of tracking: + /// UNTRACKED: Box can not be tracked + /// (either out of bound or too many tracking failures). + /// EMPTY: Box has size of <= 0 along at least on of its dimensions + /// (collapsed). + /// NO_FEATURES: No features found within the box, tracking is not possible. + /// TRACKED: Successful tracking. + /// DUPLICATED: Successful tracked, but duplicated from previous result as + /// frame was duplicated. + /// BOX_TRACKED_OUT_OF_BOUND: Successful tracked, out of bound from screen + /// area. Will advance by camera motion. Only used for static objects. + /// + public enum TrackStatus { + [pbr::OriginalName("BOX_UNTRACKED")] BoxUntracked = 0, + [pbr::OriginalName("BOX_EMPTY")] BoxEmpty = 1, + [pbr::OriginalName("BOX_NO_FEATURES")] BoxNoFeatures = 2, + [pbr::OriginalName("BOX_TRACKED")] BoxTracked = 3, + [pbr::OriginalName("BOX_DUPLICATED")] BoxDuplicated = 4, + [pbr::OriginalName("BOX_TRACKED_OUT_OF_BOUND")] BoxTrackedOutOfBound = 5, + } + + public sealed partial class Quad : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Quad()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.MotionBoxState.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Quad() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Quad(Quad other) : this() { + vertices_ = other.vertices_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Quad Clone() { + return new Quad(this); + } + + /// Field number for the "vertices" field. + public const int VerticesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_vertices_codec + = pb::FieldCodec.ForFloat(13); + private readonly pbc::RepeatedField vertices_ = new pbc::RepeatedField(); + /// + /// Vertex 0 is according to x_0 = vertices(0), y_0 = vertices(1) + /// Vertex 1 is according to x_1 = vertices(2), y_1 = vertices(3) + /// Vertex 2 is according to x_2 = vertices(4), y_2 = vertices(5) + /// Vertex 3 is according to x_3 = vertices(6), y_3 = vertices(7) + /// Order of vertices should be aligned in counter-clockwise manner + /// 0---------3 + /// | | + /// | | + /// 1---------2 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Vertices { + get { return vertices_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Quad); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Quad other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!vertices_.Equals(other.vertices_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= vertices_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + vertices_.WriteTo(output, _repeated_vertices_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + vertices_.WriteTo(ref output, _repeated_vertices_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += vertices_.CalculateSize(_repeated_vertices_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Quad other) { + if (other == null) { + return; + } + vertices_.Add(other.vertices_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + vertices_.AddEntriesFrom(input, _repeated_vertices_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + vertices_.AddEntriesFrom(ref input, _repeated_vertices_codec); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + /// + /// Captures additional internal state info about the tracking. + /// + public sealed partial class MotionBoxInternalState : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionBoxInternalState()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxInternalState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxInternalState(MotionBoxInternalState other) : this() { + posX_ = other.posX_.Clone(); + posY_ = other.posY_.Clone(); + dx_ = other.dx_.Clone(); + dy_ = other.dy_.Clone(); + cameraDx_ = other.cameraDx_.Clone(); + cameraDy_ = other.cameraDy_.Clone(); + trackId_ = other.trackId_.Clone(); + inlierScore_ = other.inlierScore_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MotionBoxInternalState Clone() { + return new MotionBoxInternalState(this); + } + + /// Field number for the "pos_x" field. + public const int PosXFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_posX_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField posX_ = new pbc::RepeatedField(); + /// + /// Stores all motion vectors that were used for tracking + /// as packed arrays, capturing position, object motion, camera motion, + /// tracking id and corresponding inlier weight. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PosX { + get { return posX_; } + } + + /// Field number for the "pos_y" field. + public const int PosYFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_posY_codec + = pb::FieldCodec.ForFloat(18); + private readonly pbc::RepeatedField posY_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PosY { + get { return posY_; } + } + + /// Field number for the "dx" field. + public const int DxFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_dx_codec + = pb::FieldCodec.ForFloat(26); + private readonly pbc::RepeatedField dx_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Dx { + get { return dx_; } + } + + /// Field number for the "dy" field. + public const int DyFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_dy_codec + = pb::FieldCodec.ForFloat(34); + private readonly pbc::RepeatedField dy_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Dy { + get { return dy_; } + } + + /// Field number for the "camera_dx" field. + public const int CameraDxFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_cameraDx_codec + = pb::FieldCodec.ForFloat(42); + private readonly pbc::RepeatedField cameraDx_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CameraDx { + get { return cameraDx_; } + } + + /// Field number for the "camera_dy" field. + public const int CameraDyFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_cameraDy_codec + = pb::FieldCodec.ForFloat(50); + private readonly pbc::RepeatedField cameraDy_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CameraDy { + get { return cameraDy_; } + } + + /// Field number for the "track_id" field. + public const int TrackIdFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_trackId_codec + = pb::FieldCodec.ForInt32(58); + private readonly pbc::RepeatedField trackId_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TrackId { + get { return trackId_; } + } + + /// Field number for the "inlier_score" field. + public const int InlierScoreFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_inlierScore_codec + = pb::FieldCodec.ForFloat(66); + private readonly pbc::RepeatedField inlierScore_ = new pbc::RepeatedField(); + /// + /// Within [0, 1]. 0 = outlier; 1 = inlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField InlierScore { + get { return inlierScore_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MotionBoxInternalState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MotionBoxInternalState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!posX_.Equals(other.posX_)) return false; + if(!posY_.Equals(other.posY_)) return false; + if(!dx_.Equals(other.dx_)) return false; + if(!dy_.Equals(other.dy_)) return false; + if(!cameraDx_.Equals(other.cameraDx_)) return false; + if(!cameraDy_.Equals(other.cameraDy_)) return false; + if(!trackId_.Equals(other.trackId_)) return false; + if(!inlierScore_.Equals(other.inlierScore_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= posX_.GetHashCode(); + hash ^= posY_.GetHashCode(); + hash ^= dx_.GetHashCode(); + hash ^= dy_.GetHashCode(); + hash ^= cameraDx_.GetHashCode(); + hash ^= cameraDy_.GetHashCode(); + hash ^= trackId_.GetHashCode(); + hash ^= inlierScore_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + posX_.WriteTo(output, _repeated_posX_codec); + posY_.WriteTo(output, _repeated_posY_codec); + dx_.WriteTo(output, _repeated_dx_codec); + dy_.WriteTo(output, _repeated_dy_codec); + cameraDx_.WriteTo(output, _repeated_cameraDx_codec); + cameraDy_.WriteTo(output, _repeated_cameraDy_codec); + trackId_.WriteTo(output, _repeated_trackId_codec); + inlierScore_.WriteTo(output, _repeated_inlierScore_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + posX_.WriteTo(ref output, _repeated_posX_codec); + posY_.WriteTo(ref output, _repeated_posY_codec); + dx_.WriteTo(ref output, _repeated_dx_codec); + dy_.WriteTo(ref output, _repeated_dy_codec); + cameraDx_.WriteTo(ref output, _repeated_cameraDx_codec); + cameraDy_.WriteTo(ref output, _repeated_cameraDy_codec); + trackId_.WriteTo(ref output, _repeated_trackId_codec); + inlierScore_.WriteTo(ref output, _repeated_inlierScore_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += posX_.CalculateSize(_repeated_posX_codec); + size += posY_.CalculateSize(_repeated_posY_codec); + size += dx_.CalculateSize(_repeated_dx_codec); + size += dy_.CalculateSize(_repeated_dy_codec); + size += cameraDx_.CalculateSize(_repeated_cameraDx_codec); + size += cameraDy_.CalculateSize(_repeated_cameraDy_codec); + size += trackId_.CalculateSize(_repeated_trackId_codec); + size += inlierScore_.CalculateSize(_repeated_inlierScore_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MotionBoxInternalState other) { + if (other == null) { + return; + } + posX_.Add(other.posX_); + posY_.Add(other.posY_); + dx_.Add(other.dx_); + dy_.Add(other.dy_); + cameraDx_.Add(other.cameraDx_); + cameraDy_.Add(other.cameraDy_); + trackId_.Add(other.trackId_); + inlierScore_.Add(other.inlierScore_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + posX_.AddEntriesFrom(input, _repeated_posX_codec); + break; + } + case 18: + case 21: { + posY_.AddEntriesFrom(input, _repeated_posY_codec); + break; + } + case 26: + case 29: { + dx_.AddEntriesFrom(input, _repeated_dx_codec); + break; + } + case 34: + case 37: { + dy_.AddEntriesFrom(input, _repeated_dy_codec); + break; + } + case 42: + case 45: { + cameraDx_.AddEntriesFrom(input, _repeated_cameraDx_codec); + break; + } + case 50: + case 53: { + cameraDy_.AddEntriesFrom(input, _repeated_cameraDy_codec); + break; + } + case 58: + case 56: { + trackId_.AddEntriesFrom(input, _repeated_trackId_codec); + break; + } + case 66: + case 69: { + inlierScore_.AddEntriesFrom(input, _repeated_inlierScore_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 13: { + posX_.AddEntriesFrom(ref input, _repeated_posX_codec); + break; + } + case 18: + case 21: { + posY_.AddEntriesFrom(ref input, _repeated_posY_codec); + break; + } + case 26: + case 29: { + dx_.AddEntriesFrom(ref input, _repeated_dx_codec); + break; + } + case 34: + case 37: { + dy_.AddEntriesFrom(ref input, _repeated_dy_codec); + break; + } + case 42: + case 45: { + cameraDx_.AddEntriesFrom(ref input, _repeated_cameraDx_codec); + break; + } + case 50: + case 53: { + cameraDy_.AddEntriesFrom(ref input, _repeated_cameraDy_codec); + break; + } + case 58: + case 56: { + trackId_.AddEntriesFrom(ref input, _repeated_trackId_codec); + break; + } + case 66: + case 69: { + inlierScore_.AddEntriesFrom(ref input, _repeated_inlierScore_codec); + break; + } + } + } + } + #endif + + } + + /// + /// Next tag: 42 + /// + public sealed partial class TrackStepOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrackStepOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + private int _hasBits1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackingReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackStepOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackStepOptions(TrackStepOptions other) : this() { + _hasBits0 = other._hasBits0; + _hasBits1 = other._hasBits1; + trackingDegrees_ = other.trackingDegrees_; + trackObjectAndCamera_ = other.trackObjectAndCamera_; + irlsIterations_ = other.irlsIterations_; + spatialSigma_ = other.spatialSigma_; + minMotionSigma_ = other.minMotionSigma_; + relativeMotionSigma_ = other.relativeMotionSigma_; + motionDisparityLowLevel_ = other.motionDisparityLowLevel_; + motionDisparityHighLevel_ = other.motionDisparityHighLevel_; + disparityDecay_ = other.disparityDecay_; + motionPriorWeight_ = other.motionPriorWeight_; + backgroundDiscriminationLowLevel_ = other.backgroundDiscriminationLowLevel_; + backgroundDiscriminationHighLevel_ = other.backgroundDiscriminationHighLevel_; + inlierCenterRelativeDistance_ = other.inlierCenterRelativeDistance_; + inlierSpringForce_ = other.inlierSpringForce_; + kineticCenterRelativeDistance_ = other.kineticCenterRelativeDistance_; + kineticSpringForce_ = other.kineticSpringForce_; + kineticSpringForceMinKineticEnergy_ = other.kineticSpringForceMinKineticEnergy_; + velocityUpdateWeight_ = other.velocityUpdateWeight_; + maxTrackFailures_ = other.maxTrackFailures_; + expansionSize_ = other.expansionSize_; + inlierLowWeight_ = other.inlierLowWeight_; + inlierHighWeight_ = other.inlierHighWeight_; + kineticEnergyDecay_ = other.kineticEnergyDecay_; + priorWeightIncrease_ = other.priorWeightIncrease_; + lowKineticEnergy_ = other.lowKineticEnergy_; + highKineticEnergy_ = other.highKineticEnergy_; + returnInternalState_ = other.returnInternalState_; + usePostEstimationWeightsForState_ = other.usePostEstimationWeightsForState_; + computeSpatialPrior_ = other.computeSpatialPrior_; + irlsInitialization_ = other.irlsInitialization_ != null ? other.irlsInitialization_.Clone() : null; + staticMotionTemporalRatio_ = other.staticMotionTemporalRatio_; + cancelTrackingWithOcclusionOptions_ = other.cancelTrackingWithOcclusionOptions_ != null ? other.cancelTrackingWithOcclusionOptions_.Clone() : null; + objectSimilarityMinContdInliers_ = other.objectSimilarityMinContdInliers_; + boxSimilarityMaxScale_ = other.boxSimilarityMaxScale_; + boxSimilarityMaxRotation_ = other.boxSimilarityMaxRotation_; + quadHomographyMaxScale_ = other.quadHomographyMaxScale_; + quadHomographyMaxRotation_ = other.quadHomographyMaxRotation_; + cameraIntrinsics_ = other.cameraIntrinsics_ != null ? other.cameraIntrinsics_.Clone() : null; + forcedPnpTracking_ = other.forcedPnpTracking_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TrackStepOptions Clone() { + return new TrackStepOptions(this); + } + + /// Field number for the "tracking_degrees" field. + public const int TrackingDegreesFieldNumber = 28; + private readonly static global::Mediapipe.TrackStepOptions.Types.TrackingDegrees TrackingDegreesDefaultValue = global::Mediapipe.TrackStepOptions.Types.TrackingDegrees.TrackingDegreeTranslation; + + private global::Mediapipe.TrackStepOptions.Types.TrackingDegrees trackingDegrees_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackStepOptions.Types.TrackingDegrees TrackingDegrees { + get { if ((_hasBits0 & 67108864) != 0) { return trackingDegrees_; } else { return TrackingDegreesDefaultValue; } } + set { + _hasBits0 |= 67108864; + trackingDegrees_ = value; + } + } + /// Gets whether the "tracking_degrees" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackingDegrees { + get { return (_hasBits0 & 67108864) != 0; } + } + /// Clears the value of the "tracking_degrees" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackingDegrees() { + _hasBits0 &= ~67108864; + } + + /// Field number for the "track_object_and_camera" field. + public const int TrackObjectAndCameraFieldNumber = 32; + private readonly static bool TrackObjectAndCameraDefaultValue = false; + + private bool trackObjectAndCamera_; + /// + /// If set and one of the TRACKING_DEGREE_OBJECT degrees are set also applies + /// camera motion in addition to the object motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool TrackObjectAndCamera { + get { if ((_hasBits0 & 268435456) != 0) { return trackObjectAndCamera_; } else { return TrackObjectAndCameraDefaultValue; } } + set { + _hasBits0 |= 268435456; + trackObjectAndCamera_ = value; + } + } + /// Gets whether the "track_object_and_camera" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTrackObjectAndCamera { + get { return (_hasBits0 & 268435456) != 0; } + } + /// Clears the value of the "track_object_and_camera" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTrackObjectAndCamera() { + _hasBits0 &= ~268435456; + } + + /// Field number for the "irls_iterations" field. + public const int IrlsIterationsFieldNumber = 1; + private readonly static int IrlsIterationsDefaultValue = 5; + + private int irlsIterations_; + /// + /// Number of iterations to iteratively estimate model and re-estimate + /// influence of each vector. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int IrlsIterations { + get { if ((_hasBits0 & 1) != 0) { return irlsIterations_; } else { return IrlsIterationsDefaultValue; } } + set { + _hasBits0 |= 1; + irlsIterations_ = value; + } + } + /// Gets whether the "irls_iterations" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIrlsIterations { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "irls_iterations" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIrlsIterations() { + _hasBits0 &= ~1; + } + + /// Field number for the "spatial_sigma" field. + public const int SpatialSigmaFieldNumber = 2; + private readonly static float SpatialSigmaDefaultValue = 0.15F; + + private float spatialSigma_; + /// + /// Gaussian spatial prior sigma relative to box size. + /// For motivation, see this plot: http://goo.gl/BCfcy. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float SpatialSigma { + get { if ((_hasBits0 & 2) != 0) { return spatialSigma_; } else { return SpatialSigmaDefaultValue; } } + set { + _hasBits0 |= 2; + spatialSigma_ = value; + } + } + /// Gets whether the "spatial_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasSpatialSigma { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "spatial_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearSpatialSigma() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_motion_sigma" field. + public const int MinMotionSigmaFieldNumber = 3; + private readonly static float MinMotionSigmaDefaultValue = 0.002F; + + private float minMotionSigma_; + /// + /// Gaussian velocity prior sigma. It is computed as the maximum of the + /// absolute minimum sigma (in normalized domain) and the relative sigma + /// w.r.t. previous motion. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinMotionSigma { + get { if ((_hasBits0 & 4) != 0) { return minMotionSigma_; } else { return MinMotionSigmaDefaultValue; } } + set { + _hasBits0 |= 4; + minMotionSigma_ = value; + } + } + /// Gets whether the "min_motion_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinMotionSigma { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_motion_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinMotionSigma() { + _hasBits0 &= ~4; + } + + /// Field number for the "relative_motion_sigma" field. + public const int RelativeMotionSigmaFieldNumber = 4; + private readonly static float RelativeMotionSigmaDefaultValue = 0.3F; + + private float relativeMotionSigma_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float RelativeMotionSigma { + get { if ((_hasBits0 & 8) != 0) { return relativeMotionSigma_; } else { return RelativeMotionSigmaDefaultValue; } } + set { + _hasBits0 |= 8; + relativeMotionSigma_ = value; + } + } + /// Gets whether the "relative_motion_sigma" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRelativeMotionSigma { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "relative_motion_sigma" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRelativeMotionSigma() { + _hasBits0 &= ~8; + } + + /// Field number for the "motion_disparity_low_level" field. + public const int MotionDisparityLowLevelFieldNumber = 6; + private readonly static float MotionDisparityLowLevelDefaultValue = 0.008F; + + private float motionDisparityLowLevel_; + /// + /// Settings for motion disparity. Difference between previous and current + /// motion magnitude is scored linearly, from motion_disparity_low_level to + /// motion_disparity_high_level (mapped to score of 0 and 1 respectively). + /// Motivation is to ensure acceleration between frames are within reasonable + /// bounds. + /// Represents a maximum acceleration of around 4 - 5 pixels per frame in 360p + /// video to be unpenalized, with accelerations of around >= 10 pixels being + /// considered inconsitent with prediction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MotionDisparityLowLevel { + get { if ((_hasBits0 & 16) != 0) { return motionDisparityLowLevel_; } else { return MotionDisparityLowLevelDefaultValue; } } + set { + _hasBits0 |= 16; + motionDisparityLowLevel_ = value; + } + } + /// Gets whether the "motion_disparity_low_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionDisparityLowLevel { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "motion_disparity_low_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionDisparityLowLevel() { + _hasBits0 &= ~16; + } + + /// Field number for the "motion_disparity_high_level" field. + public const int MotionDisparityHighLevelFieldNumber = 7; + private readonly static float MotionDisparityHighLevelDefaultValue = 0.016F; + + private float motionDisparityHighLevel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MotionDisparityHighLevel { + get { if ((_hasBits0 & 32) != 0) { return motionDisparityHighLevel_; } else { return MotionDisparityHighLevelDefaultValue; } } + set { + _hasBits0 |= 32; + motionDisparityHighLevel_ = value; + } + } + /// Gets whether the "motion_disparity_high_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionDisparityHighLevel { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "motion_disparity_high_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionDisparityHighLevel() { + _hasBits0 &= ~32; + } + + /// Field number for the "disparity_decay" field. + public const int DisparityDecayFieldNumber = 8; + private readonly static float DisparityDecayDefaultValue = 0.8F; + + private float disparityDecay_; + /// + /// Motion disparity decays across frames. Disparity of previous frame decays + /// over time. If disparity in current frame is not higher, i.e. the larger + /// of the current and decayed disparity is taken. + /// Motivation is, that if acceleration was unreasonable high (and we likely + /// lost tracking) we enter a stage of trying to regain tracking by looking for + /// vectors that agree with the previous prediction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float DisparityDecay { + get { if ((_hasBits0 & 64) != 0) { return disparityDecay_; } else { return DisparityDecayDefaultValue; } } + set { + _hasBits0 |= 64; + disparityDecay_ = value; + } + } + /// Gets whether the "disparity_decay" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasDisparityDecay { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "disparity_decay" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearDisparityDecay() { + _hasBits0 &= ~64; + } + + /// Field number for the "motion_prior_weight" field. + public const int MotionPriorWeightFieldNumber = 9; + private readonly static float MotionPriorWeightDefaultValue = 0.2F; + + private float motionPriorWeight_; + /// + /// Object motion is given as linear combination of previous and measured + /// motion depending on the motion_disparity (a high disparity is giving high + /// weight to the previous motion). + /// We enforce at least a minimum of the below motion_prior_weight regardless + /// of the motion disparity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MotionPriorWeight { + get { if ((_hasBits0 & 128) != 0) { return motionPriorWeight_; } else { return MotionPriorWeightDefaultValue; } } + set { + _hasBits0 |= 128; + motionPriorWeight_ = value; + } + } + /// Gets whether the "motion_prior_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMotionPriorWeight { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "motion_prior_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMotionPriorWeight() { + _hasBits0 &= ~128; + } + + /// Field number for the "background_discrimination_low_level" field. + public const int BackgroundDiscriminationLowLevelFieldNumber = 10; + private readonly static float BackgroundDiscriminationLowLevelDefaultValue = 0.004F; + + private float backgroundDiscriminationLowLevel_; + /// + /// Settings for motion discrimination. + /// + /// Current motion magnitude is scored linearly, + /// from background_discrimination_low_level to + /// background_discrimination_high_level (mapped to score of 0 and 1 + /// respectively). + /// Motivation is that high object motions are easy to discriminate from the + /// background, whereas small object motions are virtually indistinguishable. + /// Represents a range of 2 - 4 pixels for 360p video. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BackgroundDiscriminationLowLevel { + get { if ((_hasBits0 & 256) != 0) { return backgroundDiscriminationLowLevel_; } else { return BackgroundDiscriminationLowLevelDefaultValue; } } + set { + _hasBits0 |= 256; + backgroundDiscriminationLowLevel_ = value; + } + } + /// Gets whether the "background_discrimination_low_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBackgroundDiscriminationLowLevel { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "background_discrimination_low_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBackgroundDiscriminationLowLevel() { + _hasBits0 &= ~256; + } + + /// Field number for the "background_discrimination_high_level" field. + public const int BackgroundDiscriminationHighLevelFieldNumber = 11; + private readonly static float BackgroundDiscriminationHighLevelDefaultValue = 0.008F; + + private float backgroundDiscriminationHighLevel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BackgroundDiscriminationHighLevel { + get { if ((_hasBits0 & 512) != 0) { return backgroundDiscriminationHighLevel_; } else { return BackgroundDiscriminationHighLevelDefaultValue; } } + set { + _hasBits0 |= 512; + backgroundDiscriminationHighLevel_ = value; + } + } + /// Gets whether the "background_discrimination_high_level" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBackgroundDiscriminationHighLevel { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "background_discrimination_high_level" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBackgroundDiscriminationHighLevel() { + _hasBits0 &= ~512; + } + + /// Field number for the "inlier_center_relative_distance" field. + public const int InlierCenterRelativeDistanceFieldNumber = 12; + private readonly static float InlierCenterRelativeDistanceDefaultValue = 0.1F; + + private float inlierCenterRelativeDistance_; + /// + /// Spring force settings. If difference between predicted center of the box in + /// the next frame and the predicted center of the inliers deviates by more + /// than inlier_center_relative_distance times the box [width|height] + /// a spring force is applied to the box. The amount of force is spring_force + /// times the difference. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierCenterRelativeDistance { + get { if ((_hasBits0 & 1024) != 0) { return inlierCenterRelativeDistance_; } else { return InlierCenterRelativeDistanceDefaultValue; } } + set { + _hasBits0 |= 1024; + inlierCenterRelativeDistance_ = value; + } + } + /// Gets whether the "inlier_center_relative_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierCenterRelativeDistance { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "inlier_center_relative_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierCenterRelativeDistance() { + _hasBits0 &= ~1024; + } + + /// Field number for the "inlier_spring_force" field. + public const int InlierSpringForceFieldNumber = 13; + private readonly static float InlierSpringForceDefaultValue = 0.3F; + + private float inlierSpringForce_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierSpringForce { + get { if ((_hasBits0 & 2048) != 0) { return inlierSpringForce_; } else { return InlierSpringForceDefaultValue; } } + set { + _hasBits0 |= 2048; + inlierSpringForce_ = value; + } + } + /// Gets whether the "inlier_spring_force" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierSpringForce { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "inlier_spring_force" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierSpringForce() { + _hasBits0 &= ~2048; + } + + /// Field number for the "kinetic_center_relative_distance" field. + public const int KineticCenterRelativeDistanceFieldNumber = 14; + private readonly static float KineticCenterRelativeDistanceDefaultValue = 0.4F; + + private float kineticCenterRelativeDistance_; + /// + /// Same as above, but for the center of large motion magnitudes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float KineticCenterRelativeDistance { + get { if ((_hasBits0 & 4096) != 0) { return kineticCenterRelativeDistance_; } else { return KineticCenterRelativeDistanceDefaultValue; } } + set { + _hasBits0 |= 4096; + kineticCenterRelativeDistance_ = value; + } + } + /// Gets whether the "kinetic_center_relative_distance" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKineticCenterRelativeDistance { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "kinetic_center_relative_distance" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKineticCenterRelativeDistance() { + _hasBits0 &= ~4096; + } + + /// Field number for the "kinetic_spring_force" field. + public const int KineticSpringForceFieldNumber = 15; + private readonly static float KineticSpringForceDefaultValue = 0.5F; + + private float kineticSpringForce_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float KineticSpringForce { + get { if ((_hasBits0 & 8192) != 0) { return kineticSpringForce_; } else { return KineticSpringForceDefaultValue; } } + set { + _hasBits0 |= 8192; + kineticSpringForce_ = value; + } + } + /// Gets whether the "kinetic_spring_force" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKineticSpringForce { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "kinetic_spring_force" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKineticSpringForce() { + _hasBits0 &= ~8192; + } + + /// Field number for the "kinetic_spring_force_min_kinetic_energy" field. + public const int KineticSpringForceMinKineticEnergyFieldNumber = 21; + private readonly static float KineticSpringForceMinKineticEnergyDefaultValue = 0.003F; + + private float kineticSpringForceMinKineticEnergy_; + /// + /// Spring force towards large motions is only applied when kinetic energy is + /// above the specified threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float KineticSpringForceMinKineticEnergy { + get { if ((_hasBits0 & 524288) != 0) { return kineticSpringForceMinKineticEnergy_; } else { return KineticSpringForceMinKineticEnergyDefaultValue; } } + set { + _hasBits0 |= 524288; + kineticSpringForceMinKineticEnergy_ = value; + } + } + /// Gets whether the "kinetic_spring_force_min_kinetic_energy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKineticSpringForceMinKineticEnergy { + get { return (_hasBits0 & 524288) != 0; } + } + /// Clears the value of the "kinetic_spring_force_min_kinetic_energy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKineticSpringForceMinKineticEnergy() { + _hasBits0 &= ~524288; + } + + /// Field number for the "velocity_update_weight" field. + public const int VelocityUpdateWeightFieldNumber = 16; + private readonly static float VelocityUpdateWeightDefaultValue = 0.7F; + + private float velocityUpdateWeight_; + /// + /// Bias of old velocity during update step. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float VelocityUpdateWeight { + get { if ((_hasBits0 & 16384) != 0) { return velocityUpdateWeight_; } else { return VelocityUpdateWeightDefaultValue; } } + set { + _hasBits0 |= 16384; + velocityUpdateWeight_ = value; + } + } + /// Gets whether the "velocity_update_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasVelocityUpdateWeight { + get { return (_hasBits0 & 16384) != 0; } + } + /// Clears the value of the "velocity_update_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearVelocityUpdateWeight() { + _hasBits0 &= ~16384; + } + + /// Field number for the "max_track_failures" field. + public const int MaxTrackFailuresFieldNumber = 17; + private readonly static int MaxTrackFailuresDefaultValue = 10; + + private int maxTrackFailures_; + /// + /// Maximum number of frames considered to be tracking failures -> + /// If over threshold, box is considered untrackable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int MaxTrackFailures { + get { if ((_hasBits0 & 32768) != 0) { return maxTrackFailures_; } else { return MaxTrackFailuresDefaultValue; } } + set { + _hasBits0 |= 32768; + maxTrackFailures_ = value; + } + } + /// Gets whether the "max_track_failures" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMaxTrackFailures { + get { return (_hasBits0 & 32768) != 0; } + } + /// Clears the value of the "max_track_failures" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMaxTrackFailures() { + _hasBits0 &= ~32768; + } + + /// Field number for the "expansion_size" field. + public const int ExpansionSizeFieldNumber = 18; + private readonly static float ExpansionSizeDefaultValue = 0.05F; + + private float expansionSize_; + /// + /// Domain used for tracking is always larger than the current box. + /// If current motion is not negligible, box is expanded in the direction the + /// motion, otherwise expanded in all directions by the amount specified below + /// (w.r.t. normalized domain). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float ExpansionSize { + get { if ((_hasBits0 & 65536) != 0) { return expansionSize_; } else { return ExpansionSizeDefaultValue; } } + set { + _hasBits0 |= 65536; + expansionSize_ = value; + } + } + /// Gets whether the "expansion_size" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasExpansionSize { + get { return (_hasBits0 & 65536) != 0; } + } + /// Clears the value of the "expansion_size" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearExpansionSize() { + _hasBits0 &= ~65536; + } + + /// Field number for the "inlier_low_weight" field. + public const int InlierLowWeightFieldNumber = 19; + private readonly static float InlierLowWeightDefaultValue = 250F; + + private float inlierLowWeight_; + /// + /// Features are scored based on the magnitude of their irls weights, mapped to + /// [0, 1] using the following range. The range represents roughly 3 - 1.5 + /// pixels error for 360p video. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierLowWeight { + get { if ((_hasBits0 & 131072) != 0) { return inlierLowWeight_; } else { return InlierLowWeightDefaultValue; } } + set { + _hasBits0 |= 131072; + inlierLowWeight_ = value; + } + } + /// Gets whether the "inlier_low_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierLowWeight { + get { return (_hasBits0 & 131072) != 0; } + } + /// Clears the value of the "inlier_low_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierLowWeight() { + _hasBits0 &= ~131072; + } + + /// Field number for the "inlier_high_weight" field. + public const int InlierHighWeightFieldNumber = 20; + private readonly static float InlierHighWeightDefaultValue = 500F; + + private float inlierHighWeight_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float InlierHighWeight { + get { if ((_hasBits0 & 262144) != 0) { return inlierHighWeight_; } else { return InlierHighWeightDefaultValue; } } + set { + _hasBits0 |= 262144; + inlierHighWeight_ = value; + } + } + /// Gets whether the "inlier_high_weight" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInlierHighWeight { + get { return (_hasBits0 & 262144) != 0; } + } + /// Clears the value of the "inlier_high_weight" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInlierHighWeight() { + _hasBits0 &= ~262144; + } + + /// Field number for the "kinetic_energy_decay" field. + public const int KineticEnergyDecayFieldNumber = 22; + private readonly static float KineticEnergyDecayDefaultValue = 0.98F; + + private float kineticEnergyDecay_; + /// + /// Kinetic energy decays over time by the specified rate. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float KineticEnergyDecay { + get { if ((_hasBits0 & 1048576) != 0) { return kineticEnergyDecay_; } else { return KineticEnergyDecayDefaultValue; } } + set { + _hasBits0 |= 1048576; + kineticEnergyDecay_ = value; + } + } + /// Gets whether the "kinetic_energy_decay" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasKineticEnergyDecay { + get { return (_hasBits0 & 1048576) != 0; } + } + /// Clears the value of the "kinetic_energy_decay" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearKineticEnergyDecay() { + _hasBits0 &= ~1048576; + } + + /// Field number for the "prior_weight_increase" field. + public const int PriorWeightIncreaseFieldNumber = 23; + private readonly static float PriorWeightIncreaseDefaultValue = 0.2F; + + private float priorWeightIncrease_; + /// + /// Amount by which prior is increased/decreased in case of valid/invalid + /// measurements. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float PriorWeightIncrease { + get { if ((_hasBits0 & 2097152) != 0) { return priorWeightIncrease_; } else { return PriorWeightIncreaseDefaultValue; } } + set { + _hasBits0 |= 2097152; + priorWeightIncrease_ = value; + } + } + /// Gets whether the "prior_weight_increase" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasPriorWeightIncrease { + get { return (_hasBits0 & 2097152) != 0; } + } + /// Clears the value of the "prior_weight_increase" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearPriorWeightIncrease() { + _hasBits0 &= ~2097152; + } + + /// Field number for the "low_kinetic_energy" field. + public const int LowKineticEnergyFieldNumber = 24; + private readonly static float LowKineticEnergyDefaultValue = 0.001F; + + private float lowKineticEnergy_; + /// + /// We map the amount of present kinetic energy linearly to the domain [0, 1] + /// describing if an object is static (0) or moving (1). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float LowKineticEnergy { + get { if ((_hasBits0 & 4194304) != 0) { return lowKineticEnergy_; } else { return LowKineticEnergyDefaultValue; } } + set { + _hasBits0 |= 4194304; + lowKineticEnergy_ = value; + } + } + /// Gets whether the "low_kinetic_energy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasLowKineticEnergy { + get { return (_hasBits0 & 4194304) != 0; } + } + /// Clears the value of the "low_kinetic_energy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearLowKineticEnergy() { + _hasBits0 &= ~4194304; + } + + /// Field number for the "high_kinetic_energy" field. + public const int HighKineticEnergyFieldNumber = 25; + private readonly static float HighKineticEnergyDefaultValue = 0.004F; + + private float highKineticEnergy_; + /// + /// ~3 pix + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float HighKineticEnergy { + get { if ((_hasBits0 & 8388608) != 0) { return highKineticEnergy_; } else { return HighKineticEnergyDefaultValue; } } + set { + _hasBits0 |= 8388608; + highKineticEnergy_ = value; + } + } + /// Gets whether the "high_kinetic_energy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasHighKineticEnergy { + get { return (_hasBits0 & 8388608) != 0; } + } + /// Clears the value of the "high_kinetic_energy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearHighKineticEnergy() { + _hasBits0 &= ~8388608; + } + + /// Field number for the "return_internal_state" field. + public const int ReturnInternalStateFieldNumber = 26; + private readonly static bool ReturnInternalStateDefaultValue = false; + + private bool returnInternalState_; + /// + /// Outputs internal state to MotionBoxState. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ReturnInternalState { + get { if ((_hasBits0 & 16777216) != 0) { return returnInternalState_; } else { return ReturnInternalStateDefaultValue; } } + set { + _hasBits0 |= 16777216; + returnInternalState_ = value; + } + } + /// Gets whether the "return_internal_state" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasReturnInternalState { + get { return (_hasBits0 & 16777216) != 0; } + } + /// Clears the value of the "return_internal_state" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearReturnInternalState() { + _hasBits0 &= ~16777216; + } + + /// Field number for the "use_post_estimation_weights_for_state" field. + public const int UsePostEstimationWeightsForStateFieldNumber = 29; + private readonly static bool UsePostEstimationWeightsForStateDefaultValue = true; + + private bool usePostEstimationWeightsForState_; + /// + /// Specifies which weights are stored in the internal state. By default + /// post-estimation weights are stored, otherwise pre-estimation weights + /// are stored. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool UsePostEstimationWeightsForState { + get { if ((_hasBits0 & 134217728) != 0) { return usePostEstimationWeightsForState_; } else { return UsePostEstimationWeightsForStateDefaultValue; } } + set { + _hasBits0 |= 134217728; + usePostEstimationWeightsForState_ = value; + } + } + /// Gets whether the "use_post_estimation_weights_for_state" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasUsePostEstimationWeightsForState { + get { return (_hasBits0 & 134217728) != 0; } + } + /// Clears the value of the "use_post_estimation_weights_for_state" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearUsePostEstimationWeightsForState() { + _hasBits0 &= ~134217728; + } + + /// Field number for the "compute_spatial_prior" field. + public const int ComputeSpatialPriorFieldNumber = 27; + private readonly static bool ComputeSpatialPriorDefaultValue = false; + + private bool computeSpatialPrior_; + /// + /// Computes spatial grid of inliers and stores it in the MotionBoxState. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ComputeSpatialPrior { + get { if ((_hasBits0 & 33554432) != 0) { return computeSpatialPrior_; } else { return ComputeSpatialPriorDefaultValue; } } + set { + _hasBits0 |= 33554432; + computeSpatialPrior_ = value; + } + } + /// Gets whether the "compute_spatial_prior" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasComputeSpatialPrior { + get { return (_hasBits0 & 33554432) != 0; } + } + /// Clears the value of the "compute_spatial_prior" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComputeSpatialPrior() { + _hasBits0 &= ~33554432; + } + + /// Field number for the "irls_initialization" field. + public const int IrlsInitializationFieldNumber = 30; + private global::Mediapipe.TrackStepOptions.Types.IrlsInitialization irlsInitialization_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackStepOptions.Types.IrlsInitialization IrlsInitialization { + get { return irlsInitialization_; } + set { + irlsInitialization_ = value; + } + } + + /// Field number for the "static_motion_temporal_ratio" field. + public const int StaticMotionTemporalRatioFieldNumber = 33; + private readonly static float StaticMotionTemporalRatioDefaultValue = 0.003F; + + private float staticMotionTemporalRatio_; + /// + /// Ratio between static motion and temporal scale. This is actually + /// the threshold on speed, under which we consider static (non-moving object). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float StaticMotionTemporalRatio { + get { if ((_hasBits0 & 536870912) != 0) { return staticMotionTemporalRatio_; } else { return StaticMotionTemporalRatioDefaultValue; } } + set { + _hasBits0 |= 536870912; + staticMotionTemporalRatio_ = value; + } + } + /// Gets whether the "static_motion_temporal_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasStaticMotionTemporalRatio { + get { return (_hasBits0 & 536870912) != 0; } + } + /// Clears the value of the "static_motion_temporal_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearStaticMotionTemporalRatio() { + _hasBits0 &= ~536870912; + } + + /// Field number for the "cancel_tracking_with_occlusion_options" field. + public const int CancelTrackingWithOcclusionOptionsFieldNumber = 34; + private global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions cancelTrackingWithOcclusionOptions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions CancelTrackingWithOcclusionOptions { + get { return cancelTrackingWithOcclusionOptions_; } + set { + cancelTrackingWithOcclusionOptions_ = value; + } + } + + /// Field number for the "object_similarity_min_contd_inliers" field. + public const int ObjectSimilarityMinContdInliersFieldNumber = 35; + private readonly static int ObjectSimilarityMinContdInliersDefaultValue = 30; + + private int objectSimilarityMinContdInliers_; + /// + /// If number of continued inliers is less than this number, then the object + /// motion model will fall back to translation model. + /// Set this min_continued_inliers threshold to a low number to make sure + /// they follow local object rotation and scale, but it may result in un-robust + /// rotation and scale estimation if the threshold is too low. Recommend that + /// you don't set a number < 4. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ObjectSimilarityMinContdInliers { + get { if ((_hasBits0 & 1073741824) != 0) { return objectSimilarityMinContdInliers_; } else { return ObjectSimilarityMinContdInliersDefaultValue; } } + set { + _hasBits0 |= 1073741824; + objectSimilarityMinContdInliers_ = value; + } + } + /// Gets whether the "object_similarity_min_contd_inliers" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasObjectSimilarityMinContdInliers { + get { return (_hasBits0 & 1073741824) != 0; } + } + /// Clears the value of the "object_similarity_min_contd_inliers" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearObjectSimilarityMinContdInliers() { + _hasBits0 &= ~1073741824; + } + + /// Field number for the "box_similarity_max_scale" field. + public const int BoxSimilarityMaxScaleFieldNumber = 36; + private readonly static float BoxSimilarityMaxScaleDefaultValue = 1.05F; + + private float boxSimilarityMaxScale_; + /// + /// Maximum acceptable scale component of object similarity transform. + /// Minimum scale is computed as 1.0 / max_scale. + /// Exclusive for tracking a box with similarity. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoxSimilarityMaxScale { + get { if ((_hasBits0 & -2147483648) != 0) { return boxSimilarityMaxScale_; } else { return BoxSimilarityMaxScaleDefaultValue; } } + set { + _hasBits0 |= -2147483648; + boxSimilarityMaxScale_ = value; + } + } + /// Gets whether the "box_similarity_max_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoxSimilarityMaxScale { + get { return (_hasBits0 & -2147483648) != 0; } + } + /// Clears the value of the "box_similarity_max_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxSimilarityMaxScale() { + _hasBits0 &= ~-2147483648; + } + + /// Field number for the "box_similarity_max_rotation" field. + public const int BoxSimilarityMaxRotationFieldNumber = 37; + private readonly static float BoxSimilarityMaxRotationDefaultValue = 0.2F; + + private float boxSimilarityMaxRotation_; + /// + /// Maximum acceptable object similarity rotation in radians. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float BoxSimilarityMaxRotation { + get { if ((_hasBits1 & 1) != 0) { return boxSimilarityMaxRotation_; } else { return BoxSimilarityMaxRotationDefaultValue; } } + set { + _hasBits1 |= 1; + boxSimilarityMaxRotation_ = value; + } + } + /// Gets whether the "box_similarity_max_rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBoxSimilarityMaxRotation { + get { return (_hasBits1 & 1) != 0; } + } + /// Clears the value of the "box_similarity_max_rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBoxSimilarityMaxRotation() { + _hasBits1 &= ~1; + } + + /// Field number for the "quad_homography_max_scale" field. + public const int QuadHomographyMaxScaleFieldNumber = 38; + private readonly static float QuadHomographyMaxScaleDefaultValue = 1.2F; + + private float quadHomographyMaxScale_; + /// + /// Homography transform will first be projected to similarity, and the scale + /// component of the similarity transform should be within the range of + /// [1.0 / max_scale, max_scale]. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float QuadHomographyMaxScale { + get { if ((_hasBits1 & 2) != 0) { return quadHomographyMaxScale_; } else { return QuadHomographyMaxScaleDefaultValue; } } + set { + _hasBits1 |= 2; + quadHomographyMaxScale_ = value; + } + } + /// Gets whether the "quad_homography_max_scale" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasQuadHomographyMaxScale { + get { return (_hasBits1 & 2) != 0; } + } + /// Clears the value of the "quad_homography_max_scale" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearQuadHomographyMaxScale() { + _hasBits1 &= ~2; + } + + /// Field number for the "quad_homography_max_rotation" field. + public const int QuadHomographyMaxRotationFieldNumber = 39; + private readonly static float QuadHomographyMaxRotationDefaultValue = 0.3F; + + private float quadHomographyMaxRotation_; + /// + /// The rotation component of the projected similarity should be smaller than + /// this maximum rotation threshold. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float QuadHomographyMaxRotation { + get { if ((_hasBits1 & 4) != 0) { return quadHomographyMaxRotation_; } else { return QuadHomographyMaxRotationDefaultValue; } } + set { + _hasBits1 |= 4; + quadHomographyMaxRotation_ = value; + } + } + /// Gets whether the "quad_homography_max_rotation" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasQuadHomographyMaxRotation { + get { return (_hasBits1 & 4) != 0; } + } + /// Clears the value of the "quad_homography_max_rotation" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearQuadHomographyMaxRotation() { + _hasBits1 &= ~4; + } + + /// Field number for the "camera_intrinsics" field. + public const int CameraIntrinsicsFieldNumber = 40; + private global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics cameraIntrinsics_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics CameraIntrinsics { + get { return cameraIntrinsics_; } + set { + cameraIntrinsics_ = value; + } + } + + /// Field number for the "forced_pnp_tracking" field. + public const int ForcedPnpTrackingFieldNumber = 41; + private readonly static bool ForcedPnpTrackingDefaultValue = false; + + private bool forcedPnpTracking_; + /// + /// Specifically for quad tracking (aka TRACKING_DEGREE_OBJECT_PERSPECTIVE + /// mode), if aspect_ratio field is set in start pos, pnp tracking will be + /// deployed. If aspect_ratio is unknown (not set), but forced_pnp_tracking is + /// true, we will first estimate the aspect ratio for the 3D quadrangle, then + /// perform pnp tracking. If aspect_ratio is unknown and pnp tracking is not + /// forced, general homography tracking will be deployed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ForcedPnpTracking { + get { if ((_hasBits1 & 8) != 0) { return forcedPnpTracking_; } else { return ForcedPnpTrackingDefaultValue; } } + set { + _hasBits1 |= 8; + forcedPnpTracking_ = value; + } + } + /// Gets whether the "forced_pnp_tracking" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasForcedPnpTracking { + get { return (_hasBits1 & 8) != 0; } + } + /// Clears the value of the "forced_pnp_tracking" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearForcedPnpTracking() { + _hasBits1 &= ~8; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TrackStepOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TrackStepOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TrackingDegrees != other.TrackingDegrees) return false; + if (TrackObjectAndCamera != other.TrackObjectAndCamera) return false; + if (IrlsIterations != other.IrlsIterations) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SpatialSigma, other.SpatialSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinMotionSigma, other.MinMotionSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RelativeMotionSigma, other.RelativeMotionSigma)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MotionDisparityLowLevel, other.MotionDisparityLowLevel)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MotionDisparityHighLevel, other.MotionDisparityHighLevel)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DisparityDecay, other.DisparityDecay)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MotionPriorWeight, other.MotionPriorWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BackgroundDiscriminationLowLevel, other.BackgroundDiscriminationLowLevel)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BackgroundDiscriminationHighLevel, other.BackgroundDiscriminationHighLevel)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierCenterRelativeDistance, other.InlierCenterRelativeDistance)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierSpringForce, other.InlierSpringForce)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KineticCenterRelativeDistance, other.KineticCenterRelativeDistance)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KineticSpringForce, other.KineticSpringForce)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KineticSpringForceMinKineticEnergy, other.KineticSpringForceMinKineticEnergy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(VelocityUpdateWeight, other.VelocityUpdateWeight)) return false; + if (MaxTrackFailures != other.MaxTrackFailures) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ExpansionSize, other.ExpansionSize)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierLowWeight, other.InlierLowWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InlierHighWeight, other.InlierHighWeight)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KineticEnergyDecay, other.KineticEnergyDecay)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PriorWeightIncrease, other.PriorWeightIncrease)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowKineticEnergy, other.LowKineticEnergy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HighKineticEnergy, other.HighKineticEnergy)) return false; + if (ReturnInternalState != other.ReturnInternalState) return false; + if (UsePostEstimationWeightsForState != other.UsePostEstimationWeightsForState) return false; + if (ComputeSpatialPrior != other.ComputeSpatialPrior) return false; + if (!object.Equals(IrlsInitialization, other.IrlsInitialization)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StaticMotionTemporalRatio, other.StaticMotionTemporalRatio)) return false; + if (!object.Equals(CancelTrackingWithOcclusionOptions, other.CancelTrackingWithOcclusionOptions)) return false; + if (ObjectSimilarityMinContdInliers != other.ObjectSimilarityMinContdInliers) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoxSimilarityMaxScale, other.BoxSimilarityMaxScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BoxSimilarityMaxRotation, other.BoxSimilarityMaxRotation)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(QuadHomographyMaxScale, other.QuadHomographyMaxScale)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(QuadHomographyMaxRotation, other.QuadHomographyMaxRotation)) return false; + if (!object.Equals(CameraIntrinsics, other.CameraIntrinsics)) return false; + if (ForcedPnpTracking != other.ForcedPnpTracking) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasTrackingDegrees) hash ^= TrackingDegrees.GetHashCode(); + if (HasTrackObjectAndCamera) hash ^= TrackObjectAndCamera.GetHashCode(); + if (HasIrlsIterations) hash ^= IrlsIterations.GetHashCode(); + if (HasSpatialSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SpatialSigma); + if (HasMinMotionSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinMotionSigma); + if (HasRelativeMotionSigma) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RelativeMotionSigma); + if (HasMotionDisparityLowLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MotionDisparityLowLevel); + if (HasMotionDisparityHighLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MotionDisparityHighLevel); + if (HasDisparityDecay) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DisparityDecay); + if (HasMotionPriorWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MotionPriorWeight); + if (HasBackgroundDiscriminationLowLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BackgroundDiscriminationLowLevel); + if (HasBackgroundDiscriminationHighLevel) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BackgroundDiscriminationHighLevel); + if (HasInlierCenterRelativeDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierCenterRelativeDistance); + if (HasInlierSpringForce) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierSpringForce); + if (HasKineticCenterRelativeDistance) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KineticCenterRelativeDistance); + if (HasKineticSpringForce) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KineticSpringForce); + if (HasKineticSpringForceMinKineticEnergy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KineticSpringForceMinKineticEnergy); + if (HasVelocityUpdateWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(VelocityUpdateWeight); + if (HasMaxTrackFailures) hash ^= MaxTrackFailures.GetHashCode(); + if (HasExpansionSize) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ExpansionSize); + if (HasInlierLowWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierLowWeight); + if (HasInlierHighWeight) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InlierHighWeight); + if (HasKineticEnergyDecay) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KineticEnergyDecay); + if (HasPriorWeightIncrease) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PriorWeightIncrease); + if (HasLowKineticEnergy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowKineticEnergy); + if (HasHighKineticEnergy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HighKineticEnergy); + if (HasReturnInternalState) hash ^= ReturnInternalState.GetHashCode(); + if (HasUsePostEstimationWeightsForState) hash ^= UsePostEstimationWeightsForState.GetHashCode(); + if (HasComputeSpatialPrior) hash ^= ComputeSpatialPrior.GetHashCode(); + if (irlsInitialization_ != null) hash ^= IrlsInitialization.GetHashCode(); + if (HasStaticMotionTemporalRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StaticMotionTemporalRatio); + if (cancelTrackingWithOcclusionOptions_ != null) hash ^= CancelTrackingWithOcclusionOptions.GetHashCode(); + if (HasObjectSimilarityMinContdInliers) hash ^= ObjectSimilarityMinContdInliers.GetHashCode(); + if (HasBoxSimilarityMaxScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoxSimilarityMaxScale); + if (HasBoxSimilarityMaxRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BoxSimilarityMaxRotation); + if (HasQuadHomographyMaxScale) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(QuadHomographyMaxScale); + if (HasQuadHomographyMaxRotation) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(QuadHomographyMaxRotation); + if (cameraIntrinsics_ != null) hash ^= CameraIntrinsics.GetHashCode(); + if (HasForcedPnpTracking) hash ^= ForcedPnpTracking.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIrlsIterations) { + output.WriteRawTag(8); + output.WriteInt32(IrlsIterations); + } + if (HasSpatialSigma) { + output.WriteRawTag(21); + output.WriteFloat(SpatialSigma); + } + if (HasMinMotionSigma) { + output.WriteRawTag(29); + output.WriteFloat(MinMotionSigma); + } + if (HasRelativeMotionSigma) { + output.WriteRawTag(37); + output.WriteFloat(RelativeMotionSigma); + } + if (HasMotionDisparityLowLevel) { + output.WriteRawTag(53); + output.WriteFloat(MotionDisparityLowLevel); + } + if (HasMotionDisparityHighLevel) { + output.WriteRawTag(61); + output.WriteFloat(MotionDisparityHighLevel); + } + if (HasDisparityDecay) { + output.WriteRawTag(69); + output.WriteFloat(DisparityDecay); + } + if (HasMotionPriorWeight) { + output.WriteRawTag(77); + output.WriteFloat(MotionPriorWeight); + } + if (HasBackgroundDiscriminationLowLevel) { + output.WriteRawTag(85); + output.WriteFloat(BackgroundDiscriminationLowLevel); + } + if (HasBackgroundDiscriminationHighLevel) { + output.WriteRawTag(93); + output.WriteFloat(BackgroundDiscriminationHighLevel); + } + if (HasInlierCenterRelativeDistance) { + output.WriteRawTag(101); + output.WriteFloat(InlierCenterRelativeDistance); + } + if (HasInlierSpringForce) { + output.WriteRawTag(109); + output.WriteFloat(InlierSpringForce); + } + if (HasKineticCenterRelativeDistance) { + output.WriteRawTag(117); + output.WriteFloat(KineticCenterRelativeDistance); + } + if (HasKineticSpringForce) { + output.WriteRawTag(125); + output.WriteFloat(KineticSpringForce); + } + if (HasVelocityUpdateWeight) { + output.WriteRawTag(133, 1); + output.WriteFloat(VelocityUpdateWeight); + } + if (HasMaxTrackFailures) { + output.WriteRawTag(136, 1); + output.WriteInt32(MaxTrackFailures); + } + if (HasExpansionSize) { + output.WriteRawTag(149, 1); + output.WriteFloat(ExpansionSize); + } + if (HasInlierLowWeight) { + output.WriteRawTag(157, 1); + output.WriteFloat(InlierLowWeight); + } + if (HasInlierHighWeight) { + output.WriteRawTag(165, 1); + output.WriteFloat(InlierHighWeight); + } + if (HasKineticSpringForceMinKineticEnergy) { + output.WriteRawTag(173, 1); + output.WriteFloat(KineticSpringForceMinKineticEnergy); + } + if (HasKineticEnergyDecay) { + output.WriteRawTag(181, 1); + output.WriteFloat(KineticEnergyDecay); + } + if (HasPriorWeightIncrease) { + output.WriteRawTag(189, 1); + output.WriteFloat(PriorWeightIncrease); + } + if (HasLowKineticEnergy) { + output.WriteRawTag(197, 1); + output.WriteFloat(LowKineticEnergy); + } + if (HasHighKineticEnergy) { + output.WriteRawTag(205, 1); + output.WriteFloat(HighKineticEnergy); + } + if (HasReturnInternalState) { + output.WriteRawTag(208, 1); + output.WriteBool(ReturnInternalState); + } + if (HasComputeSpatialPrior) { + output.WriteRawTag(216, 1); + output.WriteBool(ComputeSpatialPrior); + } + if (HasTrackingDegrees) { + output.WriteRawTag(224, 1); + output.WriteEnum((int) TrackingDegrees); + } + if (HasUsePostEstimationWeightsForState) { + output.WriteRawTag(232, 1); + output.WriteBool(UsePostEstimationWeightsForState); + } + if (irlsInitialization_ != null) { + output.WriteRawTag(242, 1); + output.WriteMessage(IrlsInitialization); + } + if (HasTrackObjectAndCamera) { + output.WriteRawTag(128, 2); + output.WriteBool(TrackObjectAndCamera); + } + if (HasStaticMotionTemporalRatio) { + output.WriteRawTag(141, 2); + output.WriteFloat(StaticMotionTemporalRatio); + } + if (cancelTrackingWithOcclusionOptions_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(CancelTrackingWithOcclusionOptions); + } + if (HasObjectSimilarityMinContdInliers) { + output.WriteRawTag(152, 2); + output.WriteInt32(ObjectSimilarityMinContdInliers); + } + if (HasBoxSimilarityMaxScale) { + output.WriteRawTag(165, 2); + output.WriteFloat(BoxSimilarityMaxScale); + } + if (HasBoxSimilarityMaxRotation) { + output.WriteRawTag(173, 2); + output.WriteFloat(BoxSimilarityMaxRotation); + } + if (HasQuadHomographyMaxScale) { + output.WriteRawTag(181, 2); + output.WriteFloat(QuadHomographyMaxScale); + } + if (HasQuadHomographyMaxRotation) { + output.WriteRawTag(189, 2); + output.WriteFloat(QuadHomographyMaxRotation); + } + if (cameraIntrinsics_ != null) { + output.WriteRawTag(194, 2); + output.WriteMessage(CameraIntrinsics); + } + if (HasForcedPnpTracking) { + output.WriteRawTag(200, 2); + output.WriteBool(ForcedPnpTracking); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIrlsIterations) { + output.WriteRawTag(8); + output.WriteInt32(IrlsIterations); + } + if (HasSpatialSigma) { + output.WriteRawTag(21); + output.WriteFloat(SpatialSigma); + } + if (HasMinMotionSigma) { + output.WriteRawTag(29); + output.WriteFloat(MinMotionSigma); + } + if (HasRelativeMotionSigma) { + output.WriteRawTag(37); + output.WriteFloat(RelativeMotionSigma); + } + if (HasMotionDisparityLowLevel) { + output.WriteRawTag(53); + output.WriteFloat(MotionDisparityLowLevel); + } + if (HasMotionDisparityHighLevel) { + output.WriteRawTag(61); + output.WriteFloat(MotionDisparityHighLevel); + } + if (HasDisparityDecay) { + output.WriteRawTag(69); + output.WriteFloat(DisparityDecay); + } + if (HasMotionPriorWeight) { + output.WriteRawTag(77); + output.WriteFloat(MotionPriorWeight); + } + if (HasBackgroundDiscriminationLowLevel) { + output.WriteRawTag(85); + output.WriteFloat(BackgroundDiscriminationLowLevel); + } + if (HasBackgroundDiscriminationHighLevel) { + output.WriteRawTag(93); + output.WriteFloat(BackgroundDiscriminationHighLevel); + } + if (HasInlierCenterRelativeDistance) { + output.WriteRawTag(101); + output.WriteFloat(InlierCenterRelativeDistance); + } + if (HasInlierSpringForce) { + output.WriteRawTag(109); + output.WriteFloat(InlierSpringForce); + } + if (HasKineticCenterRelativeDistance) { + output.WriteRawTag(117); + output.WriteFloat(KineticCenterRelativeDistance); + } + if (HasKineticSpringForce) { + output.WriteRawTag(125); + output.WriteFloat(KineticSpringForce); + } + if (HasVelocityUpdateWeight) { + output.WriteRawTag(133, 1); + output.WriteFloat(VelocityUpdateWeight); + } + if (HasMaxTrackFailures) { + output.WriteRawTag(136, 1); + output.WriteInt32(MaxTrackFailures); + } + if (HasExpansionSize) { + output.WriteRawTag(149, 1); + output.WriteFloat(ExpansionSize); + } + if (HasInlierLowWeight) { + output.WriteRawTag(157, 1); + output.WriteFloat(InlierLowWeight); + } + if (HasInlierHighWeight) { + output.WriteRawTag(165, 1); + output.WriteFloat(InlierHighWeight); + } + if (HasKineticSpringForceMinKineticEnergy) { + output.WriteRawTag(173, 1); + output.WriteFloat(KineticSpringForceMinKineticEnergy); + } + if (HasKineticEnergyDecay) { + output.WriteRawTag(181, 1); + output.WriteFloat(KineticEnergyDecay); + } + if (HasPriorWeightIncrease) { + output.WriteRawTag(189, 1); + output.WriteFloat(PriorWeightIncrease); + } + if (HasLowKineticEnergy) { + output.WriteRawTag(197, 1); + output.WriteFloat(LowKineticEnergy); + } + if (HasHighKineticEnergy) { + output.WriteRawTag(205, 1); + output.WriteFloat(HighKineticEnergy); + } + if (HasReturnInternalState) { + output.WriteRawTag(208, 1); + output.WriteBool(ReturnInternalState); + } + if (HasComputeSpatialPrior) { + output.WriteRawTag(216, 1); + output.WriteBool(ComputeSpatialPrior); + } + if (HasTrackingDegrees) { + output.WriteRawTag(224, 1); + output.WriteEnum((int) TrackingDegrees); + } + if (HasUsePostEstimationWeightsForState) { + output.WriteRawTag(232, 1); + output.WriteBool(UsePostEstimationWeightsForState); + } + if (irlsInitialization_ != null) { + output.WriteRawTag(242, 1); + output.WriteMessage(IrlsInitialization); + } + if (HasTrackObjectAndCamera) { + output.WriteRawTag(128, 2); + output.WriteBool(TrackObjectAndCamera); + } + if (HasStaticMotionTemporalRatio) { + output.WriteRawTag(141, 2); + output.WriteFloat(StaticMotionTemporalRatio); + } + if (cancelTrackingWithOcclusionOptions_ != null) { + output.WriteRawTag(146, 2); + output.WriteMessage(CancelTrackingWithOcclusionOptions); + } + if (HasObjectSimilarityMinContdInliers) { + output.WriteRawTag(152, 2); + output.WriteInt32(ObjectSimilarityMinContdInliers); + } + if (HasBoxSimilarityMaxScale) { + output.WriteRawTag(165, 2); + output.WriteFloat(BoxSimilarityMaxScale); + } + if (HasBoxSimilarityMaxRotation) { + output.WriteRawTag(173, 2); + output.WriteFloat(BoxSimilarityMaxRotation); + } + if (HasQuadHomographyMaxScale) { + output.WriteRawTag(181, 2); + output.WriteFloat(QuadHomographyMaxScale); + } + if (HasQuadHomographyMaxRotation) { + output.WriteRawTag(189, 2); + output.WriteFloat(QuadHomographyMaxRotation); + } + if (cameraIntrinsics_ != null) { + output.WriteRawTag(194, 2); + output.WriteMessage(CameraIntrinsics); + } + if (HasForcedPnpTracking) { + output.WriteRawTag(200, 2); + output.WriteBool(ForcedPnpTracking); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasTrackingDegrees) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) TrackingDegrees); + } + if (HasTrackObjectAndCamera) { + size += 2 + 1; + } + if (HasIrlsIterations) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IrlsIterations); + } + if (HasSpatialSigma) { + size += 1 + 4; + } + if (HasMinMotionSigma) { + size += 1 + 4; + } + if (HasRelativeMotionSigma) { + size += 1 + 4; + } + if (HasMotionDisparityLowLevel) { + size += 1 + 4; + } + if (HasMotionDisparityHighLevel) { + size += 1 + 4; + } + if (HasDisparityDecay) { + size += 1 + 4; + } + if (HasMotionPriorWeight) { + size += 1 + 4; + } + if (HasBackgroundDiscriminationLowLevel) { + size += 1 + 4; + } + if (HasBackgroundDiscriminationHighLevel) { + size += 1 + 4; + } + if (HasInlierCenterRelativeDistance) { + size += 1 + 4; + } + if (HasInlierSpringForce) { + size += 1 + 4; + } + if (HasKineticCenterRelativeDistance) { + size += 1 + 4; + } + if (HasKineticSpringForce) { + size += 1 + 4; + } + if (HasKineticSpringForceMinKineticEnergy) { + size += 2 + 4; + } + if (HasVelocityUpdateWeight) { + size += 2 + 4; + } + if (HasMaxTrackFailures) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxTrackFailures); + } + if (HasExpansionSize) { + size += 2 + 4; + } + if (HasInlierLowWeight) { + size += 2 + 4; + } + if (HasInlierHighWeight) { + size += 2 + 4; + } + if (HasKineticEnergyDecay) { + size += 2 + 4; + } + if (HasPriorWeightIncrease) { + size += 2 + 4; + } + if (HasLowKineticEnergy) { + size += 2 + 4; + } + if (HasHighKineticEnergy) { + size += 2 + 4; + } + if (HasReturnInternalState) { + size += 2 + 1; + } + if (HasUsePostEstimationWeightsForState) { + size += 2 + 1; + } + if (HasComputeSpatialPrior) { + size += 2 + 1; + } + if (irlsInitialization_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(IrlsInitialization); + } + if (HasStaticMotionTemporalRatio) { + size += 2 + 4; + } + if (cancelTrackingWithOcclusionOptions_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(CancelTrackingWithOcclusionOptions); + } + if (HasObjectSimilarityMinContdInliers) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(ObjectSimilarityMinContdInliers); + } + if (HasBoxSimilarityMaxScale) { + size += 2 + 4; + } + if (HasBoxSimilarityMaxRotation) { + size += 2 + 4; + } + if (HasQuadHomographyMaxScale) { + size += 2 + 4; + } + if (HasQuadHomographyMaxRotation) { + size += 2 + 4; + } + if (cameraIntrinsics_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(CameraIntrinsics); + } + if (HasForcedPnpTracking) { + size += 2 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TrackStepOptions other) { + if (other == null) { + return; + } + if (other.HasTrackingDegrees) { + TrackingDegrees = other.TrackingDegrees; + } + if (other.HasTrackObjectAndCamera) { + TrackObjectAndCamera = other.TrackObjectAndCamera; + } + if (other.HasIrlsIterations) { + IrlsIterations = other.IrlsIterations; + } + if (other.HasSpatialSigma) { + SpatialSigma = other.SpatialSigma; + } + if (other.HasMinMotionSigma) { + MinMotionSigma = other.MinMotionSigma; + } + if (other.HasRelativeMotionSigma) { + RelativeMotionSigma = other.RelativeMotionSigma; + } + if (other.HasMotionDisparityLowLevel) { + MotionDisparityLowLevel = other.MotionDisparityLowLevel; + } + if (other.HasMotionDisparityHighLevel) { + MotionDisparityHighLevel = other.MotionDisparityHighLevel; + } + if (other.HasDisparityDecay) { + DisparityDecay = other.DisparityDecay; + } + if (other.HasMotionPriorWeight) { + MotionPriorWeight = other.MotionPriorWeight; + } + if (other.HasBackgroundDiscriminationLowLevel) { + BackgroundDiscriminationLowLevel = other.BackgroundDiscriminationLowLevel; + } + if (other.HasBackgroundDiscriminationHighLevel) { + BackgroundDiscriminationHighLevel = other.BackgroundDiscriminationHighLevel; + } + if (other.HasInlierCenterRelativeDistance) { + InlierCenterRelativeDistance = other.InlierCenterRelativeDistance; + } + if (other.HasInlierSpringForce) { + InlierSpringForce = other.InlierSpringForce; + } + if (other.HasKineticCenterRelativeDistance) { + KineticCenterRelativeDistance = other.KineticCenterRelativeDistance; + } + if (other.HasKineticSpringForce) { + KineticSpringForce = other.KineticSpringForce; + } + if (other.HasKineticSpringForceMinKineticEnergy) { + KineticSpringForceMinKineticEnergy = other.KineticSpringForceMinKineticEnergy; + } + if (other.HasVelocityUpdateWeight) { + VelocityUpdateWeight = other.VelocityUpdateWeight; + } + if (other.HasMaxTrackFailures) { + MaxTrackFailures = other.MaxTrackFailures; + } + if (other.HasExpansionSize) { + ExpansionSize = other.ExpansionSize; + } + if (other.HasInlierLowWeight) { + InlierLowWeight = other.InlierLowWeight; + } + if (other.HasInlierHighWeight) { + InlierHighWeight = other.InlierHighWeight; + } + if (other.HasKineticEnergyDecay) { + KineticEnergyDecay = other.KineticEnergyDecay; + } + if (other.HasPriorWeightIncrease) { + PriorWeightIncrease = other.PriorWeightIncrease; + } + if (other.HasLowKineticEnergy) { + LowKineticEnergy = other.LowKineticEnergy; + } + if (other.HasHighKineticEnergy) { + HighKineticEnergy = other.HighKineticEnergy; + } + if (other.HasReturnInternalState) { + ReturnInternalState = other.ReturnInternalState; + } + if (other.HasUsePostEstimationWeightsForState) { + UsePostEstimationWeightsForState = other.UsePostEstimationWeightsForState; + } + if (other.HasComputeSpatialPrior) { + ComputeSpatialPrior = other.ComputeSpatialPrior; + } + if (other.irlsInitialization_ != null) { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.TrackStepOptions.Types.IrlsInitialization(); + } + IrlsInitialization.MergeFrom(other.IrlsInitialization); + } + if (other.HasStaticMotionTemporalRatio) { + StaticMotionTemporalRatio = other.StaticMotionTemporalRatio; + } + if (other.cancelTrackingWithOcclusionOptions_ != null) { + if (cancelTrackingWithOcclusionOptions_ == null) { + CancelTrackingWithOcclusionOptions = new global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions(); + } + CancelTrackingWithOcclusionOptions.MergeFrom(other.CancelTrackingWithOcclusionOptions); + } + if (other.HasObjectSimilarityMinContdInliers) { + ObjectSimilarityMinContdInliers = other.ObjectSimilarityMinContdInliers; + } + if (other.HasBoxSimilarityMaxScale) { + BoxSimilarityMaxScale = other.BoxSimilarityMaxScale; + } + if (other.HasBoxSimilarityMaxRotation) { + BoxSimilarityMaxRotation = other.BoxSimilarityMaxRotation; + } + if (other.HasQuadHomographyMaxScale) { + QuadHomographyMaxScale = other.QuadHomographyMaxScale; + } + if (other.HasQuadHomographyMaxRotation) { + QuadHomographyMaxRotation = other.QuadHomographyMaxRotation; + } + if (other.cameraIntrinsics_ != null) { + if (cameraIntrinsics_ == null) { + CameraIntrinsics = new global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics(); + } + CameraIntrinsics.MergeFrom(other.CameraIntrinsics); + } + if (other.HasForcedPnpTracking) { + ForcedPnpTracking = other.ForcedPnpTracking; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IrlsIterations = input.ReadInt32(); + break; + } + case 21: { + SpatialSigma = input.ReadFloat(); + break; + } + case 29: { + MinMotionSigma = input.ReadFloat(); + break; + } + case 37: { + RelativeMotionSigma = input.ReadFloat(); + break; + } + case 53: { + MotionDisparityLowLevel = input.ReadFloat(); + break; + } + case 61: { + MotionDisparityHighLevel = input.ReadFloat(); + break; + } + case 69: { + DisparityDecay = input.ReadFloat(); + break; + } + case 77: { + MotionPriorWeight = input.ReadFloat(); + break; + } + case 85: { + BackgroundDiscriminationLowLevel = input.ReadFloat(); + break; + } + case 93: { + BackgroundDiscriminationHighLevel = input.ReadFloat(); + break; + } + case 101: { + InlierCenterRelativeDistance = input.ReadFloat(); + break; + } + case 109: { + InlierSpringForce = input.ReadFloat(); + break; + } + case 117: { + KineticCenterRelativeDistance = input.ReadFloat(); + break; + } + case 125: { + KineticSpringForce = input.ReadFloat(); + break; + } + case 133: { + VelocityUpdateWeight = input.ReadFloat(); + break; + } + case 136: { + MaxTrackFailures = input.ReadInt32(); + break; + } + case 149: { + ExpansionSize = input.ReadFloat(); + break; + } + case 157: { + InlierLowWeight = input.ReadFloat(); + break; + } + case 165: { + InlierHighWeight = input.ReadFloat(); + break; + } + case 173: { + KineticSpringForceMinKineticEnergy = input.ReadFloat(); + break; + } + case 181: { + KineticEnergyDecay = input.ReadFloat(); + break; + } + case 189: { + PriorWeightIncrease = input.ReadFloat(); + break; + } + case 197: { + LowKineticEnergy = input.ReadFloat(); + break; + } + case 205: { + HighKineticEnergy = input.ReadFloat(); + break; + } + case 208: { + ReturnInternalState = input.ReadBool(); + break; + } + case 216: { + ComputeSpatialPrior = input.ReadBool(); + break; + } + case 224: { + TrackingDegrees = (global::Mediapipe.TrackStepOptions.Types.TrackingDegrees) input.ReadEnum(); + break; + } + case 232: { + UsePostEstimationWeightsForState = input.ReadBool(); + break; + } + case 242: { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.TrackStepOptions.Types.IrlsInitialization(); + } + input.ReadMessage(IrlsInitialization); + break; + } + case 256: { + TrackObjectAndCamera = input.ReadBool(); + break; + } + case 269: { + StaticMotionTemporalRatio = input.ReadFloat(); + break; + } + case 274: { + if (cancelTrackingWithOcclusionOptions_ == null) { + CancelTrackingWithOcclusionOptions = new global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions(); + } + input.ReadMessage(CancelTrackingWithOcclusionOptions); + break; + } + case 280: { + ObjectSimilarityMinContdInliers = input.ReadInt32(); + break; + } + case 293: { + BoxSimilarityMaxScale = input.ReadFloat(); + break; + } + case 301: { + BoxSimilarityMaxRotation = input.ReadFloat(); + break; + } + case 309: { + QuadHomographyMaxScale = input.ReadFloat(); + break; + } + case 317: { + QuadHomographyMaxRotation = input.ReadFloat(); + break; + } + case 322: { + if (cameraIntrinsics_ == null) { + CameraIntrinsics = new global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics(); + } + input.ReadMessage(CameraIntrinsics); + break; + } + case 328: { + ForcedPnpTracking = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IrlsIterations = input.ReadInt32(); + break; + } + case 21: { + SpatialSigma = input.ReadFloat(); + break; + } + case 29: { + MinMotionSigma = input.ReadFloat(); + break; + } + case 37: { + RelativeMotionSigma = input.ReadFloat(); + break; + } + case 53: { + MotionDisparityLowLevel = input.ReadFloat(); + break; + } + case 61: { + MotionDisparityHighLevel = input.ReadFloat(); + break; + } + case 69: { + DisparityDecay = input.ReadFloat(); + break; + } + case 77: { + MotionPriorWeight = input.ReadFloat(); + break; + } + case 85: { + BackgroundDiscriminationLowLevel = input.ReadFloat(); + break; + } + case 93: { + BackgroundDiscriminationHighLevel = input.ReadFloat(); + break; + } + case 101: { + InlierCenterRelativeDistance = input.ReadFloat(); + break; + } + case 109: { + InlierSpringForce = input.ReadFloat(); + break; + } + case 117: { + KineticCenterRelativeDistance = input.ReadFloat(); + break; + } + case 125: { + KineticSpringForce = input.ReadFloat(); + break; + } + case 133: { + VelocityUpdateWeight = input.ReadFloat(); + break; + } + case 136: { + MaxTrackFailures = input.ReadInt32(); + break; + } + case 149: { + ExpansionSize = input.ReadFloat(); + break; + } + case 157: { + InlierLowWeight = input.ReadFloat(); + break; + } + case 165: { + InlierHighWeight = input.ReadFloat(); + break; + } + case 173: { + KineticSpringForceMinKineticEnergy = input.ReadFloat(); + break; + } + case 181: { + KineticEnergyDecay = input.ReadFloat(); + break; + } + case 189: { + PriorWeightIncrease = input.ReadFloat(); + break; + } + case 197: { + LowKineticEnergy = input.ReadFloat(); + break; + } + case 205: { + HighKineticEnergy = input.ReadFloat(); + break; + } + case 208: { + ReturnInternalState = input.ReadBool(); + break; + } + case 216: { + ComputeSpatialPrior = input.ReadBool(); + break; + } + case 224: { + TrackingDegrees = (global::Mediapipe.TrackStepOptions.Types.TrackingDegrees) input.ReadEnum(); + break; + } + case 232: { + UsePostEstimationWeightsForState = input.ReadBool(); + break; + } + case 242: { + if (irlsInitialization_ == null) { + IrlsInitialization = new global::Mediapipe.TrackStepOptions.Types.IrlsInitialization(); + } + input.ReadMessage(IrlsInitialization); + break; + } + case 256: { + TrackObjectAndCamera = input.ReadBool(); + break; + } + case 269: { + StaticMotionTemporalRatio = input.ReadFloat(); + break; + } + case 274: { + if (cancelTrackingWithOcclusionOptions_ == null) { + CancelTrackingWithOcclusionOptions = new global::Mediapipe.TrackStepOptions.Types.CancelTrackingWithOcclusionOptions(); + } + input.ReadMessage(CancelTrackingWithOcclusionOptions); + break; + } + case 280: { + ObjectSimilarityMinContdInliers = input.ReadInt32(); + break; + } + case 293: { + BoxSimilarityMaxScale = input.ReadFloat(); + break; + } + case 301: { + BoxSimilarityMaxRotation = input.ReadFloat(); + break; + } + case 309: { + QuadHomographyMaxScale = input.ReadFloat(); + break; + } + case 317: { + QuadHomographyMaxRotation = input.ReadFloat(); + break; + } + case 322: { + if (cameraIntrinsics_ == null) { + CameraIntrinsics = new global::Mediapipe.TrackStepOptions.Types.CameraIntrinsics(); + } + input.ReadMessage(CameraIntrinsics); + break; + } + case 328: { + ForcedPnpTracking = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TrackStepOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Degrees of freedom being used for tracking. By default tracker only uses + /// translation. Additionally scale and rotation from the camera motion + /// and / or object motion can be taken into account. + /// + public enum TrackingDegrees { + [pbr::OriginalName("TRACKING_DEGREE_TRANSLATION")] TrackingDegreeTranslation = 0, + /// + /// Additional tracking degrees according to camera motion. + /// + [pbr::OriginalName("TRACKING_DEGREE_CAMERA_SCALE")] TrackingDegreeCameraScale = 1, + [pbr::OriginalName("TRACKING_DEGREE_CAMERA_ROTATION")] TrackingDegreeCameraRotation = 2, + [pbr::OriginalName("TRACKING_DEGREE_CAMERA_ROTATION_SCALE")] TrackingDegreeCameraRotationScale = 3, + /// + /// TODO: Implement! + /// + [pbr::OriginalName("TRACKING_DEGREE_CAMERA_PERSPECTIVE")] TrackingDegreeCameraPerspective = 4, + /// + /// Tracking degrees modeling object motion. Note that additional + /// object degrees of freedom are only applied when estimation is deemed + /// stable, in particular sufficient inliers are present. + /// By default, does NOT apply camera motion. If that is desired set + /// the flag: track_object_and_camera to true. + /// + [pbr::OriginalName("TRACKING_DEGREE_OBJECT_SCALE")] TrackingDegreeObjectScale = 5, + [pbr::OriginalName("TRACKING_DEGREE_OBJECT_ROTATION")] TrackingDegreeObjectRotation = 6, + [pbr::OriginalName("TRACKING_DEGREE_OBJECT_ROTATION_SCALE")] TrackingDegreeObjectRotationScale = 7, + [pbr::OriginalName("TRACKING_DEGREE_OBJECT_PERSPECTIVE")] TrackingDegreeObjectPerspective = 8, + } + + /// + /// Irls initialization by performing several rounds of RANSAC to preselect + /// features for motion estimation scoring outliers low and inliers to be at + /// least of median inlier weight. + /// + public sealed partial class IrlsInitialization : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IrlsInitialization()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackStepOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsInitialization() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsInitialization(IrlsInitialization other) : this() { + _hasBits0 = other._hasBits0; + activated_ = other.activated_; + rounds_ = other.rounds_; + cutoff_ = other.cutoff_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public IrlsInitialization Clone() { + return new IrlsInitialization(this); + } + + /// Field number for the "activated" field. + public const int ActivatedFieldNumber = 1; + private readonly static bool ActivatedDefaultValue = false; + + private bool activated_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Activated { + get { if ((_hasBits0 & 1) != 0) { return activated_; } else { return ActivatedDefaultValue; } } + set { + _hasBits0 |= 1; + activated_ = value; + } + } + /// Gets whether the "activated" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivated { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "activated" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivated() { + _hasBits0 &= ~1; + } + + /// Field number for the "rounds" field. + public const int RoundsFieldNumber = 2; + private readonly static int RoundsDefaultValue = 50; + + private int rounds_; + /// + /// Rounds of RANSAC. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Rounds { + get { if ((_hasBits0 & 2) != 0) { return rounds_; } else { return RoundsDefaultValue; } } + set { + _hasBits0 |= 2; + rounds_ = value; + } + } + /// Gets whether the "rounds" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasRounds { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "rounds" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearRounds() { + _hasBits0 &= ~2; + } + + /// Field number for the "cutoff" field. + public const int CutoffFieldNumber = 3; + private readonly static float CutoffDefaultValue = 0.005F; + + private float cutoff_; + /// + /// Normalized cutoff threshold for a vector to be considered an inlier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Cutoff { + get { if ((_hasBits0 & 4) != 0) { return cutoff_; } else { return CutoffDefaultValue; } } + set { + _hasBits0 |= 4; + cutoff_ = value; + } + } + /// Gets whether the "cutoff" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCutoff { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "cutoff" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCutoff() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as IrlsInitialization); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(IrlsInitialization other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Activated != other.Activated) return false; + if (Rounds != other.Rounds) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Cutoff, other.Cutoff)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasActivated) hash ^= Activated.GetHashCode(); + if (HasRounds) hash ^= Rounds.GetHashCode(); + if (HasCutoff) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Cutoff); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasRounds) { + output.WriteRawTag(16); + output.WriteInt32(Rounds); + } + if (HasCutoff) { + output.WriteRawTag(29); + output.WriteFloat(Cutoff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasRounds) { + output.WriteRawTag(16); + output.WriteInt32(Rounds); + } + if (HasCutoff) { + output.WriteRawTag(29); + output.WriteFloat(Cutoff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasActivated) { + size += 1 + 1; + } + if (HasRounds) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Rounds); + } + if (HasCutoff) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(IrlsInitialization other) { + if (other == null) { + return; + } + if (other.HasActivated) { + Activated = other.Activated; + } + if (other.HasRounds) { + Rounds = other.Rounds; + } + if (other.HasCutoff) { + Cutoff = other.Cutoff; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 16: { + Rounds = input.ReadInt32(); + break; + } + case 29: { + Cutoff = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 16: { + Rounds = input.ReadInt32(); + break; + } + case 29: { + Cutoff = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Different control parameters to terminate tracking when + /// occlusion occurs. + /// + public sealed partial class CancelTrackingWithOcclusionOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CancelTrackingWithOcclusionOptions()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackStepOptions.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CancelTrackingWithOcclusionOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CancelTrackingWithOcclusionOptions(CancelTrackingWithOcclusionOptions other) : this() { + _hasBits0 = other._hasBits0; + activated_ = other.activated_; + minMotionContinuity_ = other.minMotionContinuity_; + minInlierRatio_ = other.minInlierRatio_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CancelTrackingWithOcclusionOptions Clone() { + return new CancelTrackingWithOcclusionOptions(this); + } + + /// Field number for the "activated" field. + public const int ActivatedFieldNumber = 1; + private readonly static bool ActivatedDefaultValue = false; + + private bool activated_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Activated { + get { if ((_hasBits0 & 1) != 0) { return activated_; } else { return ActivatedDefaultValue; } } + set { + _hasBits0 |= 1; + activated_ = value; + } + } + /// Gets whether the "activated" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasActivated { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "activated" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearActivated() { + _hasBits0 &= ~1; + } + + /// Field number for the "min_motion_continuity" field. + public const int MinMotionContinuityFieldNumber = 2; + private readonly static float MinMotionContinuityDefaultValue = 0.4F; + + private float minMotionContinuity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinMotionContinuity { + get { if ((_hasBits0 & 2) != 0) { return minMotionContinuity_; } else { return MinMotionContinuityDefaultValue; } } + set { + _hasBits0 |= 2; + minMotionContinuity_ = value; + } + } + /// Gets whether the "min_motion_continuity" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinMotionContinuity { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "min_motion_continuity" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinMotionContinuity() { + _hasBits0 &= ~2; + } + + /// Field number for the "min_inlier_ratio" field. + public const int MinInlierRatioFieldNumber = 3; + private readonly static float MinInlierRatioDefaultValue = 0.1F; + + private float minInlierRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float MinInlierRatio { + get { if ((_hasBits0 & 4) != 0) { return minInlierRatio_; } else { return MinInlierRatioDefaultValue; } } + set { + _hasBits0 |= 4; + minInlierRatio_ = value; + } + } + /// Gets whether the "min_inlier_ratio" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMinInlierRatio { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "min_inlier_ratio" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMinInlierRatio() { + _hasBits0 &= ~4; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CancelTrackingWithOcclusionOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CancelTrackingWithOcclusionOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Activated != other.Activated) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinMotionContinuity, other.MinMotionContinuity)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinInlierRatio, other.MinInlierRatio)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasActivated) hash ^= Activated.GetHashCode(); + if (HasMinMotionContinuity) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinMotionContinuity); + if (HasMinInlierRatio) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinInlierRatio); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasMinMotionContinuity) { + output.WriteRawTag(21); + output.WriteFloat(MinMotionContinuity); + } + if (HasMinInlierRatio) { + output.WriteRawTag(29); + output.WriteFloat(MinInlierRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasActivated) { + output.WriteRawTag(8); + output.WriteBool(Activated); + } + if (HasMinMotionContinuity) { + output.WriteRawTag(21); + output.WriteFloat(MinMotionContinuity); + } + if (HasMinInlierRatio) { + output.WriteRawTag(29); + output.WriteFloat(MinInlierRatio); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasActivated) { + size += 1 + 1; + } + if (HasMinMotionContinuity) { + size += 1 + 4; + } + if (HasMinInlierRatio) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CancelTrackingWithOcclusionOptions other) { + if (other == null) { + return; + } + if (other.HasActivated) { + Activated = other.Activated; + } + if (other.HasMinMotionContinuity) { + MinMotionContinuity = other.MinMotionContinuity; + } + if (other.HasMinInlierRatio) { + MinInlierRatio = other.MinInlierRatio; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 21: { + MinMotionContinuity = input.ReadFloat(); + break; + } + case 29: { + MinInlierRatio = input.ReadFloat(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Activated = input.ReadBool(); + break; + } + case 21: { + MinMotionContinuity = input.ReadFloat(); + break; + } + case 29: { + MinInlierRatio = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// Pre-calibrated camera intrinsics parameters, including focal length, center + /// point, distortion coefficients (only 3 radial factors) and image width / + /// height. The image formation model is described here: + /// https://docs.opencv.org/2.4/doc/tutorials/calib3d/camera_calibration/camera_calibration.html + /// Only used for quad tracking mode. Leave it empty if unknown. + /// + public sealed partial class CameraIntrinsics : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CameraIntrinsics()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Mediapipe.TrackStepOptions.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraIntrinsics() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraIntrinsics(CameraIntrinsics other) : this() { + _hasBits0 = other._hasBits0; + fx_ = other.fx_; + fy_ = other.fy_; + cx_ = other.cx_; + cy_ = other.cy_; + k0_ = other.k0_; + k1_ = other.k1_; + k2_ = other.k2_; + w_ = other.w_; + h_ = other.h_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CameraIntrinsics Clone() { + return new CameraIntrinsics(this); + } + + /// Field number for the "fx" field. + public const int FxFieldNumber = 1; + private readonly static float FxDefaultValue = 0F; + + private float fx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Fx { + get { if ((_hasBits0 & 1) != 0) { return fx_; } else { return FxDefaultValue; } } + set { + _hasBits0 |= 1; + fx_ = value; + } + } + /// Gets whether the "fx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFx { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "fx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFx() { + _hasBits0 &= ~1; + } + + /// Field number for the "fy" field. + public const int FyFieldNumber = 2; + private readonly static float FyDefaultValue = 0F; + + private float fy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Fy { + get { if ((_hasBits0 & 2) != 0) { return fy_; } else { return FyDefaultValue; } } + set { + _hasBits0 |= 2; + fy_ = value; + } + } + /// Gets whether the "fy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFy { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "fy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFy() { + _hasBits0 &= ~2; + } + + /// Field number for the "cx" field. + public const int CxFieldNumber = 3; + private readonly static float CxDefaultValue = 0F; + + private float cx_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Cx { + get { if ((_hasBits0 & 4) != 0) { return cx_; } else { return CxDefaultValue; } } + set { + _hasBits0 |= 4; + cx_ = value; + } + } + /// Gets whether the "cx" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCx { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "cx" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCx() { + _hasBits0 &= ~4; + } + + /// Field number for the "cy" field. + public const int CyFieldNumber = 4; + private readonly static float CyDefaultValue = 0F; + + private float cy_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Cy { + get { if ((_hasBits0 & 8) != 0) { return cy_; } else { return CyDefaultValue; } } + set { + _hasBits0 |= 8; + cy_ = value; + } + } + /// Gets whether the "cy" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasCy { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "cy" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearCy() { + _hasBits0 &= ~8; + } + + /// Field number for the "k0" field. + public const int K0FieldNumber = 5; + private readonly static float K0DefaultValue = 0F; + + private float k0_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float K0 { + get { if ((_hasBits0 & 16) != 0) { return k0_; } else { return K0DefaultValue; } } + set { + _hasBits0 |= 16; + k0_ = value; + } + } + /// Gets whether the "k0" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasK0 { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "k0" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearK0() { + _hasBits0 &= ~16; + } + + /// Field number for the "k1" field. + public const int K1FieldNumber = 6; + private readonly static float K1DefaultValue = 0F; + + private float k1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float K1 { + get { if ((_hasBits0 & 32) != 0) { return k1_; } else { return K1DefaultValue; } } + set { + _hasBits0 |= 32; + k1_ = value; + } + } + /// Gets whether the "k1" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasK1 { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "k1" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearK1() { + _hasBits0 &= ~32; + } + + /// Field number for the "k2" field. + public const int K2FieldNumber = 7; + private readonly static float K2DefaultValue = 0F; + + private float k2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float K2 { + get { if ((_hasBits0 & 64) != 0) { return k2_; } else { return K2DefaultValue; } } + set { + _hasBits0 |= 64; + k2_ = value; + } + } + /// Gets whether the "k2" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasK2 { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "k2" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearK2() { + _hasBits0 &= ~64; + } + + /// Field number for the "w" field. + public const int WFieldNumber = 8; + private readonly static int WDefaultValue = 0; + + private int w_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int W { + get { if ((_hasBits0 & 128) != 0) { return w_; } else { return WDefaultValue; } } + set { + _hasBits0 |= 128; + w_ = value; + } + } + /// Gets whether the "w" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasW { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "w" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearW() { + _hasBits0 &= ~128; + } + + /// Field number for the "h" field. + public const int HFieldNumber = 9; + private readonly static int HDefaultValue = 0; + + private int h_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int H { + get { if ((_hasBits0 & 256) != 0) { return h_; } else { return HDefaultValue; } } + set { + _hasBits0 |= 256; + h_ = value; + } + } + /// Gets whether the "h" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasH { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "h" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearH() { + _hasBits0 &= ~256; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CameraIntrinsics); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CameraIntrinsics other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Fx, other.Fx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Fy, other.Fy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Cx, other.Cx)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Cy, other.Cy)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(K0, other.K0)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(K1, other.K1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(K2, other.K2)) return false; + if (W != other.W) return false; + if (H != other.H) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasFx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Fx); + if (HasFy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Fy); + if (HasCx) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Cx); + if (HasCy) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Cy); + if (HasK0) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(K0); + if (HasK1) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(K1); + if (HasK2) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(K2); + if (HasW) hash ^= W.GetHashCode(); + if (HasH) hash ^= H.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFx) { + output.WriteRawTag(13); + output.WriteFloat(Fx); + } + if (HasFy) { + output.WriteRawTag(21); + output.WriteFloat(Fy); + } + if (HasCx) { + output.WriteRawTag(29); + output.WriteFloat(Cx); + } + if (HasCy) { + output.WriteRawTag(37); + output.WriteFloat(Cy); + } + if (HasK0) { + output.WriteRawTag(45); + output.WriteFloat(K0); + } + if (HasK1) { + output.WriteRawTag(53); + output.WriteFloat(K1); + } + if (HasK2) { + output.WriteRawTag(61); + output.WriteFloat(K2); + } + if (HasW) { + output.WriteRawTag(64); + output.WriteInt32(W); + } + if (HasH) { + output.WriteRawTag(72); + output.WriteInt32(H); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFx) { + output.WriteRawTag(13); + output.WriteFloat(Fx); + } + if (HasFy) { + output.WriteRawTag(21); + output.WriteFloat(Fy); + } + if (HasCx) { + output.WriteRawTag(29); + output.WriteFloat(Cx); + } + if (HasCy) { + output.WriteRawTag(37); + output.WriteFloat(Cy); + } + if (HasK0) { + output.WriteRawTag(45); + output.WriteFloat(K0); + } + if (HasK1) { + output.WriteRawTag(53); + output.WriteFloat(K1); + } + if (HasK2) { + output.WriteRawTag(61); + output.WriteFloat(K2); + } + if (HasW) { + output.WriteRawTag(64); + output.WriteInt32(W); + } + if (HasH) { + output.WriteRawTag(72); + output.WriteInt32(H); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasFx) { + size += 1 + 4; + } + if (HasFy) { + size += 1 + 4; + } + if (HasCx) { + size += 1 + 4; + } + if (HasCy) { + size += 1 + 4; + } + if (HasK0) { + size += 1 + 4; + } + if (HasK1) { + size += 1 + 4; + } + if (HasK2) { + size += 1 + 4; + } + if (HasW) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(W); + } + if (HasH) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(H); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CameraIntrinsics other) { + if (other == null) { + return; + } + if (other.HasFx) { + Fx = other.Fx; + } + if (other.HasFy) { + Fy = other.Fy; + } + if (other.HasCx) { + Cx = other.Cx; + } + if (other.HasCy) { + Cy = other.Cy; + } + if (other.HasK0) { + K0 = other.K0; + } + if (other.HasK1) { + K1 = other.K1; + } + if (other.HasK2) { + K2 = other.K2; + } + if (other.HasW) { + W = other.W; + } + if (other.HasH) { + H = other.H; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Fx = input.ReadFloat(); + break; + } + case 21: { + Fy = input.ReadFloat(); + break; + } + case 29: { + Cx = input.ReadFloat(); + break; + } + case 37: { + Cy = input.ReadFloat(); + break; + } + case 45: { + K0 = input.ReadFloat(); + break; + } + case 53: { + K1 = input.ReadFloat(); + break; + } + case 61: { + K2 = input.ReadFloat(); + break; + } + case 64: { + W = input.ReadInt32(); + break; + } + case 72: { + H = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Fx = input.ReadFloat(); + break; + } + case 21: { + Fy = input.ReadFloat(); + break; + } + case 29: { + Cx = input.ReadFloat(); + break; + } + case 37: { + Cy = input.ReadFloat(); + break; + } + case 45: { + K0 = input.ReadFloat(); + break; + } + case 53: { + K1 = input.ReadFloat(); + break; + } + case 61: { + K2 = input.ReadFloat(); + break; + } + case 64: { + W = input.ReadInt32(); + break; + } + case 72: { + H = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs.meta new file mode 100644 index 0000000..e94dcfa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Util/Tracking.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30aa544fc4fc6db88905e209f7446f0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity.meta new file mode 100644 index 0000000..0d42e6c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 194306ef2316bde4a9e9608de4715ed1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation.meta new file mode 100644 index 0000000..7998680 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e803487d9a067d4fbe25e4b2b884643 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs new file mode 100644 index 0000000..99803e3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs @@ -0,0 +1,110 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ + /// + /// This class draws annotations on the screen which is the parent of the attached .
+ /// That is, it's used like this.
+ /// 1. Select a GameObject where you'd like to draw annotations.
+ /// 2. Create an empty child GameObject (let's say AnnotationLayer) directly under it.
+ /// 3. Attach to AnnotationLayer.
+ /// 4. Create an empty child GameObject (let's say RootAnnotation) directly under AnnotationLayer.
+ /// 5. Attach to RootAnnotation.
+ ///
+ /// + /// Note that this class can be accessed from a thread other than main thread. + /// Extended classes must be implemented to work in such a situation, since Unity APIs won't work in other threads. + /// + public abstract class AnnotationController : MonoBehaviour where T : HierarchicalAnnotation + { + [SerializeField] protected T annotation; + protected bool isStale = false; + + public bool isMirrored + { + get => annotation.isMirrored; + set + { + if (annotation.isMirrored != value) + { + annotation.isMirrored = value; + } + } + } + + public RotationAngle rotationAngle + { + get => annotation.rotationAngle; + set + { + if (annotation.rotationAngle != value) + { + annotation.rotationAngle = value; + } + } + } + + protected virtual void Start() + { + if (!TryGetComponent(out var _)) + { + Logger.LogVerbose(GetType().Name, $"Adding RectTransform to {gameObject.name}"); + var rectTransform = gameObject.AddComponent(); + // stretch width and height by default + rectTransform.pivot = new Vector2(0.5f, 0.5f); + rectTransform.anchorMin = Vector2.zero; + rectTransform.anchorMax = Vector2.one; + rectTransform.anchoredPosition3D = Vector3.zero; + rectTransform.sizeDelta = Vector2.zero; + } + } + + protected virtual void LateUpdate() + { + if (isStale) + { + SyncNow(); + } + } + + protected virtual void OnDestroy() + { + if (annotation != null) + { + Destroy(annotation); + annotation = null; + } + isStale = false; + } + + /// + /// Draw annotations in current thread. + /// This method must set to false. + /// + /// + /// This method can only be called from main thread. + /// + protected abstract void SyncNow(); + + protected void UpdateCurrentTarget(TValue newTarget, ref TValue currentTarget) + { + if (IsTargetChanged(newTarget, currentTarget)) + { + currentTarget = newTarget; + isStale = true; + } + } + + protected bool IsTargetChanged(TValue newTarget, TValue currentTarget) + { + // It's assumed that target has not changed iff previous target and new target are both null. + return currentTarget != null || newTarget != null; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs.meta new file mode 100644 index 0000000..7b65e07 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f1980da4d69e05869d4a1cdac8f4ced +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs new file mode 100644 index 0000000..9cd240a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs @@ -0,0 +1,153 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class Arrow : MonoBehaviour + { + [SerializeField] private Color _color = Color.white; + [SerializeField] private Vector3 _direction = Vector3.right; + [SerializeField] private float _magnitude = 0.0f; + [SerializeField] private float _capScale = 1.0f; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + + private void Start() + { + ApplyColor(color); + ApplyDirection(_direction); + ApplyCapScale(_capScale); + ApplyLineWidth(_lineWidth); + ApplyMagnitude(_magnitude); // magnitude must be set after _capScale + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyDirection(_direction); + ApplyCapScale(_capScale); + ApplyLineWidth(_lineWidth); + ApplyMagnitude(_magnitude); // magnitude must be set after _capScale + } + } +#endif + + private Transform _cone; + private Transform cone + { + get + { + if (_cone == null) + { + _cone = transform.Find("Cone"); + } + return _cone; + } + } + + private LineRenderer lineRenderer => gameObject.GetComponent(); + + public Vector3 direction + { + get => _direction; + set + { + _direction = value.normalized; + ApplyDirection(_direction); + } + } + + public float magnitude + { + get => _magnitude; + set + { + if (value < 0) + { + throw new ArgumentException("Magnitude must be positive"); + } + _magnitude = value; + ApplyMagnitude(value); + } + } + + public Color color + { + get => _color; + set + { + _color = value; + ApplyColor(value); + } + } + + public void SetVector(Vector3 v) + { + direction = v; + magnitude = v.magnitude; + } + + public void SetCapScale(float capScale) + { + _capScale = capScale; + ApplyCapScale(_capScale); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(_lineWidth); + } + + private void ApplyColor(Color color) + { + lineRenderer.startColor = color; + lineRenderer.endColor = color; + cone.GetComponent().material.color = color; + } + + private void ApplyDirection(Vector3 direction) + { + lineRenderer.SetPosition(1, _magnitude * direction); + cone.localRotation = Quaternion.FromToRotation(Vector3.up, direction); + } + + private void ApplyMagnitude(float magnitude) + { + lineRenderer.SetPosition(1, magnitude * direction); + + if (magnitude == 0) + { + cone.localScale = Vector3.zero; + cone.localPosition = Vector3.zero; + } + else + { + ApplyCapScale(_capScale); + cone.localPosition = (cone.localScale.y + magnitude) * direction; // pivot is at the center of cone + } + } + + private void ApplyCapScale(float capScale) + { + cone.localScale = capScale * Vector3.one; + } + + private void ApplyLineWidth(float lineWidth) + { + lineRenderer.startWidth = lineWidth; + lineRenderer.endWidth = lineWidth; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs.meta new file mode 100644 index 0000000..b7196dc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Arrow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a793788ee98ea8ea3b28457e7dd7197d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs new file mode 100644 index 0000000..4caf9f7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class CircleAnnotation : HierarchicalAnnotation + { + [SerializeField] private LineRenderer _lineRenderer; + [SerializeField] private Color _color = Color.green; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + + private void OnEnable() + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + + private void OnDisable() + { + ApplyLineWidth(0.0f); + _lineRenderer.positionCount = 0; + _lineRenderer.SetPositions(new Vector3[] { }); + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + } +#endif + + public void SetColor(Color color) + { + _color = color; + ApplyColor(color); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(lineWidth); + } + + public void Draw(Vector3 center, float radius, int vertices = 128) + { + var start = new Vector3(radius, 0, 0); + var positions = new Vector3[vertices]; + + for (var i = 0; i < positions.Length; i++) + { + var q = Quaternion.Euler(0, 0, i * 360 / positions.Length); + positions[i] = (q * start) + center; + } + + _lineRenderer.positionCount = positions.Length; + _lineRenderer.SetPositions(positions); + } + + private void ApplyColor(Color color) + { + if (_lineRenderer != null) + { + _lineRenderer.startColor = color; + _lineRenderer.endColor = color; + } + } + + private void ApplyLineWidth(float lineWidth) + { + if (_lineRenderer != null) + { + _lineRenderer.startWidth = lineWidth; + _lineRenderer.endWidth = lineWidth; + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs.meta new file mode 100644 index 0000000..b6ae0a9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CircleAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98e622123dd1b9ac1a87d8609ce21d37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs new file mode 100644 index 0000000..e7fdfe0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + public class Connection + { + public readonly HierarchicalAnnotation start; + public readonly HierarchicalAnnotation end; + + public Connection(HierarchicalAnnotation start, HierarchicalAnnotation end) + { + this.start = start; + this.end = end; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs.meta new file mode 100644 index 0000000..87ba88c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/Connection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e71b609a71e6232a8043e02da04b2bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs new file mode 100644 index 0000000..d88e13f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs @@ -0,0 +1,41 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + public class ConnectionAnnotation : LineAnnotation + { + private Connection _currentTarget; + + public bool isEmpty => _currentTarget == null; + + public void Draw(Connection target) + { + _currentTarget = target; + + if (ActivateFor(_currentTarget)) + { + Draw(_currentTarget.start.gameObject, _currentTarget.end.gameObject); + } + } + + public void Redraw() + { + Draw(_currentTarget); + } + + protected bool ActivateFor(Connection target) + { + if (target == null || !target.start.isActiveInHierarchy || !target.end.isActiveInHierarchy) + { + SetActive(false); + return false; + } + SetActive(true); + return true; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs.meta new file mode 100644 index 0000000..3106453 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90aa7330426be071f9141dd20224e6cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs new file mode 100644 index 0000000..6029d50 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class ConnectionListAnnotation : ListAnnotation + { + [SerializeField] private Color _color = Color.red; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + } +#endif + + public void Fill(IList<(int, int)> connections, PointListAnnotation points) + { + Draw(connections.Select(pair => new Connection(points[pair.Item1], points[pair.Item2])).ToList()); + } + + public void SetColor(Color color) + { + _color = color; + ApplyColor(color); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(lineWidth); + } + + public void Draw(IList targets) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => { if (annotation != null) { annotation.Draw(target); } }); + } + } + + public void Redraw() + { + foreach (var connection in children) + { + if (connection != null) { connection.Redraw(); } + } + } + + protected override ConnectionAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetColor(_color); + annotation.SetLineWidth(_lineWidth); + return annotation; + } + + private void ApplyColor(Color color) + { + foreach (var line in children) + { + if (line != null) { line.SetColor(color); } + } + } + + private void ApplyLineWidth(float lineWidth) + { + foreach (var line in children) + { + if (line != null) { line.SetLineWidth(lineWidth); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs.meta new file mode 100644 index 0000000..f223680 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ConnectionListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 03e2158a34405b74280f0e793ae6d083 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 4824063073641375834, guid: ce6db8ad8200781fc9201c21237ce23b, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs new file mode 100644 index 0000000..2bf6252 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs @@ -0,0 +1,114 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class CuboidAnnotation : HierarchicalAnnotation + { + [SerializeField] private PointListAnnotation _pointListAnnotation; + [SerializeField] private ConnectionListAnnotation _lineListAnnotation; + [SerializeField] private TransformAnnotation _transformAnnotation; + [SerializeField] private float _arrowLengthScale = 1.0f; + + /// 3 ----------- 7 + /// /| /| + /// ../ | 0 / | + /// .4 ----------- 8 | + /// | 1 ---------|- 5 + /// | / | / + /// |/ |/ + /// 2 ----------- 6 + private readonly List<(int, int)> _connections = new List<(int, int)> { + (1, 2), + (3, 4), + (5, 6), + (7, 8), + (1, 3), + (2, 4), + (5, 7), + (6, 8), + (1, 5), + (2, 6), + (3, 7), + (4, 8), + }; + + public override bool isMirrored + { + set + { + _pointListAnnotation.isMirrored = value; + _lineListAnnotation.isMirrored = value; + _transformAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _pointListAnnotation.rotationAngle = value; + _lineListAnnotation.rotationAngle = value; + _transformAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + private void Start() + { + _pointListAnnotation.Fill(9); + _lineListAnnotation.Fill(_connections, _pointListAnnotation); + } + + public void SetPointColor(Color color) + { + _pointListAnnotation.SetColor(color); + } + + public void SetLineColor(Color color) + { + _lineListAnnotation.SetColor(color); + } + + public void SetLineWidth(float lineWidth) + { + _lineListAnnotation.SetLineWidth(lineWidth); + } + + public void SetArrowCapScale(float arrowCapScale) + { + _transformAnnotation.SetArrowCapScale(arrowCapScale); + } + + public void SetArrowLengthScale(float arrowLengthScale) + { + _arrowLengthScale = arrowLengthScale; + } + + public void SetArrowWidth(float arrowWidth) + { + _transformAnnotation.SetArrowWidth(arrowWidth); + } + + public void Draw(ObjectAnnotation target, Vector2 focalLength, Vector2 principalPoint, float zScale, bool visualizeZ = true) + { + if (ActivateFor(target)) + { + _pointListAnnotation.Draw(target.Keypoints, focalLength, principalPoint, zScale, visualizeZ); + _lineListAnnotation.Redraw(); + _transformAnnotation.Draw(target, _pointListAnnotation[0].transform.localPosition, _arrowLengthScale, visualizeZ); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs.meta new file mode 100644 index 0000000..5b27e62 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidAnnotation.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 6e88663936c139fb4971d8ab54a85a11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _pointListAnnotation: {instanceID: 0} + - _lineListAnnotation: {instanceID: 0} + - _transformAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs new file mode 100644 index 0000000..fdf5627 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs @@ -0,0 +1,152 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class CuboidListAnnotation : ListAnnotation + { + [SerializeField] private Color _pointColor = Color.green; + [SerializeField] private Color _lineColor = Color.red; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + [SerializeField] private float _arrowCapScale = 2.0f; + [SerializeField] private float _arrowLengthScale = 1.0f; + [SerializeField, Range(0, 1)] private float _arrowWidth = 1.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyPointColor(_pointColor); + ApplyLineColor(_lineColor); + ApplyLineWidth(_lineWidth); + ApplyArrowCapScale(_arrowCapScale); + ApplyArrowLengthScale(_arrowLengthScale); + ApplyArrowWidth(_arrowWidth); + } + } +#endif + + public void SetPointColor(Color pointColor) + { + _pointColor = pointColor; + ApplyPointColor(pointColor); + } + + public void SetLineColor(Color lineColor) + { + _lineColor = lineColor; + ApplyLineColor(lineColor); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(lineWidth); + } + + public void SetArrowCapScale(float arrowCapScale) + { + _arrowCapScale = arrowCapScale; + ApplyArrowCapScale(arrowCapScale); + } + + public void SetArrowLengthScale(float arrowLengthScale) + { + _arrowLengthScale = arrowLengthScale; + ApplyArrowLengthScale(arrowLengthScale); + } + + public void SetArrowWidth(float arrowWidth) + { + _arrowWidth = arrowWidth; + ApplyArrowWidth(arrowWidth); + } + + public void Draw(IList targets, Vector2 focalLength, Vector2 principalPoint, float scale, bool visualizeZ = true) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, focalLength, principalPoint, scale, visualizeZ); } + }); + } + } + + public void Draw(FrameAnnotation target, Vector2 focalLength, Vector2 principalPoint, float scale, bool visualizeZ = true) + { + Draw(target?.Annotations, focalLength, principalPoint, scale, visualizeZ); + } + + protected override CuboidAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetPointColor(_pointColor); + annotation.SetLineColor(_lineColor); + annotation.SetLineWidth(_lineWidth); + annotation.SetArrowCapScale(_arrowCapScale); + annotation.SetArrowLengthScale(_arrowLengthScale); + annotation.SetArrowWidth(_arrowWidth); + return annotation; + } + + private void ApplyPointColor(Color pointColor) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetPointColor(pointColor); } + } + } + + private void ApplyLineColor(Color lineColor) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetLineColor(lineColor); } + } + } + + private void ApplyLineWidth(float lineWidth) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetLineWidth(lineWidth); } + } + } + + private void ApplyArrowCapScale(float arrowCapScale) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetArrowCapScale(arrowCapScale); } + } + } + + private void ApplyArrowLengthScale(float arrowLengthScale) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetArrowLengthScale(arrowLengthScale); } + } + } + + private void ApplyArrowWidth(float arrowWidth) + { + foreach (var cuboid in children) + { + if (cuboid != null) { cuboid.SetArrowWidth(arrowWidth); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs.meta new file mode 100644 index 0000000..6c497f1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/CuboidListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 69c9a763206a6fa938324ba456924e67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 2519151911608524794, guid: 915f3c383a25ff9bd985b1394fc052de, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs new file mode 100644 index 0000000..2e24a66 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Mediapipe.Unity.CoordinateSystem; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class DetectionAnnotation : HierarchicalAnnotation + { + [SerializeField] private RectangleAnnotation _locationDataAnnotation; + [SerializeField] private PointListAnnotation _relativeKeypointsAnnotation; + [SerializeField] private LabelAnnotation _labelAnnotation; + + public override bool isMirrored + { + set + { + _locationDataAnnotation.isMirrored = value; + _relativeKeypointsAnnotation.isMirrored = value; + _labelAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _locationDataAnnotation.rotationAngle = value; + _relativeKeypointsAnnotation.rotationAngle = value; + _labelAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + public void SetLineWidth(float lineWidth) + { + _locationDataAnnotation.SetLineWidth(lineWidth); + } + + public void SetKeypointRadius(float radius) + { + _relativeKeypointsAnnotation.SetRadius(radius); + } + + /// + /// Score threshold. This value must be between 0 and 1. + /// This will affect the rectangle's color. For example, if the score is below the threshold, the rectangle will be transparent. + /// The default value is 0. + /// + public void Draw(Detection target, float threshold = 0.0f) + { + if (ActivateFor(target)) + { + var score = target.Score.Count > 0 ? target.Score[0] : 1.0f; + var color = GetColor(score, Mathf.Clamp(threshold, 0.0f, 1.0f)); + + // Assume that location data's format is always RelativeBoundingBox + // TODO: fix if there are cases where this assumption is not correct. + var rectVertices = GetScreenRect().GetRectVertices(target.LocationData.RelativeBoundingBox, rotationAngle, isMirrored); + _locationDataAnnotation.SetColor(GetColor(score, Mathf.Clamp(threshold, 0.0f, 1.0f))); + _locationDataAnnotation.Draw(rectVertices); + + var width = rectVertices[2].x - rectVertices[0].x; + var height = rectVertices[2].y - rectVertices[0].y; + var labelText = target.Label.Count > 0 ? target.Label[0] : null; + var vertexId = (((int)rotationAngle / 90) + 1) % 4; + var isInverted = ImageCoordinate.IsInverted(rotationAngle); + var (maxWidth, maxHeight) = isInverted ? (height, width) : (width, height); + _labelAnnotation.Draw(labelText, rectVertices[vertexId], color, maxWidth, maxHeight); + + _relativeKeypointsAnnotation.Draw(target.LocationData.RelativeKeypoints); + } + } + + private Color GetColor(float score, float threshold) + { + var t = (score - threshold) / (1 - threshold); + var h = Mathf.Lerp(90, 0, t) / 360; // from yellow-green to red + var color = Color.HSVToRGB(h, 1, 1); + + if (t < 0) + { + // below the threshold + color.a = 0.5f; + } + return color; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs.meta new file mode 100644 index 0000000..9d7572e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotation.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 6a82b9904ff34cc4fb66157217fe48a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _locationDataAnnotation: {instanceID: 0} + - _relativeKeypointsAnnotation: {instanceID: 0} + - _labelAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs new file mode 100644 index 0000000..9470e69 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs @@ -0,0 +1,34 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class DetectionAnnotationController : AnnotationController + { + [SerializeField, Range(0, 1)] private float _threshold = 0.0f; + + private Detection _currentTarget; + + public void DrawNow(Detection target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawLater(Detection target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _threshold); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs.meta new file mode 100644 index 0000000..0c58ceb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 275060fa7ac08c4128c0ea18c71b73dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 5404176935574894484, guid: 9e4308c3e97d26a388364cbe0ea8bfb4, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs new file mode 100644 index 0000000..39ad502 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public sealed class DetectionListAnnotation : ListAnnotation + { + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + [SerializeField] private float _keypointRadius = 15.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyLineWidth(_lineWidth); + ApplyKeypointRadius(_keypointRadius); + } + } +#endif + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(lineWidth); + } + + public void SetKeypointRadius(float keypointRadius) + { + _keypointRadius = keypointRadius; + ApplyKeypointRadius(keypointRadius); + } + + /// + /// Score threshold. This value must be between 0 and 1. + /// This will affect the rectangle's color. For example, if the score is below the threshold, the rectangle will be transparent. + /// The default value is 0. + /// + public void Draw(IList targets, float threshold = 0.0f) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, threshold); } + }); + } + } + + /// + /// Score threshold. This value must be between 0 and 1. + /// This will affect the rectangle's color. For example, if the score is below the threshold, the rectangle will be transparent. + /// The default value is 0. + /// + public void Draw(DetectionList target, float threshold = 0.0f) + { + Draw(target?.Detection, threshold); + } + + protected override DetectionAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetLineWidth(_lineWidth); + annotation.SetKeypointRadius(_keypointRadius); + return annotation; + } + + private void ApplyLineWidth(float lineWidth) + { + foreach (var detection in children) + { + if (detection != null) { detection.SetLineWidth(lineWidth); } + } + } + + private void ApplyKeypointRadius(float keypointRadius) + { + foreach (var detection in children) + { + if (detection != null) { detection.SetKeypointRadius(keypointRadius); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs.meta new file mode 100644 index 0000000..099aec7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d433cdb024dfd584696eeb11efb71102 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 5404176935574894484, guid: 9e4308c3e97d26a388364cbe0ea8bfb4, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs new file mode 100644 index 0000000..a741f57 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class DetectionListAnnotationController : AnnotationController + { + [SerializeField, Range(0, 1)] private float _threshold = 0.0f; + + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawNow(DetectionList target) + { + DrawNow(target?.Detection); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + public void DrawLater(DetectionList target) + { + DrawLater(target?.Detection); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _threshold); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs.meta new file mode 100644 index 0000000..a3470cb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/DetectionListAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8741257e98d0a1560b37e577decc0e2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 6320745076577806712, guid: 26114bc9cccb92454a468ea4d41f400a, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs new file mode 100644 index 0000000..fa4767e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs @@ -0,0 +1,217 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class FaceLandmarkListAnnotation : HierarchicalAnnotation + { + [SerializeField] private PointListAnnotation _landmarkListAnnotation; + [SerializeField] private ConnectionListAnnotation _connectionListAnnotation; + + private const int _LandmarkCount = 468; + private readonly List<(int, int)> _connections = new List<(int, int)> { + // Face Oval + (10, 338), + (338, 297), + (297, 332), + (332, 284), + (284, 251), + (251, 389), + (389, 356), + (356, 454), + (454, 323), + (323, 361), + (361, 288), + (288, 397), + (397, 365), + (365, 379), + (379, 378), + (378, 400), + (400, 377), + (377, 152), + (152, 148), + (148, 176), + (176, 149), + (149, 150), + (150, 136), + (136, 172), + (172, 58), + (58, 132), + (132, 93), + (93, 234), + (234, 127), + (127, 162), + (162, 21), + (21, 54), + (54, 103), + (103, 67), + (67, 109), + (109, 10), + // Left Eye + (33, 7), + (7, 163), + (163, 144), + (144, 145), + (145, 153), + (153, 154), + (154, 155), + (155, 133), + (33, 246), + (246, 161), + (161, 160), + (160, 159), + (159, 158), + (158, 157), + (157, 173), + (173, 133), + // Left Eyebrow + (46, 53), + (53, 52), + (52, 65), + (65, 55), + (70, 63), + (63, 105), + (105, 66), + (66, 107), + // Right Eye + (263, 249), + (249, 390), + (390, 373), + (373, 374), + (374, 380), + (380, 381), + (381, 382), + (382, 362), + (263, 466), + (466, 388), + (388, 387), + (387, 386), + (386, 385), + (385, 384), + (384, 398), + (398, 362), + // Right Eyebrow + (276, 283), + (283, 282), + (282, 295), + (295, 285), + (300, 293), + (293, 334), + (334, 296), + (296, 336), + // Lips (Inner) + (78, 95), + (95, 88), + (88, 178), + (178, 87), + (87, 14), + (14, 317), + (317, 402), + (402, 318), + (318, 324), + (324, 308), + (78, 191), + (191, 80), + (80, 81), + (81, 82), + (82, 13), + (13, 312), + (312, 311), + (311, 310), + (310, 415), + (415, 308), + // Lips (Outer) + (61, 146), + (146, 91), + (91, 181), + (181, 84), + (84, 17), + (17, 314), + (314, 405), + (405, 321), + (321, 375), + (375, 291), + (61, 185), + (185, 40), + (40, 39), + (39, 37), + (37, 0), + (0, 267), + (267, 269), + (269, 270), + (270, 409), + (409, 291), + }; + + public override bool isMirrored + { + set + { + _landmarkListAnnotation.isMirrored = value; + _connectionListAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _landmarkListAnnotation.rotationAngle = value; + _connectionListAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + private void Start() + { + _landmarkListAnnotation.Fill(_LandmarkCount); + _connectionListAnnotation.Fill(_connections, _landmarkListAnnotation); + } + + public void SetLandmarkColor(Color landmarkColor) + { + _landmarkListAnnotation.SetColor(landmarkColor); + } + + public void SetLandmarkRadius(float landmarkRadius) + { + _landmarkListAnnotation.SetRadius(landmarkRadius); + } + + public void SetConnectionColor(Color connectionColor) + { + _connectionListAnnotation.SetColor(connectionColor); + } + + public void SetConnectionWidth(float connectionWidth) + { + _connectionListAnnotation.SetLineWidth(connectionWidth); + } + + public void Draw(IList target, bool visualizeZ = false) + { + if (ActivateFor(target)) + { + _landmarkListAnnotation.Draw(target, visualizeZ); + // Draw explicitly because connection annotation's targets remain the same. + _connectionListAnnotation.Redraw(); + } + } + + public void Draw(NormalizedLandmarkList target, bool visualizeZ = false) + { + Draw(target?.Landmark, visualizeZ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..b8fc348 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1275dad009e98d9f490bd65e83f7eba5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _landmarkListAnnotation: {instanceID: 0} + - _connectionListAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs new file mode 100644 index 0000000..6d97356 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs @@ -0,0 +1,46 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class FaceLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + [SerializeField] private int _circleVertices = 128; + + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawNow(NormalizedLandmarkList target) + { + DrawNow(target?.Landmark); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + public void DrawLater(NormalizedLandmarkList target) + { + DrawLater(target?.Landmark); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _visualizeZ, _circleVertices); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..e3d833f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListAnnotationController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b1fe9c61c434938249e2c9d067a337a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs new file mode 100644 index 0000000..8edadd4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs @@ -0,0 +1,166 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class FaceLandmarkListWithIrisAnnotation : HierarchicalAnnotation + { + [SerializeField] private FaceLandmarkListAnnotation _faceLandmarkListAnnotation; + [SerializeField] private IrisLandmarkListAnnotation _leftIrisLandmarkListAnnotation; + [SerializeField] private IrisLandmarkListAnnotation _rightIrisLandmarkListAnnotation; + + private const int _FaceLandmarkCount = 468; + private const int _IrisLandmarkCount = 5; + + public override bool isMirrored + { + set + { + _faceLandmarkListAnnotation.isMirrored = value; + _leftIrisLandmarkListAnnotation.isMirrored = value; + _rightIrisLandmarkListAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _faceLandmarkListAnnotation.rotationAngle = value; + _leftIrisLandmarkListAnnotation.rotationAngle = value; + _rightIrisLandmarkListAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + public void SetFaceLandmarkColor(Color color) + { + _faceLandmarkListAnnotation.SetLandmarkColor(color); + } + + public void SetIrisLandmarkColor(Color color) + { + _leftIrisLandmarkListAnnotation.SetLandmarkColor(color); + _rightIrisLandmarkListAnnotation.SetLandmarkColor(color); + } + + public void SetFaceLandmarkRadius(float radius) + { + _faceLandmarkListAnnotation.SetLandmarkRadius(radius); + } + + public void SetIrisLandmarkRadius(float radius) + { + _leftIrisLandmarkListAnnotation.SetLandmarkRadius(radius); + _rightIrisLandmarkListAnnotation.SetLandmarkRadius(radius); + } + + public void SetFaceConnectionColor(Color color) + { + _faceLandmarkListAnnotation.SetConnectionColor(color); + } + + public void SetFaceConnectionWidth(float width) + { + _faceLandmarkListAnnotation.SetConnectionWidth(width); + } + + public void SetIrisCircleColor(Color color) + { + _leftIrisLandmarkListAnnotation.SetCircleColor(color); + _rightIrisLandmarkListAnnotation.SetCircleColor(color); + } + + public void SetIrisCircleWidth(float width) + { + _leftIrisLandmarkListAnnotation.SetCircleWidth(width); + _rightIrisLandmarkListAnnotation.SetCircleWidth(width); + } + + public void Draw(IList target, bool visualizeZ = false, int circleVertices = 128) + { + var (faceLandmarks, leftLandmarks, rightLandmarks) = PartitionLandmarkList(target); + DrawFaceLandmarkList(faceLandmarks, visualizeZ); + DrawLeftIrisLandmarkList(leftLandmarks, visualizeZ, circleVertices); + DrawRightIrisLandmarkList(rightLandmarks, visualizeZ, circleVertices); + } + + public void Draw(NormalizedLandmarkList target, bool visualizeZ = false, int circleVertices = 128) + { + Draw(target.Landmark, visualizeZ, circleVertices); + } + + public void DrawFaceLandmarkList(IList target, bool visualizeZ = false) + { + _faceLandmarkListAnnotation.Draw(target, visualizeZ); + } + + public void DrawLeftIrisLandmarkList(IList target, bool visualizeZ = false, int circleVertices = 128) + { + // does not deactivate if the target is null as long as face landmarks are present. + _leftIrisLandmarkListAnnotation.Draw(target, visualizeZ, circleVertices); + } + + public void DrawRightIrisLandmarkList(IList target, bool visualizeZ = false, int circleVertices = 128) + { + // does not deactivate if the target is null as long as face landmarks are present. + _rightIrisLandmarkListAnnotation.Draw(target, visualizeZ, circleVertices); + } + + private static (IList, IList, IList) PartitionLandmarkList(IList landmarks) + { + if (landmarks == null) + { + return (null, null, null); + } + + var enumerator = landmarks.GetEnumerator(); + var faceLandmarks = new List(_FaceLandmarkCount); + for (var i = 0; i < _FaceLandmarkCount; i++) + { + if (enumerator.MoveNext()) + { + faceLandmarks.Add(enumerator.Current); + } + } + if (faceLandmarks.Count < _FaceLandmarkCount) + { + return (null, null, null); + } + + var leftIrisLandmarks = new List(_IrisLandmarkCount); + for (var i = 0; i < _IrisLandmarkCount; i++) + { + if (enumerator.MoveNext()) + { + leftIrisLandmarks.Add(enumerator.Current); + } + } + if (leftIrisLandmarks.Count < _IrisLandmarkCount) + { + return (faceLandmarks, null, null); + } + + var rightIrisLandmarks = new List(_IrisLandmarkCount); + for (var i = 0; i < _IrisLandmarkCount; i++) + { + if (enumerator.MoveNext()) + { + rightIrisLandmarks.Add(enumerator.Current); + } + } + return rightIrisLandmarks.Count < _IrisLandmarkCount ? (faceLandmarks, leftIrisLandmarks, null) : (faceLandmarks, leftIrisLandmarks, rightIrisLandmarks); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs.meta new file mode 100644 index 0000000..742b7d2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e3266a44159f9c0f495c095447ca1e5f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _faceLandmarkListAnnotation: {instanceID: 0} + - _leftIrisLandmarkListAnnotation: {instanceID: 0} + - _rightIrisLandmarkListAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs new file mode 100644 index 0000000..f9d63d9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class FrameAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = true; + [SerializeField] private float _translateZ = -10.0f; + [SerializeField] private float _scaleZ = 1.0f; + + [HideInInspector] public Vector2 focalLength = Vector2.zero; + [HideInInspector] public Vector2 principalPoint = Vector2.zero; + + private FrameAnnotation _currentTarget; + + protected override void Start() + { + base.Start(); + ApplyTranslateZ(_translateZ); + } + + private void OnValidate() + { + ApplyTranslateZ(_translateZ); + } + + public void DrawNow(FrameAnnotation target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawLater(FrameAnnotation target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, focalLength, principalPoint, _scaleZ, _visualizeZ); + } + + private void ApplyTranslateZ(float translateZ) + { + annotation.transform.localPosition = _visualizeZ ? new Vector3(0, 0, translateZ) : Vector3.zero; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs.meta new file mode 100644 index 0000000..4beabae --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FrameAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ec6e7b1749fd598a93275c583e1ceb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs new file mode 100644 index 0000000..5145a39 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs @@ -0,0 +1,152 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class HandLandmarkListAnnotation : HierarchicalAnnotation + { + [SerializeField] private PointListAnnotation _landmarkListAnnotation; + [SerializeField] private ConnectionListAnnotation _connectionListAnnotation; + [SerializeField] private Color _leftLandmarkColor = Color.green; + [SerializeField] private Color _rightLandmarkColor = Color.green; + + public enum Hand + { + Left, + Right, + } + + private const int _LandmarkCount = 21; + private readonly List<(int, int)> _connections = new List<(int, int)> { + (0, 1), + (1, 2), + (2, 3), + (3, 4), + (0, 5), + (5, 9), + (9, 13), + (13, 17), + (0, 17), + (5, 6), + (6, 7), + (7, 8), + (9, 10), + (10, 11), + (11, 12), + (13, 14), + (14, 15), + (15, 16), + (17, 18), + (18, 19), + (19, 20), + }; + + public override bool isMirrored + { + set + { + _landmarkListAnnotation.isMirrored = value; + _connectionListAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _landmarkListAnnotation.rotationAngle = value; + _connectionListAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + public PointAnnotation this[int index] => _landmarkListAnnotation[index]; + + private void Start() + { + _landmarkListAnnotation.Fill(_LandmarkCount); + _connectionListAnnotation.Fill(_connections, _landmarkListAnnotation); + } + + public void SetLeftLandmarkColor(Color leftLandmarkColor) + { + _leftLandmarkColor = leftLandmarkColor; + } + + public void SetRightLandmarkColor(Color rightLandmarkColor) + { + _rightLandmarkColor = rightLandmarkColor; + } + + public void SetLandmarkRadius(float landmarkRadius) + { + _landmarkListAnnotation.SetRadius(landmarkRadius); + } + + public void SetConnectionColor(Color connectionColor) + { + _connectionListAnnotation.SetColor(connectionColor); + } + + public void SetConnectionWidth(float connectionWidth) + { + _connectionListAnnotation.SetLineWidth(connectionWidth); + } + + public void SetHandedness(Hand handedness) + { + if (handedness == Hand.Left) + { + _landmarkListAnnotation.SetColor(_leftLandmarkColor); + } + else if (handedness == Hand.Right) + { + _landmarkListAnnotation.SetColor(_rightLandmarkColor); + } + } + + public void SetHandedness(IList handedness) + { + if (handedness == null || handedness.Count == 0 || handedness[0].Label == "Left") + { + SetHandedness(Hand.Left); + } + else if (handedness[0].Label == "Right") + { + SetHandedness(Hand.Right); + } + // ignore unknown label + } + + public void SetHandedness(ClassificationList handedness) + { + SetHandedness(handedness.Classification); + } + + public void Draw(IList target, bool visualizeZ = false) + { + if (ActivateFor(target)) + { + _landmarkListAnnotation.Draw(target, visualizeZ); + // Draw explicitly because connection annotation's targets remain the same. + _connectionListAnnotation.Redraw(); + } + } + + public void Draw(NormalizedLandmarkList target, bool visualizeZ = false) + { + Draw(target?.Landmark, visualizeZ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..33691ee --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HandLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: febd88b13c7a8e91b855c9dd35dd65d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _landmarkListAnnotation: {instanceID: 0} + - _connectionListAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs new file mode 100644 index 0000000..c3a8d62 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs @@ -0,0 +1,96 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ + public interface IHierachicalAnnotation + { + IHierachicalAnnotation root { get; } + Transform transform { get; } + RectTransform GetAnnotationLayer(); + UnityEngine.Rect GetScreenRect(); + } + + public abstract class HierarchicalAnnotation : MonoBehaviour, IHierachicalAnnotation + { + private IHierachicalAnnotation _root; + public IHierachicalAnnotation root + { + get + { + if (_root == null) + { + var parentObj = transform.parent == null ? null : transform.parent.gameObject; + _root = (parentObj != null && parentObj.TryGetComponent(out var parent)) ? parent.root : this; + } + return _root; + } + protected set => _root = value; + } + + public RectTransform GetAnnotationLayer() + { + return root.transform.parent.gameObject.GetComponent(); + } + + public UnityEngine.Rect GetScreenRect() + { + return GetAnnotationLayer().rect; + } + + public bool isActive => gameObject.activeSelf; + public bool isActiveInHierarchy => gameObject.activeInHierarchy; + + public void SetActive(bool isActive) + { + if (this.isActive != isActive) + { + gameObject.SetActive(isActive); + } + } + + /// + /// Prepare to annotate . + /// If is not null, it activates itself. + /// + /// + /// If it is activated and can be drawn. + /// In effect, it returns if is null or not. + /// + /// Data to be annotated + protected bool ActivateFor(T target) + { + if (target == null) + { + SetActive(false); + return false; + } + SetActive(true); + return true; + } + + public virtual bool isMirrored { get; set; } + public virtual RotationAngle rotationAngle { get; set; } = RotationAngle.Rotation0; + + protected TAnnotation InstantiateChild(GameObject prefab) where TAnnotation : HierarchicalAnnotation + { + var annotation = Instantiate(prefab, transform).GetComponent(); + annotation.isMirrored = isMirrored; + annotation.rotationAngle = rotationAngle; + return annotation; + } + + protected TAnnotation InstantiateChild(string name = "Game Object") where TAnnotation : HierarchicalAnnotation + { + var gameObject = new GameObject(name); + gameObject.transform.SetParent(transform); + + return gameObject.AddComponent(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs.meta new file mode 100644 index 0000000..9f3fdb4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HierarchicalAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 167652b13248a643192ac447671499d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs new file mode 100644 index 0000000..9925da8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs @@ -0,0 +1,104 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public sealed class HolisticLandmarkListAnnotation : HierarchicalAnnotation + { + [SerializeField] private FaceLandmarkListWithIrisAnnotation _faceLandmarkListAnnotation; + [SerializeField] private PoseLandmarkListAnnotation _poseLandmarkListAnnotation; + [SerializeField] private HandLandmarkListAnnotation _leftHandLandmarkListAnnotation; + [SerializeField] private HandLandmarkListAnnotation _rightHandLandmarkListAnnotation; + [SerializeField] private ConnectionListAnnotation _connectionListAnnotation; + + public override bool isMirrored + { + set + { + _faceLandmarkListAnnotation.isMirrored = value; + _poseLandmarkListAnnotation.isMirrored = value; + _leftHandLandmarkListAnnotation.isMirrored = value; + _rightHandLandmarkListAnnotation.isMirrored = value; + _connectionListAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _faceLandmarkListAnnotation.rotationAngle = value; + _poseLandmarkListAnnotation.rotationAngle = value; + _leftHandLandmarkListAnnotation.rotationAngle = value; + _rightHandLandmarkListAnnotation.rotationAngle = value; + _connectionListAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + private void Start() + { + _leftHandLandmarkListAnnotation.SetHandedness(HandLandmarkListAnnotation.Hand.Left); + _rightHandLandmarkListAnnotation.SetHandedness(HandLandmarkListAnnotation.Hand.Right); + _connectionListAnnotation.Fill(2); // left/right wrist joint + } + + public void Draw(IList faceLandmarks, IList poseLandmarks, + IList leftHandLandmarks, IList rightHandLandmarks, bool visualizeZ = false, int circleVertices = 128) + { + var mask = PoseLandmarkListAnnotation.BodyParts.All; + if (faceLandmarks != null) + { + mask ^= PoseLandmarkListAnnotation.BodyParts.Face; + } + if (leftHandLandmarks != null) + { + mask ^= PoseLandmarkListAnnotation.BodyParts.LeftHand; + } + if (rightHandLandmarks != null) + { + mask ^= PoseLandmarkListAnnotation.BodyParts.RightHand; + } + _faceLandmarkListAnnotation.Draw(faceLandmarks, visualizeZ, circleVertices); + _poseLandmarkListAnnotation.Draw(poseLandmarks, mask, visualizeZ); + _leftHandLandmarkListAnnotation.Draw(leftHandLandmarks, visualizeZ); + _rightHandLandmarkListAnnotation.Draw(rightHandLandmarks, visualizeZ); + RedrawWristJoints(); + } + + public void Draw(NormalizedLandmarkList faceLandmarks, NormalizedLandmarkList poseLandmarks, + NormalizedLandmarkList leftHandLandmarks, NormalizedLandmarkList rightHandLandmarks, bool visualizeZ = false, int circleVertices = 128) + { + Draw( + faceLandmarks?.Landmark, + poseLandmarks?.Landmark, + leftHandLandmarks?.Landmark, + rightHandLandmarks?.Landmark, + visualizeZ, + circleVertices + ); + } + + private void RedrawWristJoints() + { + if (_connectionListAnnotation[0].isEmpty) + { + // connect left elbow and wrist + _connectionListAnnotation[0].Draw(new Connection(_poseLandmarkListAnnotation[13], _leftHandLandmarkListAnnotation[0])); + } + if (_connectionListAnnotation[1].isEmpty) + { + // connect right elbow and wrist + _connectionListAnnotation[1].Draw(new Connection(_poseLandmarkListAnnotation[14], _rightHandLandmarkListAnnotation[0])); + } + _connectionListAnnotation.Redraw(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..2fbc533 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotation.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8778d2c5de1025526bb9fccf445db529 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _faceLandmarkListAnnotation: {instanceID: 0} + - _poseLandmarkListAnnotation: {instanceID: 0} + - _leftHandLandmarkListAnnotation: {instanceID: 0} + - _rightHandLandmarkListAnnotation: {instanceID: 0} + - _leftIrisLandmarkListAnnotation: {instanceID: 0} + - _rightIrisLandmarkListAnnotation: {instanceID: 0} + - _connectionListAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs new file mode 100644 index 0000000..e125da8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs @@ -0,0 +1,96 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class HolisticLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + [SerializeField] private int _circleVertices = 128; + + private IList _currentFaceLandmarkList; + private IList _currentPoseLandmarkList; + private IList _currentLeftHandLandmarkList; + private IList _currentRightHandLandmarkList; + + public void DrawNow(IList faceLandmarkList, IList poseLandmarkList, + IList leftHandLandmarkList, IList rightHandLandmarkList) + { + _currentFaceLandmarkList = faceLandmarkList; + _currentPoseLandmarkList = poseLandmarkList; + _currentLeftHandLandmarkList = leftHandLandmarkList; + _currentRightHandLandmarkList = rightHandLandmarkList; + SyncNow(); + } + + public void DrawNow(NormalizedLandmarkList faceLandmarkList, NormalizedLandmarkList poseLandmarkList, + NormalizedLandmarkList leftHandLandmarkList, NormalizedLandmarkList rightHandLandmarkList) + { + DrawNow( + faceLandmarkList?.Landmark, + poseLandmarkList?.Landmark, + leftHandLandmarkList?.Landmark, + rightHandLandmarkList?.Landmark + ); + } + + public void DrawFaceLandmarkListLater(IList faceLandmarkList) + { + UpdateCurrentTarget(faceLandmarkList, ref _currentFaceLandmarkList); + } + + public void DrawFaceLandmarkListLater(NormalizedLandmarkList faceLandmarkList) + { + DrawFaceLandmarkListLater(faceLandmarkList?.Landmark); + } + + public void DrawPoseLandmarkListLater(IList poseLandmarkList) + { + UpdateCurrentTarget(poseLandmarkList, ref _currentPoseLandmarkList); + } + + public void DrawPoseLandmarkListLater(NormalizedLandmarkList poseLandmarkList) + { + DrawPoseLandmarkListLater(poseLandmarkList?.Landmark); + } + + public void DrawLeftHandLandmarkListLater(IList leftHandLandmarkList) + { + UpdateCurrentTarget(leftHandLandmarkList, ref _currentLeftHandLandmarkList); + } + + public void DrawLeftHandLandmarkListLater(NormalizedLandmarkList leftHandLandmarkList) + { + DrawLeftHandLandmarkListLater(leftHandLandmarkList?.Landmark); + } + + public void DrawRightHandLandmarkListLater(IList rightHandLandmarkList) + { + UpdateCurrentTarget(rightHandLandmarkList, ref _currentRightHandLandmarkList); + } + + public void DrawRightHandLandmarkListLater(NormalizedLandmarkList rightHandLandmarkList) + { + DrawRightHandLandmarkListLater(rightHandLandmarkList?.Landmark); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw( + _currentFaceLandmarkList, + _currentPoseLandmarkList, + _currentLeftHandLandmarkList, + _currentRightHandLandmarkList, + _visualizeZ, + _circleVertices + ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..2429a49 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/HolisticLandmarkListAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d476bc13b66983ac4b7ac1f48fb6aff9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs new file mode 100644 index 0000000..d0ef2a0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs @@ -0,0 +1,100 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Mediapipe.Unity.CoordinateSystem; +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class IrisLandmarkListAnnotation : HierarchicalAnnotation + { + [SerializeField] private PointListAnnotation _landmarkListAnnotation; + [SerializeField] private CircleAnnotation _circleAnnotation; + + public override bool isMirrored + { + set + { + _landmarkListAnnotation.isMirrored = value; + _circleAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _landmarkListAnnotation.rotationAngle = value; + _circleAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + public void SetLandmarkColor(Color landmarkColor) + { + _landmarkListAnnotation.SetColor(landmarkColor); + } + + public void SetLandmarkRadius(float landmarkRadius) + { + _landmarkListAnnotation.SetRadius(landmarkRadius); + } + + public void SetCircleColor(Color circleColor) + { + _circleAnnotation.SetColor(circleColor); + } + + public void SetCircleWidth(float circleWidth) + { + _circleAnnotation.SetLineWidth(circleWidth); + } + + public void Draw(IList target, bool visualizeZ = false, int vertices = 128) + { + if (ActivateFor(target)) + { + _landmarkListAnnotation.Draw(target, visualizeZ); + + var rect = GetScreenRect(); + var center = rect.GetPoint(target[0], rotationAngle, isMirrored); + if (!visualizeZ) + { + center.z = 0.0f; + } + var radius = CalculateRadius(rect, target); + _circleAnnotation.Draw(center, radius, vertices); + } + } + + public void Draw(NormalizedLandmarkList target, bool visualizeZ = false, int vertices = 128) + { + Draw(target?.Landmark, visualizeZ, vertices); + } + + private float CalculateRadius(UnityEngine.Rect rect, IList target) + { + var r1 = CalculateDistance(rect, target[1], target[3]); + var r2 = CalculateDistance(rect, target[2], target[4]); + return (r1 + r2) / 4; + } + + private float CalculateDistance(UnityEngine.Rect rect, NormalizedLandmark a, NormalizedLandmark b) + { + var aPos = rect.GetPoint(a, rotationAngle, isMirrored); + var bPos = rect.GetPoint(b, rotationAngle, isMirrored); + aPos.z = 0.0f; + bPos.z = 0.0f; + return Vector3.Distance(aPos, bPos); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..7f6c380 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/IrisLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1663d4d6a7ce17fdbad3dcb3e667ee85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _landmarkListAnnotation: {instanceID: 0} + - _circleAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs new file mode 100644 index 0000000..735362c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; +using UnityEngine.UI; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class LabelAnnotation : HierarchicalAnnotation + { + [SerializeField] private Text _labelText; + [SerializeField] private Transform _backgroundTransform; + + public void Draw(string text, Vector3 position, Color color, float maxWidth, float maxHeight) + { + if (ActivateFor(text)) + { + // move to the front to show background plane. + _labelText.transform.localPosition = new Vector3(position.x, position.y, -1); + _labelText.transform.localRotation = Quaternion.Euler(0, 0, -(int)rotationAngle); + _labelText.text = text; + _labelText.color = DecideTextColor(color); + _labelText.fontSize = GetFontSize(text, maxWidth, Mathf.Min(maxHeight, 48.0f)); + + var width = Mathf.Min(_labelText.preferredWidth + 24, maxWidth); // add margin + var height = _labelText.preferredHeight; + var rectTransform = _labelText.GetComponent(); + rectTransform.sizeDelta = new Vector2(width, height); + + _backgroundTransform.localScale = new Vector3(width / 10, 1, height / 10); + _backgroundTransform.gameObject.GetComponent().material.color = color; + } + } + + private int GetFontSize(string text, float maxWidth, float maxHeight) + { + var ch = Mathf.Min(maxWidth / text.Length, maxHeight); + return (int)Mathf.Clamp(ch, 24.0f, 72.0f); + } + + private Color DecideTextColor(Color backgroundColor) + { + var lw = CalcContrastRatio(Color.white, backgroundColor); + var lb = CalcContrastRatio(backgroundColor, Color.black); + return lw < lb ? Color.black : Color.white; + } + + private float CalcRelativeLuminance(Color color) + { + var r = color.r <= 0.03928f ? color.r / 12.92f : Mathf.Pow((color.r + 0.055f) / 1.055f, 2.4f); + var g = color.g <= 0.03928f ? color.g / 12.92f : Mathf.Pow((color.g + 0.055f) / 1.055f, 2.4f); + var b = color.b <= 0.03928f ? color.b / 12.92f : Mathf.Pow((color.b + 0.055f) / 1.055f, 2.4f); + return (0.2126f * r) + (0.7152f * g) + (0.0722f * b); + } + + private float CalcContrastRatio(Color lighter, Color darker) + { + var l1 = CalcRelativeLuminance(lighter); + var l2 = CalcRelativeLuminance(darker); + return (l1 + 0.05f) / (l2 + 0.05f); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs.meta new file mode 100644 index 0000000..19b969d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LabelAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96652e94527a9f3e1b4079bc3d139d06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs new file mode 100644 index 0000000..213e209 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs @@ -0,0 +1,83 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class LineAnnotation : HierarchicalAnnotation + { + [SerializeField] private LineRenderer _lineRenderer; + [SerializeField] private Color _color = Color.green; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + + private void OnEnable() + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + + private void OnDisable() + { + ApplyLineWidth(0.0f); + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + } +#endif + + public void SetColor(Color color) + { + _color = color; + ApplyColor(_color); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(_lineWidth); + } + + public void Draw(Vector3 a, Vector3 b) + { + _lineRenderer.SetPositions(new Vector3[] { a, b }); + } + + public void Draw(GameObject a, GameObject b) + { + _lineRenderer.SetPositions(new Vector3[] { a.transform.localPosition, b.transform.localPosition }); + } + + public void ApplyColor(Color color) + { + if (_lineRenderer != null) + { + _lineRenderer.startColor = color; + _lineRenderer.endColor = color; + } + } + + private void ApplyLineWidth(float lineWidth) + { + if (_lineRenderer != null) + { + _lineRenderer.startWidth = lineWidth; + _lineRenderer.endWidth = lineWidth; + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs.meta new file mode 100644 index 0000000..caccfb2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/LineAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6253cad9b27173aaaf2b82ac82f421c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs new file mode 100644 index 0000000..66e9dda --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs @@ -0,0 +1,122 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public abstract class ListAnnotation : HierarchicalAnnotation where T : HierarchicalAnnotation + { + [SerializeField] private GameObject _annotationPrefab; + + private List _children; + protected List children + { + get + { + if (_children == null) + { + _children = new List(); + } + return _children; + } + } + + public T this[int index] => children[index]; + + public int count => children.Count; + + public void Fill(int count) + { + while (children.Count < count) + { + children.Add(InstantiateChild(false)); + } + } + + public void Add(T element) + { + children.Add(element); + } + + public override bool isMirrored + { + set + { + foreach (var child in children) + { + child.isMirrored = value; + } + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + foreach (var child in children) + { + child.rotationAngle = value; + } + base.rotationAngle = value; + } + } + + protected virtual void Destroy() + { + foreach (var child in children) + { + Destroy(child); + } + _children = null; + } + + protected virtual T InstantiateChild(bool isActive = true) + { + var annotation = InstantiateChild(_annotationPrefab); + annotation.SetActive(isActive); + return annotation; + } + + /// + /// Zip and , and call with each pair. + /// If has more elements than , elements will be initialized with . + /// + /// + /// This will receive 2 arguments and return void. + /// The 1st argument is , that is an ith element in . + /// The 2nd argument is , that is also an ith element in . + /// + protected void CallActionForAll(IList argumentList, Action action) + { + for (var i = 0; i < Mathf.Max(children.Count, argumentList.Count); i++) + { + if (i >= argumentList.Count) + { + // children.Count > argumentList.Count + action(children[i], default); + continue; + } + + // reset annotations + if (i >= children.Count) + { + // children.Count < argumentList.Count + children.Add(InstantiateChild()); + } + else if (children[i] == null) + { + // child is not initialized yet + children[i] = InstantiateChild(); + } + action(children[i], argumentList[i]); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs.meta new file mode 100644 index 0000000..e5d4dd0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab5e576d5ced309e9a79c434be1a9741 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs new file mode 100644 index 0000000..587c5a8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs @@ -0,0 +1,146 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Runtime.InteropServices; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.UI; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class MaskAnnotation : HierarchicalAnnotation + { + [SerializeField] private RawImage _screen; + [SerializeField] private Shader _maskShader; + [SerializeField] private Texture2D _maskTexture; + [SerializeField] private Color _color = Color.blue; + [SerializeField, Range(0, 1)] private float _threshold = 0.9f; + + private Material _prevMaterial; + private Material _material; + private GraphicsBuffer _maskBuffer; + + private void OnEnable() + { + ApplyMaskTexture(_maskTexture, _color); + ApplyThreshold(_threshold); + } + + private void OnDisable() + { + if (_prevMaterial != null) + { + ApplyMaterial(_prevMaterial); + } + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyMaskTexture(_maskTexture, _color); + ApplyThreshold(_threshold); + } + } +#endif + + private void OnDestroy() + { + if (_maskBuffer != null) + { + _maskBuffer.Release(); + } + } + + public void Init(int width, int height) + { + _material = new Material(_maskShader) + { + renderQueue = (int)RenderQueue.Transparent + }; + + _material.SetTexture("_MainTex", _screen.texture); + ApplyMaskTexture(_maskTexture, _color); + _material.SetInt("_Width", width); + _material.SetInt("_Height", height); + ApplyThreshold(_threshold); + InitMaskBuffer(width, height); + } + + public void Draw(float[] mask, int width, int height) + { + if (mask == null) + { + ApplyMaterial(_prevMaterial); + return; + } + + if (mask.Length != width * height) + { + throw new ArgumentException("mask size must equal width * height"); + } + + ApplyMaterial(_material); + _maskBuffer.SetData(mask); + } + + private Texture2D CreateMonoColorTexture(Color color) + { + var texture = new Texture2D(1, 1, TextureFormat.RGBA32, false); + var textureColor = new Color32((byte)(255 * color.r), (byte)(255 * color.g), (byte)(255 * color.b), (byte)(255 * color.a)); + texture.SetPixels32(new Color32[] { textureColor }); + texture.Apply(); + + return texture; + } + + private void InitMaskBuffer(int width, int height) + { + if (_maskBuffer != null) + { + _maskBuffer.Release(); + } + var stride = Marshal.SizeOf(typeof(float)); + _maskBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, width * height, stride); + _material.SetBuffer("_MaskBuffer", _maskBuffer); + } + + private void ApplyMaterial(Material material) + { + if (_prevMaterial == null) + { + // backup + _prevMaterial = _screen.material; + } + if (_screen.material != material) + { + _screen.material = material; + } + } + + private void ApplyMaskTexture(Texture maskTexture, Color maskColor) + { + if (_material != null) + { + _material.SetTexture("_MaskTex", maskTexture == null ? CreateMonoColorTexture(maskColor) : maskTexture); + } + } + + private void ApplyThreshold(float threshold) + { + if (_material != null) + { + _material.SetFloat("_Threshold", threshold); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs.meta new file mode 100644 index 0000000..f95075f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f993d16dcccfcecb6892ad3cc2ea76c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs new file mode 100644 index 0000000..c6e04b5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + public class MaskAnnotationController : AnnotationController + { + private int _maskWidth; + private int _maskHeight; + + private ImageFrame _currentTarget; + private float[] _maskArray; + + public void InitScreen(int maskWidth, int maskHeight) + { + _maskWidth = maskWidth; + _maskHeight = maskHeight; + _maskArray = new float[_maskWidth * _maskHeight]; + annotation.Init(_maskWidth, _maskHeight); + } + + public void DrawNow(ImageFrame target) + { + _currentTarget = target; + UpdateMaskArray(_currentTarget); + SyncNow(); + } + + public void DrawLater(ImageFrame target) + { + UpdateCurrentTarget(target, ref _currentTarget); + UpdateMaskArray(_currentTarget); + } + + private void UpdateMaskArray(ImageFrame imageFrame) + { + if (imageFrame != null) + { + // NOTE: assume that the image is transformed properly by calculators. + var _ = imageFrame.TryReadChannelNormalized(0, _maskArray); + } + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget == null ? null : _maskArray, _maskWidth, _maskHeight); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs.meta new file mode 100644 index 0000000..6d9659b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MaskAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ece564ad16755f1ef94c4fe04bd7ce2e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs new file mode 100644 index 0000000..0381b18 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs @@ -0,0 +1,181 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class MultiFaceLandmarkListAnnotation : ListAnnotation + { + [SerializeField] private Color _faceLandmarkColor = Color.green; + [SerializeField] private Color _irisLandmarkColor = Color.yellow; + [SerializeField] private float _faceLandmarkRadius = 10.0f; + [SerializeField] private float _irisLandmarkRadius = 10.0f; + [SerializeField] private Color _faceConnectionColor = Color.red; + [SerializeField] private Color _irisCircleColor = Color.blue; + [SerializeField, Range(0, 1)] private float _faceConnectionWidth = 1.0f; + [SerializeField, Range(0, 1)] private float _irisCircleWidth = 1.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyFaceLandmarkColor(_faceLandmarkColor); + ApplyIrisLandmarkColor(_irisLandmarkColor); + ApplyFaceLandmarkRadius(_faceLandmarkRadius); + ApplyIrisLandmarkRadius(_irisLandmarkRadius); + ApplyFaceConnectionColor(_faceConnectionColor); + ApplyIrisCircleColor(_irisCircleColor); + ApplyFaceConnectionWidth(_faceConnectionWidth); + ApplyIrisCircleWidth(_irisCircleWidth); + } + } +#endif + + public void SetFaceLandmarkRadius(float radius) + { + _faceLandmarkRadius = radius; + ApplyFaceLandmarkRadius(_faceLandmarkRadius); + } + + public void SetIrisLandmarkRadius(float radius) + { + _irisLandmarkRadius = radius; + ApplyIrisLandmarkRadius(_irisLandmarkRadius); + } + + public void SetFaceLandmarkColor(Color color) + { + _faceLandmarkColor = color; + ApplyFaceLandmarkColor(_faceLandmarkColor); + } + + public void SetIrisLandmarkColor(Color color) + { + _irisLandmarkColor = color; + ApplyIrisLandmarkColor(_irisLandmarkColor); + } + + public void SetFaceConnectionWidth(float width) + { + _faceConnectionWidth = width; + ApplyFaceConnectionWidth(_faceConnectionWidth); + } + + public void SetFaceConnectionColor(Color color) + { + _faceConnectionColor = color; + ApplyFaceConnectionColor(_faceConnectionColor); + } + + public void SetIrisCircleWidth(float width) + { + _irisCircleWidth = width; + ApplyIrisCircleWidth(_irisCircleWidth); + } + + public void SetIrisCircleColor(Color color) + { + _irisCircleColor = color; + ApplyIrisCircleColor(_irisCircleColor); + } + + public void Draw(IList targets, bool visualizeZ = false) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, visualizeZ); } + }); + } + } + + protected override FaceLandmarkListWithIrisAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetFaceLandmarkRadius(_faceLandmarkRadius); + annotation.SetIrisLandmarkRadius(_irisLandmarkRadius); + annotation.SetFaceLandmarkColor(_faceLandmarkColor); + annotation.SetIrisLandmarkColor(_irisLandmarkColor); + annotation.SetFaceConnectionWidth(_faceConnectionWidth); + annotation.SetFaceConnectionColor(_faceConnectionColor); + annotation.SetIrisCircleWidth(_irisCircleWidth); + annotation.SetIrisCircleColor(_irisCircleColor); + return annotation; + } + + private void ApplyFaceLandmarkRadius(float radius) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetFaceLandmarkRadius(radius); } + } + } + + private void ApplyIrisLandmarkRadius(float radius) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetIrisLandmarkRadius(radius); } + } + } + + private void ApplyFaceLandmarkColor(Color color) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetFaceLandmarkColor(color); } + } + } + + private void ApplyIrisLandmarkColor(Color color) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetIrisLandmarkColor(color); } + } + } + + private void ApplyFaceConnectionWidth(float width) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetFaceConnectionWidth(width); } + } + } + + private void ApplyFaceConnectionColor(Color color) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetFaceConnectionColor(color); } + } + } + + private void ApplyIrisCircleWidth(float width) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetIrisCircleWidth(width); } + } + } + + private void ApplyIrisCircleColor(Color color) + { + foreach (var faceLandmarkList in children) + { + if (faceLandmarkList != null) { faceLandmarkList.SetIrisCircleColor(color); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..39653e6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d1ec0e202f29d7ee28cccba68415d95b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 7273100862690186831, guid: 16074ce928b0558829296ab0d9ccadf3, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs new file mode 100644 index 0000000..5d8933d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class MultiFaceLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _visualizeZ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..e56585b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 417bb930807ba51e9bfcc5d0e24ef3ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs new file mode 100644 index 0000000..5896f01 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs @@ -0,0 +1,143 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class MultiHandLandmarkListAnnotation : ListAnnotation + { + [SerializeField] private Color _leftLandmarkColor = Color.green; + [SerializeField] private Color _rightLandmarkColor = Color.green; + [SerializeField] private float _landmarkRadius = 15.0f; + [SerializeField] private Color _connectionColor = Color.white; + [SerializeField, Range(0, 1)] private float _connectionWidth = 1.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyLeftLandmarkColor(_leftLandmarkColor); + ApplyRightLandmarkColor(_rightLandmarkColor); + ApplyLandmarkRadius(_landmarkRadius); + ApplyConnectionColor(_connectionColor); + ApplyConnectionWidth(_connectionWidth); + } + } +#endif + + public void SetLeftLandmarkColor(Color leftLandmarkColor) + { + _leftLandmarkColor = leftLandmarkColor; + ApplyLeftLandmarkColor(_leftLandmarkColor); + } + + public void SetRightLandmarkColor(Color rightLandmarkColor) + { + _rightLandmarkColor = rightLandmarkColor; + ApplyRightLandmarkColor(_rightLandmarkColor); + } + + public void SetLandmarkRadius(float landmarkRadius) + { + _landmarkRadius = landmarkRadius; + ApplyLandmarkRadius(_landmarkRadius); + } + + public void SetConnectionColor(Color connectionColor) + { + _connectionColor = connectionColor; + ApplyConnectionColor(_connectionColor); + } + + public void SetConnectionWidth(float connectionWidth) + { + _connectionWidth = connectionWidth; + ApplyConnectionWidth(_connectionWidth); + } + + public void SetHandedness(IList handedness) + { + var count = handedness == null ? 0 : handedness.Count; + for (var i = 0; i < Mathf.Min(count, children.Count); i++) + { + children[i].SetHandedness(handedness[i]); + } + for (var i = count; i < children.Count; i++) + { + children[i].SetHandedness((IList)null); + } + } + + public void Draw(IList targets, bool visualizeZ = false) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, visualizeZ); } + }); + } + } + + protected override HandLandmarkListAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetLeftLandmarkColor(_leftLandmarkColor); + annotation.SetRightLandmarkColor(_rightLandmarkColor); + annotation.SetLandmarkRadius(_landmarkRadius); + annotation.SetConnectionColor(_connectionColor); + annotation.SetConnectionWidth(_connectionWidth); + return annotation; + } + + private void ApplyLeftLandmarkColor(Color leftLandmarkColor) + { + foreach (var handLandmarkList in children) + { + if (handLandmarkList != null) { handLandmarkList.SetLeftLandmarkColor(leftLandmarkColor); } + } + } + + private void ApplyRightLandmarkColor(Color rightLandmarkColor) + { + foreach (var handLandmarkList in children) + { + if (handLandmarkList != null) { handLandmarkList.SetRightLandmarkColor(rightLandmarkColor); } + } + } + + private void ApplyLandmarkRadius(float landmarkRadius) + { + foreach (var handLandmarkList in children) + { + if (handLandmarkList != null) { handLandmarkList.SetLandmarkRadius(landmarkRadius); } + } + } + + private void ApplyConnectionColor(Color connectionColor) + { + foreach (var handLandmarkList in children) + { + if (handLandmarkList != null) { handLandmarkList.SetConnectionColor(connectionColor); } + } + } + + private void ApplyConnectionWidth(float connectionWidth) + { + foreach (var handLandmarkList in children) + { + if (handLandmarkList != null) { handLandmarkList.SetConnectionWidth(connectionWidth); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..d67e7a1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5ba3c50c2cb46dc9e916dd3a33c8a488 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 4724242833946851653, guid: b420c3106bd9cc5b6871a7df5459dba0, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs new file mode 100644 index 0000000..d6c344e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class MultiHandLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + + private IList _currentHandLandmarkLists; + private IList _currentHandedness; + + public void DrawNow(IList handLandmarkLists, IList handedness = null) + { + _currentHandLandmarkLists = handLandmarkLists; + _currentHandedness = handedness; + SyncNow(); + } + + public void DrawLater(IList handLandmarkLists) + { + UpdateCurrentTarget(handLandmarkLists, ref _currentHandLandmarkLists); + } + + public void DrawLater(IList handedness) + { + UpdateCurrentTarget(handedness, ref _currentHandedness); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentHandLandmarkLists, _visualizeZ); + + if (_currentHandedness != null) + { + annotation.SetHandedness(_currentHandedness); + } + _currentHandedness = null; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..318ef79 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiHandLandmarkListAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c3f533a3b3fececba86462b46ff711ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 7434967355688441420, guid: 87a9be2a7620991a78342ef9a56fa62c, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs new file mode 100644 index 0000000..debe13c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class NormalizedLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawNow(NormalizedLandmarkList target) + { + DrawNow(target?.Landmark); + } + + public void DrawNow(IList landmarkLists) + { + DrawNow(FlattenNormalizedLandmarkLists(landmarkLists)); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + public void DrawLater(NormalizedLandmarkList target) + { + UpdateCurrentTarget(target?.Landmark, ref _currentTarget); + } + + public void DrawLater(IList landmarkLists) + { + UpdateCurrentTarget(FlattenNormalizedLandmarkLists(landmarkLists), ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _visualizeZ); + } + + private IList FlattenNormalizedLandmarkLists(IList landmarkLists) + { + return landmarkLists?.Select((x) => x.Landmark).SelectMany(x => x).ToList(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..e08618c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedLandmarkListAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acbf25ab09c7f4115948d7981b6024c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs new file mode 100644 index 0000000..5eee15a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Unity +{ + public class NormalizedRectAnnotationController : AnnotationController + { + private NormalizedRect _currentTarget; + + public void DrawNow(NormalizedRect target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawLater(NormalizedRect target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs.meta new file mode 100644 index 0000000..d3b830e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectAnnotationController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 145060647209d6d1c86b8ccce9fcaf5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs new file mode 100644 index 0000000..30a8a5c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; + +namespace Mediapipe.Unity +{ + public class NormalizedRectListAnnotationController : AnnotationController + { + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs.meta new file mode 100644 index 0000000..cfdf977 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/NormalizedRectListAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4f4190c4421f92d5187d2ebdc88a9594 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 9058686056784979840, guid: 94ee148c30d93d3c8aaa3aaf5ab54853, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs new file mode 100644 index 0000000..d6eb284 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs @@ -0,0 +1,138 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Mediapipe.Unity.CoordinateSystem; +using UnityEngine; + +using mplt = Mediapipe.LocationData.Types; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class PointAnnotation : HierarchicalAnnotation + { + [SerializeField] private Color _color = Color.green; + [SerializeField] private float _radius = 15.0f; + + private void OnEnable() + { + ApplyColor(_color); + ApplyRadius(_radius); + } + + private void OnDisable() + { + ApplyRadius(0.0f); + } + + public void SetColor(Color color) + { + _color = color; + ApplyColor(_color); + } + + public void SetRadius(float radius) + { + _radius = radius; + ApplyRadius(_radius); + } + + public void Draw(Vector3 position) + { + SetActive(true); // Vector3 is not nullable + transform.localPosition = position; + } + + public void Draw(Landmark target, Vector3 scale, bool visualizeZ = true) + { + if (ActivateFor(target)) + { + var position = GetScreenRect().GetPoint(target, scale, rotationAngle, isMirrored); + if (!visualizeZ) + { + position.z = 0.0f; + } + transform.localPosition = position; + } + } + + public void Draw(NormalizedLandmark target, bool visualizeZ = true) + { + if (ActivateFor(target)) + { + var position = GetScreenRect().GetPoint(target, rotationAngle, isMirrored); + if (!visualizeZ) + { + position.z = 0.0f; + } + transform.localPosition = position; + } + } + + public void Draw(NormalizedPoint2D target) + { + if (ActivateFor(target)) + { + var position = GetScreenRect().GetPoint(target, rotationAngle, isMirrored); + transform.localPosition = position; + } + } + + public void Draw(Point3D target, Vector2 focalLength, Vector2 principalPoint, float zScale, bool visualizeZ = true) + { + if (ActivateFor(target)) + { + var position = GetScreenRect().GetPoint(target, focalLength, principalPoint, zScale, rotationAngle, isMirrored); + if (!visualizeZ) + { + position.z = 0.0f; + } + transform.localPosition = position; + } + } + + public void Draw(AnnotatedKeyPoint target, Vector2 focalLength, Vector2 principalPoint, float zScale, bool visualizeZ = true) + { + if (visualizeZ) + { + Draw(target?.Point3D, focalLength, principalPoint, zScale, true); + } + else + { + Draw(target?.Point2D); + } + } + + public void Draw(mplt.RelativeKeypoint target, float threshold = 0.0f) + { + if (ActivateFor(target)) + { + Draw(GetScreenRect().GetPoint(target, rotationAngle, isMirrored)); + SetColor(GetColor(target.Score, threshold)); + } + } + + private void ApplyColor(Color color) + { + GetComponent().material.color = color; + } + + private void ApplyRadius(float radius) + { + transform.localScale = radius * Vector3.one; + } + + private Color GetColor(float score, float threshold) + { + var t = (score - threshold) / (1 - threshold); + var h = Mathf.Lerp(90, 0, t) / 360; // from yellow-green to red + return Color.HSVToRGB(h, 1, 1); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs.meta new file mode 100644 index 0000000..145293c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0476f607871e33f2783b582f7a75703c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs new file mode 100644 index 0000000..961bb7e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs @@ -0,0 +1,135 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +using mplt = Mediapipe.LocationData.Types; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class PointListAnnotation : ListAnnotation + { + [SerializeField] private Color _color = Color.green; + [SerializeField] private float _radius = 15.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyRadius(_radius); + } + } +#endif + + public void SetColor(Color color) + { + _color = color; + ApplyColor(_color); + } + + public void SetRadius(float radius) + { + _radius = radius; + ApplyRadius(_radius); + } + + public void Draw(IList targets) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target); } + }); + } + } + + public void Draw(IList targets, Vector3 scale, bool visualizeZ = true) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, scale, visualizeZ); } + }); + } + } + + public void Draw(LandmarkList targets, Vector3 scale, bool visualizeZ = true) + { + Draw(targets.Landmark, scale, visualizeZ); + } + + public void Draw(IList targets, bool visualizeZ = true) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, visualizeZ); } + }); + } + } + + public void Draw(NormalizedLandmarkList targets, bool visualizeZ = true) + { + Draw(targets.Landmark, visualizeZ); + } + + public void Draw(IList targets, Vector2 focalLength, Vector2 principalPoint, float zScale, bool visualizeZ = true) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, focalLength, principalPoint, zScale, visualizeZ); } + }); + } + } + + public void Draw(IList targets, float threshold = 0.0f) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, threshold); } + }); + } + } + + protected override PointAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetColor(_color); + annotation.SetRadius(_radius); + return annotation; + } + + private void ApplyColor(Color color) + { + foreach (var point in children) + { + if (point != null) { point.SetColor(color); } + } + } + + private void ApplyRadius(float radius) + { + foreach (var point in children) + { + if (point != null) { point.SetRadius(radius); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs.meta new file mode 100644 index 0000000..4384216 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PointListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ae7563ab8645734c6b682cbbca130f6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 5105739270100195971, guid: cd50999c161e69345953a2cb517dd339, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs new file mode 100644 index 0000000..a0436c5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs @@ -0,0 +1,278 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public sealed class PoseLandmarkListAnnotation : HierarchicalAnnotation + { + [SerializeField] private PointListAnnotation _landmarkListAnnotation; + [SerializeField] private ConnectionListAnnotation _connectionListAnnotation; + [SerializeField] private Color _leftLandmarkColor = Color.green; + [SerializeField] private Color _rightLandmarkColor = Color.green; + + [Flags] + public enum BodyParts : short + { + None = 0, + Face = 1, + // Torso = 2, + LeftArm = 4, + LeftHand = 8, + RightArm = 16, + RightHand = 32, + LowerBody = 64, + All = 127, + } + + private const int _LandmarkCount = 33; + private static readonly int[] _LeftLandmarks = new int[] { + 1, 2, 3, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31 + }; + private static readonly int[] _RightLandmarks = new int[] { + 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32 + }; + private static readonly List<(int, int)> _Connections = new List<(int, int)> { + // Left Eye + (0, 1), + (1, 2), + (2, 3), + (3, 7), + // Right Eye + (0, 4), + (4, 5), + (5, 6), + (6, 8), + // Lips + (9, 10), + // Left Arm + (11, 13), + (13, 15), + // Left Hand + (15, 17), + (15, 19), + (15, 21), + (17, 19), + // Right Arm + (12, 14), + (14, 16), + // Right Hand + (16, 18), + (16, 20), + (16, 22), + (18, 20), + // Torso + (11, 12), + (12, 24), + (24, 23), + (23, 11), + // Left Leg + (23, 25), + (25, 27), + (27, 29), + (27, 31), + (29, 31), + // Right Leg + (24, 26), + (26, 28), + (28, 30), + (28, 32), + (30, 32), + }; + + public override bool isMirrored + { + set + { + _landmarkListAnnotation.isMirrored = value; + _connectionListAnnotation.isMirrored = value; + base.isMirrored = value; + } + } + + public override RotationAngle rotationAngle + { + set + { + _landmarkListAnnotation.rotationAngle = value; + _connectionListAnnotation.rotationAngle = value; + base.rotationAngle = value; + } + } + + public PointAnnotation this[int index] => _landmarkListAnnotation[index]; + + private void Start() + { + _landmarkListAnnotation.Fill(_LandmarkCount); + ApplyLeftLandmarkColor(_leftLandmarkColor); + ApplyRightLandmarkColor(_rightLandmarkColor); + + _connectionListAnnotation.Fill(_Connections, _landmarkListAnnotation); + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyLeftLandmarkColor(_leftLandmarkColor); + ApplyRightLandmarkColor(_rightLandmarkColor); + } + } +#endif + + public void SetLeftLandmarkColor(Color leftLandmarkColor) + { + _leftLandmarkColor = leftLandmarkColor; + ApplyLeftLandmarkColor(_leftLandmarkColor); + } + + public void SetRightLandmarkColor(Color rightLandmarkColor) + { + _rightLandmarkColor = rightLandmarkColor; + ApplyRightLandmarkColor(_rightLandmarkColor); + } + + public void SetLandmarkRadius(float landmarkRadius) + { + _landmarkListAnnotation.SetRadius(landmarkRadius); + } + + public void SetConnectionColor(Color connectionColor) + { + _connectionListAnnotation.SetColor(connectionColor); + } + + public void SetConnectionWidth(float connectionWidth) + { + _connectionListAnnotation.SetLineWidth(connectionWidth); + } + + public void Draw(IList target, Vector3 scale, bool visualizeZ = false) + { + if (ActivateFor(target)) + { + _landmarkListAnnotation.Draw(target, scale, visualizeZ); + // Draw explicitly because connection annotation's targets remain the same. + _connectionListAnnotation.Redraw(); + } + } + + public void Draw(LandmarkList target, Vector3 scale, bool visualizeZ = false) + { + Draw(target?.Landmark, scale, visualizeZ); + } + + public void Draw(IList target, BodyParts mask, bool visualizeZ = false) + { + if (ActivateFor(target)) + { + _landmarkListAnnotation.Draw(target, visualizeZ); + ApplyMask(mask); + // Draw explicitly because connection annotation's targets remain the same. + _connectionListAnnotation.Redraw(); + } + } + + public void Draw(NormalizedLandmarkList target, BodyParts mask, bool visualizeZ = false) + { + Draw(target?.Landmark, mask, visualizeZ); + } + + public void Draw(IList target, bool visualizeZ = false) + { + Draw(target, BodyParts.All, visualizeZ); + } + + public void Draw(NormalizedLandmarkList target, bool visualizeZ = false) + { + Draw(target?.Landmark, BodyParts.All, visualizeZ); + } + + private void ApplyLeftLandmarkColor(Color color) + { + var annotationCount = _landmarkListAnnotation == null ? 0 : _landmarkListAnnotation.count; + if (annotationCount >= _LandmarkCount) + { + foreach (var index in _LeftLandmarks) + { + _landmarkListAnnotation[index].SetColor(color); + } + } + } + + private void ApplyRightLandmarkColor(Color color) + { + var annotationCount = _landmarkListAnnotation == null ? 0 : _landmarkListAnnotation.count; + if (annotationCount >= _LandmarkCount) + { + foreach (var index in _RightLandmarks) + { + _landmarkListAnnotation[index].SetColor(color); + } + } + } + + private void ApplyMask(BodyParts mask) + { + if (mask == BodyParts.All) + { + return; + } + + if (!mask.HasFlag(BodyParts.Face)) + { + // deactivate face landmarks + for (var i = 0; i <= 10; i++) + { + _landmarkListAnnotation[i].SetActive(false); + } + } + if (!mask.HasFlag(BodyParts.LeftArm)) + { + // deactivate left elbow to hide left arm + _landmarkListAnnotation[13].SetActive(false); + } + if (!mask.HasFlag(BodyParts.LeftHand)) + { + // deactive left wrist, thumb, index and pinky to hide left hand + _landmarkListAnnotation[15].SetActive(false); + _landmarkListAnnotation[17].SetActive(false); + _landmarkListAnnotation[19].SetActive(false); + _landmarkListAnnotation[21].SetActive(false); + } + if (!mask.HasFlag(BodyParts.RightArm)) + { + // deactivate right elbow to hide right arm + _landmarkListAnnotation[14].SetActive(false); + } + if (!mask.HasFlag(BodyParts.RightHand)) + { + // deactivate right wrist, thumb, index and pinky to hide right hand + _landmarkListAnnotation[16].SetActive(false); + _landmarkListAnnotation[18].SetActive(false); + _landmarkListAnnotation[20].SetActive(false); + _landmarkListAnnotation[22].SetActive(false); + } + if (!mask.HasFlag(BodyParts.LowerBody)) + { + // deactivate lower body landmarks + for (var i = 25; i <= 32; i++) + { + _landmarkListAnnotation[i].SetActive(false); + } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs.meta new file mode 100644 index 0000000..5cd1994 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 39bac9dd52c31ae7aa01a7383bc44853 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _landmarkListAnnotation: {instanceID: 0} + - _connectionListAnnotation: {instanceID: 0} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs new file mode 100644 index 0000000..d3496ba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class PoseLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private bool _visualizeZ = false; + + private IList _currentTarget; + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawNow(NormalizedLandmarkList target) + { + DrawNow(target?.Landmark); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + public void DrawLater(NormalizedLandmarkList target) + { + DrawLater(target?.Landmark); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _visualizeZ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..8e41eb6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseLandmarkListAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 70c2b36b394190968977c6493e60e0af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 1915238444563462411, guid: 4418f6a92856c5b51b58a36e3be7ed5c, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs new file mode 100644 index 0000000..caa2d8b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class PoseWorldLandmarkListAnnotationController : AnnotationController + { + [SerializeField] private float _hipHeightMeter = 0.9f; + [SerializeField] private Vector3 _scale = new Vector3(100, 100, 100); + [SerializeField] private bool _visualizeZ = true; + + private IList _currentTarget; + + protected override void Start() + { + base.Start(); + transform.localPosition = new Vector3(0, _hipHeightMeter * _scale.y, 0); + } + + public void DrawNow(IList target) + { + _currentTarget = target; + SyncNow(); + } + + public void DrawNow(LandmarkList target) + { + DrawNow(target?.Landmark); + } + + public void DrawLater(IList target) + { + UpdateCurrentTarget(target, ref _currentTarget); + } + + public void DrawLater(LandmarkList target) + { + DrawLater(target?.Landmark); + } + + protected override void SyncNow() + { + isStale = false; + annotation.Draw(_currentTarget, _scale, _visualizeZ); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs.meta new file mode 100644 index 0000000..1ec98cb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/PoseWorldLandmarkListAnnotationController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f152430ce9da8f9f2ae5cfd135b4d061 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - annotationPrefab: {fileID: 8684491236681850282, guid: e076022eee6a6227698c34a5ba1d25ea, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs new file mode 100644 index 0000000..4339d82 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs @@ -0,0 +1,148 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Mediapipe.Unity.CoordinateSystem; +using UnityEngine; + +using mplt = Mediapipe.LocationData.Types; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class RectangleAnnotation : HierarchicalAnnotation + { + [SerializeField] private LineRenderer _lineRenderer; + [SerializeField] private Color _color = Color.red; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + + private static readonly Vector3[] _EmptyPositions = new Vector3[] { Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero }; + + private void OnEnable() + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + + private void OnDisable() + { + ApplyLineWidth(0.0f); + _lineRenderer.SetPositions(_EmptyPositions); + } + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + } +#endif + + public void SetColor(Color color) + { + _color = color; + ApplyColor(_color); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(_lineWidth); + } + + public void Draw(Vector3[] positions) + { + _lineRenderer.SetPositions(positions ?? _EmptyPositions); + } + + public void Draw(Rect target, Vector2Int imageSize) + { + if (ActivateFor(target)) + { + Draw(GetScreenRect().GetRectVertices(target, imageSize, rotationAngle, isMirrored)); + } + } + + public void Draw(NormalizedRect target) + { + if (ActivateFor(target)) + { + Draw(GetScreenRect().GetRectVertices(target, rotationAngle, isMirrored)); + } + } + + public void Draw(LocationData target, Vector2Int imageSize) + { + if (ActivateFor(target)) + { + switch (target.Format) + { + case mplt.Format.BoundingBox: + { + Draw(GetScreenRect().GetRectVertices(target.BoundingBox, imageSize, rotationAngle, isMirrored)); + break; + } + case mplt.Format.RelativeBoundingBox: + { + Draw(GetScreenRect().GetRectVertices(target.RelativeBoundingBox, rotationAngle, isMirrored)); + break; + } + case mplt.Format.Global: + case mplt.Format.Mask: + default: + { + throw new System.ArgumentException($"The format of the LocationData must be BoundingBox or RelativeBoundingBox, but {target.Format}"); + } + } + } + } + + public void Draw(LocationData target) + { + if (ActivateFor(target)) + { + switch (target.Format) + { + case mplt.Format.RelativeBoundingBox: + { + Draw(GetScreenRect().GetRectVertices(target.RelativeBoundingBox, rotationAngle, isMirrored)); + break; + } + case mplt.Format.BoundingBox: + case mplt.Format.Global: + case mplt.Format.Mask: + default: + { + throw new System.ArgumentException($"The format of the LocationData must be RelativeBoundingBox, but {target.Format}"); + } + } + } + } + + private void ApplyColor(Color color) + { + if (_lineRenderer != null) + { + _lineRenderer.startColor = color; + _lineRenderer.endColor = color; + } + } + + private void ApplyLineWidth(float lineWidth) + { + if (_lineRenderer != null) + { + _lineRenderer.startWidth = lineWidth; + _lineRenderer.endWidth = lineWidth; + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs.meta new file mode 100644 index 0000000..5136bec --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba39488de81a63b298a92a9d09ac42db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs new file mode 100644 index 0000000..71b06da --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using UnityEngine; + +namespace Mediapipe.Unity +{ +#pragma warning disable IDE0065 + using Color = UnityEngine.Color; +#pragma warning restore IDE0065 + + public class RectangleListAnnotation : ListAnnotation + { + [SerializeField] private Color _color = Color.red; + [SerializeField, Range(0, 1)] private float _lineWidth = 1.0f; + +#if UNITY_EDITOR + private void OnValidate() + { + if (!UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) + { + ApplyColor(_color); + ApplyLineWidth(_lineWidth); + } + } +#endif + + public void SetColor(Color color) + { + _color = color; + ApplyColor(_color); + } + + public void SetLineWidth(float lineWidth) + { + _lineWidth = lineWidth; + ApplyLineWidth(_lineWidth); + } + + public void Draw(IList targets, Vector2Int imageSize) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target, imageSize); } + }); + } + } + + public void Draw(IList targets) + { + if (ActivateFor(targets)) + { + CallActionForAll(targets, (annotation, target) => + { + if (annotation != null) { annotation.Draw(target); } + }); + } + } + + protected override RectangleAnnotation InstantiateChild(bool isActive = true) + { + var annotation = base.InstantiateChild(isActive); + annotation.SetLineWidth(_lineWidth); + annotation.SetColor(_color); + return annotation; + } + + private void ApplyColor(Color color) + { + foreach (var rect in children) + { + if (rect != null) { rect.SetColor(color); } + } + } + + private void ApplyLineWidth(float lineWidth) + { + foreach (var rect in children) + { + if (rect != null) { rect.SetLineWidth(lineWidth); } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs.meta new file mode 100644 index 0000000..b27cdc1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/RectangleListAnnotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ff689dc19c0db10608af875e2c24ade9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - _annotationPrefab: {fileID: 4965192403804369243, guid: 3b696480602fe21de85315216956bd42, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs new file mode 100644 index 0000000..b867391 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs @@ -0,0 +1,71 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using Mediapipe.Unity.CoordinateSystem; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public sealed class TransformAnnotation : HierarchicalAnnotation + { + [SerializeField] private Arrow _xArrow; + [SerializeField] private Arrow _yArrow; + [SerializeField] private Arrow _zArrow; + + public Vector3 origin + { + get => transform.localPosition; + set => transform.localPosition = value; + } + + public void SetArrowCapScale(float arrowCapScale) + { + _xArrow.SetCapScale(arrowCapScale); + _yArrow.SetCapScale(arrowCapScale); + _zArrow.SetCapScale(arrowCapScale); + } + + public void SetArrowWidth(float arrowWidth) + { + _xArrow.SetLineWidth(arrowWidth); + _yArrow.SetLineWidth(arrowWidth); + _zArrow.SetLineWidth(arrowWidth); + } + + public void Draw(Quaternion rotation, Vector3 scale, bool visualizeZ = true) + { + var q = Quaternion.Euler(0, 0, -(int)rotationAngle); + DrawArrow(_xArrow, scale.x * (q * rotation * Vector3.right), visualizeZ); + DrawArrow(_yArrow, scale.y * (q * rotation * Vector3.up), visualizeZ); + DrawArrow(_zArrow, scale.z * (q * rotation * Vector3.forward), visualizeZ); + } + + public void Draw(ObjectAnnotation target, Vector3 position, float arrowLengthScale = 1.0f, bool visualizeZ = true) + { + origin = position; + + var (xDir, yDir, zDir) = CameraCoordinate.GetDirections(target, rotationAngle, isMirrored); + DrawArrow(_xArrow, arrowLengthScale * xDir, visualizeZ); + DrawArrow(_yArrow, arrowLengthScale * yDir, visualizeZ); + DrawArrow(_zArrow, arrowLengthScale * zDir, visualizeZ); + } + + private void DrawArrow(Arrow arrow, Vector3 vec, bool visualizeZ) + { + var magnitude = vec.magnitude; + var direction = vec.normalized; + + if (!visualizeZ) + { + var direction2d = new Vector3(direction.x, direction.y, 0); + magnitude *= direction2d.magnitude; + direction = direction2d; + } + arrow.direction = direction; + arrow.magnitude = magnitude; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs.meta new file mode 100644 index 0000000..543ea38 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/TransformAnnotation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 219b3f9aac8f8d18db8e85142b28db7d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem.meta new file mode 100644 index 0000000..dabe215 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 483d25e852ee39b40a6cb7b11dacbea5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs new file mode 100644 index 0000000..cce6ce0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs @@ -0,0 +1,303 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity.CoordinateSystem +{ + /// + /// This class provides helper methods for converting camera coordinate values to local coordinate values in Unity. + /// See for more details. + /// + /// + /// Assume that the origin is common to the two coordinate systems. + /// + public static class CameraCoordinate + { + public static Vector3 CameraToRealWorld(float x, float y, float z, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var (rx, ry) = isInverted ? (y, x) : (x, y); + return new Vector3(IsXReversed(imageRotation, isMirrored) ? -rx : rx, IsYReversed(imageRotation, isMirrored) ? -ry : ry, -z); + } + + /// + /// Convert from camera coordinates to local coordinates in Unity. + /// + /// X in camera coordinates + /// Y in camera coordinates + /// Z in camera coordinates + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// Normalized focal length X in NDC space + /// Normalized focal length Y in NDC space + /// Normalized principal point X in NDC space + /// Normalized principal point Y in NDC space + /// Ratio of Z values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 CameraToLocalPoint(float x, float y, float z, float xMin, float xMax, float yMin, float yMax, + float focalLengthX, float focalLengthY, float principalX, float principalY, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var (ndcX, ndcY) = ((-focalLengthX * x / z) + principalX, (focalLengthY * y / z) + principalY); + var (width, height) = (xMax - xMin, yMax - yMin); + var (nx, ny) = ((1 + ndcX) / 2.0f, (1 - ndcY) / 2.0f); + var (rectX, rectY) = IsInverted(imageRotation) ? (ny * width, nx * height) : (nx * width, ny * height); + var localX = (IsXReversed(imageRotation, isMirrored) ? width - rectX : rectX) + xMin; + var localY = (IsYReversed(imageRotation, isMirrored) ? height - rectY : rectY) + yMin; + // Reverse the sign of Z because camera coordinate system is right-handed + var localZ = -z * zScale; + + return new Vector3(localX, localY, localZ); + } + + /// + /// Convert from camera coordinates to local coordinates in Unity. + /// + /// X in camera coordinates + /// Y in camera coordinates + /// Z in camera coordinates + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// Normalized focal lengths in NDC space + /// Normalized principal point in NDC space + /// Ratio of Z values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 CameraToLocalPoint(float x, float y, float z, float xMin, float xMax, float yMin, float yMax, Vector2 focalLength, Vector2 principalPoint, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToLocalPoint(x, y, z, xMin, xMax, yMin, yMax, focalLength.x, focalLength.y, principalPoint.x, principalPoint.y, zScale, imageRotation, isMirrored); + } + + /// + /// Convert from camera coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// X in camera coordinates + /// Y in camera coordinates + /// Z in camera coordinates + /// Normalized focal length X in NDC space + /// Normalized focal length Y in NDC space + /// Normalized principal point X in NDC space + /// Normalized principal point Y in NDC space + /// Ratio of Z values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 CameraToPoint(UnityEngine.Rect rectangle, float x, float y, float z, + float focalLengthX, float focalLengthY, float principalX, float principalY, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToLocalPoint(x, y, z, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, focalLengthX, focalLengthY, principalX, principalY, + zScale, imageRotation, isMirrored); + } + + /// + /// Convert from camera coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// X in camera coordinates + /// Y in camera coordinates + /// Z in camera coordinates + /// Normalized focal lengths in NDC space + /// Normalized principal point in NDC space + /// Ratio of Z values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 CameraToPoint(UnityEngine.Rect rectangle, float x, float y, float z, + Vector2 focalLength, Vector2 principalPoint, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToLocalPoint(x, y, z, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, focalLength.x, focalLength.y, principalPoint.x, principalPoint.y, + zScale, imageRotation, isMirrored); + } + + /// + /// Convert from camera coordinates to local coordinates in Unity. + /// It is assumed that the principal point is (0, 0) in the camera coordinate system and the focal length is (1, 1). + /// + /// Rectangle to get a point inside + /// X in camera coordinates + /// Y in camera coordinates + /// Z in camera coordinates + /// Ratio of Z values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 CameraToPoint(UnityEngine.Rect rectangle, float x, float y, float z, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToLocalPoint(x, y, z, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, Vector2.one, Vector2.zero, zScale, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in local coordinate system. + /// + /// Rectangle to get a point inside + /// Normalized focal length X in NDC space + /// Normalized focal length Y in NDC space + /// Normalized principal point X in NDC space + /// Normalized principal point Y in NDC space + /// Ratio of values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect rectangle, Point3D point3d, float focalLengthX, float focalLengthY, float principalX, float principalY, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToPoint(rectangle, point3d.X, point3d.Y, point3d.Z, focalLengthX, focalLengthY, principalX, principalY, zScale, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in local coordinate system. + /// + /// Rectangle to get a point inside + /// Normalized focal lengths in NDC space + /// Normalized principal point in NDC space + /// Ratio of values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect rectangle, Point3D point3d, Vector2 focalLength, Vector2 principalPoint, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToPoint(rectangle, point3d.X, point3d.Y, point3d.Z, focalLength, principalPoint, zScale, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in local coordinate system. + /// + /// Rectangle to get a point inside + /// Ratio of values in camera coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect rectangle, Point3D point3d, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return CameraToPoint(rectangle, point3d.X, point3d.Y, point3d.Z, zScale, imageRotation, isMirrored); + } + + public static Quaternion GetApproximateQuaternion(ObjectAnnotation objectAnnotation, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var isXReversed = IsXReversed(imageRotation, isMirrored); + var isYReversed = IsYReversed(imageRotation, isMirrored); + var forward = GetZDir(objectAnnotation, isXReversed, isYReversed, isInverted); + var upward = GetYDir(objectAnnotation, isXReversed, isYReversed, isInverted); + + return Quaternion.LookRotation(forward, upward); + } + + public static (Vector3, Vector3, Vector3) GetDirections(ObjectAnnotation objectAnnotation, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var isXReversed = IsXReversed(imageRotation, isMirrored); + var isYReversed = IsYReversed(imageRotation, isMirrored); + var scale = objectAnnotation.Scale; + var xDir = scale[0] * GetXDir(objectAnnotation, isXReversed, isYReversed, isInverted); + var yDir = scale[1] * GetYDir(objectAnnotation, isXReversed, isYReversed, isInverted); + var zDir = scale[2] * GetZDir(objectAnnotation, isXReversed, isYReversed, isInverted); + return (xDir, yDir, zDir); + } + + private static Vector3 GetXDir(ObjectAnnotation objectAnnotation, bool isXReversed, bool isYReversed, bool isInverted) + { + var points = objectAnnotation.Keypoints; + var v1 = GetDirection(points[1].Point3D, points[5].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v2 = GetDirection(points[2].Point3D, points[6].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v3 = GetDirection(points[3].Point3D, points[7].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v4 = GetDirection(points[4].Point3D, points[8].Point3D, isXReversed, isYReversed, isInverted).normalized; + return (v1 + v2 + v3 + v4) / 4; + } + + private static Vector3 GetYDir(ObjectAnnotation objectAnnotation, bool isXReversed, bool isYReversed, bool isInverted) + { + var points = objectAnnotation.Keypoints; + var v1 = GetDirection(points[1].Point3D, points[3].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v2 = GetDirection(points[2].Point3D, points[4].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v3 = GetDirection(points[5].Point3D, points[7].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v4 = GetDirection(points[6].Point3D, points[8].Point3D, isXReversed, isYReversed, isInverted).normalized; + return (v1 + v2 + v3 + v4) / 4; + } + + private static Vector3 GetZDir(ObjectAnnotation objectAnnotation, bool isXReversed, bool isYReversed, bool isInverted) + { + var points = objectAnnotation.Keypoints; + var v1 = GetDirection(points[2].Point3D, points[1].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v2 = GetDirection(points[4].Point3D, points[3].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v3 = GetDirection(points[6].Point3D, points[5].Point3D, isXReversed, isYReversed, isInverted).normalized; + var v4 = GetDirection(points[8].Point3D, points[7].Point3D, isXReversed, isYReversed, isInverted).normalized; + return (v1 + v2 + v3 + v4) / 4; + } + + private static Vector3 GetDirection(Point3D from, Point3D to, bool isXReversed, bool isYReversed, bool isInverted) + { + var xDiff = to.X - from.X; + var yDiff = to.Y - from.Y; + var (xDir, yDir) = isInverted ? (yDiff, xDiff) : (xDiff, yDiff); + // convert from right-handed to left-handed + return new Vector3(isXReversed ? -xDir : xDir, isYReversed ? -yDir : yDir, from.Z - to.Z); + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original Y axis will be exactly opposite the X axis in Unity coordinates if the image is rotated back. + /// + public static bool IsXReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation270 : + rotationAngle == RotationAngle.Rotation180 || rotationAngle == RotationAngle.Rotation270; + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original X axis will be exactly opposite the Y axis in Unity coordinates if the image is rotated back. + /// + public static bool IsYReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation180 || rotationAngle == RotationAngle.Rotation270 : + rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation180; + } + + /// + /// Returns true if is or . + /// + public static bool IsInverted(RotationAngle rotationAngle) + { + return rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation270; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs.meta new file mode 100644 index 0000000..e8709c1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/CameraCoordinate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92d2557dc55654e76b24cf607ac18146 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs new file mode 100644 index 0000000..b70bcba --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs @@ -0,0 +1,676 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +using mplt = Mediapipe.LocationData.Types; + +namespace Mediapipe.Unity.CoordinateSystem +{ + /// + /// This class provides helper methods for converting from image coordinate values to local coordinate values in Unity, and vice versa. + /// + public static class ImageCoordinate + { + /// + /// Convert from image coordinates to local coordinates in Unity. + /// + /// Column value in the image coordinate system + /// Row value in the image coordinate system + /// Depth value in the local coordinate system + /// + /// The target screen width. The returned value will be local to this screen. + /// + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the image coordinates is mirrored + public static Vector3 ImageToLocalPoint(int x, int y, int z, float xMin, float xMax, float yMin, float yMax, + int imageWidth, int imageHeight, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var (rectX, rectY) = isInverted ? (y, x) : (x, y); + var (width, height) = (xMax - xMin, yMax - yMin); + var localX = ((IsXReversed(imageRotation, isMirrored) ? imageWidth - rectX : rectX) * width / imageWidth) + xMin; + var localY = ((IsYReversed(imageRotation, isMirrored) ? imageHeight - rectY : rectY) * height / imageHeight) + yMin; + return new Vector3(localX, localY, z); + } + + /// + /// Convert from image coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// Column value in the image coordinate system + /// Row value in the image coordinate system + /// Depth value in the local coordinate system + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the image coordinates is mirrored + public static Vector3 ImageToPoint(UnityEngine.Rect rectangle, int x, int y, int z, + int imageWidth, int imageHeight, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToLocalPoint(x, y, z, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, imageWidth, imageHeight, imageRotation, isMirrored); + } + + /// + /// Convert from image coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// + /// The position in the image coordinate system. + /// If position.z is not zero, it's assumed to be the depth value in the local coordinate system. + /// + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the image coordinates is mirrored + public static Vector3 ImageToPoint(UnityEngine.Rect rectangle, Vector3Int position, + Vector2Int imageSize, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToPoint(rectangle, position.x, position.y, position.z, imageSize.x, imageSize.y, imageRotation, isMirrored); + } + + /// + /// Convert from image coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// Column value in the image coordinate system + /// Row value in the image coordinate system + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the image coordinates is mirrored + public static Vector3 ImageToPoint(UnityEngine.Rect rectangle, int x, int y, + int imageWidth, int imageHeight, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToLocalPoint(x, y, 0, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, imageWidth, imageHeight, imageRotation, isMirrored); + } + + /// + /// Convert from image coordinates to local coordinates in Unity. + /// + /// Rectangle to get a point inside + /// The position in the image coordinate system + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the image coordinates is mirrored + public static Vector3 ImageToPoint(UnityEngine.Rect rectangle, Vector2Int position, Vector2Int imageSize, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToPoint(rectangle, position.x, position.y, imageSize.x, imageSize.y, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Normalized x value in the image coordinate system + /// Normalized y value in the image coordinate system + /// Normalized z value in the image coordinate system + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// Ratio of Z value in image coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToLocalPoint(float normalizedX, float normalizedY, float normalizedZ, float xMin, float xMax, float yMin, float yMax, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var (nx, ny) = isInverted ? (normalizedY, normalizedX) : (normalizedX, normalizedY); + var x = IsXReversed(imageRotation, isMirrored) ? Mathf.LerpUnclamped(xMax, xMin, nx) : Mathf.LerpUnclamped(xMin, xMax, nx); + var y = IsYReversed(imageRotation, isMirrored) ? Mathf.LerpUnclamped(yMax, yMin, ny) : Mathf.LerpUnclamped(yMin, yMax, ny); + var z = zScale * normalizedZ; + return new Vector3(x, y, z); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// Normalized x value in the image coordinate system + /// Normalized y value in the image coordinate system + /// Normalized z value in the image coordinate system + /// Ratio of Z value in image coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, float normalizedX, float normalizedY, float normalizedZ, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToLocalPoint(normalizedX, normalizedY, normalizedZ, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, zScale, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// The position in the image coordinate system + /// Ratio of Z value in image coordinates to local coordinates in Unity + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, Vector3 position, + float zScale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, position.x, position.y, position.z, zScale, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Normalized x value in the image coordinate system + /// Normalized y value in the image coordinate system + /// Normalized z value in the image coordinate system + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// The minimum X coordinate of the target rectangle + /// The maximum X coordinate of the target rectangle + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToLocalPoint(float normalizedX, float normalizedY, float normalizedZ, float xMin, float xMax, float yMin, float yMax, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + // Z usually uses roughly the same scale as X + var zScale = IsInverted(imageRotation) ? (yMax - yMin) : (xMax - xMin); + return ImageNormalizedToLocalPoint(normalizedX, normalizedY, normalizedZ, xMin, xMax, yMin, yMax, zScale, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// Normalized x value in the image coordinate system + /// Normalized y value in the image coordinate system + /// Normalized z value in the image coordinate system + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, float normalizedX, float normalizedY, float normalizedZ, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToLocalPoint(normalizedX, normalizedY, normalizedZ, rectangle.xMin, rectangle.xMax, rectangle.yMin, rectangle.yMax, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// The position in the image coordinate system + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, Vector3 position, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, position.x, position.y, position.z, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// Normalized x value in the image coordinate system + /// Normalized y value in the image coordinate system + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, float normalizedX, float normalizedY, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, normalizedX, normalizedY, 0, imageRotation, isMirrored); + } + + /// + /// Convert normalized values in the image coordinate system to local coordinate values in Unity. + /// If the normalized values are out of [0, 1], the return value will be off the target screen. + /// + /// Rectangle to get a point inside + /// The position in the image coordinate system + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 ImageNormalizedToPoint(UnityEngine.Rect rectangle, Vector2 position, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, position.x, position.y, imageRotation, isMirrored); + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left. + /// + /// + /// Z values are always zero. + /// + /// Rectangle to get a point inside + /// Leftmost X value + /// Topmost Y value + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageToRectVertices(UnityEngine.Rect rectangle, int xMin, int yMin, int width, int height, + int imageWidth, int imageHeight, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var p = ImageToPoint(rectangle, xMin, yMin + height, imageWidth, imageHeight, imageRotation, isMirrored); + var q = ImageToPoint(rectangle, xMin + width, yMin, imageWidth, imageHeight, imageRotation, isMirrored); + return GetRectVertices(p, q); + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left. + /// + /// + /// Z values are always zero. + /// + /// Rectangle to get a point inside + /// Leftmost X value + /// Topmost Y value + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageToRectVertices(UnityEngine.Rect rectangle, int xMin, int yMin, int width, int height, + Vector2Int imageSize, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, xMin, yMin, width, height, imageSize.x, imageSize.y, imageRotation, isMirrored); + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left. + /// + /// + /// Z values are always zero. + /// + /// Rectangle to get a point inside + /// Normalized leftmost X value + /// Normalized topmost Y value + /// Normalized width + /// Normalized height + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageNormalizedToRectVertices(UnityEngine.Rect rectangle, float normalizedXMin, float normalizedYMin, float normalizedWidth, float normalizedHeight, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var p = ImageNormalizedToPoint(rectangle, normalizedXMin, normalizedYMin + normalizedHeight, imageRotation, isMirrored); + var q = ImageNormalizedToPoint(rectangle, normalizedXMin + normalizedWidth, normalizedYMin, imageRotation, isMirrored); + return GetRectVertices(p, q); + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left before the rotation. + /// + /// Rectangle to get a point inside + /// X value of the rectangle's center coordinate + /// Y value of the rectangle's center coordinate + /// Clockwise rotation angle in radians + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageToRectVertices(UnityEngine.Rect rectangle, int xCenter, int yCenter, int width, int height, float rotation, + int imageWidth, int imageHeight, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var (rectWidth, rectHeight) = IsInverted(imageRotation) ? (height, width) : (width, height); + + var center = ImageToPoint(rectangle, xCenter, yCenter, imageWidth, imageHeight, imageRotation, isMirrored); + var isRotationReversed = isInverted ^ IsXReversed(imageRotation, isMirrored) ^ IsYReversed(imageRotation, isMirrored); + var quaternion = Quaternion.Euler(0, 0, (isRotationReversed ? -1 : 1) * Mathf.Rad2Deg * rotation); + + var bottomLeftRel = quaternion * new Vector3(-rectWidth / 2, -rectHeight / 2, 0); + var topLeftRel = quaternion * new Vector3(-rectWidth / 2, rectHeight / 2, 0); + + return new Vector3[] { + center + bottomLeftRel, + center + topLeftRel, + center - bottomLeftRel, + center - topLeftRel, + }; + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left before the rotation. + /// + /// Rectangle to get a point inside + /// X value of the rectangle's center coordinate + /// Y value of the rectangle's center coordinate + /// Clockwise rotation angle in radians + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageToRectVertices(UnityEngine.Rect rectangle, int xCenter, int yCenter, int width, int height, float rotation, + Vector2Int imageSize, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, xCenter, yCenter, width, height, rotation, imageSize.x, imageSize.y, imageRotation, isMirrored); + } + + /// + /// Returns a array which represents a rectangle's vertices. + /// They are in clockwise order, starting from the coordinate that was in the bottom-left before the rotation. + /// + /// Rectangle to get a point inside + /// X value of the rectangle's center coordinate + /// Y value of the rectangle's center coordinate + /// Normalized width + /// Normalized height + /// Clockwise rotation angle in radians + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] ImageNormalizedToRectVertices(UnityEngine.Rect rectangle, float normalizedXCenter, float normalizedYCenter, float normalizedWidth, float normalizedHeight, + float rotation, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var isInverted = IsInverted(imageRotation); + var width = rectangle.width * (isInverted ? normalizedHeight : normalizedWidth); + var height = rectangle.height * (isInverted ? normalizedWidth : normalizedHeight); + + var center = ImageNormalizedToPoint(rectangle, normalizedXCenter, normalizedYCenter, imageRotation, isMirrored); + var isRotationReversed = isInverted ^ IsXReversed(imageRotation, isMirrored) ^ IsYReversed(imageRotation, isMirrored); + var quaternion = Quaternion.Euler(0, 0, (isRotationReversed ? -1 : 1) * Mathf.Rad2Deg * rotation); + + var bottomLeftRel = quaternion * new Vector3(-width / 2, -height / 2, 0); + var topLeftRel = quaternion * new Vector3(-width / 2, height / 2, 0); + + return new Vector3[] { + center + bottomLeftRel, + center + topLeftRel, + center - bottomLeftRel, + center - topLeftRel, + }; + } + + private static Vector3[] GetRectVertices(Vector2 p, Vector2 q) + { + var leftX = Mathf.Min(p.x, q.x); + var rightX = Mathf.Max(p.x, q.x); + var bottomY = Mathf.Min(p.y, q.y); + var topY = Mathf.Max(p.y, q.y); + + var bottomLeft = new Vector3(leftX, bottomY); + var topLeft = new Vector3(leftX, topY); + var topRight = new Vector3(rightX, topY); + var bottomRight = new Vector3(rightX, bottomY); + + return new Vector3[] { bottomLeft, topLeft, topRight, bottomRight }; + } + + /// + /// Get the coordinates represented by in the local coordinate system. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector2 GetPoint(this UnityEngine.Rect rectangle, mplt.RelativeKeypoint relativeKeypoint, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, relativeKeypoint.X, relativeKeypoint.Y, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in the local coordinate system. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect rectangle, NormalizedLandmark normalizedLandmark, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, normalizedLandmark.X, normalizedLandmark.Y, normalizedLandmark.Z, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in the local coordinate system. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect rectangle, NormalizedPoint2D point2d, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, point2d.X, point2d.Y, imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in the local coordinate system. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector2 GetPoint(this UnityEngine.Rect rectangle, Anchor3d anchor3d, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToPoint(rectangle, anchor3d.x, anchor3d.y, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, mplt.BoundingBox boundingBox, int imageWidth, int imageHeight, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, boundingBox.Xmin, boundingBox.Ymin, boundingBox.Width, boundingBox.Height, imageWidth, imageHeight, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, mplt.BoundingBox boundingBox, Vector2Int imageSize, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, boundingBox.Xmin, boundingBox.Ymin, boundingBox.Width, boundingBox.Height, imageSize, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, mplt.RelativeBoundingBox boundingBox, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToRectVertices(rectangle, boundingBox.Xmin, boundingBox.Ymin, boundingBox.Width, boundingBox.Height, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// Image width in pixels + /// Image width in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, Rect rect, int imageWidth, int imageHeight, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, rect.XCenter, rect.YCenter, rect.Width, rect.Height, rect.Rotation, imageWidth, imageHeight, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// Image size in pixels + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, Rect rect, Vector2Int imageSize, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageToRectVertices(rectangle, rect.XCenter, rect.YCenter, rect.Width, rect.Height, rect.Rotation, imageSize, imageRotation, isMirrored); + } + + /// + /// Get a Vector3 array which represents 's vertex coordinates in the local coordinate system. + /// They are ordered clockwise from bottom-left point. + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3[] GetRectVertices(this UnityEngine.Rect rectangle, NormalizedRect normalizedRect, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return ImageNormalizedToRectVertices(rectangle, normalizedRect.XCenter, normalizedRect.YCenter, normalizedRect.Width, normalizedRect.Height, normalizedRect.Rotation, imageRotation, isMirrored); + } + + /// + /// Get the image normalized point corresponding to . + /// + /// Rectangle to get a point inside + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector2 PointToImageNormalized(this UnityEngine.Rect rectangle, Vector2 localPosition, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var normalizedX = IsXReversed(imageRotation, isMirrored) ? + Mathf.InverseLerp(rectangle.width / 2, -rectangle.width / 2, localPosition.x) : + Mathf.InverseLerp(-rectangle.width / 2, rectangle.width / 2, localPosition.x); + var normalizedY = IsYReversed(imageRotation, isMirrored) ? + Mathf.InverseLerp(rectangle.height / 2, -rectangle.height / 2, localPosition.y) : + Mathf.InverseLerp(-rectangle.height / 2, rectangle.height / 2, localPosition.y); + return IsInverted(imageRotation) ? new Vector2(normalizedY, normalizedX) : new Vector2(normalizedX, normalizedY); + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original Y axis will be exactly opposite the X axis in Unity coordinates if the image is rotated back. + /// + public static bool IsXReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation90 : + rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation180; + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original X axis will be exactly opposite the Y axis in Unity coordinates if the image is rotated back. + /// + public static bool IsYReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation270 : + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation90; + } + + /// + /// Returns true if is or . + /// + public static bool IsInverted(RotationAngle rotationAngle) + { + return rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation270; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs.meta new file mode 100644 index 0000000..9072351 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/ImageCoordinate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0e382e967c8301cfb71c0baf698cb45 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs new file mode 100644 index 0000000..c0ed393 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs @@ -0,0 +1,106 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity.CoordinateSystem +{ + /// + /// This class provides helper methods for converting real-world coordinate values to local coordinate values. + /// In real-world coordinate system, X axis is toward the right, Y axis is toward the bottom, and Z axis is toward the back. + /// + public static class RealWorldCoordinate + { + /// + /// Convert from real world coordinates to Unity local coordinates. + /// Assume that the origin is common to the two coordinate systems. + /// + /// X in real world coordinates + /// Y in real world coordinates + /// Z in real world coordinates + /// Ratio of real world coordinate values to local coordinate values + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 RealWorldToLocalPoint(float x, float y, float z, Vector3 scale, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + var (rx, ry) = IsInverted(imageRotation) ? (y, x) : (x, y); + var realX = IsXReversed(imageRotation, isMirrored) ? -rx : rx; + var realY = IsYReversed(imageRotation, isMirrored) ? -ry : ry; + return Vector3.Scale(new Vector3(realX, realY, z), scale); + } + + /// + /// Convert from real world coordinates to Unity local coordinates. + /// Assume that the origin is common to the two coordinate systems. + /// + /// X in real world coordinates + /// Y in real world coordinates + /// Z in real world coordinates + /// Ratio of real world coordinate X to local coordinate X + /// Ratio of real world coordinate Y to local coordinate Y + /// Ratio of real world coordinate Z to local coordinate Z + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 RealWorldToLocalPoint(float x, float y, float z, float scaleX = 1, float scaleY = 1, float scaleZ = 1, + RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return RealWorldToLocalPoint(x, y, z, new Vector3(scaleX, scaleY, scaleZ), imageRotation, isMirrored); + } + + /// + /// Get the coordinates represented by in the local coordinate system. + /// + /// Ratio of real world coordinate values to local coordinate values + /// + /// Counterclockwise rotation angle of the input image in the image coordinate system. + /// In the local coordinate system, this value will often represent a clockwise rotation angle. + /// + /// Set to true if the original coordinates is mirrored + public static Vector3 GetPoint(this UnityEngine.Rect _, Landmark landmark, Vector3 scale, RotationAngle imageRotation = RotationAngle.Rotation0, bool isMirrored = false) + { + return RealWorldToLocalPoint(landmark.X, landmark.Y, landmark.Z, scale, imageRotation, isMirrored); + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original Y axis will be exactly opposite the X axis in Unity coordinates if the image is rotated back. + /// + public static bool IsXReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation90 : + rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation180; + } + + /// + /// When the image is rotated back, returns whether the axis parallel to the X axis of the Unity coordinates is pointing in the same direction as the X axis of the Unity coordinates. + /// For example, if is and is false, this returns true + /// because the original X axis will be exactly opposite the Y axis in Unity coordinates if the image is rotated back. + /// + public static bool IsYReversed(RotationAngle rotationAngle, bool isMirrored = false) + { + return isMirrored ? + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation270 : + rotationAngle == RotationAngle.Rotation0 || rotationAngle == RotationAngle.Rotation90; + } + + /// + /// Returns true if is or . + /// + public static bool IsInverted(RotationAngle rotationAngle) + { + return rotationAngle == RotationAngle.Rotation90 || rotationAngle == RotationAngle.Rotation270; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs.meta new file mode 100644 index 0000000..533a9a5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/CoordinateSystem/RealWorldCoordinate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bd1bbb8c8056065c940c7d9d211b3d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension.meta new file mode 100644 index 0000000..b2f445a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b608fd45c3e23274082f4cd4919c23f4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs new file mode 100644 index 0000000..39f7016 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs @@ -0,0 +1,27 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using pb = Google.Protobuf; + +namespace Mediapipe.Unity +{ + public static class CalculatorGraphConfigExtension + { + public static string AddPacketPresenceCalculator(this CalculatorGraphConfig config, string outputStreamName) + { + var presenceStreamName = Tool.GetUnusedStreamName(config, $"{outputStreamName}_presence"); + var packetPresenceCalculatorNode = new CalculatorGraphConfig.Types.Node() + { + Calculator = "PacketPresenceCalculator" + }; + packetPresenceCalculatorNode.InputStream.Add($"PACKET:{outputStreamName}"); + packetPresenceCalculatorNode.OutputStream.Add($"PRESENCE:{presenceStreamName}"); + + config.Node.Add(packetPresenceCalculatorNode); + return presenceStreamName; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs.meta new file mode 100644 index 0000000..9c0db75 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/CalculatorGraphConfigExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfad83caa3e9e0012b327e6409a19937 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs new file mode 100644 index 0000000..3d84b5d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs @@ -0,0 +1,936 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Runtime.CompilerServices; +using UnityEngine; +namespace Mediapipe.Unity +{ + public static class ImageFrameExtension + { + /// + /// Read the specific channel data only. + /// It's useful when only one channel is used (e.g. Hair Segmentation mask). + /// + /// + /// true if the channel data is read successfully; otherwise false. + /// + /// + /// Specify from which channel (0-indexed) the data will be retrieved. + /// For example, if the format is RGB, 0 means R channel, 1 means G channel, and 2 means B channel. + /// + /// + /// The array to which the output data will be written. + /// + /// + /// Set true if the is flipped horizontally. + /// + /// + /// Set true if the is flipped vertically. + /// + public static bool TryReadChannel(this ImageFrame imageFrame, int channelNumber, byte[] channelData, bool isHorizontallyFlipped = false, bool isVerticallyFlipped = false) + { + var format = imageFrame.Format(); + var channelCount = ImageFrame.NumberOfChannelsForFormat(format); + if (!IsChannelNumberValid(channelCount, channelNumber)) + { + return false; + } + +#pragma warning disable IDE0010 + switch (format) + { + case ImageFormat.Types.Format.Srgb: + case ImageFormat.Types.Format.Srgba: + case ImageFormat.Types.Format.Sbgra: + case ImageFormat.Types.Format.Gray8: + case ImageFormat.Types.Format.Lab8: + return TryReadChannel(imageFrame, channelCount, channelNumber, channelData, isHorizontallyFlipped, isVerticallyFlipped); + default: + Logger.LogWarning("The channel data is not stored in bytes"); + return false; + } +#pragma warning restore IDE0010 + } + + /// + /// Read the specific channel data only. + /// It's useful when only one channel is used (e.g. Hair Segmentation mask). + /// + /// + /// true if the channel data is read successfully; otherwise false. + /// + /// + /// Specify from which channel (0-indexed) the data will be retrieved. + /// For example, if the format is RGB, 0 means R channel, 1 means G channel, and 2 means B channel. + /// + /// + /// The array to which the output data will be written. + /// + /// + /// Set true if the is flipped horizontally. + /// + /// + /// Set true if the is flipped vertically. + /// + public static bool TryReadChannel(this ImageFrame imageFrame, int channelNumber, ushort[] channelData, bool isHorizontallyFlipped = false, bool isVerticallyFlipped = false) + { + var format = imageFrame.Format(); + var channelCount = ImageFrame.NumberOfChannelsForFormat(format); + if (!IsChannelNumberValid(channelCount, channelNumber)) + { + return false; + } + +#pragma warning disable IDE0010 + switch (format) + { + case ImageFormat.Types.Format.Srgb48: + case ImageFormat.Types.Format.Srgba64: + case ImageFormat.Types.Format.Gray16: + return TryReadChannel(imageFrame, channelCount, channelNumber, channelData, isHorizontallyFlipped, isVerticallyFlipped); + default: + Logger.LogWarning("The channel data is not stored in ushorts"); + return false; + } +#pragma warning restore IDE0010 + } + + /// + /// Read the specific channel data only. + /// It's useful when only one channel is used (e.g. Selfie Segmentation mask). + /// + /// + /// true if the channel data is read successfully; otherwise false. + /// + /// + /// Specify from which channel (0-indexed) the data will be retrieved. + /// + /// + /// The array to which the output data will be written. + /// + /// + /// Set true if the is flipped horizontally. + /// + /// + /// Set true if the is flipped vertically. + /// + public static bool TryReadChannel(this ImageFrame imageFrame, int channelNumber, float[] channelData, bool isHorizontallyFlipped = false, bool isVerticallyFlipped = false) + { + var format = imageFrame.Format(); + var channelCount = ImageFrame.NumberOfChannelsForFormat(format); + if (!IsChannelNumberValid(channelCount, channelNumber)) + { + return false; + } + +#pragma warning disable IDE0010 + switch (format) + { + case ImageFormat.Types.Format.Vec32F1: + case ImageFormat.Types.Format.Vec32F2: + return TryReadChannel(imageFrame, channelCount, channelNumber, channelData, isHorizontallyFlipped, isVerticallyFlipped); + default: + Logger.LogWarning("The channel data is not stored in floats"); + return false; + } +#pragma warning restore IDE0010 + } + + /// + /// Read the specific channel data only. + /// Each value in will be normalized to [0.0, 1.0]. + /// + /// + /// true if the channel data is read successfully; otherwise false. + /// + /// + /// Specify from which channel (0-indexed) the data will be retrieved. + /// + /// + /// The array to which the output data will be written. + /// + /// + /// Set true if the is flipped horizontally. + /// + /// + /// Set true if the is flipped vertically. + /// + public static bool TryReadChannelNormalized(this ImageFrame imageFrame, int channelNumber, float[] normalizedChannelData, bool isHorizontallyFlipped = false, bool isVerticallyFlipped = false) + { + var format = imageFrame.Format(); + var channelCount = ImageFrame.NumberOfChannelsForFormat(format); + if (!IsChannelNumberValid(channelCount, channelNumber)) + { + return false; + } + +#pragma warning disable IDE0010 + switch (format) + { + case ImageFormat.Types.Format.Srgb: + case ImageFormat.Types.Format.Srgba: + case ImageFormat.Types.Format.Sbgra: + case ImageFormat.Types.Format.Gray8: + case ImageFormat.Types.Format.Lab8: + return TryReadChannel(imageFrame, channelCount, channelNumber, ByteNormalizer, normalizedChannelData, isHorizontallyFlipped, isVerticallyFlipped); + case ImageFormat.Types.Format.Srgb48: + case ImageFormat.Types.Format.Srgba64: + case ImageFormat.Types.Format.Gray16: + return TryReadChannel(imageFrame, channelCount, channelNumber, UshortNormalizer, normalizedChannelData, isHorizontallyFlipped, isVerticallyFlipped); + case ImageFormat.Types.Format.Vec32F1: + case ImageFormat.Types.Format.Vec32F2: + return TryReadChannel(imageFrame, channelCount, channelNumber, normalizedChannelData, isHorizontallyFlipped, isVerticallyFlipped); + default: + Logger.LogWarning("Channels don't make sense in the current context"); + return false; + } +#pragma warning restore IDE0010 + } + + public static bool TryReadPixelData(this ImageFrame imageFrame, Color32[] colors) + { + unsafe + { +#pragma warning disable IDE0010 + switch (imageFrame.Format()) + { + case ImageFormat.Types.Format.Srgb: + return TryReadSrgb(imageFrame, colors); + case ImageFormat.Types.Format.Srgba: + return TryReadSrgba(imageFrame, colors); + case ImageFormat.Types.Format.Sbgra: + return TryReadSbgra(imageFrame, colors); + case ImageFormat.Types.Format.Gray8: + return TryReadGray8(imageFrame, colors); + case ImageFormat.Types.Format.Lab8: + return TryReadLab8(imageFrame, colors); + case ImageFormat.Types.Format.Srgb48: + return TryReadSrgb48(imageFrame, colors); + case ImageFormat.Types.Format.Srgba64: + return TryReadSrgba64(imageFrame, colors); + case ImageFormat.Types.Format.Gray16: + return TryReadGray16(imageFrame, colors); + case ImageFormat.Types.Format.Vec32F1: + return TryReadVec32f1(imageFrame, colors); + case ImageFormat.Types.Format.Vec32F2: + return TryReadVec32f2(imageFrame, colors); + default: + Logger.LogWarning("Channels don't make sense in the current context"); + return false; + } +#pragma warning restore IDE0010 + } + } + + private static bool TryReadChannel(ImageFrame imageFrame, int channelCount, int channelNumber, T[] channelData, bool isHorizontallyFlipped, bool isVerticallyFlipped) where T : unmanaged + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (channelData.Length != length) + { + Logger.LogWarning($"The length of channelData ({channelData.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (T* dest = channelData) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + pLine += byteDepth * channelNumber; + + if (isVerticallyFlipped) + { + if (isHorizontallyFlipped) + { + // The first element is at bottom-right. + var pDest = dest + width - 1; + + for (var i = 0; i < height; i++) + { + var pSrc = (T*)pLine; + for (var j = 0; j < width; j++) + { + *pDest-- = *pSrc; + pSrc += channelCount; + } + pLine += widthStep; + pDest += 2 * width; + } + } + else + { + // The first element is at bottom-left. + // NOTE: In the Unity coordinate system, the image can be considered as not flipped. + var pDest = dest; + + for (var i = 0; i < height; i++) + { + var pSrc = (T*)pLine; + for (var j = 0; j < width; j++) + { + *pDest++ = *pSrc; + pSrc += channelCount; + } + pLine += widthStep; + } + } + } + else + { + if (isHorizontallyFlipped) + { + // The first element is at top-right. + var pDest = dest + length - 1; + + for (var i = 0; i < height; i++) + { + var pSrc = (T*)pLine; + for (var j = 0; j < width; j++) + { + *pDest-- = *pSrc; + pSrc += channelCount; + } + pLine += widthStep; + } + } + else + { + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (T*)pLine; + for (var j = 0; j < width; j++) + { + *pDest++ = *pSrc; + pSrc += channelCount; + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + } + } + + return true; + } + + private delegate TDst ChannelTransformer(TSrc channel); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static bool TryReadChannel(ImageFrame imageFrame, int channelCount, int channelNumber, ChannelTransformer transformer, + TDst[] channelData, bool isHorizontallyFlipped, bool isVerticallyFlipped) where TSrc : unmanaged where TDst : unmanaged + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (channelData.Length != length) + { + Logger.LogWarning($"The length of channelData ({channelData.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (TDst* dest = channelData) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + pLine += byteDepth * channelNumber; + + if (isVerticallyFlipped) + { + if (isHorizontallyFlipped) + { + // The first element is at bottom-right. + var pDest = dest + width - 1; + + for (var i = 0; i < height; i++) + { + var pSrc = (TSrc*)pLine; + for (var j = 0; j < width; j++) + { + *pDest-- = transformer(*pSrc); + pSrc += channelCount; + } + pLine += widthStep; + pDest += 2 * width; + } + } + else + { + // The first element is at bottom-left. + // NOTE: In the Unity coordinate system, the image can be considered as not flipped. + var pDest = dest; + + for (var i = 0; i < height; i++) + { + var pSrc = (TSrc*)pLine; + for (var j = 0; j < width; j++) + { + *pDest++ = transformer(*pSrc); + pSrc += channelCount; + } + pLine += widthStep; + } + } + } + else + { + if (isHorizontallyFlipped) + { + // The first element is at top-right. + var pDest = dest + length - 1; + + for (var i = 0; i < height; i++) + { + var pSrc = (TSrc*)pLine; + for (var j = 0; j < width; j++) + { + *pDest-- = transformer(*pSrc); + pSrc += channelCount; + } + pLine += widthStep; + } + } + else + { + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (TSrc*)pLine; + for (var j = 0; j < width; j++) + { + *pDest++ = transformer(*pSrc); + pSrc += channelCount; + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + } + } + + return true; + } + + private static T Identity(T x) + { + return x; + } + + private static float ByteNormalizer(byte x) + { + return (float)x / ((1 << 8) - 1); + } + + private static float UshortNormalizer(ushort x) + { + return (float)x / ((1 << 16) - 1); + } + + private static bool IsChannelNumberValid(int channelCount, int channelNumber) + { + if (channelNumber < 0) + { + Logger.LogWarning($"{channelNumber} must be >= 0"); + return false; + } + + if (channelCount == 0) + { + Logger.LogWarning("Channels don't make sense in the current context"); + return false; + } + + if (channelNumber >= channelCount) + { + Logger.LogWarning($"channelNumber must be <= {channelCount - 1} since there are only {channelCount} channels, but {channelNumber} is given"); + return false; + } + return true; + } + + private static bool TryReadSrgb(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = pLine; + for (var j = 0; j < width; j++) + { + var r = *pSrc++; + var g = *pSrc++; + var b = *pSrc++; + *pDest++ = new Color32(r, g, b, 255); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadSrgba(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = pLine; + for (var j = 0; j < width; j++) + { + var r = *pSrc++; + var g = *pSrc++; + var b = *pSrc++; + var a = *pSrc++; + *pDest++ = new Color32(r, g, b, a); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadSbgra(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = pLine; + for (var j = 0; j < width; j++) + { + var b = *pSrc++; + var g = *pSrc++; + var r = *pSrc++; + var a = *pSrc++; + *pDest++ = new Color32(r, g, b, a); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadGray8(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = pLine; + for (var j = 0; j < width; j++) + { + var v = *pSrc++; + *pDest++ = new Color32(v, v, v, 255); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadLab8(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = pLine; + for (var j = 0; j < width; j++) + { + var l = *pSrc++; + var a = *pSrc++; + var b = *pSrc++; + *pDest++ = Lab8ToRgb(l, a, b); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadSrgb48(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (ushort*)pLine; + for (var j = 0; j < width; j++) + { + var r = *pSrc++; + var g = *pSrc++; + var b = *pSrc++; + *pDest++ = new Color32((byte)(r / 255), (byte)(g / 255), (byte)(b / 255), 255); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadSrgba64(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (ushort*)pLine; + for (var j = 0; j < width; j++) + { + var r = *pSrc++; + var g = *pSrc++; + var b = *pSrc++; + var a = *pSrc++; + *pDest++ = new Color32((byte)(r / 255), (byte)(g / 255), (byte)(b / 255), (byte)(a / 255)); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadGray16(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (ushort*)pLine; + for (var j = 0; j < width; j++) + { + var v = *pSrc++; + *pDest++ = new Color32((byte)(v / 255), (byte)(v / 255), (byte)(v / 255), 255); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadVec32f1(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (float*)pLine; + for (var j = 0; j < width; j++) + { + var v = *pSrc++; + *pDest++ = new Color32((byte)(v * 255), (byte)(v * 255), (byte)(v * 255), 255); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static bool TryReadVec32f2(ImageFrame imageFrame, Color32[] colors) + { + var width = imageFrame.Width(); + var height = imageFrame.Height(); + var length = width * height; + + if (colors.Length != length) + { + Logger.LogWarning($"The length of colors ({colors.Length}) does not equal {width} * {height} = {length}"); + return false; + } + + var widthStep = imageFrame.WidthStep(); + var byteDepth = imageFrame.ByteDepth(); + + unsafe + { + fixed (Color32* dest = colors) + { + // NOTE: We cannot assume that the pixel data is aligned properly. + var pLine = (byte*)imageFrame.MutablePixelData(); + // The first element is at top-left (the image is not flipped at all). + var pDest = dest + (width * (height - 1)); + + for (var i = 0; i < height; i++) + { + var pSrc = (float*)pLine; + for (var j = 0; j < width; j++) + { + var x = *pSrc++; + var y = *pSrc++; + var magnitude = Mathf.Sqrt((x * x) + (y * y)); + var angle = Mathf.Atan2(y, x); + *pDest++ = UnityEngine.Color.HSVToRGB(magnitude, 1.0f, angle); + } + pLine += widthStep; + pDest -= 2 * width; + } + } + } + + return true; + } + + private static (float, float, float) Lab8ToXYZ(byte l, sbyte a, sbyte b) + { + // cf. https://en.wikipedia.org/wiki/CIELAB_color_space + var delta = 6.0f / 29; + var kappa = 903.3f; // 24389 / 27 + var fy = (float)(l + 16) / 116; + var fx = ((float)a / 500) + fy; + var fz = fy - ((float)b / 200); + var xr = fx > delta ? fx * fx * fx : ((116 * fx) - 16) / kappa; + var yr = fy > delta ? fy * fy * fy : ((116 * fy) - 16) / kappa; + var zr = fz > delta ? fz * fz * fz : ((116 * fz) - 16) / kappa; + + // use D65 as the reference white + return (0.950489f * xr, yr, 1.088840f * zr); + } + + private static Color32 XYZToRgb(float x, float y, float z) + { + // cf. https://stackoverflow.com/questions/66360637/which-matrix-is-correct-to-map-xyz-to-linear-rgb-for-srgb + var rl = (3.24096994f * x) - (1.53738318f * y) - (0.49861076f * z); + var gl = (-0.96924364f * x) + (1.87596750f * y) + (0.04155506f * z); + var bl = (0.05563008f * x) - (0.20397696f * y) + (1.05697151f * z); + var r = rl <= 0.0031308f ? 12.92f * rl : (1.055f * Mathf.Pow(rl, 1 / 2.4f)) - 0.055f; + var g = gl <= 0.0031308f ? 12.92f * gl : (1.055f * Mathf.Pow(gl, 1 / 2.4f)) - 0.055f; + var b = bl <= 0.0031308f ? 12.92f * bl : (1.055f * Mathf.Pow(bl, 1 / 2.4f)) - 0.055f; + + return new UnityEngine.Color(r, g, b, 255); + } + + private static Color32 Lab8ToRgb(byte l, byte a, byte b) + { + var (x, y, z) = Lab8ToXYZ(l, (sbyte)a, (sbyte)b); + return XYZToRgb(x, y, z); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs.meta new file mode 100644 index 0000000..5249533 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/ImageFrameExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d2ed92677011f5249a32983f023f216 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs new file mode 100644 index 0000000..987b25c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs @@ -0,0 +1,58 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe +{ + public static class TextureFormatExtension + { + public static ImageFormat.Types.Format ToImageFormat(this TextureFormat textureFormat) + { +#pragma warning disable IDE0010 + switch (textureFormat) + { + case TextureFormat.RGB24: + { + return ImageFormat.Types.Format.Srgb; + } + case TextureFormat.RGBA32: + { + return ImageFormat.Types.Format.Srgba; + } + case TextureFormat.Alpha8: + { + return ImageFormat.Types.Format.Gray8; + } + case TextureFormat.RGB48: + { + return ImageFormat.Types.Format.Srgb48; + } + case TextureFormat.RGBA64: + { + return ImageFormat.Types.Format.Srgba64; + } + case TextureFormat.RFloat: + { + return ImageFormat.Types.Format.Vec32F1; + } + case TextureFormat.RGFloat: + { + return ImageFormat.Types.Format.Vec32F2; + } + case TextureFormat.BGRA32: + { + return ImageFormat.Types.Format.Sbgra; + } + default: + { + return ImageFormat.Types.Format.Unknown; + } + } + } +#pragma warning restore IDE0010 + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs.meta new file mode 100644 index 0000000..8ed4a93 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Extension/TextureFormatExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1175bfd0d6ad20e858e8cc31a58187eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs new file mode 100644 index 0000000..1e62eec --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs @@ -0,0 +1,93 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Mediapipe.Unity +{ + public class GlobalInstanceTable where TValue : class + { + private readonly Dictionary> _table; + private readonly int _maxSize; + + public GlobalInstanceTable(int maxSize) + { + _table = new Dictionary>(); + _maxSize = maxSize; + } + + public void Add(TKey key, TValue value) + { + if (_table.Count >= _maxSize) + { + ClearUnusedKeys(); + } + + lock (((ICollection)_table).SyncRoot) + { + if (_table.Count >= _maxSize) + { + throw new InvalidOperationException("The table is full"); + } + + if (_table.ContainsKey(key)) + { + if (_table[key].TryGetTarget(out var currentValue)) + { + throw new ArgumentException("An instance with the same key already exists"); + } + _table[key].SetTarget(value); + } + else + { + _table[key] = new WeakReference(value); + } + } + } + + public bool TryGetValue(TKey key, out TValue value) + { + lock (((ICollection)_table).SyncRoot) + { + if (_table.ContainsKey(key)) + { + return _table[key].TryGetTarget(out value); + } + } + value = default; + return false; + } + + public void Clear() + { + lock (((ICollection)_table).SyncRoot) + { + _table.Clear(); + } + } + + public bool ContainsKey(TKey key) + { + return _table.ContainsKey(key); + } + + private void ClearUnusedKeys() + { + lock (((ICollection)_table).SyncRoot) + { + var deadKeys = _table.Where(x => !x.Value.TryGetTarget(out var target)).Select(x => x.Key).ToArray(); + + foreach (var key in deadKeys) + { + var _ = _table.Remove(key); + } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs.meta new file mode 100644 index 0000000..cb9c81c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GlobalInstanceTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2732ac5c3629755e19f5eeeba29bfe79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs new file mode 100644 index 0000000..2d2d400 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs @@ -0,0 +1,148 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.Rendering; + +#if UNITY_ANDROID +using System.Runtime.InteropServices; +#endif + +namespace Mediapipe.Unity +{ + public static class GpuManager + { + private const string _TAG = nameof(GpuManager); + + private delegate void PluginCallback(int eventId); + + private static readonly object _SetupLock = new object(); +#pragma warning disable IDE0044 + private static IntPtr _CurrentContext = IntPtr.Zero; +#pragma warning restore IDE0044 + private static bool _IsContextInitialized = false; + + public static GpuResources GpuResources { get; private set; } + public static GlCalculatorHelper GlCalculatorHelper { get; private set; } + + public static bool IsInitialized { get; private set; } + + /// + /// Initialize GPU resources. + /// If it finishes successfully, will be set to true. + /// + /// + /// If is true, it will do nothing. + /// Before the application exits, don't forget to call . + /// + public static IEnumerator Initialize() + { + lock (_SetupLock) + { + if (IsInitialized) + { + Logger.LogInfo(_TAG, "Already initialized"); + yield break; + } + +#if UNITY_ANDROID + _IsContextInitialized = SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES3; + if (!_IsContextInitialized) + { + PluginCallback callback = GetCurrentContext; + + var fp = Marshal.GetFunctionPointerForDelegate(callback); + GL.IssuePluginEvent(fp, 1); + } +#else + _IsContextInitialized = true; +#endif + + var count = 100; + yield return new WaitUntil(() => + { + return --count < 0 || _IsContextInitialized; + }); + + if (!_IsContextInitialized) + { + Logger.LogError(_TAG, "Failed to get GlContext"); + yield break; + } + +#if UNITY_ANDROID + if (_CurrentContext == IntPtr.Zero) + { + Logger.LogWarning(_TAG, "EGL context is not found, so MediaPipe won't share their EGL contexts with Unity"); + } + else + { + Logger.LogVerbose(_TAG, $"EGL context is found: {_CurrentContext}"); + } +#endif + + try + { + Logger.LogInfo(_TAG, "Initializing GpuResources..."); + var statusOrGpuResources = GpuResources.Create(_CurrentContext); + + statusOrGpuResources.status.AssertOk(); + GpuResources = statusOrGpuResources.Value(); + + Logger.LogInfo(_TAG, "Initializing GlCalculatorHelper..."); + GlCalculatorHelper = new GlCalculatorHelper(); + GlCalculatorHelper.InitializeForTest(GpuResources); + + IsInitialized = true; + } + catch (EntryPointNotFoundException e) + { + Logger.LogException(e); + Logger.LogError(_TAG, "Failed to create GpuResources. Did you build libraries with GPU enabled?"); + } + catch (Exception e) + { + Logger.LogException(e); + } + } + } + + /// + /// Dispose GPU resources. + /// + /// + /// This has to be called before the application exits. + /// Otherwise, UnityEditor can freeze. + /// + public static void Shutdown() + { + if (GpuResources != null) + { + GpuResources.Dispose(); + GpuResources = null; + } + + if (GlCalculatorHelper != null) + { + GlCalculatorHelper.Dispose(); + GlCalculatorHelper = null; + } + + IsInitialized = false; + } + + // Currently, it works only on Android +#if UNITY_ANDROID + [AOT.MonoPInvokeCallback(typeof(PluginCallback))] + private static void GetCurrentContext(int eventId) { + _CurrentContext = Egl.GetCurrentContext(); + _IsContextInitialized = true; + } +#endif + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs.meta new file mode 100644 index 0000000..c2b17c5 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fba9b42612cdd0930b549163d865fd39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs new file mode 100644 index 0000000..269af9b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs @@ -0,0 +1,292 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using UnityEngine; + +using ConditionalAttribute = System.Diagnostics.ConditionalAttribute; + +namespace Mediapipe.Unity +{ + public interface IExtendedLogger : ILogger + { + void Log(Logger.LogLevel logLevel, string tag, object message, UnityEngine.Object context); + void Log(Logger.LogLevel logLevel, string tag, object message); + void Log(Logger.LogLevel logLevel, object message, UnityEngine.Object context); + void Log(Logger.LogLevel logLevel, object message); + } + + public static class Logger + { + public enum LogLevel : int + { + Fatal, + Error, + Warn, + Info, + Verbose, + Debug, + } + + public static LogLevel MinLogLevel { get; set; } = LogLevel.Info; + private static IExtendedLogger _InternalLogger; + public static IExtendedLogger InternalLogger + { + get + { + if (_InternalLogger == null) + { + _InternalLogger = new LoggerWrapper(Debug.unityLogger); + } + return _InternalLogger; + } + } + + public static void SetLogger(IExtendedLogger newLogger) + { + _InternalLogger = newLogger; + } + + public static void SetLogger(ILogger newLogger) + { + _InternalLogger = new LoggerWrapper(newLogger); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogException(Exception exception, UnityEngine.Object context) + { + if (MinLogLevel >= LogLevel.Error) + { + InternalLogger.LogException(exception, context); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogException(Exception exception) + { + if (MinLogLevel >= LogLevel.Error) + { + InternalLogger.LogException(exception); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogError(string tag, object message, UnityEngine.Object context) + { + if (MinLogLevel >= LogLevel.Error) + { + InternalLogger.LogError(tag, message, context); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogError(string tag, object message) + { + if (MinLogLevel >= LogLevel.Error) + { + InternalLogger.LogError(tag, message); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogError(object message) + { + LogError(null, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogWarning(string tag, object message, UnityEngine.Object context) + { + if (MinLogLevel >= LogLevel.Info) + { + InternalLogger.LogWarning(tag, message, context); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogWarning(string tag, object message) + { + if (MinLogLevel >= LogLevel.Info) + { + InternalLogger.LogWarning(tag, message); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogWarning(object message) + { + LogWarning(null, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(LogLevel logLevel, string tag, object message, UnityEngine.Object context) + { + if (MinLogLevel >= logLevel) + { + InternalLogger.Log(logLevel, tag, message, context); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(LogLevel logLevel, string tag, object message) + { + if (MinLogLevel >= logLevel) + { + InternalLogger.Log(logLevel, tag, message); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(LogLevel logLevel, object message, UnityEngine.Object context) + { + if (MinLogLevel >= logLevel) + { + InternalLogger.Log(logLevel, message, context); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(LogLevel logLevel, object message) + { + if (MinLogLevel >= logLevel) + { + InternalLogger.Log(logLevel, message); + } + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(string tag, object message) + { + Log(LogLevel.Info, tag, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void Log(object message) + { + Log(LogLevel.Info, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogInfo(string tag, object message, UnityEngine.Object context) + { + Log(LogLevel.Info, tag, message, context); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogInfo(string tag, object message) + { + Log(LogLevel.Info, tag, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogInfo(object message) + { + Log(LogLevel.Info, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogVerbose(string tag, object message, UnityEngine.Object context) + { + Log(LogLevel.Verbose, tag, message, context); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogVerbose(string tag, object message) + { + Log(LogLevel.Verbose, tag, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogVerbose(object message) + { + Log(LogLevel.Verbose, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogDebug(string tag, object message, UnityEngine.Object context) + { + Log(LogLevel.Debug, tag, message, context); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogDebug(string tag, object message) + { + Log(LogLevel.Debug, tag, message); + } + + [Conditional("DEBUG"), Conditional("DEVELOPMENT_BUILD")] + public static void LogDebug(object message) + { + Log(LogLevel.Debug, message); + } + + private class LoggerWrapper : IExtendedLogger + { + private readonly ILogger _logger; + + public LoggerWrapper(ILogger logger) + { + _logger = logger; + } + + public LogType filterLogType + { + get => _logger.filterLogType; + set => _logger.filterLogType = value; + } + + public bool logEnabled + { + get => _logger.logEnabled; + set => _logger.logEnabled = value; + } + + public ILogHandler logHandler + { + get => _logger.logHandler; + set => _logger.logHandler = value; + } + + public bool IsLogTypeAllowed(LogType logType) { return _logger.IsLogTypeAllowed(logType); } + public void Log(LogType logType, object message) { _logger.Log(logType, message); } + public void Log(LogType logType, object message, UnityEngine.Object context) { _logger.Log(logType, message, context); } + public void Log(LogType logType, string tag, object message) { _logger.Log(logType, tag, message); } + public void Log(LogType logType, string tag, object message, UnityEngine.Object context) { _logger.Log(logType, tag, message, context); } + public void Log(object message) { _logger.Log(message); } + public void Log(string tag, object message) { _logger.Log(tag, message); } + public void Log(string tag, object message, UnityEngine.Object context) { _logger.Log(tag, message, context); } + public void Log(LogLevel logLevel, string tag, object message, UnityEngine.Object context) { _logger.Log(logLevel.GetLogType(), tag, message, context); } + public void Log(LogLevel logLevel, string tag, object message) { _logger.Log(logLevel.GetLogType(), tag, message); } + public void Log(LogLevel logLevel, object message, UnityEngine.Object context) { _logger.Log(logLevel.GetLogType(), message, context); } + public void Log(LogLevel logLevel, object message) { _logger.Log(logLevel.GetLogType(), message); } + public void LogWarning(string tag, object message) { _logger.LogWarning(tag, message); } + public void LogWarning(string tag, object message, UnityEngine.Object context) { _logger.LogWarning(tag, message, context); } + public void LogError(string tag, object message) { _logger.LogError(tag, message); } + public void LogError(string tag, object message, UnityEngine.Object context) { _logger.LogError(tag, message, context); } + public void LogException(Exception exception) { _logger.LogException(exception); } + public void LogException(Exception exception, UnityEngine.Object context) { _logger.LogException(exception, context); } + public void LogFormat(LogType logType, string format, params object[] args) { _logger.LogFormat(logType, format, args); } + public void LogFormat(LogType logType, UnityEngine.Object context, string format, params object[] args) { _logger.LogFormat(logType, context, format, args); } + } + } + + public static class LoggerLogLevelExtension + { + public static LogType GetLogType(this Logger.LogLevel logLevel) + { + switch (logLevel) + { + case Logger.LogLevel.Fatal: + case Logger.LogLevel.Error: return LogType.Error; + case Logger.LogLevel.Warn: return LogType.Warning; + case Logger.LogLevel.Info: + case Logger.LogLevel.Verbose: + case Logger.LogLevel.Debug: + default: return LogType.Log; + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs.meta new file mode 100644 index 0000000..7d2914d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Logger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ac29e34e770fcf2da57e7f805844165 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs new file mode 100644 index 0000000..ebf90eb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs @@ -0,0 +1,414 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections.Generic; + +namespace Mediapipe.Unity +{ + public class OutputEventArgs : EventArgs + { + public readonly TValue value; + + public OutputEventArgs(TValue value) + { + this.value = value; + } + } + + public class OutputStream where TPacket : Packet, new() + { + private static int _Counter = 0; + private static readonly GlobalInstanceTable> _InstanceTable = new GlobalInstanceTable>(20); + + protected readonly CalculatorGraph calculatorGraph; + + private readonly int _id; + public readonly string streamName; + public readonly string presenceStreamName; + public readonly bool observeTimestampBounds; + + private OutputStreamPoller _poller; + private TPacket _outputPacket; + + private OutputStreamPoller _presencePoller; + private BoolPacket _presencePacket; + + private long _lastTimestampMicrosec; + private long _timeoutMicrosec; + public long timeoutMicrosec + { + get => _timeoutMicrosec; + set => _timeoutMicrosec = Math.Max(0, value); + } + + protected event EventHandler> OnReceived; + + private TPacket _referencePacket; + protected TPacket referencePacket + { + get + { + if (_referencePacket == null) + { + _referencePacket = Packet.Create(IntPtr.Zero, false); + } + return _referencePacket; + } + } + + protected bool canTestPresence => presenceStreamName != null; + + /// + /// Initialize a new instance of the class. + /// + /// + /// If is set to false, there are no ways to know whether the output is present or not.
+ /// This can be especially problematic
+ /// - when trying to get the output synchronously, because the thread will hang forever if no value is output.
+ /// - when trying to get the output using callbacks, because they won't be called while no value is output.
+ ///
+ /// The owner of the stream + /// The name of the stream + /// + /// This parameter controlls the behaviour when no output is present.
+ /// When no output is present, if it's set to true, the stream outputs an empty packet, but if it's false, the stream does not output packets. + /// + /// + /// If the output packet is empty, the instance drops the packet until the period specified here elapses. + /// + public OutputStream(CalculatorGraph calculatorGraph, string streamName, bool observeTimestampBounds = true, long timeoutMicrosec = 0) + { + _id = System.Threading.Interlocked.Increment(ref _Counter); + this.calculatorGraph = calculatorGraph; + this.streamName = streamName; + this.observeTimestampBounds = observeTimestampBounds; + this.timeoutMicrosec = timeoutMicrosec; + + _InstanceTable.Add(_id, this); + } + + /// + /// Initialize a new instance of the class.
+ /// It's necessary for the graph to have PacketPresenceCalculator node that calculates if the stream has output or not. + ///
+ /// + /// This is useful when you want to get the output synchronously but don't want to block the thread while waiting for the output. + /// + /// The owner of the stream + /// The name of the stream + /// + /// The name of the stream that outputs true iff the output is present. + /// + /// + /// If the output packet is empty, the instance drops the packet until the period specified here elapses. + /// + public OutputStream(CalculatorGraph calculatorGraph, string streamName, string presenceStreamName, long timeoutMicrosec = 0) : this(calculatorGraph, streamName, false, timeoutMicrosec) + { + this.presenceStreamName = presenceStreamName; + } + + public Status StartPolling() + { + _outputPacket = new TPacket(); + + var statusOrPoller = calculatorGraph.AddOutputStreamPoller(streamName, observeTimestampBounds); + var status = statusOrPoller.status; + if (status.Ok()) + { + _poller = statusOrPoller.Value(); + } + + if (presenceStreamName == null) + { + return status; + } + + _presencePacket = new BoolPacket(); + + var statusOrPresencePoller = calculatorGraph.AddOutputStreamPoller(presenceStreamName, false); + status = statusOrPresencePoller.status; + if (status.Ok()) + { + _presencePoller = statusOrPresencePoller.Value(); + } + return status; + } + + public void AddListener(EventHandler> callback) + { + if (OnReceived == null) + { + calculatorGraph.ObserveOutputStream(streamName, _id, InvokeIfOutputStreamFound, observeTimestampBounds).AssertOk(); + } + OnReceived += callback; + } + + public void RemoveListener(EventHandler> eventHandler) + { + OnReceived -= eventHandler; + } + + public void RemoveAllListeners() + { + OnReceived = null; + } + + public void Close() + { + RemoveAllListeners(); + + _poller?.Dispose(); + _poller = null; + _outputPacket?.Dispose(); + _outputPacket = null; + + _presencePoller?.Dispose(); + _presencePoller = null; + _presencePacket?.Dispose(); + _presencePacket = null; + + _referencePacket?.Dispose(); + _referencePacket = null; + } + + /// + /// Gets the next value from the stream. + /// This method drops a packet whose timestamp is less than . + /// + /// + /// + /// If is set to true, MediaPipe outputs an empty packet when no output is present, but this method ignores those packets. + /// This behavior is useful to avoid outputting an empty value when the detection fails for a particular frame. + /// + /// + /// When is set to the default value, you cannot tell whether it's because the output was empty or not. + /// + /// + /// + /// When this method returns, it contains the next output value if it's present and retrieved successfully; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// + /// + /// Drops outputs whose timestamp is less than this value. + /// + /// + /// If true, this method can block the thread until the value is retrieved.
+ /// It can be set to false only if is set. + /// + /// + /// true if is successfully retrieved; otherwise false. + /// + public bool TryGetNext(out TValue value, long timestampThreshold, bool allowBlock = true) + { + var timestampMicrosec = long.MinValue; + + while (timestampMicrosec < timestampThreshold) + { + if (!CanCallNext(allowBlock) || !Next()) + { + value = default; + return false; + } + using (var timestamp = _outputPacket.Timestamp()) + { + timestampMicrosec = timestamp.Microseconds(); + } + } + + if (_outputPacket.IsEmpty()) + { + value = default; // TODO: distinguish when the output is empty and when it's not (retrieved value can be the default value). + return false; + } + + _lastTimestampMicrosec = timestampMicrosec; + value = _outputPacket.Get(); + return true; + } + + public bool TryGetNext(out TValue value, bool allowBlock = true) + { + return TryGetNext(out value, 0, allowBlock); + } + + public bool TryConsumeNext(out TValue value, long timestampThreshold, bool allowBlock = true) + { + long timestampMicrosec = 0; + + while (timestampMicrosec <= timestampThreshold) + { + if (!CanCallNext(allowBlock) || !Next()) + { + value = default; + return true; + } + using (var timestamp = _outputPacket.Timestamp()) + { + timestampMicrosec = timestamp.Microseconds(); + } + } + + if (_outputPacket.IsEmpty()) + { + value = default; // TODO: distinguish when the output is empty and when it's not (retrieved value can be the default value). + return false; + } + + _lastTimestampMicrosec = timestampMicrosec; + var statusOrValue = _outputPacket.Consume(); + + value = statusOrValue.ValueOr(); + return true; + } + + public bool TryConsumeNext(out TValue value, bool allowBlock = true) + { + return TryConsumeNext(out value, 0, allowBlock); + } + + public bool ResetTimestampIfTimedOut(long timestampMicrosec, long timeoutMicrosec) + { + if (timestampMicrosec - _lastTimestampMicrosec <= timeoutMicrosec) + { + return false; + } + _lastTimestampMicrosec = timestampMicrosec; + return true; + } + + protected bool CanCallNext(bool allowBlock) + { + if (_poller == null) + { + Logger.LogWarning("OutputStreamPoller is not initialized. Call StartPolling before running the CalculatorGraph"); + return false; + } + + if (canTestPresence) + { + if (!allowBlock) + { + if (_presencePoller.QueueSize() <= 0) + { + return false; + } + } + if (!NextPresence() || !_presencePacket.Get()) + { + // NOTE: _presencePacket.IsEmpty() always returns false + return false; + } + } + else if (!allowBlock) + { + Logger.LogWarning("Cannot avoid thread being blocked when `presenceStreamName` is not set"); + return false; + } + return true; + } + + protected bool NextPresence() + { + return Next(_presencePoller, _presencePacket, presenceStreamName); + } + + protected bool Next() + { + return Next(_poller, _outputPacket, streamName); + } + + protected static bool Next(OutputStreamPoller poller, Packet packet, string stream) + { + if (!poller.Next(packet)) + { + Logger.LogWarning($"Failed to get next value from {stream}. See logs for more details"); + return false; + } + return true; + } + + protected bool TryGetPacketValue(Packet packet, out TValue value, long timeoutMicrosec = 0) + { + using (var timestamp = packet.Timestamp()) + { + var currentMicrosec = timestamp.Microseconds(); + + if (!packet.IsEmpty()) + { + _lastTimestampMicrosec = currentMicrosec; + value = packet.Get(); + return true; + } + + value = default; // TODO: distinguish when the output is empty and when it's not (retrieved value can be the default value). + var hasTimedOut = currentMicrosec - _lastTimestampMicrosec >= timeoutMicrosec; + + if (hasTimedOut) + { + _lastTimestampMicrosec = currentMicrosec; + } + return hasTimedOut; + } + } + + protected bool TryConsumePacketValue(Packet packet, out TValue value, long timeoutMicrosec = 0) + { + using (var timestamp = packet.Timestamp()) + { + var currentMicrosec = timestamp.Microseconds(); + + if (!packet.IsEmpty()) + { + _lastTimestampMicrosec = currentMicrosec; + var statusOrValue = packet.Consume(); + + value = statusOrValue.ValueOr(); + return true; + } + + value = default; // TODO: distinguish when the output is empty and when it's not (retrieved value can be the default value). + var hasTimedOut = currentMicrosec - _lastTimestampMicrosec >= timeoutMicrosec; + + if (hasTimedOut) + { + _lastTimestampMicrosec = currentMicrosec; + } + return hasTimedOut; + } + } + + [AOT.MonoPInvokeCallback(typeof(CalculatorGraph.NativePacketCallback))] + protected static Status.StatusArgs InvokeIfOutputStreamFound(IntPtr graphPtr, int streamId, IntPtr packetPtr) + { + try + { + var isFound = _InstanceTable.TryGetValue(streamId, out var outputStream); + if (!isFound) + { + return Status.StatusArgs.NotFound($"OutputStream with id {streamId} is not found, maybe already GCed"); + } + if (outputStream.calculatorGraph.mpPtr != graphPtr) + { + return Status.StatusArgs.InvalidArgument($"OutputStream is found, but is not linked to the specified CalclatorGraph"); + } + + outputStream.referencePacket.SwitchNativePtr(packetPtr); + if (outputStream.TryGetPacketValue(outputStream.referencePacket, out var value, outputStream.timeoutMicrosec)) + { + outputStream.OnReceived?.Invoke(outputStream, new OutputEventArgs(value)); + } + outputStream.referencePacket.ReleaseMpResource(); + + return Status.StatusArgs.Ok(); + } + catch (Exception e) + { + return Status.StatusArgs.Internal(e.ToString()); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs.meta new file mode 100644 index 0000000..fa5ae53 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78b03ec6bb307ea8a93452644cf11457 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager.meta new file mode 100644 index 0000000..b9dc97c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23775e14e9eabe443b7017ddc4647c84 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs new file mode 100644 index 0000000..a6dd391 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs @@ -0,0 +1,117 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.IO; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class AssetBundleResourceManager : ResourceManager + { + private static readonly string _TAG = nameof(AssetBundleResourceManager); + + private static string _AssetBundlePath; + private static string _CachePathRoot; + + public AssetBundleResourceManager(string assetBundleName, string cachePath = "Cache") : base(PathToResourceAsFile, GetResourceContents) + { + // It's safe to update static members because at most one RsourceManager can be initialized. + _AssetBundlePath = Path.Combine(Application.streamingAssetsPath, assetBundleName); + _CachePathRoot = Path.Combine(Application.persistentDataPath, cachePath); + } + + public override bool IsPrepared(string name) + { + var path = GetCachePathFor(name); + + return File.Exists(path); + } + + + private AssetBundleCreateRequest _assetBundleReq; + private AssetBundle assetBundle => _assetBundleReq?.assetBundle; + + public void ClearAllCacheFiles() + { + if (Directory.Exists(_CachePathRoot)) + { + Directory.Delete(_CachePathRoot, true); + } + } + + public IEnumerator LoadAssetBundleAsync() + { + if (assetBundle != null) + { + Logger.LogWarning(_TAG, "AssetBundle is already loaded"); + yield break; + } + + // No need to lock because this code can be run in main thread only. + _assetBundleReq = AssetBundle.LoadFromFileAsync(_AssetBundlePath); + yield return _assetBundleReq; + + if (_assetBundleReq.assetBundle == null) + { + throw new IOException($"Failed to load {_AssetBundlePath}"); + } + } + + public override IEnumerator PrepareAssetAsync(string name, string uniqueKey, bool overwrite = true) + { + var destFilePath = GetCachePathFor(uniqueKey); + + if (File.Exists(destFilePath) && !overwrite) + { + Logger.LogInfo(_TAG, $"{name} will not be copied to {destFilePath} because it already exists"); + yield break; + } + + if (assetBundle == null) + { + yield return LoadAssetBundleAsync(); + } + + var assetLoadReq = assetBundle.LoadAssetAsync(name); + yield return assetLoadReq; + + if (assetLoadReq.asset == null) + { + throw new IOException($"Failed to load {name} from {assetBundle.name}"); + } + + Logger.LogVerbose(_TAG, $"Writing {name} data to {destFilePath}..."); + if (!Directory.Exists(_CachePathRoot)) + { + var _ = Directory.CreateDirectory(_CachePathRoot); + } + var bytes = (assetLoadReq.asset as TextAsset).bytes; + File.WriteAllBytes(destFilePath, bytes); + Logger.LogVerbose(_TAG, $"{name} is saved to {destFilePath} (length={bytes.Length})"); + } + + protected static string PathToResourceAsFile(string assetPath) + { + var assetName = GetAssetNameFromPath(assetPath); + return GetCachePathFor(assetName); + } + + protected static byte[] GetResourceContents(string path) + { + Logger.LogDebug($"{path} is requested"); + + var cachePath = PathToResourceAsFile(path); + return File.ReadAllBytes(cachePath); + } + + private static string GetCachePathFor(string assetName) + { + return Path.Combine(_CachePathRoot, assetName); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs.meta new file mode 100644 index 0000000..d647163 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/AssetBundleResourceManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39737784a5d929cc4ab94aa5f36635c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs new file mode 100644 index 0000000..5838f67 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +#if UNITY_EDITOR +using System.Collections; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace Mediapipe.Unity +{ + public class LocalResourceManager : ResourceManager + { + private static readonly string _TAG = nameof(LocalResourceManager); + + private static string _RelativePath; + private static readonly string _AssetPathRoot = "Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe"; + private static string _CachePathRoot; + + public LocalResourceManager(string path) : base(PathToResourceAsFile, GetResourceContents) + { + // It's safe to update static members because at most one RsourceManager can be initialized. + _RelativePath = path; + _CachePathRoot = Path.Combine(Application.persistentDataPath, _RelativePath); + } + + public LocalResourceManager() : this("") { } + + public override bool IsPrepared(string assetName) + { + return File.Exists(GetCachePathFor(assetName)); + } + + public override IEnumerator PrepareAssetAsync(string name, string uniqueKey, bool overwrite = true) + { + var destFilePath = GetCachePathFor(uniqueKey); + + if (File.Exists(destFilePath) && !overwrite) + { + Logger.LogInfo(_TAG, $"{name} will not be copied to {destFilePath} because it already exists"); + yield break; + } + + var assetPath = GetAssetPathFor(name); + var asset = AssetDatabase.LoadAssetAtPath(assetPath); + + if (asset == null) + { + throw new FileNotFoundException($"{assetPath} is not found. Check if {name} is included in the package"); + } + + Logger.LogVerbose(_TAG, $"Writing {name} data to {destFilePath}..."); + if (!Directory.Exists(_CachePathRoot)) + { + var _ = Directory.CreateDirectory(_CachePathRoot); + } + File.WriteAllBytes(destFilePath, asset.bytes); + Logger.LogVerbose(_TAG, $"{name} is saved to {destFilePath} (length={asset.bytes.Length})"); + } + + protected static string PathToResourceAsFile(string assetPath) + { + var assetName = GetAssetNameFromPath(assetPath); + return GetCachePathFor(assetName); + } + + protected static byte[] GetResourceContents(string path) + { + // TODO: try AsyncReadManager + Logger.LogDebug($"{path} is requested"); + + var cachePath = PathToResourceAsFile(path); + return File.ReadAllBytes(cachePath); + } + + private static string GetAssetPathFor(string assetName) + { + return Path.Combine(_AssetPathRoot, assetName); + } + + private static string GetCachePathFor(string assetName) + { + return Path.Combine(_CachePathRoot, assetName); + } + } +} +#endif diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs.meta new file mode 100644 index 0000000..f2604b6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 987096dd33929458589fc4bfd0a199c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs new file mode 100644 index 0000000..62126ce --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs @@ -0,0 +1,127 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections; +using System.IO; +using UnityEngine; +using UnityEngine.Networking; + +namespace Mediapipe.Unity +{ + public class StreamingAssetsResourceManager : ResourceManager + { + private static readonly string _TAG = nameof(StreamingAssetsResourceManager); + + private static string _RelativePath; + private static string _AssetPathRoot; + private static string _CachePathRoot; + + public StreamingAssetsResourceManager(string path) : base(PathToResourceAsFile, GetResourceContents) + { + // It's safe to update static members because at most one RsourceManager can be initialized. + _RelativePath = path; + _AssetPathRoot = Path.Combine(Application.streamingAssetsPath, _RelativePath); + _CachePathRoot = Path.Combine(Application.persistentDataPath, _RelativePath); + } + + public StreamingAssetsResourceManager() : this("") { } + + public override bool IsPrepared(string name) + { + var path = GetCachePathFor(name); + + return File.Exists(path); + } + + public override IEnumerator PrepareAssetAsync(string name, string uniqueKey, bool overwrite = true) + { + var destFilePath = GetCachePathFor(uniqueKey); + + if (File.Exists(destFilePath) && !overwrite) + { + Logger.LogInfo(_TAG, $"{name} will not be copied to {destFilePath} because it already exists"); + yield break; + } + + var sourceFilePath = GetCachePathFor(name); + if (!File.Exists(sourceFilePath)) + { + yield return CreateCacheFile(name); + } + + if (sourceFilePath == destFilePath) + { + yield break; + } + + Logger.LogVerbose(_TAG, $"Copying {sourceFilePath} to {destFilePath}..."); + File.Copy(sourceFilePath, destFilePath, overwrite); + Logger.LogVerbose(_TAG, $"{sourceFilePath} is copied to {destFilePath}"); + } + + protected static string PathToResourceAsFile(string assetPath) + { + var assetName = GetAssetNameFromPath(assetPath); + return GetCachePathFor(assetName); + } + + protected static byte[] GetResourceContents(string path) + { + // TODO: try AsyncReadManager + Logger.LogDebug($"{path} is requested"); + + var cachePath = PathToResourceAsFile(path); + return File.ReadAllBytes(cachePath); + } + + private IEnumerator CreateCacheFile(string assetName) + { + var cacheFilePath = GetCachePathFor(assetName); + + if (File.Exists(cacheFilePath)) + { + yield break; + } + +#if !UNITY_ANDROID && !UNITY_WEBGL + throw new FileNotFoundException($"{cacheFilePath} is not found"); +#else + var assetPath = GetAssetPathFor(assetName); + using (var webRequest = UnityWebRequest.Get(assetPath)) + { + yield return webRequest.SendWebRequest(); + + if (webRequest.result == UnityWebRequest.Result.Success) + { + if (!Directory.Exists(_CachePathRoot)) + { + var _ = Directory.CreateDirectory(_CachePathRoot); + } + Logger.LogVerbose(_TAG, $"Writing {assetName} data to {cacheFilePath}..."); + var bytes = webRequest.downloadHandler.data; + File.WriteAllBytes(cacheFilePath, bytes); + Logger.LogVerbose(_TAG, $"{assetName} is saved to {cacheFilePath} (length={bytes.Length})"); + } + else + { + throw new InternalException($"Failed to load {assetName}: {webRequest.error}"); + } + } +#endif + } + + private static string GetAssetPathFor(string assetName) + { + return Path.Combine(_AssetPathRoot, assetName); + } + + private static string GetCachePathFor(string assetName) + { + var assetPath = GetAssetPathFor(assetName); + return File.Exists(assetPath) ? assetPath : Path.Combine(_CachePathRoot, assetName); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs.meta new file mode 100644 index 0000000..3c68bec --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/StreamingAssetsResourceManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8590959d1f3a5951792fb898918d64d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs new file mode 100644 index 0000000..b05aa47 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs @@ -0,0 +1,41 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using UnityEngine; + +namespace Mediapipe.Unity +{ + public enum RotationAngle + { + Rotation0 = 0, + Rotation90 = 90, + Rotation180 = 180, + Rotation270 = 270, + } + + public static class RotationAngleExtension + { + public static RotationAngle Add(this RotationAngle rotationAngle, RotationAngle angle) + { + return (RotationAngle)(((int)rotationAngle + (int)angle) % 360); + } + + public static RotationAngle Subtract(this RotationAngle rotationAngle, RotationAngle angle) + { + return (RotationAngle)(((int)rotationAngle - (int)angle) % 360); + } + + public static RotationAngle Reverse(this RotationAngle rotationAngle) + { + return (RotationAngle)((360 - (int)rotationAngle) % 360); + } + + public static Vector3 GetEulerAngles(this RotationAngle rotationAngle) + { + return new Vector3(0, 0, (int)rotationAngle); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs.meta new file mode 100644 index 0000000..073b76e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/RotationAngle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c509cca5dd159035b8d19a21376b5ea9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util.meta new file mode 100644 index 0000000..139c0f6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad0a6f6f52a1d844a8f6c80e33cd017d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs new file mode 100644 index 0000000..0ac3ded --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs @@ -0,0 +1,121 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System; +using System.Collections; +using System.IO; + +namespace Mediapipe +{ + /// + /// Class to manage assets that MediaPipe accesses. + /// + /// + /// There must not be more than one instance at the same time. + /// + public abstract class ResourceManager + { + public delegate string PathResolver(string path); + internal delegate bool NativeResourceProvider(string path, IntPtr dest); + public delegate byte[] ResourceProvider(string path); + + private static readonly object _InitLock = new object(); + private static ResourceManager _Instance; + private readonly PathResolver _pathResolver; + private readonly ResourceProvider _resourceProvider; + + public ResourceManager(PathResolver pathResolver, ResourceProvider resourceProvider) + { + lock (_InitLock) + { + if (_Instance != null) + { + throw new InvalidOperationException("ResourceManager can be initialized only once"); + } + _pathResolver = pathResolver; + _resourceProvider = resourceProvider; + SafeNativeMethods.mp__SetCustomGlobalPathResolver__P(PathToResourceAsFile); + SafeNativeMethods.mp__SetCustomGlobalResourceProvider__P(GetResourceContents); + _Instance = this; + } + } + + /// Asset name + /// + /// Returns true if is already prepared (saved locally on the device). + /// + public abstract bool IsPrepared(string name); + + /// + /// Saves as asynchronously. + /// + /// + /// Specifies whether will be overwritten if it already exists. + /// + public abstract IEnumerator PrepareAssetAsync(string name, string uniqueKey, bool overwrite = true); + + public IEnumerator PrepareAssetAsync(string name, bool overwrite = true) + { + return PrepareAssetAsync(name, name, overwrite); + } + + [AOT.MonoPInvokeCallback(typeof(PathResolver))] + private static string PathToResourceAsFile(string assetPath) + { + try + { + return _Instance._pathResolver(assetPath); + } + catch (Exception e) + { + UnityEngine.Debug.LogException(e); + return ""; + } + } + + [AOT.MonoPInvokeCallback(typeof(ResourceProvider))] + private static bool GetResourceContents(string path, IntPtr dst) + { + try + { + var asset = _Instance._resourceProvider(path); + using (var srcStr = new StdString(asset)) + { + srcStr.Swap(new StdString(dst, false)); + } + return true; + } + catch (Exception e) + { + UnityEngine.Debug.LogException(e); + return false; + } + } + + protected static string GetAssetNameFromPath(string assetPath) + { + var assetName = Path.GetFileNameWithoutExtension(assetPath); + var extension = Path.GetExtension(assetPath); + + switch (extension) + { + case ".binarypb": + case ".tflite": + { + return $"{assetName}.bytes"; + } + case ".pbtxt": + { + return $"{assetName}.txt"; + } + default: + { + return $"{assetName}{extension}"; + } + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs.meta new file mode 100644 index 0000000..ca1c57b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Util/ResourceManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4e51cc091c70c661943c15038a905da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests.meta b/Packages/com.github.homuler.mediapipe/Tests.meta new file mode 100644 index 0000000..9ce65e0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2e9d39e567182247b9f1978c0a53669 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode.meta new file mode 100644 index 0000000..e69fd27 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7edb27f0a5180a64985017cb8bfc82ca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework.meta new file mode 100644 index 0000000..453e2a3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ec4b51665a3e7b499aa9c64fc9c7462 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs new file mode 100644 index 0000000..330391a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs @@ -0,0 +1,167 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class CalculatorGraphTest + { + private const string _ValidConfigText = @"node { + calculator: ""PassThroughCalculator"" + input_stream: ""in"" + output_stream: ""out1"" +} +node { + calculator: ""PassThroughCalculator"" + input_stream: ""out1"" + output_stream: ""out"" +} +input_stream: ""in"" +output_stream: ""out"" +"; + + #region Constructor + [Test] + public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithNoArguments() + { + Assert.DoesNotThrow(() => + { + var graph = new CalculatorGraph(); + graph.Dispose(); + }); + } + + [Test] + public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithConfigText() + { + using (var graph = new CalculatorGraph(_ValidConfigText)) + { + var config = graph.Config(); + Assert.AreEqual("in", config.InputStream[0]); + Assert.AreEqual("out", config.OutputStream[0]); + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var graph = new CalculatorGraph()) + { + Assert.False(graph.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var graph = new CalculatorGraph(); + graph.Dispose(); + + Assert.True(graph.isDisposed); + } + #endregion + + #region #Initialize + [Test] + public void Initialize_ShouldReturnOk_When_CalledWithConfig_And_ConfigIsNotSet() + { + using (var graph = new CalculatorGraph()) + { + using (var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText))) + { + Assert.True(status.Ok()); + } + + var config = graph.Config(); + Assert.AreEqual("in", config.InputStream[0]); + Assert.AreEqual("out", config.OutputStream[0]); + } + } + + [Test] + public void Initialize_ShouldReturnInternalError_When_CalledWithConfig_And_ConfigIsSet() + { + using (var graph = new CalculatorGraph(_ValidConfigText)) + { + using (var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText))) + { + Assert.AreEqual(Status.StatusCode.Internal, status.Code()); + } + } + } + + [Test] + public void Initialize_ShouldReturnOk_When_CalledWithConfigAndSidePacket_And_ConfigIsNotSet() + { + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("flag", new BoolPacket(true)); + + using (var graph = new CalculatorGraph()) + { + var config = CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText); + + using (var status = graph.Initialize(config, sidePacket)) + { + Assert.True(status.Ok()); + } + } + } + } + + [Test] + public void Initialize_ShouldReturnInternalError_When_CalledWithConfigAndSidePacket_And_ConfigIsSet() + { + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("flag", new BoolPacket(true)); + + using (var graph = new CalculatorGraph(_ValidConfigText)) + { + var config = CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText); + + using (var status = graph.Initialize(config, sidePacket)) + { + Assert.AreEqual(Status.StatusCode.Internal, status.Code()); + } + } + } + } + #endregion + + #region lifecycle + [Test] + public void LifecycleMethods_ShouldControlGraphLifeCycle() + { + using (var graph = new CalculatorGraph(_ValidConfigText)) + { + Assert.True(graph.StartRun().Ok()); + Assert.False(graph.GraphInputStreamsClosed()); + + Assert.True(graph.WaitUntilIdle().Ok()); + Assert.True(graph.CloseAllPacketSources().Ok()); + Assert.True(graph.GraphInputStreamsClosed()); + Assert.True(graph.WaitUntilDone().Ok()); + Assert.False(graph.HasError()); + } + } + + [Test] + public void Cancel_ShouldCancelGraph() + { + using (var graph = new CalculatorGraph(_ValidConfigText)) + { + Assert.True(graph.StartRun().Ok()); + graph.Cancel(); + Assert.AreEqual(Status.StatusCode.Cancelled, graph.WaitUntilDone().Code()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs.meta new file mode 100644 index 0000000..86978b8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/CalculatorGraphTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 083c8421f4820d09290f0de495a23ec2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format.meta new file mode 100644 index 0000000..c9c53b4 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a55a1703b7efe449be66773a42e7ff0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs new file mode 100644 index 0000000..7fd102e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs @@ -0,0 +1,256 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; +using System.Linq; +using Unity.Collections; + +namespace Mediapipe.Tests +{ + public class ImageFrameTest + { + #region Constructor + [Test] + public void Ctor_ShouldInstantiateImageFrame_When_CalledWithNoArguments() + { + using (var imageFrame = new ImageFrame()) + { + Assert.AreEqual(ImageFormat.Types.Format.Unknown, imageFrame.Format()); + Assert.AreEqual(0, imageFrame.Width()); + Assert.AreEqual(0, imageFrame.Height(), 0); + Assert.AreEqual(0, imageFrame.ChannelSize()); + Assert.AreEqual(0, imageFrame.NumberOfChannels()); + Assert.AreEqual(0, imageFrame.ByteDepth()); + Assert.AreEqual(0, imageFrame.WidthStep()); + Assert.AreEqual(0, imageFrame.PixelDataSize()); + Assert.AreEqual(0, imageFrame.PixelDataSizeStoredContiguously()); + Assert.True(imageFrame.IsEmpty()); + Assert.False(imageFrame.IsContiguous()); + Assert.False(imageFrame.IsAligned(16)); + Assert.AreEqual(IntPtr.Zero, imageFrame.MutablePixelData()); + } + } + + [Test] + public void Ctor_ShouldInstantiateImageFrame_When_CalledWithFormat() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 640, 480)) + { + Assert.AreEqual(ImageFormat.Types.Format.Sbgra, imageFrame.Format()); + Assert.AreEqual(640, imageFrame.Width()); + Assert.AreEqual(480, imageFrame.Height()); + Assert.AreEqual(1, imageFrame.ChannelSize()); + Assert.AreEqual(4, imageFrame.NumberOfChannels()); + Assert.AreEqual(1, imageFrame.ByteDepth()); + Assert.AreEqual(640 * 4, imageFrame.WidthStep()); + Assert.AreEqual(640 * 480 * 4, imageFrame.PixelDataSize()); + Assert.AreEqual(640 * 480 * 4, imageFrame.PixelDataSizeStoredContiguously()); + Assert.False(imageFrame.IsEmpty()); + Assert.True(imageFrame.IsContiguous()); + Assert.True(imageFrame.IsAligned(16)); + Assert.AreNotEqual(IntPtr.Zero, imageFrame.MutablePixelData()); + } + } + + [Test] + public void Ctor_ShouldInstantiateImageFrame_When_CalledWithFormatAndAlignmentBoundary() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 100, 100, 8)) + { + Assert.AreEqual(100, imageFrame.Width()); + Assert.AreEqual(1, imageFrame.NumberOfChannels()); + Assert.AreEqual(104, imageFrame.WidthStep()); + } + } + + [Test] + public void Ctor_ShouldInstantiateImageFrame_When_CalledWithPixelData() + { + var pixelData = new NativeArray(32, Allocator.Temp, NativeArrayOptions.UninitializedMemory); + var srcBytes = new byte[] { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + }; + pixelData.CopyFrom(srcBytes); + + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 4, 2, 16, pixelData)) + { + Assert.AreEqual(4, imageFrame.Width()); + Assert.AreEqual(2, imageFrame.Height()); + Assert.False(imageFrame.IsEmpty()); + + var bytes = new byte[32]; + imageFrame.CopyToBuffer(bytes); + Assert.IsEmpty(bytes.Where((x, i) => x != srcBytes[i])); + } + } + + [Test, SignalAbort] + public void Ctor_ShouldThrowMediaPipeException_When_CalledWithInvalidArgument() + { +#pragma warning disable IDE0058 + Assert.Throws(() => { new ImageFrame(ImageFormat.Types.Format.Sbgra, 640, 480, 0); }); +#pragma warning restore IDE0058 + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var imageFrame = new ImageFrame()) + { + Assert.False(imageFrame.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var imageFrame = new ImageFrame(); + imageFrame.Dispose(); + + Assert.True(imageFrame.isDisposed); + } + #endregion + + #region #SetToZero + [Test] + public void SetToZero_ShouldSetZeroToAllBytes() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10)) + { + imageFrame.SetToZero(); + var bytes = new byte[100]; + imageFrame.CopyToBuffer(bytes); + Assert.True(bytes.All((x) => x == 0)); + } + } + #endregion + + #region #SetAlignmentPaddingAreas + [Test] + public void SetAlignmentPaddingAreas_ShouldNotThrow() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10, 16)) + { + Assert.DoesNotThrow(() => { imageFrame.SetAlignmentPaddingAreas(); }); + } + } + #endregion + + #region CopyToBuffer + [Test, SignalAbort] + public void CopyToByteBuffer_ShouldThrowException_When_BufferDepthIsWrong() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new byte[100]); }); +#pragma warning restore IDE0058 + } + } + + [Test] + public void CopyToByteBuffer_ShouldReturnByteArray_When_BufferSizeIsLargeEnough() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10)) + { + var normalBuffer = new byte[100]; + var largeBuffer = new byte[120]; + imageFrame.CopyToBuffer(normalBuffer); + imageFrame.CopyToBuffer(largeBuffer); + + Assert.IsEmpty(normalBuffer.Where((x, i) => x != largeBuffer[i])); + } + } + + [Test, SignalAbort] + public void CopyToByteBuffer_ShouldThrowException_When_BufferSizeIsTooSmall() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new byte[99]); }); +#pragma warning restore IDE0058 + } + } + + [Test, SignalAbort] + public void CopyToUshortBuffer_ShouldThrowException_When_BufferDepthIsWrong() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new ushort[100]); }); +#pragma warning restore IDE0058 + } + } + + [Test] + public void CopyToUshortBuffer_ShouldReturnUshortArray_When_BufferSizeIsLargeEnough() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10)) + { + var normalBuffer = new ushort[100]; + var largeBuffer = new ushort[120]; + imageFrame.CopyToBuffer(normalBuffer); + imageFrame.CopyToBuffer(largeBuffer); + + Assert.IsEmpty(normalBuffer.Where((x, i) => x != largeBuffer[i])); + } + } + + [Test, SignalAbort] + public void CopyToUshortBuffer_ShouldThrowException_When_BufferSizeIsTooSmall() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new ushort[99]); }); +#pragma warning restore IDE0058 + } + } + + [Test, SignalAbort] + public void CopyToFloatBuffer_ShouldThrowException_When_BufferDepthIsWrong() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new float[100]); }); +#pragma warning restore IDE0058 + } + } + + [Test] + public void CopyToFloatBuffer_ShouldReturnFloatArray_When_BufferSizeIsLargeEnough() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Vec32F1, 10, 10)) + { + var normalBuffer = new float[100]; + var largeBuffer = new float[120]; + imageFrame.CopyToBuffer(normalBuffer); + imageFrame.CopyToBuffer(largeBuffer); + + Assert.IsEmpty(normalBuffer.Where((x, i) => Math.Abs(x - largeBuffer[i]) > 1e-9)); + } + } + + [Test, SignalAbort] + public void CopyToFloatBuffer_ShouldThrowException_When_BufferSizeIsTooSmall() + { + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Vec32F1, 10, 10)) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { imageFrame.CopyToBuffer(new float[99]); }); +#pragma warning restore IDE0058 + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs.meta new file mode 100644 index 0000000..bbb222f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Format/ImageFrameTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: efccb8a8c7f87c9629872169190107db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet.meta new file mode 100644 index 0000000..768aaec --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 55cd80546e3f9d043b59677c12f0e891 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs new file mode 100644 index 0000000..54e34bd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs @@ -0,0 +1,132 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class BoolPacketTest + { + #region Constructor + [Test, SignalAbort] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new BoolPacket()) + { +#pragma warning disable IDE0058 + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.Throws(() => { packet.Get(); }); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); +#pragma warning restore IDE0058 + } + + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithTrue() + { + using (var packet = new BoolPacket(true)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.True(packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithFalse() + { + using (var packet = new BoolPacket(false)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.False(packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + using (var packet = new BoolPacket(true, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.True(packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new BoolPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new BoolPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var packet = new BoolPacket(true).At(timestamp); + Assert.True(packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.True(newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldThrowNotSupportedException() + { + using (var packet = new BoolPacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Consume(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + using (var packet = new BoolPacket(true)) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs.meta new file mode 100644 index 0000000..929637a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/BoolPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b59151b6708d204ee970450f8028d00b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs new file mode 100644 index 0000000..0ece68f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs @@ -0,0 +1,137 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class FloatArrayPacketTest + { + #region Constructor + [Test, SignalAbort] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new FloatArrayPacket()) + { +#pragma warning disable IDE0058 + packet.length = 0; + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.Throws(() => { packet.Get(); }); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); +#pragma warning restore IDE0058 + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithEmptyArray() + { + float[] array = { }; + using (var packet = new FloatArrayPacket(array)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(array, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithArray() + { + float[] array = { 0.01f }; + using (var packet = new FloatArrayPacket(array)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(array, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp() + { + float[] array = { 0.01f, 0.02f }; + using (var timestamp = new Timestamp(1)) + { + using (var packet = new FloatArrayPacket(array, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(array, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new FloatArrayPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new FloatArrayPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + float[] array = { 0.0f }; + var packet = new FloatArrayPacket(array).At(timestamp); + Assert.AreEqual(array, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(array, newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldThrowNotSupportedException() + { + using (var packet = new FloatArrayPacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Consume(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + float[] array = { 0.01f }; + using (var packet = new FloatArrayPacket(array)) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs.meta new file mode 100644 index 0000000..4eb5dcc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatArrayPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43430c0ef642804f9a6347fce4ec497a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs new file mode 100644 index 0000000..45d3300 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs @@ -0,0 +1,120 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class FloatPacketTest + { + #region Constructor + [Test, SignalAbort] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new FloatPacket()) + { +#pragma warning disable IDE0058 + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.Throws(() => { packet.Get(); }); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); +#pragma warning restore IDE0058 + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValue() + { + using (var packet = new FloatPacket(0.01f)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(0.01f, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + using (var packet = new FloatPacket(0.01f, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(0.01f, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new FloatPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new FloatPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var packet = new FloatPacket(0).At(timestamp); + Assert.AreEqual(0.0f, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(0.0f, newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldThrowNotSupportedException() + { + using (var packet = new FloatPacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Consume(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + using (var packet = new FloatPacket(0.01f)) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs.meta new file mode 100644 index 0000000..71c439a --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39a81137616a1218b9b2b11d2feeadd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs new file mode 100644 index 0000000..06d0da2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs @@ -0,0 +1,176 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; +using System.Collections.Generic; + +namespace Mediapipe.Tests +{ + public class FloatVectorPacketTest + { + #region Constructor + [Test, SignalAbort] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new FloatVectorPacket()) + { +#pragma warning disable IDE0058 + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.Throws(() => { packet.Get(); }); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); +#pragma warning restore IDE0058 + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithEmptyArray() + { + float[] data = { }; + using (var packet = new FloatVectorPacket(data)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithArray() + { + float[] data = { 0.01f }; + using (var packet = new FloatVectorPacket(data)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp() + { + float[] data = { 0.01f, 0.02f }; + using (var timestamp = new Timestamp(1)) + { + using (var packet = new FloatVectorPacket(data, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithEmptyList() + { + var data = new List(); + using (var packet = new FloatVectorPacket(data)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithList() + { + var data = new List() { 0.01f }; + using (var packet = new FloatVectorPacket(data)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithListAndTimestamp() + { + var data = new List() { 0.01f, 0.02f }; + using (var timestamp = new Timestamp(1)) + { + using (var packet = new FloatVectorPacket(data, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new FloatVectorPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new FloatVectorPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var data = new List() { 0.0f }; + var packet = new FloatVectorPacket(data).At(timestamp); + Assert.AreEqual(data, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(data, newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldThrowNotSupportedException() + { + using (var packet = new FloatVectorPacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Consume(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + float[] array = { 0.01f }; + using (var packet = new FloatVectorPacket(array)) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs.meta new file mode 100644 index 0000000..15a7a32 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/FloatVectorPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a567519c65348c47ae2c5784431179e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs new file mode 100644 index 0000000..359166d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs @@ -0,0 +1,178 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class ImageFramePacketTest + { + #region Constructor + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new ImageFramePacket()) + { + using (var statusOrImageFrame = packet.Consume()) + { + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.AreEqual(Status.StatusCode.Internal, statusOrImageFrame.status.Code()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValue() + { + var srcImageFrame = new ImageFrame(); + + using (var packet = new ImageFramePacket(srcImageFrame)) + { + Assert.True(srcImageFrame.isDisposed); + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + + using (var statusOrImageFrame = packet.Consume()) + { + Assert.True(statusOrImageFrame.Ok()); + + using (var imageFrame = statusOrImageFrame.Value()) + { + Assert.AreEqual(ImageFormat.Types.Format.Unknown, imageFrame.Format()); + } + } + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp() + { + var srcImageFrame = new ImageFrame(); + + using (var timestamp = new Timestamp(1)) + { + using (var packet = new ImageFramePacket(srcImageFrame, timestamp)) + { + Assert.True(srcImageFrame.isDisposed); + Assert.True(packet.ValidateAsType().Ok()); + + using (var statusOrImageFrame = packet.Consume()) + { + Assert.True(statusOrImageFrame.Ok()); + + using (var imageFrame = statusOrImageFrame.Value()) + { + Assert.AreEqual(ImageFormat.Types.Format.Unknown, imageFrame.Format()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new ImageFramePacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new ImageFramePacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var packet = new ImageFramePacket(new ImageFrame(ImageFormat.Types.Format.Srgba, 10, 10)).At(timestamp); + Assert.AreEqual(10, packet.Get().Width()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(10, newPacket.Get().Width()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Get + [Test, SignalAbort] + public void Get_ShouldThrowMediaPipeException_When_DataIsEmpty() + { + using (var packet = new ImageFramePacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Get(); }); +#pragma warning restore IDE0058 + } + } + + public void Get_ShouldReturnImageFrame_When_DataIsNotEmpty() + { + using (var packet = new ImageFramePacket(new ImageFrame(ImageFormat.Types.Format.Sbgra, 10, 10))) + { + using (var imageFrame = packet.Get()) + { + Assert.AreEqual(ImageFormat.Types.Format.Sbgra, imageFrame.Format()); + Assert.AreEqual(10, imageFrame.Width()); + Assert.AreEqual(10, imageFrame.Height()); + } + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldReturnImageFrame() + { + using (var packet = new ImageFramePacket(new ImageFrame(ImageFormat.Types.Format.Sbgra, 10, 10))) + { + using (var statusOrImageFrame = packet.Consume()) + { + Assert.True(statusOrImageFrame.Ok()); + + using (var imageFrame = statusOrImageFrame.Value()) + { + Assert.AreEqual(ImageFormat.Types.Format.Sbgra, imageFrame.Format()); + Assert.AreEqual(10, imageFrame.Width()); + Assert.AreEqual(10, imageFrame.Height()); + } + } + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + using (var packet = new ImageFramePacket(new ImageFrame())) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs.meta new file mode 100644 index 0000000..4c18fb1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/ImageFramePacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3eb7f3538d626cd68495da48b11e6f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs new file mode 100644 index 0000000..4d361e8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs @@ -0,0 +1,111 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class MatrixPacketTest + { + #region Constructor + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithValue() + { + var matrix = CreateMatrixInputData(); + using (var packet = new MatrixPacket(matrix)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual(matrix, packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new MatrixPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new MatrixPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var matrix = CreateMatrixInputData(); + var packet = new MatrixPacket(matrix).At(timestamp); + Assert.AreEqual(matrix, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(matrix, newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldThrowNotSupportedException() + { + using (var packet = new MatrixPacket()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { packet.Consume(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + using (var packet = new MatrixPacket(CreateMatrixInputData())) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + + private static MatrixData CreateMatrixInputData() + { + var matrix = new MatrixData(); + matrix.PackedData.Add(0); + matrix.PackedData.Add(1); + matrix.PackedData.Add(2); + matrix.PackedData.Add(3); + matrix.PackedData.Add(4); + matrix.PackedData.Add(5); + + matrix.Rows = 2; + matrix.Cols = 3; + return matrix; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs.meta new file mode 100644 index 0000000..b349e37 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/MatrixPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3a4963f37dcdcc43a8292c2493c19bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs new file mode 100644 index 0000000..8f9d4ac --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class PacketTest + { + #region #DebugString + [Test] + public void DebugString_ShouldReturnDebugString_When_InstantiatedWithDefaultConstructor() + { + using (var packet = new BoolPacket()) + { + Assert.AreEqual("mediapipe::Packet with timestamp: Timestamp::Unset() and no data", packet.DebugString()); + } + } + #endregion + + #region #DebugTypeName + [Test] + public void DebugTypeName_ShouldReturnTypeName_When_ValueIsNotSet() + { + using (var packet = new BoolPacket()) + { + Assert.AreEqual("{empty}", packet.DebugTypeName()); + } + } + #endregion + + #region #RegisteredTypeName + [Test] + public void RegisteredTypeName_ShouldReturnEmptyString() + { + using (var packet = new BoolPacket()) + { + Assert.AreEqual("", packet.RegisteredTypeName()); + } + } + #endregion + + #region #ValidateAsProtoMessageLite + [Test] + public void ValidateAsProtoMessageLite_ShouldReturnInvalidArgument_When_ValueIsBool() + { + using (var packet = new BoolPacket(true)) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, packet.ValidateAsProtoMessageLite().Code()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs.meta new file mode 100644 index 0000000..3d1c74c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/PacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c8b062f481adfe73be16b679e3c1cca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs new file mode 100644 index 0000000..ce02c30 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs @@ -0,0 +1,129 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class SidePacketTest + { + #region #size + [Test] + public void Size_ShouldReturnZero_When_Initialized() + { + using (var sidePacket = new SidePacket()) + { + Assert.AreEqual(0, sidePacket.size); + } + } + + [Test] + public void Size_ShouldReturnSize_When_AfterPacketsAreEmplaced() + { + using (var sidePacket = new SidePacket()) + { + var flagPacket = new BoolPacket(true); + var valuePacket = new FloatPacket(1.0f); + sidePacket.Emplace("flag", flagPacket); + sidePacket.Emplace("value", valuePacket); + + Assert.AreEqual(2, sidePacket.size); + Assert.True(flagPacket.isDisposed); + Assert.True(valuePacket.isDisposed); + } + } + #endregion + + #region #Emplace + [Test] + public void Emplace_ShouldInsertAndDisposePacket() + { + using (var sidePacket = new SidePacket()) + { + Assert.AreEqual(0, sidePacket.size); + Assert.IsNull(sidePacket.At("value")); + + var flagPacket = new FloatPacket(1.0f); + sidePacket.Emplace("value", flagPacket); + + Assert.AreEqual(1, sidePacket.size); + Assert.AreEqual(1.0f, sidePacket.At("value").Get()); + Assert.True(flagPacket.isDisposed); + } + } + + [Test] + public void Emplace_ShouldIgnoreValue_When_KeyExists() + { + using (var sidePacket = new SidePacket()) + { + var oldValuePacket = new FloatPacket(1.0f); + sidePacket.Emplace("value", oldValuePacket); + Assert.AreEqual(1.0f, sidePacket.At("value").Get()); + + var newValuePacket = new FloatPacket(2.0f); + sidePacket.Emplace("value", newValuePacket); + Assert.AreEqual(1.0f, sidePacket.At("value").Get()); + } + } + #endregion + + #region #Erase + [Test] + public void Erase_ShouldDoNothing_When_KeyDoesNotExist() + { + using (var sidePacket = new SidePacket()) + { + var count = sidePacket.Erase("value"); + + Assert.AreEqual(0, sidePacket.size); + Assert.AreEqual(0, count); + } + } + + [Test] + public void Erase_ShouldEraseKey_When_KeyExists() + { + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("value", new BoolPacket(true)); + Assert.AreEqual(1, sidePacket.size); + + var count = sidePacket.Erase("value"); + Assert.AreEqual(0, sidePacket.size); + Assert.AreEqual(1, count); + } + } + #endregion + + #region #Clear + [Test] + public void Clear_ShouldDoNothing_When_SizeIsZero() + { + using (var sidePacket = new SidePacket()) + { + sidePacket.Clear(); + + Assert.AreEqual(0, sidePacket.size); + } + } + + [Test] + public void Clear_ShouldClearAllKeys_When_SizeIsNotZero() + { + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("flag", new BoolPacket(true)); + sidePacket.Emplace("value", new FloatPacket(1.0f)); + Assert.AreEqual(2, sidePacket.size); + + sidePacket.Clear(); + Assert.AreEqual(0, sidePacket.size); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs.meta new file mode 100644 index 0000000..7b0d6e0 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/SidePacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 148809b5633f2f8cd9f277e01bb7b0ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs new file mode 100644 index 0000000..f5b3ccc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs @@ -0,0 +1,177 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System.Text.RegularExpressions; + +namespace Mediapipe.Tests +{ + public class StringPacketTest + { + #region Constructor + [Test, SignalAbort] + public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments() + { + using (var packet = new StringPacket()) + { +#pragma warning disable IDE0058 + Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code()); + Assert.Throws(() => { packet.Get(); }); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); +#pragma warning restore IDE0058 + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithString() + { + using (var packet = new StringPacket("test")) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual("test", packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithByteArray() + { + var bytes = new byte[] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }; + using (var packet = new StringPacket(bytes)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual("test", packet.Get()); + Assert.AreEqual(Timestamp.Unset(), packet.Timestamp()); + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithStringAndTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + using (var packet = new StringPacket("test", timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual("test", packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + + [Test] + public void Ctor_ShouldInstantiatePacket_When_CalledWithByteArrayAndTimestamp() + { + var bytes = new byte[] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }; + using (var timestamp = new Timestamp(1)) + { + using (var packet = new StringPacket(bytes, timestamp)) + { + Assert.True(packet.ValidateAsType().Ok()); + Assert.AreEqual("test", packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var packet = new StringPacket()) + { + Assert.False(packet.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var packet = new StringPacket(); + packet.Dispose(); + + Assert.True(packet.isDisposed); + } + #endregion + + #region #At + [Test] + public void At_ShouldReturnNewPacketWithTimestamp() + { + using (var timestamp = new Timestamp(1)) + { + var str = "str"; + var packet = new StringPacket(str).At(timestamp); + Assert.AreEqual(str, packet.Get()); + Assert.AreEqual(timestamp, packet.Timestamp()); + + using (var newTimestamp = new Timestamp(2)) + { + var newPacket = packet.At(newTimestamp); + Assert.AreEqual(str, newPacket.Get()); + Assert.AreEqual(newTimestamp, newPacket.Timestamp()); + } + + Assert.AreEqual(timestamp, packet.Timestamp()); + } + } + #endregion + + #region #GetByteArray + [Test] + public void GetByteArray_ShouldReturnByteArray() + { + var bytes = new byte[] { (byte)'a', (byte)'b', 0, (byte)'c' }; + using (var packet = new StringPacket(bytes)) + { + Assert.AreEqual(bytes, packet.GetByteArray()); + Assert.AreEqual("ab", packet.Get()); + } + } + #endregion + + #region #Consume + [Test] + public void Consume_ShouldReturnStatusOrString_When_PacketIsEmpty() + { + using (var packet = new StringPacket()) + { + using (var statusOrString = packet.Consume()) + { + Assert.False(statusOrString.Ok()); + Assert.AreEqual(Status.StatusCode.Internal, statusOrString.status.Code()); + } + } + } + + [Test] + public void Consume_ShouldReturnStatusOrString_When_PacketIsNotEmpty() + { + using (var packet = new StringPacket("abc")) + { + using (var statusOrString = packet.Consume()) + { + Assert.True(statusOrString.Ok()); + Assert.AreEqual("abc", statusOrString.Value()); + } + Assert.True(packet.IsEmpty()); + } + } + #endregion + + #region #ValidateAsType + [Test] + public void ValidateAsType_ShouldReturnOk_When_ValueIsSet() + { + using (var packet = new StringPacket("test")) + { + Assert.True(packet.ValidateAsType().Ok()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs.meta new file mode 100644 index 0000000..53e5f18 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Packet/StringPacketTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fc360374ea123c28b7da8b9b81ebac6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port.meta new file mode 100644 index 0000000..97b3b19 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 62cf7906c5d34b94b984c3b13300b589 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs new file mode 100644 index 0000000..1412e83 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class StatusOrGpuResourcesTest + { + #region #status + [Test, GpuOnly] + public void Status_ShouldReturnOk_When_StatusIsOk() + { + using (var statusOrGpuResources = GpuResources.Create()) + { + Assert.AreEqual(Status.StatusCode.Ok, statusOrGpuResources.status.Code()); + } + } + #endregion + + #region #isDisposed + [Test, GpuOnly] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var statusOrGpuResources = GpuResources.Create()) + { + Assert.False(statusOrGpuResources.isDisposed); + } + } + + [Test, GpuOnly] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var statusOrGpuResources = GpuResources.Create(); + statusOrGpuResources.Dispose(); + + Assert.True(statusOrGpuResources.isDisposed); + } + #endregion + + #region #Value + [Test, GpuOnly] + public void Value_ShouldReturnGpuResources_When_StatusIsOk() + { + using (var statusOrGpuResources = GpuResources.Create()) + { + Assert.True(statusOrGpuResources.Ok()); + + using (var gpuResources = statusOrGpuResources.Value()) + { + Assert.IsInstanceOf(gpuResources); + Assert.True(statusOrGpuResources.isDisposed); + } + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs.meta new file mode 100644 index 0000000..e7545ea --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrGpuResourcesTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 744f3edd2e0a5c864b1e59a13c017bbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs new file mode 100644 index 0000000..1d60df7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs @@ -0,0 +1,71 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class StatusOrImageFrameTest + { + #region #status + [Test] + public void Status_ShouldReturnOk_When_StatusIsOk() + { + using (var statusOrImageFrame = InitializeSubject()) + { + Assert.True(statusOrImageFrame.Ok()); + Assert.AreEqual(Status.StatusCode.Ok, statusOrImageFrame.status.Code()); + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var statusOrImageFrame = InitializeSubject()) + { + Assert.False(statusOrImageFrame.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var statusOrImageFrame = InitializeSubject(); + statusOrImageFrame.Dispose(); + + Assert.True(statusOrImageFrame.isDisposed); + } + #endregion + + #region #Value + [Test] + public void Value_ShouldReturnImageFrame_When_StatusIsOk() + { + using (var statusOrImageFrame = InitializeSubject()) + { + Assert.True(statusOrImageFrame.Ok()); + + using (var imageFrame = statusOrImageFrame.Value()) + { + Assert.AreEqual(10, imageFrame.Width()); + Assert.AreEqual(10, imageFrame.Height()); + Assert.True(statusOrImageFrame.isDisposed); + } + } + } + #endregion + + private StatusOrImageFrame InitializeSubject() + { + var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 10, 10); + var packet = new ImageFramePacket(imageFrame, new Timestamp(1)); + + return (StatusOrImageFrame)packet.Consume(); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs.meta new file mode 100644 index 0000000..dd6cada --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrImageFrameTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 466caabcab9db68b9bf6cd8b2ea6829a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs new file mode 100644 index 0000000..25c761d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs @@ -0,0 +1,87 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class StatusOrStringTest + { + #region #status + [Test] + public void Status_ShouldReturnOk_When_StatusIsOk() + { + using (var statusOrString = InitializeSubject("")) + { + Assert.True(statusOrString.Ok()); + Assert.AreEqual(Status.StatusCode.Ok, statusOrString.status.Code()); + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var statusOrString = InitializeSubject("")) + { + Assert.False(statusOrString.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var statusOrString = InitializeSubject(""); + statusOrString.Dispose(); + + Assert.True(statusOrString.isDisposed); + } + #endregion + + #region #Value + [Test] + public void Value_ShouldReturnString_When_StatusIsOk() + { + var bytes = new byte[] { (byte)'a', (byte)'b', 0, (byte)'c' }; + using (var statusOrString = InitializeSubject(bytes)) + { + Assert.True(statusOrString.Ok()); + Assert.AreEqual("ab", statusOrString.Value()); + } + } + #endregion + + #region #ValueAsByteArray + [Test] + public void ValueAsByteArray_ShouldReturnByteArray_When_StatusIsOk() + { + var bytes = new byte[] { (byte)'a', (byte)'b', 0, (byte)'c' }; + using (var statusOrString = InitializeSubject(bytes)) + { + Assert.True(statusOrString.Ok()); + Assert.AreEqual(bytes, statusOrString.ValueAsByteArray()); + } + } + #endregion + + private StatusOrString InitializeSubject(string str) + { + using (var packet = new StringPacket(str)) + { + return (StatusOrString)packet.Consume(); + } + } + + private StatusOrString InitializeSubject(byte[] bytes) + { + using (var packet = new StringPacket(bytes)) + { + return (StatusOrString)packet.Consume(); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs.meta new file mode 100644 index 0000000..e969bed --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusOrStringTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 033bc341009a18e46920a405cd163bfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs new file mode 100644 index 0000000..49d0aaa --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs @@ -0,0 +1,286 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class StatusTest + { + #region #Code + [Test] + public void Code_ShouldReturnStatusCode_When_StatusIsOk() + { + using (var status = Status.Ok()) + { + Assert.AreEqual(Status.StatusCode.Ok, status.Code()); + } + } + + [Test] + public void Code_ShouldReturnStatusCode_When_StatusIsFailedPrecondition() + { + using (var status = Status.FailedPrecondition()) + { + Assert.AreEqual(Status.StatusCode.FailedPrecondition, status.Code()); + } + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var status = Status.Ok()) + { + Assert.False(status.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var status = Status.Ok(); + status.Dispose(); + + Assert.True(status.isDisposed); + } + #endregion + + #region #RawCode + [Test] + public void RawCode_ShouldReturnRawCode_When_StatusIsOk() + { + using (var status = Status.Ok()) + { + Assert.AreEqual(0, status.RawCode()); + } + } + + [Test] + public void RawCode_ShouldReturnRawCode_When_StatusIsFailedPrecondition() + { + using (var status = Status.FailedPrecondition()) + { + Assert.AreEqual(9, status.RawCode()); + } + } + #endregion + + #region #Ok + [Test] + public void Ok_ShouldReturnTrue_When_StatusIsOk() + { + using (var status = Status.Ok()) + { + Assert.True(status.Ok()); + } + } + + [Test] + public void Ok_ShouldReturnFalse_When_StatusIsFailedPrecondition() + { + using (var status = Status.FailedPrecondition()) + { + Assert.False(status.Ok()); + } + } + #endregion + + #region #AssertOk + [Test] + public void AssertOk_ShouldNotThrow_When_StatusIsOk() + { + using (var status = Status.Ok()) + { + Assert.DoesNotThrow(() => { status.AssertOk(); }); + } + } + + [Test] + public void AssertOk_ShouldThrow_When_StatusIsNotOk() + { + using (var status = Status.FailedPrecondition()) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { status.AssertOk(); }); +#pragma warning restore IDE0058 + } + } + #endregion + + #region #ToString + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsOk() + { + using (var status = Status.Ok()) + { + Assert.AreEqual("OK", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsCancelled() + { + var message = "Some error"; + using (var status = Status.Cancelled(message)) + { + Assert.AreEqual($"CANCELLED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsUnknown() + { + var message = "Some error"; + using (var status = Status.Unknown(message)) + { + Assert.AreEqual($"UNKNOWN: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsInvalidArgument() + { + var message = "Some error"; + using (var status = Status.InvalidArgument(message)) + { + Assert.AreEqual($"INVALID_ARGUMENT: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsDeadlineExceeded() + { + var message = "Some error"; + using (var status = Status.DeadlineExceeded(message)) + { + Assert.AreEqual($"DEADLINE_EXCEEDED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsNotFound() + { + var message = "Some error"; + using (var status = Status.NotFound(message)) + { + Assert.AreEqual($"NOT_FOUND: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsAlreadyExists() + { + var message = "Some error"; + using (var status = Status.AlreadyExists(message)) + { + Assert.AreEqual($"ALREADY_EXISTS: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsPermissionDenied() + { + var message = "Some error"; + using (var status = Status.PermissionDenied(message)) + { + Assert.AreEqual($"PERMISSION_DENIED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsResourceExhausted() + { + var message = "Some error"; + using (var status = Status.ResourceExhausted(message)) + { + Assert.AreEqual($"RESOURCE_EXHAUSTED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsFailedPrecondition() + { + var message = "Some error"; + using (var status = Status.FailedPrecondition(message)) + { + Assert.AreEqual($"FAILED_PRECONDITION: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsAborted() + { + var message = "Some error"; + using (var status = Status.Aborted(message)) + { + Assert.AreEqual($"ABORTED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsOutOfRange() + { + var message = "Some error"; + using (var status = Status.OutOfRange(message)) + { + Assert.AreEqual($"OUT_OF_RANGE: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsUnimplemented() + { + var message = "Some error"; + using (var status = Status.Unimplemented(message)) + { + Assert.AreEqual($"UNIMPLEMENTED: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsInternal() + { + var message = "Some error"; + using (var status = Status.Internal(message)) + { + Assert.AreEqual($"INTERNAL: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsUnavailable() + { + var message = "Some error"; + using (var status = Status.Unavailable(message)) + { + Assert.AreEqual($"UNAVAILABLE: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsDataLoss() + { + var message = "Some error"; + using (var status = Status.DataLoss(message)) + { + Assert.AreEqual($"DATA_LOSS: {message}", status.ToString()); + } + } + + [Test] + public void ToString_ShouldReturnMessage_When_StatusIsUnauthenticated() + { + var message = "Some error"; + using (var status = Status.Unauthenticated(message)) + { + Assert.AreEqual($"UNAUTHENTICATED: {message}", status.ToString()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs.meta new file mode 100644 index 0000000..30b46c2 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Port/StatusTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb9c4c0cb4b7c323db90d8592b4684cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs new file mode 100644 index 0000000..adeef7d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs @@ -0,0 +1,254 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class TimestampTest + { + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var timestamp = new Timestamp(1)) + { + Assert.False(timestamp.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var timestamp = new Timestamp(1); + timestamp.Dispose(); + + Assert.True(timestamp.isDisposed); + } + #endregion + + #region #Value + [Test] + public void Value_ShouldReturnValue() + { + using (var timestamp = new Timestamp(10)) + { + Assert.AreEqual(10, timestamp.Value()); + } + } + #endregion + + #region #Seconds + [Test] + public void Seconds_ShouldReturnValueInSeconds() + { + using (var timestamp = new Timestamp(1_000_000)) + { + Assert.AreEqual(1d, timestamp.Seconds(), 1e-9); + } + } + #endregion + + #region #Microseconds + [Test] + public void Microseconds_ShouldReturnValueInMicroseconds() + { + using (var timestamp = new Timestamp(1_000_000)) + { + Assert.AreEqual(1_000_000, timestamp.Microseconds()); + } + } + #endregion + + #region #IsSpecialValue + [Test] + public void IsSpecialValue_ShouldReturnFalse_When_ValueIsInRange() + { + using (var timestamp = new Timestamp(1)) + { + Assert.False(timestamp.IsSpecialValue()); + } + } + + [Test] + public void IsSpecialValue_ShouldReturnTrue_When_TimestampIsUnset() + { + using (var timestamp = Timestamp.Unset()) + { + Assert.True(timestamp.IsSpecialValue()); + } + } + + [Test] + public void IsSpecialValue_ShouldReturnTrue_When_TimestampIsUnstarted() + { + using (var timestamp = Timestamp.Unstarted()) + { + Assert.True(timestamp.IsSpecialValue()); + } + } + #endregion + + #region #IsRangeValue + [Test] + public void IsRangeValue_ShouldReturnTrue_When_ValueIsInRange() + { + using (var timestamp = new Timestamp(1)) + { + Assert.True(timestamp.IsRangeValue()); + } + } + + [Test] + public void IsRangeValue_ShouldReturnFalse_When_TimestampIsPreStream() + { + using (var timestamp = Timestamp.PreStream()) + { + Assert.False(timestamp.IsRangeValue()); + } + } + + [Test] + public void IsRangeValue_ShouldReturnFalse_When_TimestampIsPostStream() + { + using (var timestamp = Timestamp.PostStream()) + { + Assert.False(timestamp.IsRangeValue()); + } + } + + [Test] + public void IsRangeValue_ShouldReturnTrue_When_TimestampIsMin() + { + using (var timestamp = Timestamp.Min()) + { + Assert.True(timestamp.IsRangeValue()); + } + } + + [Test] + public void IsRangeValue_ShouldReturnTrue_When_TimestampIsMax() + { + using (var timestamp = Timestamp.Max()) + { + Assert.True(timestamp.IsRangeValue()); + } + } + #endregion + + #region #IsAllowedInStream + [Test] + public void IsAllowedInStream_ShouldReturnTrue_When_ValueIsInRange() + { + using (var timestamp = new Timestamp(1)) + { + Assert.True(timestamp.IsAllowedInStream()); + } + } + + [Test] + public void IsAllowedInStream_ShouldReturnFalse_When_TimestampIsOneOverPostStream() + { + using (var timestamp = Timestamp.OneOverPostStream()) + { + Assert.False(timestamp.IsAllowedInStream()); + } + } + + [Test] + public void IsAllowedInStream_ShouldReturnFalse_When_TimestampIsDone() + { + using (var timestamp = Timestamp.Done()) + { + Assert.False(timestamp.IsAllowedInStream()); + } + } + #endregion + + #region #DebugString + [Test] + public void DebugString_ShouldReturnDebugString() + { + using (var timestamp = new Timestamp(1)) + { + Assert.AreEqual("1", timestamp.DebugString()); + } + } + + [Test] + public void DebugString_ShouldReturnDebugString_When_TimestampIsUnset() + { + using (var timestamp = Timestamp.Unset()) + { + Assert.AreEqual("Timestamp::Unset()", timestamp.DebugString()); + } + } + #endregion + + #region #NextAllowedInStream + [Test] + public void NextAllowedInStream_ShouldReturnNextTimestamp_When_ValueIsInRange() + { + using (var timestamp = new Timestamp(1)) + { + using (var nextTimestamp = timestamp.NextAllowedInStream()) + { + Assert.AreEqual(2, nextTimestamp.Microseconds()); + } + } + } + + [Test] + public void NextAllowedInStream_ShouldReturnOneOverPostStream_When_TimestampIsPostStream() + { + using (var timestamp = Timestamp.PostStream()) + { + using (var nextTimestamp = timestamp.NextAllowedInStream()) + { + Assert.AreEqual(Timestamp.OneOverPostStream(), nextTimestamp); + } + } + } + #endregion + + #region #PreviousAllowedInStream + [Test] + public void PreviousAllowedInStream_ShouldReturnPreviousTimestamp_When_ValueIsInRange() + { + using (var timestamp = new Timestamp(1)) + { + using (var nextTimestamp = timestamp.PreviousAllowedInStream()) + { + Assert.AreEqual(0, nextTimestamp.Microseconds()); + } + } + } + + [Test] + public void PreviousAllowedInStream_ShouldReturnUnstarted_When_TimestampIsPreStream() + { + using (var timestamp = Timestamp.PreStream()) + { + using (var nextTimestamp = timestamp.PreviousAllowedInStream()) + { + Assert.AreEqual(Timestamp.Unstarted(), nextTimestamp); + } + } + } + #endregion + + #region #FromSeconds + [Test] + public void FromSeconds_ShouldReturnTimestamp() + { + using (var timestamp = Timestamp.FromSeconds(1d)) + { + Assert.AreEqual(1_000_000, timestamp.Microseconds()); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs.meta new file mode 100644 index 0000000..a5dfbda --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/TimestampTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a89b44de17930bf6bcbf5f75f57c100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool.meta new file mode 100644 index 0000000..e554234 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b737c0d514315064ebd2a4180cc065a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs new file mode 100644 index 0000000..3fcc7b7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs @@ -0,0 +1,156 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class NameUtilTest + { + [TestCase("{}", "base", "base")] + [TestCase(@"{""node"":[{""name"":""a""}]}", "base", "base")] + [TestCase(@"{""node"":[{},{}]}", "", "")] + [TestCase(@"{""node"":[{""name"":""base""},{""name"":""base_02""}]}", "base", "base_03")] + public void GetUnusedNodeName_ShouldReturnUniqueName(string configJson, string nameBase, string uniqueName) + { + var config = CalculatorGraphConfig.Parser.ParseJson(configJson); + Assert.AreEqual(uniqueName, Tool.GetUnusedNodeName(config, nameBase)); + } + + [TestCase("{}", "base", "base")] + [TestCase(@"{""node"":[{""input_side_packet"":[""a""]}]}", "base", "base")] + [TestCase(@"{""node"":[{},{""input_side_packet"":[]}]}", "", "")] + [TestCase(@"{""node"":[{""input_side_packet"":[""base""]},{""input_side_packet"":[""TAG:base_02""]}]}", "base", "base_03")] + public void GetUnusedSidePacketName_ShouldReturnUniqueName(string configJson, string nameBase, string uniqueName) + { + var config = CalculatorGraphConfig.Parser.ParseJson(configJson); + Assert.AreEqual(uniqueName, Tool.GetUnusedSidePacketName(config, nameBase)); + } + + [TestCase(@"{""node"":[{""name"":""x""}]}", 0, "x")] + [TestCase(@"{""node"":[{""name"":""x""},{""name"":""x""},{""name"":""y""},{""name"":""x""}]}", 0, "x_1")] + [TestCase(@"{""node"":[{""name"":""x""},{""name"":""x""},{""name"":""y""},{""name"":""x""}]}", 1, "x_2")] + [TestCase(@"{""node"":[{""name"":""x""},{""name"":""x""},{""name"":""y""},{""name"":""x""}]}", 2, "y")] + [TestCase(@"{""node"":[{""name"":""x""},{""name"":""x""},{""name"":""y""},{""name"":""x""}]}", 3, "x_3")] + [TestCase(@"{""node"":[{""calculator"":""x""},{""name"":""x""}]}", 0, "x_1")] + [TestCase(@"{""node"":[{""calculator"":""x""},{""name"":""x""}]}", 1, "x_2")] + [TestCase(@"{""node"":[{""name"":""x""},{""calculator"":""x""}]}", 0, "x_1")] + [TestCase(@"{""node"":[{""name"":""x""},{""calculator"":""x""}]}", 1, "x_2")] + public void CanonicalNodeName_ShouldReturnCanonicalNodeName_When_NodeIdIsValid(string configJson, int nodeId, string name) + { + var config = CalculatorGraphConfig.Parser.ParseJson(configJson); + Assert.AreEqual(name, Tool.CanonicalNodeName(config, nodeId)); + } + + [Test] + public void CanonicalNodeName_ShouldThrow_When_NodeIdIsNegative() + { + var config = CalculatorGraphConfig.Parser.ParseJson(@"{""node"":[{""name"":""name""}]}"); +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.CanonicalNodeName(config, -1); }); +#pragma warning restore IDE0058 + } + + [Test] + public void CanonicalNodeName_ShouldThrow_When_NodeIdIsInvalid() + { + var config = CalculatorGraphConfig.Parser.ParseJson(@"{""node"":[{""name"":""name""}]}"); +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.CanonicalNodeName(config, 1); }); +#pragma warning restore IDE0058 + } + + [Test] + public void CanonicalNodeName_ShouldThrow_When_NodeIsEmpty() + { + var config = CalculatorGraphConfig.Parser.ParseJson("{}"); +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.CanonicalNodeName(config, 0); }); +#pragma warning restore IDE0058 + } + + [TestCase("stream", "stream")] + [TestCase("TAG:x", "x")] + [TestCase("TAG:1:x", "x")] + public void ParseNameFromStream_ShouldReturnName_When_InputIsValid(string stream, string name) + { + Assert.AreEqual(name, Tool.ParseNameFromStream(stream)); + } + + [TestCase(":stream")] + [TestCase("TAG::stream")] + [TestCase("TAG:1:")] + public void ParseNameFromStream_ShouldThrow_When_InputIsInvalid(string stream) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseNameFromStream(stream); }); +#pragma warning restore IDE0058 + } + + [TestCase("", "", 0)] + [TestCase("TAG", "TAG", 0)] + [TestCase(":1", "", 1)] + [TestCase("TAG:1", "TAG", 1)] + public void ParseTagIndex_ShouldReturnTagIndexPair_When_InputIsValid(string tagIndex, string tag, int index) + { + var output = Tool.ParseTagIndex(tagIndex); + + Assert.AreEqual(tag, output.Item1); + Assert.AreEqual(index, output.Item2); + } + + [TestCase("tag")] + [TestCase(":")] + [TestCase("TAG:")] + [TestCase("1")] + public void ParseTagIndex_ShouldThrow_When_InputIsInvalid(string tagIndex) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseTagIndex(tagIndex); }); +#pragma warning restore IDE0058 + } + + [TestCase("stream", "", -1)] + [TestCase("TAG:x", "TAG", 0)] + [TestCase("TAG:1:x", "TAG", 1)] + public void ParseTagIndexFromStream_ShouldReturnTagIndexPair_When_InputIsValid(string stream, string tag, int index) + { + var output = Tool.ParseTagIndexFromStream(stream); + + Assert.AreEqual(tag, output.Item1); + Assert.AreEqual(index, output.Item2); + } + + [TestCase(":stream")] + [TestCase("TAG::stream")] + [TestCase("TAG:1:")] + public void ParseTagIndexFromStream_ShouldThrow_When_InputIsInvalid(string stream) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseTagIndexFromStream(stream); }); +#pragma warning restore IDE0058 + } + + [TestCase("", -1, "")] + [TestCase("", 1, "")] + [TestCase("TAG", -1, "TAG")] + [TestCase("TAG", 1, "TAG:1")] + public void CatTag_ShouldReturnTag(string tag, int index, string output) + { + Assert.AreEqual(output, Tool.CatTag(tag, index)); + } + + [TestCase("", -1, "x", "x")] + [TestCase("", 1, "x", "x")] + [TestCase("TAG", -1, "x", "TAG:x")] + [TestCase("TAG", 1, "x", "TAG:1:x")] + public void CatStream_ShouldReturnStream(string tag, int index, string name, string output) + { + Assert.AreEqual(output, Tool.CatStream((tag, index), name)); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs.meta new file mode 100644 index 0000000..9ca8108 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/NameUtilTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7707b1c1356d57b29b1ad8932beca1a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs new file mode 100644 index 0000000..75192d9 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs @@ -0,0 +1,290 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class ValidateNameTest + { + #region .ValidateName + [TestCase("humphrey")] + [TestCase("humphrey_bogart")] + [TestCase("humphrey_bogart_1899")] + [TestCase("aa")] + [TestCase("b1")] + [TestCase("_1")] + public void ValidateName_ShouldNotThrow_WhenNameIsValid(string name) + { + Assert.DoesNotThrow(() => { Tool.ValidateName(name); }); + } + + [TestCase("")] + [TestCase("humphrey bogart")] + [TestCase("humphreyBogart")] + [TestCase("humphrey-bogart")] + [TestCase("humphrey/bogart")] + [TestCase("humphrey.bogart")] + [TestCase("humphrey:bogart")] + [TestCase("1ST")] + [TestCase("7_ELEVEN")] + [TestCase("401K")] + [TestCase("0")] + [TestCase("1")] + [TestCase("11")] + [TestCase("92091")] + [TestCase("1st")] + [TestCase("7_eleven")] + [TestCase("401k")] + [TestCase("\0contains_escapes\t")] + public void ValidateName_ShouldThrow_WhenNameIsInvalid(string name) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ValidateName(name); }); +#pragma warning restore IDE0058 + } + #endregion + + #region .ValidateNumber + [TestCase("0")] + [TestCase("10")] + [TestCase("1234567890")] + public void ValidateNumber_ShouldNotThrow_WhenNumberIsValid(string number) + { + Assert.DoesNotThrow(() => { Tool.ValidateNumber(number); }); + } + + [TestCase("01")] + [TestCase("1a")] + public void ValidateNumber_ShouldThrow_WhenNumberIsInvalid(string number) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ValidateNumber(number); }); +#pragma warning restore IDE0058 + } + #endregion + + #region .ValidateTag + [TestCase("MALE")] + [TestCase("MALE_ACTOR")] + [TestCase("ACTOR_1899")] + [TestCase("AA")] + [TestCase("B1")] + [TestCase("_1")] + public void ValidateTag_ShouldNotThrow_WhenTagIsValid(string tag) + { + Assert.DoesNotThrow(() => { Tool.ValidateTag(tag); }); + } + + [TestCase("")] + [TestCase("MALE ACTOR")] + [TestCase("MALEaCTOR")] + [TestCase("MALE-ACTOR")] + [TestCase("MALE/ACTOR")] + [TestCase("MALE.ACTOR")] + [TestCase("MALE:ACTOR")] + [TestCase("0")] + [TestCase("1")] + [TestCase("11")] + [TestCase("92091")] + [TestCase("1ST")] + [TestCase("7_ELEVEN")] + [TestCase("401K")] + [TestCase("\0CONTAINS_ESCAPES\t")] + public void ValidateTag_ShouldThrow_WhenTagIsInvalid(string tag) + { +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ValidateTag(tag); }); +#pragma warning restore IDE0058 + } + #endregion + + #region .ParseTagAndName + [TestCase("MALE:humphrey", "MALE", "humphrey")] + [TestCase("ACTOR:humphrey_bogart", "ACTOR", "humphrey_bogart")] + [TestCase("ACTOR_1899:humphrey_1899", "ACTOR_1899", "humphrey_1899")] + [TestCase("humphrey_bogart", "", "humphrey_bogart")] + [TestCase("ACTOR:humphrey", "ACTOR", "humphrey")] + public void ParseTagAndName_ShouldParseInput_When_InputIsValid(string input, string expectedTag, string expectedName) + { + Tool.ParseTagAndName(input, out var tag, out var name); + + Assert.AreEqual(expectedTag, tag); + Assert.AreEqual(expectedName, name); + } + + [TestCase(":humphrey")] + [TestCase("humphrey bogart")] + [TestCase("actor:humphrey")] + [TestCase("actor:humphrey")] + [TestCase("ACTOR:HUMPHREY")] + public void ParseTagAndName_ShouldThrow_When_InputIsInvalid(string input) + { + var tag = "UNTOUCHED"; + var name = "untouched"; + +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseTagAndName(input, out tag, out name); }); + Assert.AreEqual("UNTOUCHED", tag); + Assert.AreEqual("untouched", name); +#pragma warning restore IDE0058 + } + + [Test] + public void ParseTagAndName_ShouldThrow_When_InputIncludesBadCharacters( + [Values(' ', '-', '/', '.', ':')] char ch, + [Values("MALE$0ACTOR:humphrey", "ACTOR:humphrey$0:bogart")] string str + ) + { + ParseTagAndName_ShouldThrow_When_InputIsInvalid(str.Replace("$0", $"{ch}")); + } + #endregion + + #region .ParseTagIndexName + [TestCase("MALE:humphrey", "MALE", 0, "humphrey")] + [TestCase("ACTOR:humphrey_bogart", "ACTOR", 0, "humphrey_bogart")] + [TestCase("ACTOR_1899:humphrey_1899", "ACTOR_1899", 0, "humphrey_1899")] + [TestCase("humphrey_bogart", "", -1, "humphrey_bogart")] + [TestCase("ACTRESS:3:mieko_harada", "ACTRESS", 3, "mieko_harada")] + [TestCase("ACTRESS:0:mieko_harada", "ACTRESS", 0, "mieko_harada")] + [TestCase("A1:100:mieko1", "A1", 100, "mieko1")] + [TestCase("A1:10000:mieko1", "A1", 10000, "mieko1")] + public void ParseTagIndexName_ShouldParseInput_When_InputIsValid(string input, string expectedTag, int expectedIndex, string expectedName) + { + Tool.ParseTagIndexName(input, out var tag, out var index, out var name); + + Assert.AreEqual(expectedTag, tag); + Assert.AreEqual(expectedIndex, index); + Assert.AreEqual(expectedName, name); + } + + [TestCase("")] + [TestCase("A")] + [TestCase("Aa")] + [TestCase("aA")] + [TestCase("1a")] + [TestCase("1")] + [TestCase(":name")] + [TestCase("A:")] + [TestCase("a:name")] + [TestCase("Aa:name")] + [TestCase("aA:name")] + [TestCase("1A:name")] + [TestCase("1:name")] + [TestCase(":1:name")] + [TestCase("A:1:")] + [TestCase("A::name")] + [TestCase("a:1:name")] + [TestCase("Aa:1:name")] + [TestCase("aA:1:name")] + [TestCase("1A:1:name")] + [TestCase("1:1:name")] + [TestCase("A:1:N")] + [TestCase("A:1:nN")] + [TestCase("A:1:Nn")] + [TestCase("A:1:1name")] + [TestCase("A:1:1")] + [TestCase("A:-0:name")] + [TestCase("A:-1:name")] + [TestCase("A:01:name")] + [TestCase("A:00:name")] + [TestCase("A:10001:a")] + [TestCase("A:1:a:")] + [TestCase(":A:1:a")] + [TestCase("A:1:a:a")] + [TestCase("A:1:a:A")] + [TestCase("A:1:a:1")] + public void ParseTagIndexName_ShouldThrow_When_InputIsInvalid(string input) + { + var tag = "UNTOUCHED"; + var index = -1; + var name = "untouched"; + +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseTagIndexName(input, out tag, out index, out name); }); + Assert.AreEqual("UNTOUCHED", tag); + Assert.AreEqual(-1, index); + Assert.AreEqual("untouched", name); +#pragma warning restore IDE0058 + } + + [Test] + public void ParseTagIndexName_ShouldThrow_When_InputIncludesBadCharacters( + [Values('!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '{', '}', '[', ']', + '/', '=', '?', '+', '\\', '|', '-', ';', ':', '\'', '"', '<', '.', '>')] char ch, + [Values("$0", "$0a", "a$0", "$0:a", "A$0:a", "$0A:a", "A:$0:a", "A:$01:a", "A:1$0:a", "A:1:a$0", "$0A:1:a")] string str + ) + { + ParseTagIndexName_ShouldThrow_When_InputIsInvalid(str.Replace("$0", $"{ch}")); + } + #endregion + + #region .ParseTagIndex + [TestCase("", "", 0)] + [TestCase("VIDEO:0", "VIDEO", 0)] + [TestCase("VIDEO:1", "VIDEO", 1)] + [TestCase("AUDIO:2", "AUDIO", 2)] + [TestCase(":0", "", 0)] + [TestCase(":1", "", 1)] + [TestCase(":100", "", 100)] + [TestCase("VIDEO:10000", "VIDEO", 10000)] + public void ParseTagIndex_ShouldParseInput_When_InputIsValid(string input, string expectedTag, int expectedIndex) + { + Tool.ParseTagIndex(input, out var tag, out var index); + + Assert.AreEqual(expectedTag, tag); + Assert.AreEqual(expectedIndex, index); + } + + [TestCase("a")] + [TestCase("Aa")] + [TestCase("aA")] + [TestCase("1A")] + [TestCase("1")] + [TestCase(":")] + [TestCase(":a")] + [TestCase(":A")] + [TestCase(":-0")] + [TestCase(":-1")] + [TestCase(":01")] + [TestCase(":00")] + [TestCase("A:")] + [TestCase("A:a")] + [TestCase("A:A")] + [TestCase("A:-0")] + [TestCase("A:-1")] + [TestCase("A:01")] + [TestCase("A:00")] + [TestCase("A:10001")] + [TestCase("A:1:")] + [TestCase(":A:1")] + [TestCase("A:1:2")] + [TestCase("A:A:1")] + public void ParseTagIndex_ShouldThrow_When_InputIsInvalid(string input) + { + var tag = "UNTOUCHED"; + var index = -1; + +#pragma warning disable IDE0058 + Assert.Throws(() => { Tool.ParseTagIndex(input, out tag, out index); }); + Assert.AreEqual("UNTOUCHED", tag); + Assert.AreEqual(-1, index); +#pragma warning restore IDE0058 + } + + [Test] + public void ParseTagIndex_ShouldThrow_When_InputIncludesBadCharacters( + [Values('!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '{', '}', '[', ']', + '/', '=', '?', '+', '\\', '|', '-', ';', ':', '\'', '"', '<', '.', '>')] char ch, + [Values("$0", "$0A", "A$0", "$0:1", "A$0:1", "$0A:1", "A:1$0", "A:$01")] string str + ) + { + ParseTagIndex_ShouldThrow_When_InputIsInvalid(str.Replace("$0", $"{ch}")); + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs.meta new file mode 100644 index 0000000..42eb7cb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/Tool/ValidateNameTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17bfd5c3db2e476b6b04101190819090 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs new file mode 100644 index 0000000..ead2004 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs @@ -0,0 +1,743 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System.Linq; + +namespace Mediapipe.Tests +{ + public class ValidatedGraphConfigTest + { + private const string _PassThroughConfigText = @" +node { + calculator: ""PassThroughCalculator"" + input_stream: ""in"" + output_stream: ""out1"" +} +node { + calculator: ""PassThroughCalculator"" + input_stream: ""out1"" + output_stream: ""out"" +} +input_stream: ""in"" +output_stream: ""out"" +"; + + private const string _FlowLimiterConfigText = @" +input_stream: ""input_video"" +input_stream: ""output"" + +node { + calculator: ""FlowLimiterCalculator"" + input_stream: ""input_video"" + input_stream: ""FINISHED:output"" + input_stream_info: { + tag_index: ""FINISHED"" + back_edge: true + } + input_side_packet: ""MAX_IN_FLIGHT:max_in_flight"" + input_side_packet: ""OPTIONS:flow_limiter_calculator_options"" + output_stream: ""throttled_input_video"" +} +"; + + private const string _ImageTransformationConfigText = @" +input_stream: ""input_video"" + +node: { + calculator: ""ImageTransformationCalculator"" + input_stream: ""IMAGE:input_video"" + input_side_packet: ""ROTATION_DEGREES:input_rotation"" + input_side_packet: ""FLIP_HORIZONTALLY:input_horizontally_flipped"" + input_side_packet: ""FLIP_VERTICALLY:input_vertically_flipped"" + output_stream: ""IMAGE:transformed_input_video"" +} +"; + + private const string _ConstantSidePacketConfigText = @" +node { + calculator: ""ConstantSidePacketCalculator"" + output_side_packet: ""PACKET:0:int_packet"" + output_side_packet: ""PACKET:1:float_packet"" + output_side_packet: ""PACKET:2:bool_packet"" + output_side_packet: ""PACKET:3:string_packet"" + options: { + [mediapipe.ConstantSidePacketCalculatorOptions.ext]: { + packet { int_value: 256 } + packet { float_value: 0.5f } + packet { bool_value: false } + packet { string_value: ""string"" } + } + } +} +"; + + private const string _FaceDetectionShortRangeConfigText = @" +input_stream: ""image"" +input_stream: ""roi"" + +node { + calculator: ""FaceDetectionShortRange"" + input_stream: ""IMAGE:image"" + input_stream: ""ROI:roi"" + output_stream: ""DETECTIONS:detections"" +} +"; + + #region Constructor + [Test] + public void Ctor_ShouldInstantiateValidatedGraphConfig() + { + Assert.DoesNotThrow(() => + { + var config = new ValidatedGraphConfig(); + config.Dispose(); + }); + } + #endregion + + #region #isDisposed + [Test] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.False(config.isDisposed); + } + } + + [Test] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var config = new ValidatedGraphConfig(); + config.Dispose(); + + Assert.True(config.isDisposed); + } + #endregion + + #region #Initialize + [Test] + public void Initialize_ShouldReturnOk_When_CalledWithConfig() + { + using (var config = new ValidatedGraphConfig()) + { + using (var status = config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText))) + { + Assert.True(status.Ok()); + } + Assert.True(config.Initialized()); + } + } + + [Test] + public void Initialize_ShouldReturnOk_When_CalledWithValidGraphType() + { + using (var config = new ValidatedGraphConfig()) + { + using (var status = config.Initialize("SwitchContainer")) + { + Assert.True(status.Ok()); + } + Assert.True(config.Initialized()); + } + } + + [Test] + public void Initialize_ShouldReturnInternalError_When_CalledWithInvalidGraphType() + { + using (var config = new ValidatedGraphConfig()) + { + using (var status = config.Initialize("InvalidSubgraph")) + { + Assert.AreEqual(Status.StatusCode.NotFound, status.Code()); + } + Assert.False(config.Initialized()); + } + } + #endregion + + #region #ValidateRequiredSidePackets + [Test] + public void ValidateRequiredSidePackets_ShouldReturnOk_When_TheConfigDoesNotRequireSidePackets_And_SidePacketIsEmpty() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.True(status.Ok()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnOk_When_TheConfigDoesNotRequireSidePackets_And_SidePacketIsNotEmpty() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("in", new IntPacket(0)); + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.True(status.Ok()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnOk_When_AllTheSidePacketsAreOptional_And_SidePacketIsEmpty() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_FlowLimiterConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.True(status.Ok()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnInvalidArgumentError_When_TheConfigRequiresSidePackets_And_SidePacketIsEmpty() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ImageTransformationConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, status.Code()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnInvalidArgumentError_When_AllTheRequiredSidePacketsAreNotGiven() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ImageTransformationConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("input_horizontally_flipped", new BoolPacket(false)); + sidePacket.Emplace("input_vertically_flipped", new BoolPacket(true)); + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, status.Code()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnInvalidArgumentError_When_TheSidePacketValuesAreWrong() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ImageTransformationConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("input_horizontally_flipped", new BoolPacket(false)); + sidePacket.Emplace("input_vertically_flipped", new BoolPacket(true)); + sidePacket.Emplace("input_rotation", new StringPacket("0")); + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, status.Code()); + } + } + } + } + + [Test] + public void ValidateRequiredSidePackets_ShouldReturnOk_When_AllTheRequiredSidePacketsAreGiven() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ImageTransformationConfigText)).AssertOk(); + using (var sidePacket = new SidePacket()) + { + sidePacket.Emplace("input_horizontally_flipped", new BoolPacket(false)); + sidePacket.Emplace("input_vertically_flipped", new BoolPacket(true)); + sidePacket.Emplace("input_rotation", new IntPacket(0)); + using (var status = config.ValidateRequiredSidePackets(sidePacket)) + { + Assert.True(status.Ok()); + } + } + } + } + #endregion + + #region Config + [Test] + public void Config_ShouldReturnAnEmptyConfig_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + var canonicalizedConfig = config.Config(); + Assert.AreEqual(canonicalizedConfig.CalculateSize(), 0); + } + } + + [Test] + public void Config_ShouldReturnTheCanonicalizedConfig_When_TheConfigIsPassThroughConfig() + { + using (var config = new ValidatedGraphConfig()) + { + var originalConfig = CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText); + config.Initialize(originalConfig).AssertOk(); + var canonicalizedConfig = config.Config(); + + Assert.AreEqual(originalConfig.Node, canonicalizedConfig.Node); + Assert.AreEqual(originalConfig.InputStream, canonicalizedConfig.InputStream); + Assert.AreEqual(originalConfig.OutputStream, canonicalizedConfig.OutputStream); + Assert.IsEmpty(originalConfig.Executor); + Assert.AreEqual(1, canonicalizedConfig.Executor.Count); + Assert.AreEqual(0, canonicalizedConfig.Executor[0].CalculateSize()); + + Assert.AreEqual(80, originalConfig.CalculateSize()); + Assert.AreEqual(82, canonicalizedConfig.CalculateSize()); + } + } + + [Test] + public void Config_ShouldReturnTheCanonicalizedConfig_When_TheConfigIsFaceDetectionShortRangeCommonConfig() + { + using (var config = new ValidatedGraphConfig()) + { + var originalConfig = CalculatorGraphConfig.Parser.ParseFromTextFormat(_FaceDetectionShortRangeConfigText); + config.Initialize(originalConfig).AssertOk(); + var canonicalizedConfig = config.Config(); + + Assert.AreEqual(84, originalConfig.CalculateSize()); + // 2167 on CPU, 2166 on GPU + Assert.AreEqual(2166, canonicalizedConfig.CalculateSize(), 1); + } + } + #endregion + + #region InputStreamInfos + [Test] + public void InputStreamInfos_ShouldReturnEmptyList_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.IsEmpty(config.InputStreamInfos()); + } + } + + [Test] + public void InputStreamInfos_ShouldReturnEmptyList_When_NoInputStreamExists() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ConstantSidePacketConfigText)).AssertOk(); + Assert.IsEmpty(config.InputStreamInfos()); + } + } + + [Test] + public void InputStreamInfos_ShouldReturnEdgeInfoList_When_InputStreamsExist() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + var inputStreamInfos = config.InputStreamInfos(); + + Assert.AreEqual(inputStreamInfos.Count, 2); + + var inStream = inputStreamInfos.First((edgeInfo) => edgeInfo.name == "in"); + Assert.AreEqual(0, inStream.upstream); + Assert.AreEqual(NodeType.Calculator, inStream.parentNode.type); + Assert.AreEqual(0, inStream.parentNode.index); + Assert.False(inStream.backEdge); + + var out1Stream = inputStreamInfos.First((edgeInfo) => edgeInfo.name == "out1"); + Assert.AreEqual(1, out1Stream.upstream); + Assert.AreEqual(NodeType.Calculator, out1Stream.parentNode.type); + Assert.AreEqual(1, out1Stream.parentNode.index); + Assert.False(out1Stream.backEdge); + } + } + #endregion + + #region OutputStreamInfos + [Test] + public void OutputStreamInfos_ShouldReturnEmptyList_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.IsEmpty(config.OutputStreamInfos()); + } + } + + [Test] + public void OutputStreamInfos_ShouldReturnEdgeInfoList_When_OutputStreamsExist() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + var outputStreamInfos = config.OutputStreamInfos(); + + Assert.AreEqual(3, outputStreamInfos.Count); + + var inStream = outputStreamInfos.First((edgeInfo) => edgeInfo.name == "in"); + Assert.AreEqual(-1, inStream.upstream); + Assert.AreEqual(NodeType.GraphInputStream, inStream.parentNode.type); + Assert.AreEqual(2, inStream.parentNode.index, 2); + Assert.False(inStream.backEdge); + + var out1Stream = outputStreamInfos.First((edgeInfo) => edgeInfo.name == "out1"); + Assert.AreEqual(-1, out1Stream.upstream); + Assert.AreEqual(NodeType.Calculator, out1Stream.parentNode.type); + Assert.AreEqual(0, out1Stream.parentNode.index); + Assert.False(out1Stream.backEdge); + + var outStream = outputStreamInfos.First((edgeInfo) => edgeInfo.name == "out"); + Assert.AreEqual(-1, outStream.upstream); + Assert.AreEqual(NodeType.Calculator, outStream.parentNode.type); + Assert.AreEqual(1, outStream.parentNode.index); + Assert.False(outStream.backEdge); + } + } + #endregion + + #region InputSidePacketInfos + [Test] + public void InputSidePacketInfos_ShouldReturnEmptyList_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.IsEmpty(config.InputSidePacketInfos()); + } + } + + [Test] + public void InputSidePacketInfos_ShouldReturnEmptyList_When_NoInputSidePacketExists() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.IsEmpty(config.InputSidePacketInfos()); + } + } + + [Test] + public void InputSidePacketInfos_ShouldReturnEdgeInfoList_When_InputSidePacketsExist() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_FlowLimiterConfigText)).AssertOk(); + var inputSidePacketInfos = config.InputSidePacketInfos(); + + Assert.True(inputSidePacketInfos.Count >= 2); + + var maxInFlightPacket = inputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "max_in_flight"); + Assert.AreEqual(-1, maxInFlightPacket.upstream); + Assert.AreEqual(NodeType.Calculator, maxInFlightPacket.parentNode.type); + Assert.False(maxInFlightPacket.backEdge); + + var flowLimiterCalculatorOptionsPacket = inputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "flow_limiter_calculator_options"); + Assert.AreEqual(-1, flowLimiterCalculatorOptionsPacket.upstream); + Assert.AreEqual(NodeType.Calculator, flowLimiterCalculatorOptionsPacket.parentNode.type); + Assert.False(flowLimiterCalculatorOptionsPacket.backEdge); + } + } + #endregion + + #region OutputSidePacketInfos + [Test] + public void OutputSidePacketInfos_ShouldReturnEmptyList_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.IsEmpty(config.OutputSidePacketInfos()); + } + } + + [Test] + public void OutputSidePacketInfos_ShouldReturnEmptyList_When_NoOutputSidePacketExists() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.IsEmpty(config.OutputSidePacketInfos()); + } + } + + [Test] + public void OutputSidePacketInfos_ShouldReturnEdgeInfoList_When_OutputSidePacketsExist() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ConstantSidePacketConfigText)).AssertOk(); + var outputSidePacketInfos = config.OutputSidePacketInfos(); + + Assert.AreEqual(4, outputSidePacketInfos.Count); + + var intPacket = outputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "int_packet"); + Assert.AreEqual(-1, intPacket.upstream); + Assert.AreEqual(NodeType.Calculator, intPacket.parentNode.type); + Assert.False(intPacket.backEdge); + + var floatPacket = outputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "float_packet"); + Assert.AreEqual(-1, floatPacket.upstream); + Assert.AreEqual(NodeType.Calculator, floatPacket.parentNode.type); + Assert.False(floatPacket.backEdge); + + var boolPacket = outputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "bool_packet"); + Assert.AreEqual(-1, boolPacket.upstream); + Assert.AreEqual(NodeType.Calculator, boolPacket.parentNode.type); + Assert.False(boolPacket.backEdge); + + var stringPacket = outputSidePacketInfos.First((edgeInfo) => edgeInfo.name == "string_packet"); + Assert.AreEqual(-1, stringPacket.upstream); + Assert.AreEqual(NodeType.Calculator, stringPacket.parentNode.type); + Assert.False(stringPacket.backEdge); + } + } + #endregion + + #region OutputStreamIndex + [Test] + public void OutputStreamIndex_ShouldReturnNegativeValue_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.AreEqual(-1, config.OutputStreamIndex("")); + } + } + + [Test] + public void OutputStreamIndex_ShouldReturnNegativeValue_When_TheNameIsInvalid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.AreEqual(-1, config.OutputStreamIndex("unknown")); + } + } + + [Test] + public void OutputStreamIndex_ShouldReturnIndex_When_TheNameIsValid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.AreEqual(2, config.OutputStreamIndex("out")); + } + } + + [Test] + public void OutputStreamIndex_ShouldReturnIndex_When_TheStreamIsNotPublic() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.AreEqual(1, config.OutputStreamIndex("out1")); + } + } + #endregion + + #region OutputSidePacketIndex + [Test] + public void OutputSidePacketIndex_ShouldReturnNegativeValue_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.AreEqual(-1, config.OutputSidePacketIndex("")); + } + } + + [Test] + public void OutputSidePacketIndex_ShouldReturnNegativeValue_When_TheNameIsInvalid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ConstantSidePacketConfigText)).AssertOk(); + Assert.AreEqual(-1, config.OutputSidePacketIndex("unknown")); + } + } + + [Test] + public void OutputSidePacketIndex_ShouldReturnIndex_When_TheNameIsValid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ConstantSidePacketConfigText)).AssertOk(); + Assert.AreEqual(0, config.OutputSidePacketIndex("int_packet")); + } + } + #endregion + + + #region OutputStreamToNode + [Test] + public void OutputStreamToNode_ShouldReturnNegativeValue_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.AreEqual(-1, config.OutputStreamToNode("")); + } + } + + [Test] + public void OutputStreamToNode_ShouldReturnNegativeValue_When_TheNameIsInvalid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.AreEqual(-1, config.OutputStreamToNode("unknown")); + } + } + + [Test] + public void OutputStreamToNode_ShouldReturnIndex_When_TheNameIsValid() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.AreEqual(0, config.OutputStreamToNode("out1")); + } + } + #endregion + + #region RegisteredSidePacketTypeName + [Test] + public void RegisteredSidePacketTypeName_ShouldReturnInvalidArgumentError_When_TheSidePacketDoesNotExist() + { + using (var config = new ValidatedGraphConfig()) + { + using (var statusOrString = config.RegisteredSidePacketTypeName("max_in_flight")) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, statusOrString.status.Code()); + } + } + } + + [Test] + public void RegisteredSidePacketTypeName_ShouldReturnUnknownError_When_TheSidePacketTypeCannotBeDetermined() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_FlowLimiterConfigText)).AssertOk(); + using (var statusOrString = config.RegisteredSidePacketTypeName("max_in_flight")) + { + Assert.AreEqual(Status.StatusCode.Unknown, statusOrString.status.Code()); + } + } + } + #endregion + + #region RegisteredStreamTypeName + [Test] + public void RegisteredStreamTypeName_ShouldReturnInvalidArgumentError_When_TheStreamDoesNotExist() + { + using (var config = new ValidatedGraphConfig()) + { + using (var statusOrString = config.RegisteredStreamTypeName("in")) + { + Assert.AreEqual(Status.StatusCode.InvalidArgument, statusOrString.status.Code()); + } + } + } + + [Test] + public void RegisteredStreamTypeName_ShouldReturnUnknownError_When_TheStreamTypeCannotBeDetermined() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + using (var statusOrString = config.RegisteredStreamTypeName("in")) + { + Assert.AreEqual(Status.StatusCode.Unknown, statusOrString.status.Code()); + } + } + } + #endregion + + #region Package + [Test] + public void Package_ShouldReturnNull_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.IsNull(config.Package()); + } + } + + [Test] + public void Package_ShouldReturnNull_When_TheNamespaceIsNotSet() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_PassThroughConfigText)).AssertOk(); + Assert.IsNull(config.Package()); + } + } + #endregion + + #region IsReservedExecutorName + [Test] + public void IsReservedExecutorName_ShouldReturnFalse_When_TheNameIsNotReserved() + { + Assert.False(ValidatedGraphConfig.IsReservedExecutorName("unknown")); + } + + [Test] + public void IsReservedExecutorName_ShouldReturnFalse_When_TheNameIsReserved() + { + Assert.True(ValidatedGraphConfig.IsReservedExecutorName("default")); + Assert.True(ValidatedGraphConfig.IsReservedExecutorName("gpu")); + Assert.True(ValidatedGraphConfig.IsReservedExecutorName("__gpu")); + } + #endregion + + #region IsExternalSidePacket + [Test] + public void IsExternalSidePacket_ShouldReturnFalse_When_NotInitialized() + { + using (var config = new ValidatedGraphConfig()) + { + Assert.False(config.IsExternalSidePacket("max_in_flight")); + } + } + + + [Test] + public void IsExternalSidePacket_ShouldReturnFalse_When_TheSidePacketIsInternal() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ConstantSidePacketConfigText)).AssertOk(); + Assert.False(config.IsExternalSidePacket("int_packet")); + } + } + + [Test] + public void IsExternalSidePacket_ShouldReturnTrue_When_TheSidePacketIsExternal() + { + using (var config = new ValidatedGraphConfig()) + { + config.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_FlowLimiterConfigText)).AssertOk(); + Assert.True(config.IsExternalSidePacket("max_in_flight")); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs.meta new file mode 100644 index 0000000..68882fc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Framework/ValidatedGraphConfigTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 593d3340196fca643b5346fb3cd60f7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu.meta new file mode 100644 index 0000000..9e1596f --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34ad49218cadf094e8bc99057c757771 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs new file mode 100644 index 0000000..5d3b7dc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs @@ -0,0 +1,192 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class GlCalculatorHelperTest + { + #region Constructor + [Test, GpuOnly] + public void Ctor_ShouldInstantiateGlCalculatorHelper() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + Assert.AreNotEqual(IntPtr.Zero, glCalculatorHelper.mpPtr); + } + } + #endregion + + #region #isDisposed + [Test, GpuOnly] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + Assert.False(glCalculatorHelper.isDisposed); + } + } + + [Test, GpuOnly] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var glCalculatorHelper = new GlCalculatorHelper(); + glCalculatorHelper.Dispose(); + + Assert.True(glCalculatorHelper.isDisposed); + } + #endregion + + #region #InitializeForTest + [Test, GpuOnly] + public void InitializeForTest_ShouldInitialize() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + Assert.False(glCalculatorHelper.Initialized()); + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + Assert.True(glCalculatorHelper.Initialized()); + } + } + #endregion + + #region #RunInGlContext + [Test, GpuOnly] + public void RunInGlContext_ShouldReturnOk_When_FunctionReturnsOk() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + var status = glCalculatorHelper.RunInGlContext(() => { }); + Assert.True(status.Ok()); + } + } + + [Test, GpuOnly] + public void RunInGlContext_ShouldReturnInternal_When_FunctionThrows() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + var status = glCalculatorHelper.RunInGlContext((GlCalculatorHelper.GlFunction)(() => { throw new Exception("Function Throws"); })); + Assert.AreEqual(Status.StatusCode.Internal, status.Code()); + } + } + #endregion + + #region #CreateSourceTexture + [Test, GpuOnly] + public void CreateSourceTexture_ShouldReturnGlTexture_When_CalledWithImageFrame() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Srgba, 32, 24)) + { + var status = glCalculatorHelper.RunInGlContext(() => + { + var texture = glCalculatorHelper.CreateSourceTexture(imageFrame); + + Assert.AreEqual(32, texture.width); + Assert.AreEqual(24, texture.height); + + texture.Dispose(); + }); + Assert.True(status.Ok()); + + status.Dispose(); + } + } + } + + [Test, GpuOnly] + [Ignore("Skip because a thread will hang")] + public void CreateSourceTexture_ShouldFail_When_ImageFrameFormatIsInvalid() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 32, 24)) + { + var status = glCalculatorHelper.RunInGlContext(() => + { + using (var texture = glCalculatorHelper.CreateSourceTexture(imageFrame)) + { + texture.Release(); + } + }); + Assert.AreEqual(Status.StatusCode.FailedPrecondition, status.Code()); + + status.Dispose(); + } + } + } + #endregion + + #region #CreateDestinationTexture + [Test, GpuOnly] + public void CreateDestinationTexture_ShouldReturnGlTexture_When_GpuBufferFormatIsValid() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + var status = glCalculatorHelper.RunInGlContext(() => + { + var glTexture = glCalculatorHelper.CreateDestinationTexture(32, 24, GpuBufferFormat.kBGRA32); + + Assert.AreEqual(32, glTexture.width); + Assert.AreEqual(24, glTexture.height); + }); + + Assert.True(status.Ok()); + } + } + #endregion + + #region #framebuffer + [Test, GpuOnly] + public void Framebuffer_ShouldReturnGLName() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + // default frame buffer + Assert.AreEqual(0, glCalculatorHelper.framebuffer); + } + } + #endregion + + #region #GetGlContext + [Test, GpuOnly] + public void GetGlContext_ShouldReturnCurrentContext() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + using (var glContext = glCalculatorHelper.GetGlContext()) + { +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + Assert.AreNotEqual(IntPtr.Zero, glContext.eglContext); +#elif UNITY_STANDALONE_OSX + Assert.AreNotEqual(IntPtr.Zero, glContext.nsglContext); +#elif UNITY_IOS + Assert.AreNotEqual(IntPtr.Zero, glContext.eaglContext); +#endif + } + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs.meta new file mode 100644 index 0000000..bf45527 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlCalculatorHelperTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f47dcca1b6cbd6538c87a9914863444 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs new file mode 100644 index 0000000..bdc44d6 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs @@ -0,0 +1,83 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe.Tests +{ + public class GlContextTest + { + #region .GetCurrent + [Test, GpuOnly] + public void GetCurrent_ShouldReturnNull_When_CalledOutOfGlContext() + { + var glContext = GlContext.GetCurrent(); + + Assert.Null(glContext); + } + + [Test, GpuOnly] + public void GetCurrent_ShouldReturnCurrentContext_When_CalledInGlContext() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + glCalculatorHelper.RunInGlContext(() => + { + using (var glContext = GlContext.GetCurrent()) + { + Assert.NotNull(glContext); + Assert.True(glContext.IsCurrent()); + } + }).AssertOk(); + } + } + #endregion + + #region #IsCurrent + public void IsCurrent_ShouldReturnFalse_When_CalledOutOfGlContext() + { + var glContext = GetGlContext(); + + Assert.False(glContext.IsCurrent()); + } + #endregion + + #region properties + [Test, GpuOnly] + public void ShouldReturnProperties() + { + using (var glContext = GetGlContext()) + { +#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID + Assert.AreNotEqual(IntPtr.Zero, glContext.eglDisplay); + Assert.AreNotEqual(IntPtr.Zero, glContext.eglConfig); + Assert.AreNotEqual(IntPtr.Zero, glContext.eglContext); + Assert.AreEqual(3, glContext.glMajorVersion); + Assert.AreEqual(2, glContext.glMinorVersion); + Assert.AreEqual(0, glContext.glFinishCount); +#elif UNITY_STANDALONE_OSX + Assert.AreNotEqual(IntPtr.Zero, glContext.nsglContext); +#elif UNITY_IOS + Assert.AreNotEqual(IntPtr.Zero, glContext.eaglContext); +#endif + } + } + #endregion + + private GlContext GetGlContext() + { + using (var glCalculatorHelper = new GlCalculatorHelper()) + { + glCalculatorHelper.InitializeForTest(GpuResources.Create().Value()); + + return glCalculatorHelper.GetGlContext(); + } + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs.meta new file mode 100644 index 0000000..0eb97b3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlContextTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5e3ffbb666f2d185b043064194cbf12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs new file mode 100644 index 0000000..e24b137 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class GlTextureTest + { + #region Constructor + [Test, GpuOnly] + public void Ctor_ShouldInstantiateGlTexture_When_CalledWithNoArguments() + { + using (var glTexture = new GlTexture()) + { + Assert.AreEqual(0, glTexture.width); + Assert.AreEqual(0, glTexture.height); + } + } + #endregion + + #region #isDisposed + [Test, GpuOnly] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var glTexture = new GlTexture()) + { + Assert.False(glTexture.isDisposed); + } + } + + [Test, GpuOnly] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var glTexture = new GlTexture(); + glTexture.Dispose(); + + Assert.True(glTexture.isDisposed); + } + #endregion + + #region target + [Test, GpuOnly] + public void Target_ShouldReturnTarget() + { + using (var glTexture = new GlTexture()) + { + Assert.AreEqual(Gl.GL_TEXTURE_2D, glTexture.target); + } + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs.meta new file mode 100644 index 0000000..607ac50 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GlTextureTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fbe1d82329bb2b09a88651d8ac9ad4fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs new file mode 100644 index 0000000..6c2281b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; + +namespace Mediapipe.Tests +{ + public class GpuResourcesTest + { + #region Create + [Test, GpuOnly] + public void Create_ShouldReturnStatusOrGpuResources() + { + using (var statusOrGpuResources = GpuResources.Create()) + { + Assert.True(statusOrGpuResources.Ok()); + } + } + #endregion + + #region #isDisposed + [Test, GpuOnly] + public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet() + { + using (var gpuResources = GpuResources.Create().Value()) + { + Assert.False(gpuResources.isDisposed); + } + } + + [Test, GpuOnly] + public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() + { + var gpuResources = GpuResources.Create().Value(); + gpuResources.Dispose(); + + Assert.True(gpuResources.isDisposed); + } + #endregion + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs.meta new file mode 100644 index 0000000..42a6a65 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Gpu/GpuResourcesTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e987f90210347a37b48e4a9f9f93c53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs new file mode 100644 index 0000000..92b3263 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class GpuOnlyAttribute : CategoryAttribute { } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs.meta new file mode 100644 index 0000000..59dfe6d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/GpuOnlyAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b811cc83cc37d7d0384b37c24a725131 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef new file mode 100644 index 0000000..758d145 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef @@ -0,0 +1,25 @@ +{ + "name": "Mediapipe.Runtime.Tests", + "rootNamespace": "", + "references": [ + "UnityEngine.TestRunner", + "UnityEditor.TestRunner", + "Mediapipe.Runtime" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Google.Protobuf.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef.meta new file mode 100644 index 0000000..ccec0fd --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Mediapipe.Runtime.Tests.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8c775aaa5aced5173b281b8d98cebd31 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs new file mode 100644 index 0000000..96e3a81 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using System; + +namespace Mediapipe +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class SignalAbortAttribute : CategoryAttribute { } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs.meta new file mode 100644 index 0000000..0b0c54c --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/SignalAbortAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12af93e7f5250800ca6b14711be2e1d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity.meta new file mode 100644 index 0000000..2c9f219 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: abb99fa6c61a00b46918b927f263e440 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem.meta new file mode 100644 index 0000000..c4efcbc --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f909f741c24136448c3a4f22b5b9127 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs new file mode 100644 index 0000000..c94de1d --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs @@ -0,0 +1,429 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using UnityEngine; + +namespace Mediapipe.Unity.CoordinateSystem.Tests +{ + public class ImageCoordinateTest + { + #region ImageToPoint + [TestCase(640, 480, -160, 0, 10, RotationAngle.Rotation0, false, -480, 240, 10)] + [TestCase(640, 480, 0, -160, 10, RotationAngle.Rotation0, false, -320, 400, 10)] + [TestCase(640, 480, 800, 0, 10, RotationAngle.Rotation0, false, 480, 240, 10)] + [TestCase(640, 480, 640, -160, 10, RotationAngle.Rotation0, false, 320, 400, 10)] + [TestCase(640, 480, -160, 480, -10, RotationAngle.Rotation0, false, -480, -240, -10)] + [TestCase(640, 480, 0, 640, -10, RotationAngle.Rotation0, false, -320, -400, -10)] + [TestCase(640, 480, 800, 480, -10, RotationAngle.Rotation0, false, 480, -240, -10)] + [TestCase(640, 480, 640, 640, -10, RotationAngle.Rotation0, false, 320, -400, -10)] + [TestCase(640, 480, -160, 0, -10, RotationAngle.Rotation0, true, 480, 240, -10)] + [TestCase(640, 480, 0, -160, -10, RotationAngle.Rotation0, true, 320, 400, -10)] + [TestCase(640, 480, 800, 0, -10, RotationAngle.Rotation0, true, -480, 240, -10)] + [TestCase(640, 480, 640, -160, -10, RotationAngle.Rotation0, true, -320, 400, -10)] + [TestCase(640, 480, -160, 480, 10, RotationAngle.Rotation0, true, 480, -240, 10)] + [TestCase(640, 480, 0, 640, 10, RotationAngle.Rotation0, true, 320, -400, 10)] + [TestCase(640, 480, 800, 480, 10, RotationAngle.Rotation0, true, -480, -240, 10)] + [TestCase(640, 480, 640, 640, 10, RotationAngle.Rotation0, true, -320, -400, 10)] + [TestCase(640, 480, -160, 0, 10, RotationAngle.Rotation90, false, 320, 400, 10)] + [TestCase(640, 480, 0, -160, 10, RotationAngle.Rotation90, false, 480, 240, 10)] + [TestCase(640, 480, 640, 0, 10, RotationAngle.Rotation90, false, 320, -400, 10)] + [TestCase(640, 480, 480, -160, 10, RotationAngle.Rotation90, false, 480, -240, 10)] + [TestCase(640, 480, -160, 640, -10, RotationAngle.Rotation90, false, -320, 400, -10)] + [TestCase(640, 480, 0, 800, -10, RotationAngle.Rotation90, false, -480, 240, -10)] + [TestCase(640, 480, 640, 640, -10, RotationAngle.Rotation90, false, -320, -400, -10)] + [TestCase(640, 480, 480, 800, -10, RotationAngle.Rotation90, false, -480, -240, -10)] + [TestCase(640, 480, -160, 0, -10, RotationAngle.Rotation90, true, 320, -400, -10)] + [TestCase(640, 480, 0, -160, -10, RotationAngle.Rotation90, true, 480, -240, -10)] + [TestCase(640, 480, 640, 0, -10, RotationAngle.Rotation90, true, 320, 400, -10)] + [TestCase(640, 480, 480, -160, -10, RotationAngle.Rotation90, true, 480, 240, -10)] + [TestCase(640, 480, -160, 640, 10, RotationAngle.Rotation90, true, -320, -400, 10)] + [TestCase(640, 480, 0, 800, 10, RotationAngle.Rotation90, true, -480, -240, 10)] + [TestCase(640, 480, 640, 640, 10, RotationAngle.Rotation90, true, -320, 400, 10)] + [TestCase(640, 480, 480, 800, 10, RotationAngle.Rotation90, true, -480, 240, 10)] + [TestCase(640, 480, -160, 0, 10, RotationAngle.Rotation180, false, 480, -240, 10)] + [TestCase(640, 480, 0, -160, 10, RotationAngle.Rotation180, false, 320, -400, 10)] + [TestCase(640, 480, 800, 0, 10, RotationAngle.Rotation180, false, -480, -240, 10)] + [TestCase(640, 480, 640, -160, 10, RotationAngle.Rotation180, false, -320, -400, 10)] + [TestCase(640, 480, -160, 480, -10, RotationAngle.Rotation180, false, 480, 240, -10)] + [TestCase(640, 480, 0, 640, -10, RotationAngle.Rotation180, false, 320, 400, -10)] + [TestCase(640, 480, 800, 480, -10, RotationAngle.Rotation180, false, -480, 240, -10)] + [TestCase(640, 480, 640, 640, -10, RotationAngle.Rotation180, false, -320, 400, -10)] + [TestCase(640, 480, -160, 0, -10, RotationAngle.Rotation180, true, -480, -240, -10)] + [TestCase(640, 480, 0, -160, -10, RotationAngle.Rotation180, true, -320, -400, -10)] + [TestCase(640, 480, 800, 0, -10, RotationAngle.Rotation180, true, 480, -240, -10)] + [TestCase(640, 480, 640, -160, -10, RotationAngle.Rotation180, true, 320, -400, -10)] + [TestCase(640, 480, -160, 480, 10, RotationAngle.Rotation180, true, -480, 240, 10)] + [TestCase(640, 480, 0, 640, 10, RotationAngle.Rotation180, true, -320, 400, 10)] + [TestCase(640, 480, 800, 480, 10, RotationAngle.Rotation180, true, 480, 240, 10)] + [TestCase(640, 480, 640, 640, 10, RotationAngle.Rotation180, true, 320, 400, 10)] + [TestCase(640, 480, -160, 0, 10, RotationAngle.Rotation270, false, -320, -400, 10)] + [TestCase(640, 480, 0, -160, 10, RotationAngle.Rotation270, false, -480, -240, 10)] + [TestCase(640, 480, 640, 0, 10, RotationAngle.Rotation270, false, -320, 400, 10)] + [TestCase(640, 480, 480, -160, 10, RotationAngle.Rotation270, false, -480, 240, 10)] + [TestCase(640, 480, -160, 640, -10, RotationAngle.Rotation270, false, 320, -400, -10)] + [TestCase(640, 480, 0, 800, -10, RotationAngle.Rotation270, false, 480, -240, -10)] + [TestCase(640, 480, 640, 640, -10, RotationAngle.Rotation270, false, 320, 400, -10)] + [TestCase(640, 480, 480, 800, -10, RotationAngle.Rotation270, false, 480, 240, -10)] + [TestCase(640, 480, -160, 0, -10, RotationAngle.Rotation270, true, -320, 400, -10)] + [TestCase(640, 480, 0, -160, -10, RotationAngle.Rotation270, true, -480, 240, -10)] + [TestCase(640, 480, 640, 0, -10, RotationAngle.Rotation270, true, -320, -400, -10)] + [TestCase(640, 480, 480, -160, -10, RotationAngle.Rotation270, true, -480, -240, -10)] + [TestCase(640, 480, -160, 640, 10, RotationAngle.Rotation270, true, 320, 400, 10)] + [TestCase(640, 480, 0, 800, 10, RotationAngle.Rotation270, true, 480, 240, 10)] + [TestCase(640, 480, 640, 640, 10, RotationAngle.Rotation270, true, 320, -400, 10)] + [TestCase(640, 480, 480, 800, 10, RotationAngle.Rotation270, true, 480, -240, 10)] + public void ImageToPoint_ShouldReturnLocalPoint_When_ImageSizeIsSameAsScreenSize(int width, int height, int x, int y, int z, RotationAngle imageRotation, bool isMirrored, + float expectedX, float expectedY, float expectedZ) + { + var rect = BuildRect(-width / 2, width / 2, -height / 2, height / 2); + var result = ImageCoordinate.ImageToPoint(rect, x, y, z, width, height, imageRotation, isMirrored); + Assert.AreEqual(new Vector3(expectedX, expectedY, expectedZ), result); + } + + [TestCase(640, 480, 720, 540, -160, 0, 0, RotationAngle.Rotation0, false, -540, 270, 0)] + [TestCase(640, 480, 720, 540, 0, -160, 0, RotationAngle.Rotation0, false, -360, 450, 0)] + [TestCase(640, 480, 720, 540, 800, 0, 0, RotationAngle.Rotation0, false, 540, 270, 0)] + [TestCase(640, 480, 720, 540, 640, -160, 0, RotationAngle.Rotation0, false, 360, 450, 0)] + [TestCase(640, 480, 720, 540, -160, 480, 0, RotationAngle.Rotation0, false, -540, -270, 0)] + [TestCase(640, 480, 720, 540, 0, 640, 0, RotationAngle.Rotation0, false, -360, -450, 0)] + [TestCase(640, 480, 720, 540, 800, 480, 0, RotationAngle.Rotation0, false, 540, -270, 0)] + [TestCase(640, 480, 720, 540, 640, 640, 0, RotationAngle.Rotation0, false, 360, -450, 0)] + [TestCase(640, 480, 960, 720, -160, 0, 0, RotationAngle.Rotation90, true, 480, -600, 0)] + [TestCase(640, 480, 960, 720, 0, -160, 0, RotationAngle.Rotation90, true, 720, -360, 0)] + [TestCase(640, 480, 960, 720, 640, 0, 0, RotationAngle.Rotation90, true, 480, 600, 0)] + [TestCase(640, 480, 960, 720, 480, -160, 0, RotationAngle.Rotation90, true, 720, 360, 0)] + [TestCase(640, 480, 960, 720, -160, 640, 0, RotationAngle.Rotation90, true, -480, -600, 0)] + [TestCase(640, 480, 960, 720, 0, 800, 0, RotationAngle.Rotation90, true, -720, -360, 0)] + [TestCase(640, 480, 960, 720, 640, 640, 0, RotationAngle.Rotation90, true, -480, 600, 0)] + [TestCase(640, 480, 960, 720, 480, 800, 0, RotationAngle.Rotation90, true, -720, 360, 0)] + [TestCase(640, 480, 480, 360, -160, 0, 0, RotationAngle.Rotation180, true, -360, -180, 0)] + [TestCase(640, 480, 480, 360, 0, -160, 0, RotationAngle.Rotation180, true, -240, -300, 0)] + [TestCase(640, 480, 480, 360, 800, 0, 0, RotationAngle.Rotation180, true, 360, -180, 0)] + [TestCase(640, 480, 480, 360, 640, -160, 0, RotationAngle.Rotation180, true, 240, -300, 0)] + [TestCase(640, 480, 480, 360, -160, 480, 0, RotationAngle.Rotation180, true, -360, 180, 0)] + [TestCase(640, 480, 480, 360, 0, 640, 0, RotationAngle.Rotation180, true, -240, 300, 0)] + [TestCase(640, 480, 480, 360, 800, 480, 0, RotationAngle.Rotation180, true, 360, 180, 0)] + [TestCase(640, 480, 480, 360, 640, 640, 0, RotationAngle.Rotation180, true, 240, 300, 0)] + [TestCase(640, 480, 320, 240, -160, 0, 0, RotationAngle.Rotation270, false, -160, -200, 0)] + [TestCase(640, 480, 320, 240, 0, -160, 0, RotationAngle.Rotation270, false, -240, -120, 0)] + [TestCase(640, 480, 320, 240, 640, 0, 0, RotationAngle.Rotation270, false, -160, 200, 0)] + [TestCase(640, 480, 320, 240, 480, -160, 0, RotationAngle.Rotation270, false, -240, 120, 0)] + [TestCase(640, 480, 320, 240, -160, 640, 0, RotationAngle.Rotation270, false, 160, -200, 0)] + [TestCase(640, 480, 320, 240, 0, 800, 0, RotationAngle.Rotation270, false, 240, -120, 0)] + [TestCase(640, 480, 320, 240, 640, 640, 0, RotationAngle.Rotation270, false, 160, 200, 0)] + [TestCase(640, 480, 320, 240, 480, 800, 0, RotationAngle.Rotation270, false, 240, 120, 0)] + public void ImageToPoint_ShouldReturnLocalPoint_When_ImageSizeIsNotSameAsScreenSize(int imageWidth, int imageHeight, int width, int height, int x, int y, int z, + RotationAngle imageRotation, bool isMirrored, float expectedX, float expectedY, float expectedZ) + { + var rect = BuildRect(-width / 2, width / 2, -height / 2, height / 2); + var result = ImageCoordinate.ImageToPoint(rect, x, y, z, imageWidth, imageHeight, imageRotation, isMirrored); + Assert.AreEqual(new Vector3(expectedX, expectedY, expectedZ), result); + } + + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation0, false, 0, 480)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation0, true, 640, 480)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation90, false, 640, 480)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation90, true, 640, 0)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation180, false, 640, 0)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation180, true, 0, 0)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation270, false, 0, 0)] + [TestCase(640, 480, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation270, true, 0, 480)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation0, false, -320, 480)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation0, true, 320, 480)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation90, false, 320, 480)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation90, true, 320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation180, false, 320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation180, true, -320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation270, false, -320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation270, true, -320, 480)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation0, false, -640, 480)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation0, true, 0, 480)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation90, false, 0, 480)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation90, true, 0, 0)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation180, false, 0, 0)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation180, true, -640, 0)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation270, false, -640, 0)] + [TestCase(640, 480, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation270, true, -640, 480)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation0, false, 0, 240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation0, true, 640, 240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation90, false, 640, 240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation90, true, 640, -240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation180, false, 640, -240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation180, true, 0, -240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation270, false, 0, -240)] + [TestCase(640, 480, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation270, true, 0, 240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation0, false, -320, 240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation0, true, 320, 240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation90, false, 320, 240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation90, true, 320, -240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation180, false, 320, -240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation180, true, -320, -240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation270, false, -320, -240)] + [TestCase(640, 480, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation270, true, -320, 240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation0, false, -640, 240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation0, true, 0, 240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation90, false, 0, 240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation90, true, 0, -240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation180, false, 0, -240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation180, true, -640, -240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation270, false, -640, -240)] + [TestCase(640, 480, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation270, true, -640, 240)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation0, false, 0, 0)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation0, true, 640, 0)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation90, false, 640, 0)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation90, true, 640, -480)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation180, false, 640, -480)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation180, true, 0, -480)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation270, false, 0, -480)] + [TestCase(640, 480, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation270, true, 0, 0)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation0, false, -320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation0, true, 320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation90, false, 320, 0)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation90, true, 320, -480)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation180, false, 320, -480)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation180, true, -320, -480)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation270, false, -320, -480)] + [TestCase(640, 480, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation270, true, -320, 0)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation0, false, -640, 0)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation0, true, 0, 0)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation90, false, 0, 0)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation90, true, 0, -480)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation180, false, 0, -480)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation180, true, -640, -480)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation270, false, -640, -480)] + [TestCase(640, 480, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation270, true, -640, 0)] + public void ImageToPoint_ShouldReturnLocalPoint_When_TheAnchorOfRectIsNotAtTheCenter(int width, int height, int x, int y, float xMin, float xMax, float yMin, float yMax, + RotationAngle imageRotation, bool isMirrored, float expectedX, float expectedY) + { + var rect = BuildRect(xMin, xMax, yMin, yMax); + var result = ImageCoordinate.ImageToPoint(rect, x, y, width, height, imageRotation, isMirrored); + Assert.AreEqual(new Vector3(expectedX, expectedY, 0), result); + } + #endregion + + #region ImageNormalizedToPoint + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation0, false, -480, 240, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation0, false, -320, 360, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation0, false, 480, 240, 640)] + [TestCase(640, 480, 1f, -0.25f, 1, RotationAngle.Rotation0, false, 320, 360, 640)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation0, false, -480, -240, -640)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation0, false, -320, -360, -640)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation0, false, 480, -240, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation0, false, 320, -360, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation0, true, 480, 240, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation0, true, 320, 360, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation0, true, -480, 240, 640)] + [TestCase(640, 480, 1f, -0.25f, 1, RotationAngle.Rotation0, true, -320, 360, 640)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation0, true, 480, -240, -640)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation0, true, 320, -360, -640)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation0, true, -480, -240, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation0, true, -320, -360, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation90, false, 320, 360, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation90, false, 480, 240, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation90, false, 320, -360, 480)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation90, false, 480, -240, 480)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation90, false, -320, 360, -480)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation90, false, -480, 240, -480)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation90, false, -320, -360, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation90, false, -480, -240, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation90, true, 320, -360, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation90, true, 480, -240, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation90, true, 320, 360, 480)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation90, true, 480, 240, 480)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation90, true, -320, -360, -480)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation90, true, -480, -240, -480)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation90, true, -320, 360, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation90, true, -480, 240, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation180, false, 480, -240, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation180, false, 320, -360, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation180, false, -480, -240, 640)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation180, false, -320, -360, 640)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation180, false, 480, 240, -640)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation180, false, 320, 360, -640)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation180, false, -480, 240, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation180, false, -320, 360, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation180, true, -480, -240, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation180, true, -320, -360, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation180, true, 480, -240, 640)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation180, true, 320, -360, 640)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation180, true, -480, 240, -640)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation180, true, -320, 360, -640)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation180, true, 480, 240, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation180, true, 320, 360, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation270, false, -320, -360, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation270, false, -480, -240, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation270, false, -320, 360, 480)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation270, false, -480, 240, 480)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation270, false, 320, -360, -480)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation270, false, 480, -240, -480)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation270, false, 320, 360, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation270, false, 480, 240, 0)] + [TestCase(640, 480, -0.25f, 0, 0, RotationAngle.Rotation270, true, -320, 360, 0)] + [TestCase(640, 480, 0, -0.25f, 0, RotationAngle.Rotation270, true, -480, 240, 0)] + [TestCase(640, 480, 1.25f, 0, 1, RotationAngle.Rotation270, true, -320, -360, 480)] + [TestCase(640, 480, 1, -0.25f, 1, RotationAngle.Rotation270, true, -480, -240, 480)] + [TestCase(640, 480, -0.25f, 1, -1, RotationAngle.Rotation270, true, 320, 360, -480)] + [TestCase(640, 480, 0, 1.25f, -1, RotationAngle.Rotation270, true, 480, 240, -480)] + [TestCase(640, 480, 1.25f, 1, 0, RotationAngle.Rotation270, true, 320, -360, 0)] + [TestCase(640, 480, 1, 1.25f, 0, RotationAngle.Rotation270, true, 480, -240, 0)] + public void ImageNormalizedToPoint_ShouldReturnLocalPoint_When_TheAnchorOfRectIsAtTheCenter(int width, int height, float normalizedX, float normalizedY, float normalizedZ, + RotationAngle imageRotation, bool isMirrored, float expectedX, float expectedY, float expectedZ) + { + var rect = BuildRect(-width / 2, width / 2, -height / 2, height / 2); + var result = ImageCoordinate.ImageNormalizedToPoint(rect, normalizedX, normalizedY, normalizedZ, imageRotation, isMirrored); + Assert.AreEqual(new Vector3(expectedX, expectedY, expectedZ), result); + } + + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation0, false, 0, 480, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation0, true, 640, 480, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation90, false, 640, 480, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation90, true, 640, 0, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation180, false, 640, 0, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation180, true, 0, 0, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation270, false, 0, 0, 0)] + [TestCase(0, 0, 0, 0, 640, 0, 480, RotationAngle.Rotation270, true, 0, 480, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation0, false, -320, 480, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation0, true, 320, 480, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation90, false, 320, 480, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation90, true, 320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation180, false, 320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation180, true, -320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation270, false, -320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, 0, 480, RotationAngle.Rotation270, true, -320, 480, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation0, false, -640, 480, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation0, true, 0, 480, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation90, false, 0, 480, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation90, true, 0, 0, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation180, false, 0, 0, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation180, true, -640, 0, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation270, false, -640, 0, 0)] + [TestCase(0, 0, 0, -640, 0, 0, 480, RotationAngle.Rotation270, true, -640, 480, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation0, false, 0, 240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation0, true, 640, 240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation90, false, 640, 240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation90, true, 640, -240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation180, false, 640, -240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation180, true, 0, -240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation270, false, 0, -240, 0)] + [TestCase(0, 0, 0, 0, 640, -240, 240, RotationAngle.Rotation270, true, 0, 240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation0, false, -320, 240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation0, true, 320, 240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation90, false, 320, 240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation90, true, 320, -240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation180, false, 320, -240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation180, true, -320, -240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation270, false, -320, -240, 0)] + [TestCase(0, 0, 0, -320, 320, -240, 240, RotationAngle.Rotation270, true, -320, 240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation0, false, -640, 240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation0, true, 0, 240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation90, false, 0, 240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation90, true, 0, -240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation180, false, 0, -240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation180, true, -640, -240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation270, false, -640, -240, 0)] + [TestCase(0, 0, 0, -640, 0, -240, 240, RotationAngle.Rotation270, true, -640, 240, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation0, false, 0, 0, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation0, true, 640, 0, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation90, false, 640, 0, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation90, true, 640, -480, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation180, false, 640, -480, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation180, true, 0, -480, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation270, false, 0, -480, 0)] + [TestCase(0, 0, 0, 0, 640, -480, 0, RotationAngle.Rotation270, true, 0, 0, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation0, false, -320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation0, true, 320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation90, false, 320, 0, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation90, true, 320, -480, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation180, false, 320, -480, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation180, true, -320, -480, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation270, false, -320, -480, 0)] + [TestCase(0, 0, 0, -320, 320, -480, 0, RotationAngle.Rotation270, true, -320, 0, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation0, false, -640, 0, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation0, true, 0, 0, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation90, false, 0, 0, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation90, true, 0, -480, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation180, false, 0, -480, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation180, true, -640, -480, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation270, false, -640, -480, 0)] + [TestCase(0, 0, 0, -640, 0, -480, 0, RotationAngle.Rotation270, true, -640, 0, 0)] + public void ImageNormalizedToPoint_ShouldReturnLocalPoint_When_TheAnchorOfRectIsNotAtTheCenter(float normalizedX, float normalizedY, float normalizedZ, float xMin, float xMax, float yMin, float yMax, + RotationAngle imageRotation, bool isMirrored, float expectedX, float expectedY, float expectedZ) + { + var rect = BuildRect(xMin, xMax, yMin, yMax); + var result = ImageCoordinate.ImageNormalizedToPoint(rect, normalizedX, normalizedY, normalizedZ, imageRotation, isMirrored); + Assert.AreEqual(new Vector3(expectedX, expectedY, expectedZ), result); + } + + [TestCase(640, 480, 0, 0, 1, 100, RotationAngle.Rotation0, false, 100)] + [TestCase(640, 480, 0, 0, 0.5f, 100, RotationAngle.Rotation0, false, 50)] + [TestCase(640, 480, 0, 0, -1, 100, RotationAngle.Rotation0, false, -100)] + [TestCase(640, 480, 0, 0, -0.5f, 100, RotationAngle.Rotation0, false, -50)] + [TestCase(640, 480, 0, 0, 1, -100, RotationAngle.Rotation0, true, -100)] + [TestCase(640, 480, 0, 0, 0.5f, -100, RotationAngle.Rotation0, true, -50)] + [TestCase(640, 480, 0, 0, -1, -100, RotationAngle.Rotation0, true, 100)] + [TestCase(640, 480, 0, 0, -0.5f, -100, RotationAngle.Rotation0, true, 50)] + [TestCase(640, 480, 0, 0, 1, 100, RotationAngle.Rotation90, false, 100)] + [TestCase(640, 480, 0, 0, 0.5f, 100, RotationAngle.Rotation90, false, 50)] + [TestCase(640, 480, 0, 0, -1, 100, RotationAngle.Rotation90, false, -100)] + [TestCase(640, 480, 0, 0, -0.5f, 100, RotationAngle.Rotation90, false, -50)] + [TestCase(640, 480, 0, 0, 1, -100, RotationAngle.Rotation90, true, -100)] + [TestCase(640, 480, 0, 0, 0.5f, -100, RotationAngle.Rotation90, true, -50)] + [TestCase(640, 480, 0, 0, -1, -100, RotationAngle.Rotation90, true, 100)] + [TestCase(640, 480, 0, 0, -0.5f, -100, RotationAngle.Rotation90, true, 50)] + [TestCase(640, 480, 0, 0, 1, -100, RotationAngle.Rotation180, false, -100)] + [TestCase(640, 480, 0, 0, 0.5f, -100, RotationAngle.Rotation180, false, -50)] + [TestCase(640, 480, 0, 0, -1, -100, RotationAngle.Rotation180, false, 100)] + [TestCase(640, 480, 0, 0, -0.5f, -100, RotationAngle.Rotation180, false, 50)] + [TestCase(640, 480, 0, 0, 1, 100, RotationAngle.Rotation180, true, 100)] + [TestCase(640, 480, 0, 0, 0.5f, 100, RotationAngle.Rotation180, true, 50)] + [TestCase(640, 480, 0, 0, -1, 100, RotationAngle.Rotation180, true, -100)] + [TestCase(640, 480, 0, 0, -0.5f, 100, RotationAngle.Rotation180, true, -50)] + [TestCase(640, 480, 0, 0, 1, -100, RotationAngle.Rotation270, false, -100)] + [TestCase(640, 480, 0, 0, 0.5f, -100, RotationAngle.Rotation270, false, -50)] + [TestCase(640, 480, 0, 0, -1, -100, RotationAngle.Rotation270, false, 100)] + [TestCase(640, 480, 0, 0, -0.5f, -100, RotationAngle.Rotation270, false, 50)] + [TestCase(640, 480, 0, 0, 1, 100, RotationAngle.Rotation270, true, 100)] + [TestCase(640, 480, 0, 0, 0.5f, 100, RotationAngle.Rotation270, true, 50)] + [TestCase(640, 480, 0, 0, -1, 100, RotationAngle.Rotation270, true, -100)] + [TestCase(640, 480, 0, 0, -0.5f, 100, RotationAngle.Rotation270, true, -50)] + public void ImageNormalizedToPoint_ShouldReturnLocalPoint_When_ZScaleIsSpecified(int width, int height, float normalizedX, float normalizedY, float normalizedZ, float zScale, + RotationAngle imageRotation, bool isMirrored, float expectedZ) + { + var rect = BuildRect(-width / 2, width / 2, -height / 2, height / 2); + var result = ImageCoordinate.ImageNormalizedToPoint(rect, normalizedX, normalizedY, normalizedZ, zScale, imageRotation, isMirrored); + Assert.AreEqual(expectedZ, result.z); + } + #endregion + + private UnityEngine.Rect BuildRect(float xMin, float xMax, float yMin, float yMax) + { + var x = xMax < 0 ? xMin : -xMax; + var y = yMax < 0 ? yMin : -yMax; + var rect = new UnityEngine.Rect(x, y, -2 * x, -2 * y); + + if (xMax < 0) + { + rect.xMax = xMax; + } + else + { + rect.xMin = xMin; + } + + if (yMax < 0) + { + rect.yMax = yMax; + } + else + { + rect.yMin = yMin; + } + + return rect; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs.meta new file mode 100644 index 0000000..5150951 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/CoordinateSystem/ImageCoordinateTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b90b6f4e0f7089ba6a9c4ab9890c0897 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension.meta new file mode 100644 index 0000000..03d4630 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43ab0e32eb34e004e914c4e1d69d4db4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs new file mode 100644 index 0000000..8354432 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs @@ -0,0 +1,1308 @@ +// Copyright (c) 2021 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using NUnit.Framework; +using Unity.Collections; +using UnityEngine; + +using System.Linq; + +namespace Mediapipe.Unity.Tests +{ + public class ImageFrameExtensionTest + { + #region TryReadChannel(byte) + [Test] + public void TryReadChannelByte_ShouldReturnFalse_When_ChannelNumberIsNegative() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(-1, new byte[] { })); + } + } + + [Test] + public void TryReadChannelByte_ShouldReturnFalse_When_TheChannelDataIsNotStoredInBytes() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new byte[] { })); + } + } + + [Test] + public void TryReadChannelByte_ShouldReturnFalse_When_ChannelNumberEqualsTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(3, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(4, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(4, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(1, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(3, new byte[] { })); + } + } + + [Test] + public void TryReadChannelByte_ShouldReturnTrue_When_ChannelNumberIsLessThanTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(2, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(3, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(3, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(0, new byte[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(2, new byte[] { })); + } + } + + [Test] + public void TryReadChannelByte_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgb() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 3 = 7 + 1, 2, 3, 33, 34, 35, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 11, 41, 42, 43, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new byte[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new byte[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new byte[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new byte[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new byte[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new byte[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new byte[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new byte[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new byte[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new byte[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new byte[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new byte[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new byte[] { 67, 35, 3, 75, 43, 11 }, result); + + } + } + + [Test] + public void TryReadChannelByte_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgba() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 4 = 4 + 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 68, 0, 0, 0, 0, + 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 0, 0, 0, 0, + }; + var result = new byte[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new byte[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new byte[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new byte[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new byte[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new byte[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new byte[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new byte[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new byte[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new byte[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new byte[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new byte[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new byte[] { 67, 35, 3, 75, 43, 11 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, false)); + Assert.AreEqual(new byte[] { 12, 44, 76, 4, 36, 68 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, true)); + Assert.AreEqual(new byte[] { 4, 36, 68, 12, 44, 76 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, false)); + Assert.AreEqual(new byte[] { 76, 44, 12, 68, 36, 4 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, true)); + Assert.AreEqual(new byte[] { 68, 36, 4, 76, 44, 12 }, result); + } + } + + [Test] + public void TryReadChannelByte_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSbgra() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 4 * 3 = 4 + 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 68, 0, 0, 0, 0, + 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 0, 0, 0, 0, + }; + var result = new byte[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new byte[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new byte[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new byte[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new byte[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new byte[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new byte[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new byte[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new byte[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new byte[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new byte[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new byte[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new byte[] { 67, 35, 3, 75, 43, 11 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, false)); + Assert.AreEqual(new byte[] { 12, 44, 76, 4, 36, 68 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, true)); + Assert.AreEqual(new byte[] { 4, 36, 68, 12, 44, 76 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, false)); + Assert.AreEqual(new byte[] { 76, 44, 12, 68, 36, 4 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, true)); + Assert.AreEqual(new byte[] { 68, 36, 4, 76, 44, 12 }, result); + } + } + + [Test] + public void TryReadChannelByte_ShouldReadTheSpecifiedChannelData_When_TheFormatIsGray8() + { + var bytes = new byte[] { + // padding is 16 - 3 * 1 = 13 + 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new byte[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new byte[] { 4, 5, 6, 1, 2, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new byte[] { 1, 2, 3, 4, 5, 6 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new byte[] { 6, 5, 4, 3, 2, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new byte[] { 3, 2, 1, 6, 5, 4 }, result); + } + } + + [Test] + public void TryReadChannelByte_ShouldReadTheSpecifiedChannelData_When_TheFormatIsLab8() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 3 = 7 + 1, 2, 3, 33, 34, 35, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 11, 41, 42, 43, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new byte[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new byte[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new byte[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new byte[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new byte[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new byte[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new byte[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new byte[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new byte[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new byte[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new byte[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new byte[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new byte[] { 67, 35, 3, 75, 43, 11 }, result); + } + } + #endregion + + #region TryReadChannel(ushort) + [Test] + public void TryReadChannelUshort_ShouldReturnFalse_When_ChannelNumberIsNegative() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(-1, new ushort[] { })); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReturnFalse_When_TheChannelDataIsNotStoredInUshorts() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new ushort[] { })); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReturnFalse_When_ChannelNumberEqualsTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(3, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(4, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(1, new ushort[] { })); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReturnTrue_When_ChannelNumberIsLessThanTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(2, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(3, new ushort[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(0, new ushort[] { })); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgb48() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 24 - 2 * 3 * 3 = 6 + 1, 0, 2, 0, 3, 0, 33, 0, 34, 0, 35, 0, 65, 0, 66, 0, 67, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 10, 0, 11, 0, 41, 0, 42, 0, 43, 0, 73, 0, 74, 0, 75, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new ushort[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 3, 2, 24, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new ushort[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new ushort[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new ushort[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new ushort[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new ushort[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new ushort[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new ushort[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new ushort[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new ushort[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new ushort[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new ushort[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new ushort[] { 67, 35, 3, 75, 43, 11 }, result); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgba64() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 24 - 2 * 3 * 4 = 0 + 1, 0, 2, 0, 3, 0, 4, 0, 33, 0, 34, 0, 35, 0, 36, 0, 65, 0, 66, 0, 67, 0, 68, 0, + 9, 0, 10, 0, 11, 0, 12, 0, 41, 0, 42, 0, 43, 0, 44, 0, 73, 0, 74, 0, 75, 0, 76, 0, + }; + var result = new ushort[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 3, 2, 24, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new ushort[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new ushort[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new ushort[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new ushort[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new ushort[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new ushort[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new ushort[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new ushort[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, false)); + Assert.AreEqual(new ushort[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, false, true)); + Assert.AreEqual(new ushort[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, false)); + Assert.AreEqual(new ushort[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(2, result, true, true)); + Assert.AreEqual(new ushort[] { 67, 35, 3, 75, 43, 11 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, false)); + Assert.AreEqual(new ushort[] { 12, 44, 76, 4, 36, 68 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, false, true)); + Assert.AreEqual(new ushort[] { 4, 36, 68, 12, 44, 76 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, false)); + Assert.AreEqual(new ushort[] { 76, 44, 12, 68, 36, 4 }, result); + + Assert.True(imageFrame.TryReadChannel(3, result, true, true)); + Assert.AreEqual(new ushort[] { 68, 36, 4, 76, 44, 12 }, result); + } + } + + [Test] + public void TryReadChannelUshort_ShouldReadTheSpecifiedChannelData_When_TheFormatIsGray16() + { + var bytes = new byte[] { + // padding is 16 - 2 * 3 = 10 + 1, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new ushort[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new ushort[] { 4, 5, 6, 1, 2, 3 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new ushort[] { 1, 2, 3, 4, 5, 6 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new ushort[] { 6, 5, 4, 3, 2, 1 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new ushort[] { 3, 2, 1, 6, 5, 4 }, result); + } + } + #endregion + + #region TryReadChannel(float) + [Test] + public void TryReadChannelFloat_ShouldReturnFalse_When_ChannelNumberIsNegative() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(-1, new float[] { })); + } + } + + [Test] + public void TryReadChannelFloat_ShouldReturnFalse_When_TheChannelDataIsNotStoredInFloats() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(4, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(0, new float[] { })); + } + } + + [Test] + public void TryReadChannelFloat_ShouldReturnFalse_When_ChannelNumberEqualsTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(1, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannel(2, new float[] { })); + } + } + + [Test] + public void TryReadChannelFloat_ShouldReturnTrue_When_ChannelNumberIsLessThanTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannel(1, new float[] { })); + } + } + + [Test] + public void TryReadChannelFloat_ShouldReadTheSpecifiedChannelData_When_TheFormatIsVec32F1() + { + var floats = new float[] { + // padding is 16 - 3 * 4 = 4 + 1.0f / 255, 2.0f / 255, 3.0f / 255, 0, + 4.0f / 255, 5.0f / 255, 6.0f / 255, 0, + }; + var bytes = FloatsToBytes(floats); + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new float[] { 4.0f / 255, 5.0f / 255, 6.0f / 255, 1.0f / 255, 2.0f / 255, 3.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new float[] { 1.0f / 255, 2.0f / 255, 3.0f / 255, 4.0f / 255, 5.0f / 255, 6.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new float[] { 6.0f / 255, 5.0f / 255, 4.0f / 255, 3.0f / 255, 2.0f / 255, 1.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new float[] { 3.0f / 255, 2.0f / 255, 1.0f / 255, 6.0f / 255, 5.0f / 255, 4.0f / 255 }, result); + } + } + + [Test] + public void TryReadChannelFloat_ShouldReadTheSpecifiedChannelData_When_TheFormatIsVec32F2() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var floats = new float[] { + // padding is 32 - 2 * 3 * 4 = 8 + 1.0f / 255, 2.0f / 255, 33.0f / 255, 34.0f / 255, 65.0f / 255, 66.0f / 255, 0, 0, + 9.0f / 255, 10.0f / 255, 41.0f / 255, 42.0f / 255, 73.0f / 255, 74.0f / 255, 0, 0, + }; + var bytes = FloatsToBytes(floats); + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 3, 2, 32, bytes)) + { + Assert.True(imageFrame.TryReadChannel(0, result, false, false)); + Assert.AreEqual(new float[] { 9.0f / 255, 41.0f / 255, 73.0f / 255, 1.0f / 255, 33.0f / 255, 65.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, false, true)); + Assert.AreEqual(new float[] { 1.0f / 255, 33.0f / 255, 65.0f / 255, 9.0f / 255, 41.0f / 255, 73.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, false)); + Assert.AreEqual(new float[] { 73.0f / 255, 41.0f / 255, 9.0f / 255, 65.0f / 255, 33.0f / 255, 1.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(0, result, true, true)); + Assert.AreEqual(new float[] { 65.0f / 255, 33.0f / 255, 1.0f / 255, 73.0f / 255, 41.0f / 255, 9.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, false)); + Assert.AreEqual(new float[] { 10.0f / 255, 42.0f / 255, 74.0f / 255, 2.0f / 255, 34.0f / 255, 66.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, false, true)); + Assert.AreEqual(new float[] { 2.0f / 255, 34.0f / 255, 66.0f / 255, 10.0f / 255, 42.0f / 255, 74.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, false)); + Assert.AreEqual(new float[] { 74.0f / 255, 42.0f / 255, 10.0f / 255, 66.0f / 255, 34.0f / 255, 2.0f / 255 }, result); + + Assert.True(imageFrame.TryReadChannel(1, result, true, true)); + Assert.AreEqual(new float[] { 66.0f / 255, 34.0f / 255, 2.0f / 255, 74.0f / 255, 42.0f / 255, 10.0f / 255 }, result); + } + } + #endregion + + #region TryReadChannelNormalized + [Test] + public void TryReadChannelNormalized_ShouldReturnFalse_When_ChannelNumberIsNegative() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(-1, new float[] { })); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReturnFalse_When_ChannelNumberEqualsTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(4, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(4, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(4, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(1, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(1, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(1, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(2, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReturnTrue_When_ChannelNumberIsLessThanTheNumberOfChannels() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(2, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(2, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(3, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F2, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(1, new float[] { })); + } + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 0, 0, 0, new byte[] { })) + { + Assert.True(imageFrame.TryReadChannelNormalized(2, new float[] { })); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgba() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 4 = 4 + 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 68, 0, 0, 0, 0, + 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 0, 0, 0, 0, + }; + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, false)); + AssertNormalized(new byte[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, true)); + AssertNormalized(new byte[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, false)); + AssertNormalized(new byte[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, true)); + AssertNormalized(new byte[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, false, false)); + AssertNormalized(new byte[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, false, true)); + AssertNormalized(new byte[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, true, false)); + AssertNormalized(new byte[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, true, true)); + AssertNormalized(new byte[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, false, false)); + AssertNormalized(new byte[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, false, true)); + AssertNormalized(new byte[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, true, false)); + AssertNormalized(new byte[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, true, true)); + AssertNormalized(new byte[] { 67, 35, 3, 75, 43, 11 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, false, false)); + AssertNormalized(new byte[] { 12, 44, 76, 4, 36, 68 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, false, true)); + AssertNormalized(new byte[] { 4, 36, 68, 12, 44, 76 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, true, false)); + AssertNormalized(new byte[] { 76, 44, 12, 68, 36, 4 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, true, true)); + AssertNormalized(new byte[] { 68, 36, 4, 76, 44, 12 }, result); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReadTheSpecifiedChannelData_When_TheFormatIsGray8() + { + var bytes = new byte[] { + // padding is 16 - 3 * 1 = 13 + 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, false)); + AssertNormalized(new byte[] { 4, 5, 6, 1, 2, 3 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, true)); + AssertNormalized(new byte[] { 1, 2, 3, 4, 5, 6 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, false)); + AssertNormalized(new byte[] { 6, 5, 4, 3, 2, 1 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, true)); + AssertNormalized(new byte[] { 3, 2, 1, 6, 5, 4 }, result); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReadTheSpecifiedChannelData_When_TheFormatIsSrgba64() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 24 - 2 * 3 * 4 = 0 + 1, 0, 2, 0, 3, 0, 4, 0, 33, 0, 34, 0, 35, 0, 36, 0, 65, 0, 66, 0, 67, 0, 68, 0, + 9, 0, 10, 0, 11, 0, 12, 0, 41, 0, 42, 0, 43, 0, 44, 0, 73, 0, 74, 0, 75, 0, 76, 0, + }; + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 3, 2, 24, bytes)) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, false)); + AssertNormalized(new ushort[] { 9, 41, 73, 1, 33, 65 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, true)); + AssertNormalized(new ushort[] { 1, 33, 65, 9, 41, 73 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, false)); + AssertNormalized(new ushort[] { 73, 41, 9, 65, 33, 1 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, true)); + AssertNormalized(new ushort[] { 65, 33, 1, 73, 41, 9 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, false, false)); + AssertNormalized(new ushort[] { 10, 42, 74, 2, 34, 66 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, false, true)); + AssertNormalized(new ushort[] { 2, 34, 66, 10, 42, 74 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, true, false)); + AssertNormalized(new ushort[] { 74, 42, 10, 66, 34, 2 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(1, result, true, true)); + AssertNormalized(new ushort[] { 66, 34, 2, 74, 42, 10 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, false, false)); + AssertNormalized(new ushort[] { 11, 43, 75, 3, 35, 67 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, false, true)); + AssertNormalized(new ushort[] { 3, 35, 67, 11, 43, 75 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, true, false)); + AssertNormalized(new ushort[] { 75, 43, 11, 67, 35, 3 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(2, result, true, true)); + AssertNormalized(new ushort[] { 67, 35, 3, 75, 43, 11 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, false, false)); + AssertNormalized(new ushort[] { 12, 44, 76, 4, 36, 68 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, false, true)); + AssertNormalized(new ushort[] { 4, 36, 68, 12, 44, 76 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, true, false)); + AssertNormalized(new ushort[] { 76, 44, 12, 68, 36, 4 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(3, result, true, true)); + AssertNormalized(new ushort[] { 68, 36, 4, 76, 44, 12 }, result); + } + } + + [Test] + public void TryReadChannelNormalized_ShouldReadTheSpecifiedChannelData_When_TheFormatIsGray16() + { + var bytes = new byte[] { + // padding is 16 - 2 * 3 = 10 + 1, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var result = new float[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, false)); + AssertNormalized(new ushort[] { 4, 5, 6, 1, 2, 3 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, false, true)); + AssertNormalized(new ushort[] { 1, 2, 3, 4, 5, 6 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, false)); + AssertNormalized(new ushort[] { 6, 5, 4, 3, 2, 1 }, result); + + Assert.True(imageFrame.TryReadChannelNormalized(0, result, true, true)); + AssertNormalized(new ushort[] { 3, 2, 1, 6, 5, 4 }, result); + } + } + #endregion + + #region TryReadPixelData + [Test] + public void TryReadPixelData_ShouldReturnFalse_When_TheFormatIsInvalid() + { + using (var imageFrame = new ImageFrame()) + { + Assert.False(imageFrame.TryReadPixelData(new Color32[] { })); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnFalse_When_ColorsLengthIsWrong() + { + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 0, 0, 0, new byte[] { })) + { + Assert.False(imageFrame.TryReadPixelData(new Color32[1] { new Color32() })); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsSrgb() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 3 = 7 + 1, 2, 3, 33, 34, 35, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 11, 41, 42, 43, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(9, 10, 11, 255), new Color32(41, 42, 43, 255), new Color32(73, 74, 75, 255), + new Color32(1, 2, 3, 255), new Color32(33, 34, 35, 255), new Color32(65, 66, 67, 255), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsSrgba() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 4 = 4 + 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 68, 0, 0, 0, 0, + 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(9, 10, 11, 12), new Color32(41, 42, 43, 44), new Color32(73, 74, 75, 76), + new Color32(1, 2, 3, 4), new Color32(33, 34, 35, 36), new Color32(65, 66, 67, 68), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsSbgra() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 16 - 3 * 4 = 4 + 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 68, 0, 0, 0, 0, + 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(11, 10, 9, 12), new Color32(43, 42, 41, 44), new Color32(75, 74, 73, 76), + new Color32(3, 2, 1, 4), new Color32(35, 34, 33, 36), new Color32(67, 66, 65, 68), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Sbgra, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsGray8() + { + var bytes = new byte[] { + // padding is 16 - 3 * 1 = 13 + 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(4, 4, 4, 255), new Color32(5, 5, 5, 255), new Color32(6, 6, 6, 255), + new Color32(1, 1, 1, 255), new Color32(2, 2, 2, 255), new Color32(3, 3, 3, 255), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray8, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsLab8() + { + var bytes = new byte[] { + // padding is 16 - 3 * 1 = 13 + 0, 0, 0, 0, 128, 128, 0, 128, 127, 0, 127, 128, 0, 127, 127, 0, + 50, 0, 0, 50, 128, 128, 50, 128, 127, 50, 127, 128, 50, 127, 127, 0, + 100, 0, 0, 100, 128, 128, 100, 128, 127, 100, 127, 128, 100, 127, 127, 0, + 69, 10, 30, 62, 207, 87, 27, 241, 100, 12, 79, 78, 36, 70, 2, 0, // random + }; + var expected = new Color32[] { + new Color32(204, 161, 115, 255), new Color32(93, 169, 0, 255), new Color32(71, 68, 0, 255), new Color32(122, 0, 0, 255), new Color32(178, 0, 84, 255), + new Color32(255, 255, 255, 255), new Color32(0, 255, 255, 255), new Color32(0, 255, 0, 255), new Color32(255, 139, 255, 255), new Color32(255, 70, 0, 255), + new Color32(119, 119, 119, 255), new Color32(0, 169, 255, 255), new Color32(0, 152, 0, 255), new Color32(183, 0, 255, 255), new Color32(255, 0, 0, 255), + new Color32(0, 0, 0, 255), new Color32(0, 64, 194, 255), new Color32(0, 45, 0, 255), new Color32(0, 0, 195, 255), new Color32(132, 0, 0, 255), + }; + var result = new Color32[20]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Lab8, 5, 4, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsSrgb48() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 24 - 2 * 3 * 3 = 6 + 0, 1, 0, 2, 0, 3, 0, 33, 0, 34, 0, 35, 0, 65, 0, 66, 0, 67, 0, 0, 0, 0, 0, 0, + 0, 9, 0, 10, 0, 11, 0, 41, 0, 42, 0, 43, 0, 73, 0, 74, 0, 75, 0, 0, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(9, 10, 11, 255), new Color32(41, 42, 43, 255), new Color32(73, 74, 75, 255), + new Color32(1, 2, 3, 255), new Color32(33, 34, 35, 255), new Color32(65, 66, 67, 255), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgb48, 3, 2, 24, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsSrgba64() + { + // (w, h, c) -> w << 5 + h << 3 + (c + 1) + var bytes = new byte[] { + // padding is 24 - 2 * 3 * 4 = 0 + 0, 1, 0, 2, 0, 3, 0, 4, 0, 33, 0, 34, 0, 35, 0, 36, 0, 65, 0, 66, 0, 67, 0, 68, + 0, 9, 0, 10, 0, 11, 0, 12, 0, 41, 0, 42, 0, 43, 0, 44, 0, 73, 0, 74, 0, 75, 0, 76, + }; + var expected = new Color32[] { + new Color32(9, 10, 11, 12), new Color32(41, 42, 43, 44), new Color32(73, 74, 75, 76), + new Color32(1, 2, 3, 4), new Color32(33, 34, 35, 36), new Color32(65, 66, 67, 68), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Srgba64, 3, 2, 24, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsGray16() + { + var bytes = new byte[] { + // padding is 16 - 2 * 3 = 10 + 0, 1, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + var expected = new Color32[] { + new Color32(4, 4, 4, 255), new Color32(5, 5, 5, 255), new Color32(6, 6, 6, 255), + new Color32(1, 1, 1, 255), new Color32(2, 2, 2, 255), new Color32(3, 3, 3, 255), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Gray16, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + + [Test] + public void TryReadPixelData_ShouldReturnTrue_When_TheFormatIsVec32f1() + { + var floats = new float[] { + // padding is 16 - 3 * 4 = 4 + 1.0f / 255, 2.0f / 255, 3.0f / 255, 0, + 4.0f / 255, 5.0f / 255, 6.0f / 255, 0, + }; + var bytes = FloatsToBytes(floats); + var expected = new Color32[] { + new Color32(4, 4, 4, 255), new Color32(5, 5, 5, 255), new Color32(6, 6, 6, 255), + new Color32(1, 1, 1, 255), new Color32(2, 2, 2, 255), new Color32(3, 3, 3, 255), + }; + var result = new Color32[6]; + + using (var imageFrame = BuildImageFrame(ImageFormat.Types.Format.Vec32F1, 3, 2, 16, bytes)) + { + Assert.True(imageFrame.TryReadPixelData(result)); + Assert.AreEqual(expected, result); + } + } + #endregion + + private ImageFrame BuildImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, byte[] pixelData) + { + var array = new NativeArray(pixelData.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory); + array.CopyFrom(pixelData); + + return new ImageFrame(format, width, height, widthStep, array); + } + + private byte[] FloatsToBytes(float[] array) + { + var bytes = new byte[array.Length * 4]; + + unsafe + { + fixed (float* pArray = array) + { + var pByte = (byte*)pArray; + for (var i = 0; i < 4 * array.Length; i++) + { + bytes[i] = *pByte++; + } + } + } + return bytes; + } + + private void AssertNormalized(byte[] expectedUnnormalized, float[] result) + { + Assert.True(result.All((v) => v >= 0.0f && v <= 1.0f)); + AreAlmostEqual(expectedUnnormalized.Select((v) => (float)v / 255).ToArray(), result, 1e-6); + } + + private void AssertNormalized(ushort[] expectedUnnormalized, float[] result) + { + Assert.True(result.All((v) => v >= 0.0f && v <= 1.0f)); + AreAlmostEqual(expectedUnnormalized.Select((v) => (float)v / 65525).ToArray(), result, 1e-6); + } + + private void AreAlmostEqual(float[] expected, float[] actual, double threshold) + { + Assert.AreEqual(expected.Length, actual.Length); + Assert.True(expected.Zip(actual, (x, y) => x - y).All((diff) => Mathf.Abs(diff) < threshold)); + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs.meta b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs.meta new file mode 100644 index 0000000..b8a26e3 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Tests/EditMode/Unity/Extension/ImageFrameExtensionTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46cfb5995c4d2b93899f4920ae0b016a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Third Party Notices.md b/Packages/com.github.homuler.mediapipe/Third Party Notices.md new file mode 100644 index 0000000..a9a12b1 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Third Party Notices.md @@ -0,0 +1,2419 @@ +This package contains third-party software components governed by the license(s) indicated below: + +--- + +Component Name: Abseil + +License Type: Apache 2.0 + +Copyright (c) 2021, The Abseil Authors, all rights reserved. + +https://github.com/abseil/abseil-cpp + +``` + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +``` + +--- + +Component Name: Ceres Solver + +License Type: Custom + +Copyright (c) 2015 Google Inc. All rights reserved. +Copyright (c) 2007-2011 libmv authors, all rights reserved. + +https://github.com/ceres-solver/ceres-solver + +``` +Ceres Solver - A fast non-linear least squares minimizer +Copyright 2015 Google Inc. All rights reserved. +http://ceres-solver.org/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Google Inc. nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------------------------------------------------------- + +Some of the code in the examples directory derives from libmv, which is +distributed under the MIT license as described below + + +Copyright (c) 2007-2011 libmv authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +``` + +--- + +Component Name: easyexif + +Licence Type: 2-Clause BSD + +Copyright (c) 2010-2015 Mayank Lahiri, All rights reserved. + +https://github.com/mayanklahiri/easyexif + +``` +Copyright (c) 2010-2015 Mayank Lahiri +mlahiri@gmail.com +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +-- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +-- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +``` + +--- + +Component Name: Emscripten + +License Type: MIT + +Copyright (c) 2010-2014, The Emscripten Authors, all rights reserved. + +https://github.com/emscripten-core/emscripten + +``` +Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +``` + +--- + +Component Name: FlatBuffers + +License Type: Apache 2.0 + +Copyright (c) 2021 Google Inc. All rights reserved. + +https://github.com/google/flatbuffers + +``` + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +--- + +Component Name: Font Awesome + +License Type: SIL OFL 1.1 License + +Copyright (c) 2022 Fonticons, Inc. (https://fontawesome.com), all rights reserved + +https://github.com/FortAwesome/Font-Awesome + +``` +# Fonts: SIL OFL 1.1 License + +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +Copyright (c) 2022 Fonticons, Inc. (https://fontawesome.com) +with Reserved Font Name: "Font Awesome". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +SIL OPEN FONT LICENSE +Version 1.1 - 26 February 2007 + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting — in part or in whole — any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +``` + +--- + +Component Name: gflags + +Licence Type: 3-Clause BSD + +Copyright (c) 2006, Google Inc. All rights reserved. + +https://github.com/gflags/gflags + +``` +Copyright (c) 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +--- + +Component Name: Google Logging Library + +Licence Type: 3-Clause BSD + +Copyright (c) 2006, Google Inc. All rights reserved. +Copyright (c) 2003-2008, Jouni Malinen and contributors, All Rights Reserved. + +https://github.com/google/glog + +``` +Copyright (c) 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +A function gettimeofday in utilities.cc is based on + +http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/COPYING&q=GetSystemTimeAsFileTime%20license:bsd + +The license of this code is: + +Copyright (c) 2003-2008, Jouni Malinen and contributors +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +--- + +Component Name: libyuv + +License Type: 3-Clause BSD + +Copyright (c) 2011 The LibYuv Project Authors. All rights reserved. + +https://chromium.googlesource.com/libyuv/libyuv + +``` +Copyright 2011 The LibYuv Project Authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +--- + +Component Name: MediaPipe + +License Type: Apache 2.0 + +Copyright (c) 2021, The MediaPipe Authors, all rights reserved. + +https://github.com/google/mediapipe + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +--- + +Component Name: Protocol Buffers + +License Type: 3-Clause BSD + +Copyright (c) 2008 Google Inc. All rights reserved. + +https://github.com/protocolbuffers/protobuf + +``` +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. +``` + +--- + +Component Name: RE2 + +License Type: 3-Clause BSD + +Copyright (c) 2009 The RE2 Authors. All rights reserved. + +https://github.com/google/re2 + +``` +Copyright (c) 2009 The RE2 Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +--- + +Component Name: SentencePiece + +License Type: Apache 2.0 + +Copyright (c) 2023, Google Inc, all rights reserved. + +https://github.com/google/sentencepiece + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +--- + +Component Name: System.Buffers + +License Type: MIT + +Copyright (c) .NET Foundation and Contributors, all rights reserved + +https://www.nuget.org/packages/System.Buffers + +--- + +Component Name: System.Memory + +License Type: MIT + +Copyright (c) .NET Foundation and Contributors, all rights reserved + +https://www.nuget.org/packages/System.Memory + +--- + +Component Name: System.Runtime.CompilerServices.Unsafe + +License Type: MIT + +Copyright (c) .NET Foundation and Contributors, all rights reserved + +https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe + +--- + +Component Name: Tensorflow + +License Type: Custom + +Copyright (c) 2021 The TensorFlow Authors. All Rights Reserved. +Copyright (c) 2014, The Regents of the University of California (Regents), All rights reserved. + +https://github.com/tensorflow/tensorflow + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +## Some of TensorFlow's code is derived from Caffe, which is subject to the following copyright notice: + +COPYRIGHT + +All contributions by the University of California: + +Copyright (c) 2014, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: + +Copyright (c) 2014, the respective contributors +All rights reserved. + +Caffe uses a shared copyright model: each contributor holds copyright over +their contributions to Caffe. The project versioning records all such +contribution and copyright details. If a contributor wants to further mark +their specific copyright on a particular contribution, they should indicate +their copyright solely in the commit message of the change when it is +committed. + +LICENSE + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +CONTRIBUTION AGREEMENT + +By contributing to the BVLC/caffe repository through pull-request, comment, +or otherwise, the contributor releases their content to the +license and copyright terms herein. +``` + +--- + +Component Name: Tensorflow Text + +License Type: Custom + +Copyright (c) 2021 The TensorFlow Authors. All Rights Reserved. + +https://github.com/tensorflow/text + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +--- + +Component Name: OpenCV + +License Type: 3-Clause BSD + +Copyright (C) 2000-2022, Intel Corporation, all rights reserved. +Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +Copyright (C) 2015-2022, OpenCV Foundation, all rights reserved. +Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +Copyright (C) 2019-2022, Xperience AI, all rights reserved. + +https://github.com/opencv/opencv + +``` +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Copyright (C) 2000-2022, Intel Corporation, all rights reserved. +Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +Copyright (C) 2015-2022, OpenCV Foundation, all rights reserved. +Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +Copyright (C) 2019-2022, Xperience AI, all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +``` + +--- + +Component Name: Carotene + +License Type: 3-Clause BSD + +Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved. + +https://github.com/opencv/opencv/tree/master/3rdparty/carotene + +``` +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +``` + +--- + +Component Name: libjpeg-turbo + +License Type: IJG + +This software is based in part on the work of the Independent JPEG Group. + +https://github.com/libjpeg-turbo/libjpeg-turbo + +--- + +Component Name: libpng + +License Type: Custom + +http://www.libpng.org/pub/png/libpng.html + +``` +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2020 The PNG Reference Library Authors. + * Copyright (c) 2018-2020 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. +``` + +--- + +Component Name: LibTIFF + +License Type: libtiff + +Copyright (c) 1988-1997 Sam Leffler, All rights reserved. +Copyright (c) 1991-1997 Silicon Graphics, Inc. All rights reserved. + +http://www.libtiff.org/ + +``` +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. +``` + +--- + +Component Name: OpenEXR + +License Type: 3-Clause BSD + +Copyright (c) Contributors to the OpenEXR Project. All rights reserved. + +https://www.openexr.com/index.html + +``` +Copyright (c) Contributors to the OpenEXR Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +--- + +Component Name: zlib + +License Type: Zlib + +Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler, all rights reserved. + +https://github.com/madler/zlib + +``` + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu +``` diff --git a/Packages/com.github.homuler.mediapipe/Third Party Notices.md.meta b/Packages/com.github.homuler.mediapipe/Third Party Notices.md.meta new file mode 100644 index 0000000..5153445 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Third Party Notices.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b5a08d6ebcf7e863c9f540cbbd5384ab +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/package.json b/Packages/com.github.homuler.mediapipe/package.json new file mode 100644 index 0000000..3dbb5fb --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/package.json @@ -0,0 +1,38 @@ +{ + "name": "com.github.homuler.mediapipe", + "version": "0.11.0", + "displayName": "MediaPipe Unity Plugin", + "description": "A Unity Plugin to run MediaPipe CalculatorGraph", + "unity": "2020.4", + "author": { + "name": "homuler" + }, + "changelogUrl": "https://github.com/homuler/MediaPipeUnityPlugin/blob/master/CHANGELOG.md", + "documentationUrl": "https://github.com/homuler/MediaPipeUnityPlugin/wiki", + "keywords": [ + "mediapipe", + "MediaPipe" + ], + "scripts": { + "setupSampleDir": "rm -rf $(npm prefix)/Samples~ && mkdir -p $(npm prefix)/Samples~", + "removeStartScene": "rm \"$(npm prefix)/Samples~/Solutions/Scenes/Start Scene.unity\" && rm \"$(npm prefix)/Samples~/Solutions/Scenes/Start Scene.unity.meta\"", + "copySolutionSamples": "cp -r $(npm prefix)/../../Assets/MediaPipeUnity/Samples $(npm prefix)/Samples~/Solutions && npm run removeStartScene", + "copyTutorial": "cp -r $(npm prefix)/../../Assets/MediaPipeUnity/Tutorial $(npm prefix)/Samples~/Tutorial", + "prepack": "npm run setupSampleDir && npm run copySolutionSamples && npm run copyTutorial", + "postpack": "rm -rf $(npm prefix)/Samples~" + }, + "license": "MIT", + "licenseUrl": "https://github.com/homuler/MediaPipeUnityPlugin/blob/master/LICENSE", + "samples": [ + { + "displayName": "Official Solutions", + "description": "MediaPipe Official Solutions Sample", + "path": "Samples~/Solutions" + }, + { + "displayName": "Tutorial", + "description": "Sample Scenes for Tutorial", + "path": "Samples~/Tutorial" + } + ] +} diff --git a/Packages/com.github.homuler.mediapipe/package.json.meta b/Packages/com.github.homuler.mediapipe/package.json.meta new file mode 100644 index 0000000..66e0790 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c02cadc1a4a73c6b08975fee7a8660ed +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 1c24dc9..3a7bc4b 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,5 +1,11 @@ { "dependencies": { + "com.github.homuler.mediapipe": { + "version": "file:com.github.homuler.mediapipe", + "depth": 0, + "source": "embedded", + "dependencies": {} + }, "com.unity.collab-proxy": { "version": "2.0.0", "depth": 0,