(cls)
| 99 | |
| 100 | @classmethod |
| 101 | def setUpClass(cls): |
| 102 | super().setUpClass() |
| 103 | codecs = VideoFileDataset.get_available_codecs() |
| 104 | if ".mp4" in codecs.values(): |
| 105 | fname = "endo.mp4" |
| 106 | config = testing_data_config("videos", "endovis") |
| 107 | cls.known_fps = 2.0 |
| 108 | cls.known_num_frames = 23 |
| 109 | elif ".avi" in codecs.values(): |
| 110 | fname = "ultrasound.avi" |
| 111 | config = testing_data_config("videos", "ultrasound") |
| 112 | cls.known_fps = 2.0 |
| 113 | cls.known_num_frames = 523 |
| 114 | else: |
| 115 | cls.known_fps = None |
| 116 | cls.known_num_frames = None |
| 117 | cls.video_source = None |
| 118 | return |
| 119 | tests_path = Path(__file__).parents[1].as_posix() |
| 120 | cls.video_source = os.path.join(tests_path, "testing_data", fname) |
| 121 | download_url_or_skip_test( |
| 122 | url=config["url"], |
| 123 | filepath=cls.video_source, |
| 124 | hash_val=config.get("hash_val"), |
| 125 | hash_type=config.get("hash_type", "sha256"), |
| 126 | ) |
| 127 | |
| 128 | @unittest.skipUnless(has_cv2, "OpenCV required.") |
| 129 | def test_dataset(self): |
nothing calls this directly
no test coverage detected