code: def test_coco_2017():
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "ground_truth" in schema
      assert len(dataset) == 10
      assert len(dataset.match_tags("test")) == 5
      assert len(dataset.match_tags("validation")) == 5
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          max_samples=5,
          label_field="gt",
      )
      schema = dataset.get_field_schema()
  
      assert "gt" in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          label_types=("detections", "segmentations"),
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "segmentations" in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          label_types=("detections", "segmentations"),
          max_samples=5,
          label_field="gt",
      )
      schema = dataset.get_field_schema()
  
      assert "gt_detections" in schema
      assert "gt_segmentations" in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          label_types=("detections", "segmentations"),
          include_id=True,
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "detections" in schema
      assert "segmentations" in schema
      assert "coco_id" in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          splits=("test", "validation"),
          label_types=[],
          max_samples=5,
      )
      schema = dataset.get_field_schema()
  
      assert "ground_truth" not in schema
      assert "detections" not in schema
      assert "coco_id" not in schema
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          split="validation",
          label_types=["detections"],
          classes="person",
          max_samples=25,
      )
  
      assert (
          len(dataset.count_values("ground_truth.detections.label")) > 1
      )
      assert (
          len(
              dataset.match_labels(
                  fields="ground_truth", filter=F("label") == "person"
              )
          )
          == 25
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          split="validation",
          classes="person",
          max_samples=25,
          only_matching=True,
      )
  
      assert (
          len(dataset.count_values("ground_truth.detections.label"))
          == 1
      )
      assert (
          len(
              dataset.match_labels(
                  fields="ground_truth", filter=F("label") == "person"
              )
          )
          == 25
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          split="validation",
          label_types=["detections", "segmentations"],
          classes="person",
          max_samples=25,
      )
  
      assert (
          len(
              dataset.match_labels(
                  fields="detections", filter=F("label") == "person"
              )
          )
          == 25
      )
      assert (
          len(
              dataset.match_labels(
                  fields="segmentations", filter=F("label") == "person"
              )
          )
          == 25
      )
      dataset.delete()
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          split="validation",
          label_types="segmentations",
          classes="person",
          max_samples=25,
          use_polylines=True,
          include_id=True,
      )
      schema = dataset.get_field_schema()
      counts = dataset.count_values("segmentations.polylines.label")
  
      assert "segmentations" in schema
      assert "coco_id" in schema
      assert (
          len(
              dataset.match_labels(
                  fields="segmentations", filter=F("label") == "person"
              )
          )
          == 25
      )
      assert "person" in counts
      assert counts["person"] >= 25
      dataset.delete()
  
      dataset = foz.load_zoo_dataset("coco-2017", split="validation")
      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 3 for calling a global function with example usage: test_coco_2017() without return types