Exemple #1
0
def test_clip():
    default_clipid = "a001"
    dataset = tut2017se.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path": ("tests/resources/sound_datasets/tut2017se/TUT-sound-"
                       "events-2017-development/audio/street/a001.wav"),
        "annotations_path":
        ("tests/resources/sound_datasets/tut2017se/TUT-sound-"
         "events-2017-development/meta/street/a001.ann"),
        "non_verified_annotations_path":
        ("tests/resources/sound_datasets/tut2017se/TUT-sound-"
         "events-2017-development/non_verified/meta/street/a001.ann"),
        "clip_id":
        "a001",
    }

    expected_property_types = {
        "split": str,
        "audio": tuple,
        "events": annotations.Events,
        "non_verified_events": annotations.Events,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
def test_clip():
    default_clipid = "135776-2-0-49"
    dataset = urbansound8k.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path":
        "tests/resources/sound_datasets/urbansound8k/audio/fold1/135776-2-0-49.wav",
        "clip_id": "135776-2-0-49",
    }

    expected_property_types = {
        "slice_file_name": str,
        "freesound_id": str,
        "freesound_start_time": float,
        "freesound_end_time": float,
        "salience": int,
        "fold": int,
        "class_id": int,
        "class_label": str,
        "audio": tuple,
        "tags": annotations.Tags,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #3
0
def test_clip():
    default_clipid = "[b827ebf3744c][2020-08-19T22-46-04Z][manual][---][4edbade2d41d5f80e324ee4f10d401c0][]-135"
    dataset = singapura.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path": (os.path.join(
            TEST_DATA_HOME,
            "labelled",
            "2020-08-19",
            "[b827ebf3744c][2020-08-19T22-46-04Z][manual][---][4edbade2d41d5f80e324ee4f10d401c0][]-135.flac",
        )),
        "annotation_path":
        os.path.join(
            TEST_DATA_HOME,
            "labels_public",
            "[b827ebf3744c][2020-08-19T22-46-04Z][manual][---][4edbade2d41d5f80e324ee4f10d401c0][]-135.csv",
        ),
        "clip_id":
        "[b827ebf3744c][2020-08-19T22-46-04Z][manual][---][4edbade2d41d5f80e324ee4f10d401c0][]-135",
        "sensor_id":
        "b827ebf3744c",
        "town":
        "West 2",
        "timestamp":
        np.datetime64("2020-08-20T06:46:04+08:00"),
        "dotw":
        4,
    }

    expected_property_types = {
        "audio": np.ndarray,
        "events": annotations.MultiAnnotator,
        "audio_path": str,
        "annotation_path": str,
        "clip_id": str,
        "sensor_id": str,
        "town": str,
        "timestamp": np.datetime64,
        "dotw": int,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #4
0
def test_clip():
    default_clipid = "Beach.1"
    dataset = eigenscape.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path": ("tests/resources/sound_datasets/eigenscape/Beach.1.wav"),
        "clip_id": "Beach.1",
    }

    expected_property_types = {
        "audio": tuple,
        "tags": annotations.Tags,
        "location": str,
        "date": str,
        "time": str,
        "additional_information": str,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #5
0
def test_clip():
    default_clipid = "64760"
    dataset = fsd50k.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)
    expected_attributes = {
        "audio_path": "tests/resources/sound_datasets/fsd50k/FSD50K.dev_audio/64760.wav",
        "clip_id": "64760",
    }

    expected_property_types = {
        "audio": tuple,
        "tags": annotations.Tags,
        "mids": annotations.Tags,
        "split": str,
        "title": str,
        "description": str,
        "pp_pnp_ratings": dict,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #6
0
def test_clip():
    default_clipid = "impulse_response/+90deg_011_OCT3D_2_FR"
    dataset = marco.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path":
        ("tests/resources/sound_datasets/marco/3D-MARCo Impulse Responses/01_Speaker_+90deg_3m/+90deg_011_OCT3D_2_FR.wav"
         ),
        "clip_id":
        "impulse_response/+90deg_011_OCT3D_2_FR",
        "source_label":
        "impulse_response",
        "source_angle":
        "+90deg",
        "microphone_info": ["OCT3D", "2", "FR"],
    }

    expected_property_types = {"audio": tuple}

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #7
0
def test_clip():
    default_clipid = "foa_dev/split1_ir0_ov1_1"
    dataset = tau2019sse.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "clip_id": "foa_dev/split1_ir0_ov1_1",
        "audio_path":
        "tests/resources/sound_datasets/tau2019sse/foa_dev/split1_ir0_ov1_1.wav",
        "csv_path":
        "tests/resources/sound_datasets/tau2019sse/metadata_dev/split1_ir0_ov1_1.csv",
        "format": "foa",
        "set": "dev",
    }

    expected_property_types = {
        "audio": tuple,
        "spatial_events": tau2019sse.SpatialEvents,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #8
0
def test_clip():
    default_clipid = "some_id"
    dataset = example.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "clip_id":
        "some_id",
        "audio_path":
        "tests/resources/sound_datasets/example/audio/some_id.wav",
        "annotation_path":
        "tests/resources/sound_datasets/example/annotation/some_id.pv",
    }

    # List here all the properties of your loader
    expected_property_types = {
        "tags": annotations.Tags,
        "some_other_annotation": "some_annotation_type"
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #9
0
def test_clip():
    default_clipid = "foa_dev/fold1_room1_mix001_ov1"
    dataset = tau2020sse_nigens.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "clip_id": "foa_dev/fold1_room1_mix001_ov1",
        "audio_path":
        "tests/resources/sound_datasets/tau2020sse_nigens/foa_dev/fold1_room1_mix001_ov1.wav",
        "csv_path":
        "tests/resources/sound_datasets/tau2020sse_nigens/metadata_dev/fold1_room1_mix001_ov1.csv",
        "format": "foa",
        "set": "dev",
    }

    expected_property_types = {
        "audio": tuple,
        "spatial_events": tau2020sse_nigens.SpatialEvents,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #10
0
def test_clip():
    default_clipid = "soundscape_train_uniform1736"
    dataset = urbansed.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path":
        "tests/resources/sound_datasets/urbansed/audio/train/soundscape_train_uniform1736.wav",
        "jams_path":
        "tests/resources/sound_datasets/urbansed/annotations/train/soundscape_train_uniform1736.jams",
        "txt_path":
        "tests/resources/sound_datasets/urbansed/annotations/train/soundscape_train_uniform1736.txt",
        "clip_id": "soundscape_train_uniform1736",
    }

    expected_property_types = {
        "split": str,
        "audio": tuple,
        "events": annotations.Events,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #11
0
def test_clip():
    default_clipid = "foa_dev/dev-train-sony/fold3_room21_mix001"
    dataset = starss2022.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "clip_id": "foa_dev/dev-train-sony/fold3_room21_mix001",
        "audio_path":
        "tests/resources/sound_datasets/starss2022/foa_dev/dev-train-sony/fold3_room21_mix001.wav",
        "csv_path":
        "tests/resources/sound_datasets/starss2022/metadata_dev/dev-train-sony/fold3_room21_mix001.csv",
        "format": "foa",
        "set": "dev",
        "split": "train",
    }

    expected_property_types = {
        "audio": tuple,
        "spatial_events": starss2022.SpatialEvents,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #12
0
def test_clip():
    default_clipid = "development/airport-barcelona-0-0-a"
    dataset = tau2019uas.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path":
        ("tests/resources/sound_datasets/tau2019uas/TAU-urban-acoustic-scenes-2019-development/audio/airport-barcelona-0-0-a.wav"
         ),
        "clip_id":
        "development/airport-barcelona-0-0-a",
    }

    expected_property_types = {
        "split": str,
        "audio": tuple,
        "tags": annotations.Tags,
        "city": str,
        "identifier": str,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)
Exemple #13
0
def test_clip():
    default_clipid = "1-104089-A-22"
    dataset = esc50.Dataset(TEST_DATA_HOME)
    clip = dataset.clip(default_clipid)

    expected_attributes = {
        "audio_path":
        "tests/resources/sound_datasets/esc50/audio/1-104089-A-22.wav",
        "clip_id": "1-104089-A-22",
    }

    expected_property_types = {
        "filename": str,
        "fold": int,
        "target": int,
        "category": str,
        "esc10": bool,
        "src_file": str,
        "take": str,
        "audio": tuple,
        "tags": annotations.Tags,
    }

    run_clip_tests(clip, expected_attributes, expected_property_types)