code: def _make_segmentation_labels(tmp_dir):
      labels = OpenLABELLabels()
      labels.update_metadata(
          {
              "annotation_id": 51,
              "annotation_type": "semantic segmentation",
              "input_uuid": "0",
              "project": "FiftyOne Test",
              "schema_version": "1.0.0",
              "uri": "https://annotation.provider",
              "uuid": "5151",
          }
      )
      poly_obj_data = OpenLABELObjectData(
          "poly2d-0",
          [100, 200, 200, 200, 200, 100, 100, 100],
          "poly2d",
      )
      poly_obj_data.add_attributes(
          [
              ("closed", True),
              ("mode", "MODE_POLY2D_ABOSLUTE"),
          ]
      )
      poly_obj_data.add_attributes(
          [("is_hole", False), ("polygon_id", "0")],
          as_property=True,
      )
      poly_obj = OpenLABELObject(
          "polyname",
          "objectlabel1",
          frame_interval=(0, 0),
      )
      poly_obj.add_object_data(poly_obj_data, is_frame=True)
      labels.add_object(poly_obj)
  
      line_obj_data = OpenLABELObjectData(
          "poly2d-1",
          [100, 200, 200, 200, 200, 100],
          "poly2d",
      )
      line_obj_data.add_attributes(
          [
              ("closed", False),
              ("mode", "MODE_POLY2D_ABOSLUTE"),
          ]
      )
      line_obj_data.add_attributes(
          [
              ("stream", "camera1"),
          ],
          as_property=True,
      )
      line_obj = OpenLABELObject(
          "polyname2",
          "objectlabel1",
          frame_interval=(0, 0),
      )
      line_obj.add_object_data(line_obj_data, is_frame=True)
      labels.add_object(line_obj)
  
      labels_path = os.path.join(tmp_dir, "openlabel_test.json")
      labels.write_labels(labels_path)
      return labels_path
  
imports: from collections import defaultdict
  import os
  import eta.core.serial
  import fiftyone.core.odm.dataset
label_desc: Use image node_id 4 for calling a global function with example usage: _make_segmentation_labels(tmp_dir) and returns: labels_path