Skip to content

Commit

Permalink
Merge pull request #25 from drishyakarki/main
Browse files Browse the repository at this point in the history
add robust support for new datasets classes loading and improve the usage documentation
  • Loading branch information
SilvioGiancola authored Jan 6, 2025
2 parents dcec6a8 + ea31952 commit a7f0d68
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Please refer to [install.md](docs/install.md) for installation and data preparat

Please refer to [usage.md](docs/usage.md) for details of training and evaluation scripts.

_Note: - We have added few documentation guides inside different parts of the library to make working with the library easier. Like this is an [instruction](configs/_base_/datasets/json/README.md) for class intialization inside the configs directory. So please try to follow them if you get issues while working with the library. :)_

## 🤝 Roadmap

All the things that need to be done in the future is in [roadmap.md](docs/en/roadmap.md).
Expand Down
46 changes: 46 additions & 0 deletions configs/_base_/datasets/json/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Instructions regarding Classes Initialization for end to end methods like E2ESpot

If you are working with new datasets, then you might need to change the classes list accordingly to adapt to that particular dataset labels.

For instance, when you are working with OSL-Action Spotting Dataset "spotting-OSL", it has 17 classes so you will have the classes as
```python
classes = [
"Ball out of play",
"Clearance",
"Corner",
"Direct free-kick",
"Foul",
"Goal",
"Indirect free-kick",
"Kick-off",
"Offside",
"Penalty",
"Red card",
"Shots off target",
"Shots on target",
"Substitution",
"Throw-in",
"Yellow card",
"Yellow->red card",
]
```
in the ```video_dali.py``` and ```video_ocv.py``` files.

But if you are working with, say [SN-Ball Action Spotting Dataset](https://huggingface.co/datasets/SoccerNet/SN-BAS-2025), then you need to make these changes in the ```video_dali.py``` and ```video_ocv.py``` files.

```python
[
"PASS",
"DRIVE",
"HEADER",
"HIGH PASS",
"OUT",
"CROSS",
"THROW IN",
"SHOT",
"BALL PLAYER BLOCK",
"PLAYER SUCCESSFUL TACKLE",
"FREE KICK",
"GOAL"
]
```
18 changes: 18 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ python tools/evaluate.py \
dataset.test.metric=tight
```

### If you don't see any results, you might need to specify the path to your results file

```bash
python tools/evaluate.py \
configs/e2espot/e2espot.py \
--cfg-options dataset.test.results=/outputs/e2e/rny008_gsm_150/results_spotting_test.recall.json.gz
```

#### So for a custom evaluation on test set, it might look something like this

```bash
python tools/evaluate.py \
configs/e2espot/e2espot.py \
--cfg-options dataset.test.path=/datasets/224p/test/annotations.json \
dataset.test.data_root=/datasets/224p/test \
dataset.test.results=outputs/e2e/rny008_gsm_150/results_spotting_test.recall.json.gz \
dataset.test.metric=tight
```
## Visualization

```bash
Expand Down
2 changes: 1 addition & 1 deletion oslactionspotting/core/utils/default_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ def get_default_args_train(model, train_loader, valid_loader, classes, trainer_t
"train_loader": train_loader,
"valid_loader": valid_loader,
"classes": classes,
}
}

0 comments on commit a7f0d68

Please sign in to comment.