public bool HasDetectionResult(out DetectionResult result)
        {
            if (Sensor != null)
            {
                result = Sensor.Detector.Result;
                return(true);
            }

            result = null;
            return(false);
        }
Ejemplo n.º 2
0
        public override void Encode(DetectionResult result)
        {
            int n       = m_Grid.Shape.ChannelsPerStackLayer;
            int channel = n * m_CrntStackIndex;

            m_Grid.ClearChannels(channel, n);

            int shortestDistanceChannel = channel;

            channel += m_ChannelOffset;

            foreach (string tag in m_Tags)
            {
                var list = result.GetDetectionDataList(tag);
                foreach (var item in list)
                {
                    switch (m_EncodingType)
                    {
                    case ColliderEncodingType.DistancesOnly:
                        EncodeItem(item, channel);
                        break;

                    case ColliderEncodingType.OneHotAndShortestDistance:
                        EncodeItem(item, shortestDistanceChannel, channel);
                        break;

                    case ColliderEncodingType.OneHotAndDistances:
                        EncodeItem(item, channel, channel + 1);
                        break;
                    }
                }

                channel += m_ChannelIncr;
            }

            base.Encode(result);
        }
Ejemplo n.º 3
0
 public Detector(IEnumerable <string> tags)
 {
     Result = new DetectionResult(tags);
     m_Tags = tags.ToList();
 }
Ejemplo n.º 4
0
        public virtual void Encode(DetectionResult result)
        {
            // Implement in subclass.

            m_CrntStackIndex = ++m_CrntStackIndex % m_Grid.Shape.StackSize;
        }