Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
VlSomers committed May 31, 2024
2 parents 69bef9a + 166ad46 commit a672f1f
Show file tree
Hide file tree
Showing 8 changed files with 1,198 additions and 1,040 deletions.
71 changes: 62 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,71 @@ Finally, evaluation is performed via the evaluator.run() function once the Track
When developing a new module, it is often useful to dump the tracker state to disk to save computation time and avoid running the other modules several times.
Here is how to do it:
1. First, save the tracker state by using the corresponding configuration in the config.yaml file:
```yaml
defaults:
- state: save
# ...
state:
save_file: "states/${experiment_name}.pklz" # 'null' to disable saving. This is the save path for the tracker_state object that contains all modules outputs (bboxes, reid embeddings, jersey numbers, roles, teams, etc)
load_file: null
```
2. Run Tracklab. The tracker state will be saved in the experiment folder as a .pklz file.
3. Then modify the load_file key in "config.yaml" to specify the path to the tracker state file that has just been created (`load_file: "..."` config).
5. In config.yaml, remove from the pipeline all modules that should not be executed again. For instance, if you want to use the detections and reid embeddings from the saved tracker state, remove the "bbox_detector" and "reid" modules from the pipeline. Use `pipeline: []` if no module should be run again.
```yaml
defaults:
- state: save
...
# ...
pipeline:
- track
# ...
state:
save_file: null # 'null' to disable saving. This is the save path for the tracker_state object that contains all modules outputs (bboxes, reid embeddings, jersey numbers, roles, teams, etc)
load_file: "path/to/tracker_state.pklz"
```
2. Run Tracklab. The tracker state will be saved in the experiment folder as a .pcklz file.
3. Then modify "tracklab/configs/state/load.yaml" to specify the path to the tracker state file that has just been created (`load_file: "..."` config).
4. Then change config.yaml to load the tracker state by using the corresponding configuration in the config.yaml file:
8. Run Tracklab again.


## Citation
If you use this repository for your research or wish to refer to our contributions, please use the following BibTeX entries:

