Skip to content

Commit

Permalink
Merge pull request #6 from qlue-dev/feature/multi-agg
Browse files Browse the repository at this point in the history
Feature/multi agg
  • Loading branch information
MuhammadSYahyaS committed Aug 25, 2021
2 parents c0da9bf + d4fbbd8 commit 5f02b4b
Show file tree
Hide file tree
Showing 8 changed files with 481 additions and 163 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dist
build
ssvad_metrics/VERSION
.vscode
.pytest_cache
.benchmarks
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install-requirements:
pip3 install -r requirements.txt

test:
pytests -s
pytest -s

build:
python3 setup.py bdist_wheel
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@ This project contains evaluation protocol (metrics) for benchmarking single-scen

This is an unofficial implementation of Sec. 2.2 of [A Survey of Single-Scene Video Anomaly Detection](https://arxiv.org/pdf/2004.05993.pdf).

## Installation

This metrics is available via PyPI.

```bash
pip install py-ssvad-metrics
```

## Usage

1. Prepare ground-truth JSON file and prediction JSON file. Examples are in the `tests` folder.
1. For UCSD Pedestrian 1 and 2 datasets, CUHK Avenue dataset, and Street Scene dataset,
we provided scripts for converting ground-truth annotation files from Street Scene dataset. Download link is provided in the paper [http://www.merl.com/demos/video-anomaly-detection].
1. Example usage for single groundtruth and prediction file pair:

```python
import ssvad_metrics
result = ssvad_metrics.metrics.evaluate(
"tests/gt_examples/Test001_gt.json",
"tests/pred_examples/Test001_pred.json")
```

1. Example usage for multiple groundtruth and prediction file pairs:

```python
import ssvad_metrics
result = ssvad_metrics.metrics.accumulated_evaluate(
"tests/gt_examples",
"tests/pred_examples",
gt_name_suffix="_gt",
pred_name_suffix="_pred")
```

## References

1. B. Ramachandra, M. Jones and R. R. Vatsavai, "A Survey of Single-Scene Video Anomaly Detection," in IEEE Transactions on Pattern Analysis and Machine Intelligence, doi: 10.1109/TPAMI.2020.3040591.
Expand Down

0 comments on commit 5f02b4b

Please sign in to comment.