void Visualize(List <Ros.Detection2D> objects, Camera cam, RenderTextureDisplayer camPreview)
    {
        if (objects == null || cam == null || camPreview == null)
        {
            return;
        }

        if (!cam.enabled || !camPreview.gameObject.activeSelf)
        {
            return;
        }

        foreach (Ros.Detection2D obj in objects)
        {
            float x      = (float)obj.bbox.x;
            float y      = (float)obj.bbox.y;
            float width  = (float)obj.bbox.width;
            float height = (float)obj.bbox.height;

            Vector3[] corners = new Vector3[4];
            ((RectTransform)camPreview.transform).GetWorldCorners(corners);
            var previewWidth  = corners[3].x - corners[0].x;
            var previewHeight = corners[1].y - corners[0].y;

            x      = obj.bbox.x / cam.pixelWidth * previewWidth;
            y      = obj.bbox.y / cam.pixelHeight * previewHeight;
            width  = obj.bbox.width / cam.pixelWidth * previewWidth;
            height = obj.bbox.height / cam.pixelHeight * previewHeight;

            // Top-left corner is (0, 0)
            var x_left  = x - width / 2;
            var x_right = x + width / 2;
            var y_up    = y - height / 2;
            var y_down  = y + height / 2;

            // Crop if box is out of preview
            if (x_left < 0)
            {
                x_left = 0;
            }
            if (x_right > previewWidth)
            {
                x_right = previewWidth;
            }
            if (y_up < 0)
            {
                y_up = 0;
            }
            if (y_down > previewHeight)
            {
                y_down = previewHeight;
            }

            Vector2 min = new Vector2(corners[0].x + x_left, (Screen.height - corners[1].y) + y_up);
            Vector2 max = new Vector2(corners[0].x + x_right, (Screen.height - corners[1].y) + y_down);

            Rect rect = Rect.MinMaxRect(min.x, min.y, max.x, max.y);
            if (obj.label == "car")
            {
                GUI.backgroundColor = new Color(0, 1, 0, 0.3f);  // Color.green
            }
            else if (obj.label == "pedestrian")
            {
                GUI.backgroundColor = new Color(1, 0.92f, 0.016f, 0.3f);  // Color.yellow
            }
            else if (obj.label == "bicycle")
            {
                GUI.backgroundColor = new Color(0, 1, 1, 0.3f);  // Color.cyan
            }
            else
            {
                GUI.backgroundColor = new Color(1, 0, 1, 0.3f);  // Color.magenta
            }

            GUI.Box(rect, "", textureStyle);
        }
    }