[TrackLab](https://github.com/TrackingLaboratory/tracklab):
```
defaults:
- state: load
...
@misc{Joos2024Tracklab,
title = {{TrackLab}},
author = {Joos, Victor and Somers, Vladimir and Standaert, Baptiste},
journal = {GitHub repository},
year = {2024},
howpublished = {\url{https://github.com/TrackingLaboratory/tracklab}}
}
```

[SoccerNet Game State Reconstruction](https://arxiv.org/abs/2404.11335):
```
@inproceedings{Somers2024SoccerNetGameState,
title = {{SoccerNet} Game State Reconstruction: End-to-End Athlete Tracking and Identification on a Minimap},
author = {Somers, Vladimir and Joos, Victor and Giancola, Silvio and Cioppa, Anthony and Ghasemzadeh, Seyed Abolfazl and Magera, Floriane and Standaert, Baptiste and Mansourian, Amir Mohammad and Zhou, Xin and Kasaei, Shohreh and Ghanem, Bernard and Alahi, Alexandre and Van Droogenbroeck, Marc and De Vleeschouwer, Christophe},
booktitle = cvsports,
month = Jun,
year = {2024},
address = city-seattle,
}
```

[BPBreID](https://arxiv.org/abs/2211.03679):
```
@article{bpbreid,
archivePrefix = {arXiv},
arxivId = {2211.03679},
author = {Somers, Vladimir and {De Vleeschouwer}, Christophe and Alahi, Alexandre},
doi = {10.48550/arxiv.2211.03679},
eprint = {2211.03679},
file = {:Users/vladimirsomers/Library/CloudStorage/OneDrive-SportradarAG/PhD/Scientific Literature/Mendeley/Somers, De Vleeschouwer, Alahi_2023_Body Part-Based Representation Learning for Occluded Person Re-Identification.pdf:pdf},
isbn = {2211.03679v1},
journal = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV23)},
month = {nov},
title = {{Body Part-Based Representation Learning for Occluded Person Re-Identification}},
url = {https://arxiv.org/abs/2211.03679v1 http://arxiv.org/abs/2211.03679},
year = {2023}
}
```
5. In config.yaml, remove from the pipeline all modules that should not be executed again. For instance, if you want to use the detections and reid embeddings from the saved tracker state, remove the "bbox_detector" and "reid" modules from the pipeline. Use `pipeline: []` if no module should be run again.
6. Run Tracklab again.
2,117 changes: 1,095 additions & 1,022 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = [{include = "tracklab"}]
[tool.poetry.dependencies]
python = "^3.9"
# openpifpaf = {git="https://github.com/PbTrack/openpifpaf", branch="pbtrack", develop=true, extras=["dev","train","test"]}
poseval = {git="https://github.com/PbTrack/poseval", branch="pbtrack", develop=true}
poseval = {git="https://github.com/TrackingLaboratory/poseval", branch="pbtrack", develop=true}
posetrack21 = {path = "plugins/eval/PoseTrack21/posetrack21", develop = true}
posetrack21_mot = {path = "plugins/eval/PoseTrack21/posetrack21_mot", develop = true}
hydra-core = "^1.3"
Expand All @@ -26,18 +26,19 @@ torch = "1.13.1"
torchvision = "0.14.1"
mmdet = "~3.1.0"
chumpy = "0.66"
lap = {git = "https://github.com/PbTrack/lap"}
lap = {git = "https://github.com/TrackingLaboratory/lap"}
track-bench-track = {path = "plugins/track", develop = true}
mmengine = "^0.10.1"
timm = "^0.9.12"
torchreid = {git = "https://github.com/VlSomers/bpbreid"}
openpifpaf = "^0.13.11"
# openpifpaf = "^0.13.11" # FIXME : Removed until dependency is fixed
soccernet = "^0.1.53"
mmpose = "^1.2.0"
trackeval = {git = "https://github.com/SoccerNet/sn-trackeval.git"}
yt-dlp = "^2023.12.30"
sn-trackeval = ">=0.3.0" # {git = "https://github.com/SoccerNet/sn-trackeval.git"}
yt-dlp = ">2023.12.30"
gdown = "^4.7.1"
pandas = "^2.1.0"
matplotlib = "<3.9.0"

[tool.poetry.scripts]
tracklab = 'tracklab.main:main'
Expand Down
19 changes: 19 additions & 0 deletions tracklab/configs/visualization/test_vis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
_target_: tracklab.visualization.VisualizationEngine
save_videos: True
visualizers:
test:
_target_: tracklab.visualization.DefaultDetectionVisualizer
# ellipse:
# _target_: tracklab.visualization.EllipseDetectionVisualizer
track_line:
_target_: tracklab.visualization.TrackingLineVisualizer

colors:
bbox:
no_id: [0,0,0]
prediction: null
ground_truth: [0,0,0]
text:
no_id: [0,0,0]
prediction: null
ground_truth: [0,0,0]
7 changes: 4 additions & 3 deletions tracklab/wrappers/datasets/soccernet/soccernet_game_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,15 @@ def video_dir_to_dfs(args):
dataset_path = args['dataset_path']
video_folder = args['video_folder']
split = args['split']
split_id = ["train", "valid", "test", "challenge"].index(split) + 1
annotation_pitch_camera_df = None
detections_df = None
video_level_categories = []
video_folder_path = os.path.join(dataset_path, video_folder)
if os.path.isdir(video_folder_path):
if not (Path(video_folder_path) / "Labels-GameState.json").exists():
img_folder_path = os.path.join(video_folder_path, 'img1')
video_id = str(int(video_folder.split('-')[-1]))
video_id = str(video_folder.split('-')[-1])
video_metadata = {
'id': video_id,
'name': video_folder,
Expand All @@ -219,7 +220,7 @@ def video_dir_to_dfs(args):
nframes = len(os.listdir(img_folder_path))
img_metadata_df = pd.DataFrame({
'frame': [i for i in range(0, nframes)],
'id': [str(int(video_id) * 10000 + i) for i in range(0, nframes)],
'id': [f"{split_id}{video_id}{i:06d}" for i in range(1, nframes + 1)],
'video_id': video_id,
'file_path': [os.path.join(img_folder_path, f'{i:06d}.jpg') for i in
range(1, nframes + 1)],
Expand All @@ -234,7 +235,7 @@ def video_dir_to_dfs(args):
images_data = gamestate_data['images']
annotations_data = gamestate_data['annotations']
categories_data = gamestate_data['categories']
video_id = info_data.get("id", str(int(video_folder.split('-')[-1])))
video_id = info_data.get("id", str(video_folder.split('-')[-1]))

detections_df, annotation_pitch_camera_df, video_level_categories = dict_to_df_detections(annotations_data, categories_data)
# detections_df['image_id'] = detections_df['image_id'] - 1 + image_counter
Expand Down
2 changes: 1 addition & 1 deletion tracklab/wrappers/detect_multiple/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# from .mmdetection_api import MMDetection
# from .bottomup_mmpose_api import BottomUpMMPose
from .openpifpaf_api import OpenPifPaf
# from .openpifpaf_api import OpenPifPaf # FIXME : removed until dependency problem is fixed
from .yolov8_api import YOLOv8
from .yolov8_pose_api import YOLOv8Pose
Empty file.
11 changes: 11 additions & 0 deletions tracklab/wrappers/eval/soccernet/soccer_accuracy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pycocotools

from tracklab.core import Evaluator


class SoccerAccuracy(Evaluator):
def __init__(self, eval_set, *args, **kwargs):
self.eval_set = eval_set

def run(self, tracker_state):
pycocotools

0 comments on commit a672f1f

Please sign in to comment.