code: def test_open_images_v6():
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["segmentations"],
          max_samples=25,
      )
  
      assert len(dataset) == 25
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=[],
          label_field="oi_id",
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "oi_id" in schema
      assert "positive_labels" not in schema
      assert "negative_labels" not in schema
      assert "detections" not in schema
      assert "relationships" not in schema
      assert "segmentations" not in schema
      assert len(dataset) == 5
      assert len(dataset.match_tags("validation")) == 5
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=[],
          include_id=False,
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "ground_truth" not in schema
      assert "positive_labels" not in schema
      assert "negative_labels" not in schema
      assert "detections" not in schema
      assert "relationships" not in schema
      assert "segmentations" not in schema
      assert "open_images_id" not in schema
      assert len(dataset) == 5
      assert len(dataset.match_tags("validation")) == 5
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types="detections",
          include_id=False,
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "ground_truth" in schema
      assert "open_images_id" not in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "positive_labels" in schema
      assert "negative_labels" in schema
      assert "detections" in schema
      assert "relationships" in schema
      assert "segmentations" in schema
      assert "open_images_id" in schema
      assert len(dataset) == 5
      assert len(dataset.match_tags("validation")) == 5
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          max_samples=5,
          label_field="gt",
      )
      schema = dataset.get_field_schema()
  
      assert "gt_positive_labels" in schema
      assert "gt_negative_labels" in schema
      assert "gt_detections" in schema
      assert "gt_relationships" in schema
      assert "gt_segmentations" in schema
      assert "gt_open_images_id" in schema
      assert len(dataset) == 5
      assert len(dataset.match_tags("validation")) == 5
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "relationships"],
          classes=["Piano", "Fedora"],
          max_samples=50,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "relationships" in schema
      assert "open_images_id" in schema
      assert (
          len(
              dataset.match_labels(
                  filter=F("label").is_in(["Fedora", "Piano"]),
                  fields="detections",
              )
          )
          == 50
      )
      assert (
          len(dataset.count_values("detections.detections.label")) > 1
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "relationships"],
          classes=["Piano", "Fedora"],
          only_matching=True,
          max_samples=50,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "relationships" in schema
      assert "open_images_id" in schema
      assert (
          len(
              dataset.match_labels(
                  filter=F("label").is_in(["Fedora", "Piano"]),
                  fields="detections",
              )
          )
          == 50
      )
      assert (
          len(dataset.count_values("detections.detections.label")) == 2
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "relationships"],
          attrs="Plastic",
          max_samples=50,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "relationships" in schema
      assert "open_images_id" in schema
      assert (
          len(
              dataset.match_labels(
                  filter=(F("Label1") == "Plastic")
                  | (F("Label2") == "Plastic"),
                  fields="relationships",
              )
          )
          == 50
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "relationships"],
          attrs="Plastic",
          only_matching=True,
          max_samples=50,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "relationships" in schema
      assert "open_images_id" in schema
      assert (
          len(
              dataset.match_labels(
                  filter=(F("Label1") == "Plastic")
                  | (F("Label2") == "Plastic"),
                  fields="relationships",
              )
          )
          == 50
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "relationships"],
          classes=["Piano", "Fedora"],
          attrs="Plastic",
          max_samples=50,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "relationships" in schema
      assert "open_images_id" in schema
      assert len(
          dataset.match_labels(
              filter=F("label").is_in(["Fedora", "Piano"]),
              fields="detections",
          )
      ) == len(dataset)
      assert len(
          dataset.match_labels(
              filter=(F("Label1") == "Plastic")
              | (F("Label2") == "Plastic"),
              fields="relationships",
          )
      ) == len(dataset)
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          classes="Violin",
          max_samples=25,
      )
  
      assert (
          len(
              dataset.match_labels(
                  fields="detections", filter=F("label") == "Violin"
              )
          )
          == 25
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "open-images-v6",
          split="validation",
          label_types=["detections", "segmentations"],
          classes="Violin",
          max_samples=25,
      )
  
      assert (
          len(
              dataset.match_labels(
                  fields="detections", filter=F("label") == "Violin"
              )
          )
          == 25
      )
      dataset.delete()
  
file_path: fiftyone/tests/intensive/dataset_zoo_tests.py
imports: import unittest
  import fiftyone
  import fiftyone.zoo
  from fiftyone import ViewField
label_desc: Use image node_id 4 for calling a global function with example usage: test_open_images_v6() without return types