From 7f926002bcaa7041b47fa8afbd72fdc9d4cbb764 Mon Sep 17 00:00:00 2001 From: Julien Denize Date: Thu, 10 Oct 2024 09:55:28 +0200 Subject: [PATCH 1/2] Fix soccernet labels --- eztorch/datasets/soccernet.py | 6 +++--- run/datasets/precompute_soccernet_labels.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eztorch/datasets/soccernet.py b/eztorch/datasets/soccernet.py index d4a80f7..3a84bcc 100644 --- a/eztorch/datasets/soccernet.py +++ b/eztorch/datasets/soccernet.py @@ -441,9 +441,9 @@ def _precompute_labels(self): return - else: - make_cache = True - cache_dir.mkdir(parents=True, exist_ok=False) + else: + make_cache = True + cache_dir.mkdir(parents=True, exist_ok=False) if precompute_labels: labels_tot = [None for i in range(self.num_halves)] diff --git a/run/datasets/precompute_soccernet_labels.py b/run/datasets/precompute_soccernet_labels.py index 656a006..6e5f94b 100644 --- a/run/datasets/precompute_soccernet_labels.py +++ b/run/datasets/precompute_soccernet_labels.py @@ -8,7 +8,7 @@ parser.add_argument("--data-path", type=str, default="") parser.add_argument("--path-prefix", type=str, default="") parser.add_argument("--fps", type=int, default=2) -parser.add_argument("--cache-dir", type=str, default="") +parser.add_argument("--cache-dir", type=str, required=True) parser.add_argument("--task", type=str, default="action") From 34a9799c2316dd46f185291202870a4597ba6389 Mon Sep 17 00:00:00 2001 From: Julien Denize Date: Thu, 10 Oct 2024 10:04:37 +0200 Subject: [PATCH 2/2] Reverse some changes --- .gitignore | 2 -- eztorch/datasets/soccernet_utils/soccernet_paths.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 18dfa2e..7987d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,3 @@ coverage docs/build notebooks build/ -ckpts/ -scripts/ diff --git a/eztorch/datasets/soccernet_utils/soccernet_paths.py b/eztorch/datasets/soccernet_utils/soccernet_paths.py index 8392f4a..3399fc7 100644 --- a/eztorch/datasets/soccernet_utils/soccernet_paths.py +++ b/eztorch/datasets/soccernet_utils/soccernet_paths.py @@ -121,7 +121,7 @@ def _serialize_annotations(self): """Serialize annotations for the dataset.""" self._video_paths = np.array( [match_content["UrlLocal"] for match_content in self._annotations] - ).astype(np.bytes_) + ).astype(np.string_) self._halves_per_video = torch.tensor( [len(match_content["halves"]) for match_content in self._annotations], dtype=torch.uint8, @@ -132,7 +132,7 @@ def _serialize_annotations(self): for match_content in self._annotations for _, half_content in match_content["halves"].items() ] - ).astype(np.bytes_) + ).astype(np.string_) self._half_ids = torch.tensor( [