Пример #1
0
        /// <inheritdoc/>
        protected override void Setup()
        {
            if (idLabelConfig == null)
            {
                throw new InvalidOperationException("BoundingBox2DLabeler's idLabelConfig field must be assigned");
            }

            m_AsyncAnnotations = new Dictionary <int, AsyncAnnotation>();

            m_BoundingBoxAnnotationDefinition = DatasetCapture.RegisterAnnotationDefinition("bounding box", idLabelConfig.GetAnnotationSpecification(),
                                                                                            "Bounding box for each labeled object visible to the sensor", id: new Guid(annotationId));

            perceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;

            visualizationEnabled = supportsVisualization;

            // Record the original screen size. The screen size can change during play, and the visual bounding
            // boxes need to be scaled appropriately
            m_OriginalScreenSize = new Vector2(Screen.width, Screen.height);

            m_BoundingBoxTexture = Resources.Load <Texture>("outline_box");
            m_LabelTexture       = Resources.Load <Texture>("solid_white");

            m_Style = new GUIStyle();
            m_Style.normal.textColor = Color.black;
            m_Style.fontSize         = 16;
            m_Style.padding          = new RectOffset(4, 4, 4, 4);
            m_Style.contentOffset    = new Vector2(4, 0);
            m_Style.alignment        = TextAnchor.MiddleLeft;
        }
        /// <inheritdoc/>
        protected override void Setup()
        {
            if (idLabelConfig == null)
            {
                throw new InvalidOperationException("BoundingBox2DLabeler's idLabelConfig field must be assigned");
            }

            m_AsyncAnnotations = new Dictionary <int, AsyncAnnotation>();

            m_BoundingBoxAnnotationDefinition = DatasetCapture.RegisterAnnotationDefinition("bounding box", idLabelConfig.GetAnnotationSpecification(),
                                                                                            "Bounding box for each labeled object visible to the sensor", id: new Guid(annotationId));

            perceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;
        }
        /// <inheritdoc/>
        protected override void Setup()
        {
            if (idLabelConfig == null)
            {
                throw new InvalidOperationException("BoundingBox2DLabeler's idLabelConfig field must be assigned");
            }

            m_AsyncAnnotations = new Dictionary <int, AsyncAnnotation>();

            m_BoundingBoxAnnotationDefinition = DatasetCapture.RegisterAnnotationDefinition("bounding box", idLabelConfig.GetAnnotationSpecification(),
                                                                                            "Bounding box for each labeled object visible to the sensor", id: new Guid(annotationId));

            perceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;

            visualizationEnabled = supportsVisualization;

            // Record the original screen size. The screen size can change during play, and the visual bounding
            // boxes need to be scaled appropriately
            originalScreenSize = new Vector2(Screen.width, Screen.height);
        }