Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #22

Merged
merged 15 commits into from
Apr 13, 2024
Merged

Dev #22

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist .
run: make sdist

- uses: actions/upload-artifact@v4
with:
Expand All @@ -67,12 +67,12 @@ jobs:
with:
name: sdist
path: dist

- uses: actions/download-artifact@v4
with:
name: wheels
path: dist

- name: Display structure of downloaded files
run: ls -R dist

Expand All @@ -95,16 +95,16 @@ jobs:
with:
name: sdist
path: dist

- uses: actions/download-artifact@v4
with:
name: wheels
path: dist

- name: Display structure of downloaded files
run: ls -R dist

- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
python-version: "3.x"

- name: Install dependencies
run: pip3 install flake8==7.0.0 black==24.2.0 isort==5.13.2
run: pip3 install flake8==7.0.0 black==24.2.0 isort==5.13.2 docformatter==1.7.5

- name: Lint with flake8
run: make linter
run: make linter
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ dist
faster_coco_eval.egg-info
*.pyc
__pycache__
examples/comparison/COCO
examples/comparison/model
csrc/mask/pycocotools/_mask.c
examples/comparison/mmdet/COCO
examples/comparison/mmdet/model
csrc/mask/pycocotools/_mask.c
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
all: clean format sdist wheel
ls -lah dist

wheel:
pipx run build --wheel .

sdist:
python3 -m build . --sdist
pipx run build --sdist .

wheel:
python3 -m build . --wheel
install: clean wheel
pip3 install dist/*.whl

FORMAT_DIRS = ./faster_coco_eval ./tests ./examples setup.py
LINE_LENGTH = 80
BLACK_CONFIG = --preview --enable-unstable-feature string_processing

format:
python3 -m black --config pyproject.toml .
python3 -m isort --profile black .
python3 -m docformatter --in-place --recursive --blank $(FORMAT_DIRS)
python3 -m black $(BLACK_CONFIG) --line-length $(LINE_LENGTH) $(FORMAT_DIRS)
python3 -m isort --line-length $(LINE_LENGTH) --profile black $(FORMAT_DIRS)
$(MAKE) linter

linter:
python3 -m black . --check --diff
python3 -m isort --profile black . --check --diff
flake8 .
python3 -m docformatter --check --recursive --blank $(FORMAT_DIRS)
python3 -m black $(BLACK_CONFIG) --line-length $(LINE_LENGTH) $(FORMAT_DIRS) --check --diff
python3 -m isort --line-length $(LINE_LENGTH) --profile black $(FORMAT_DIRS) --check --diff
flake8 --max-line-length $(LINE_LENGTH) $(FORMAT_DIRS) --ignore=E203,W503 --exclude "*/model/*"

clean:
rm -rf build
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@ for coco's AP metrics, especially when dealing with a high number of instances i
For our use case with a test dataset of 5000 images from the coco val dataset.
Testing was carried out using the mmdetection framework and the eval_metric.py script. The indicators are presented below.

Visualization of testing **comparison.ipynb** available in directory [examples/comparison](https://github.com/MiXaiLL76/faster_coco_eval/blob/main/examples/comparison/comparison.ipynb)
Visualization of testing **comparison.ipynb** available in directory [examples/comparison](https://github.com/MiXaiLL76/faster_coco_eval/blob/main/examples/comparison/mmdet/comparison.ipynb)
Tested with yolo3 model (bbox eval) and yoloact model (segm eval)

| Type | COCOeval | COCOeval_faster | Profit |
| ---- | ----------- | --------------- | ----------- |
| bbox | 18.477 sec. | 7.345 sec. | 2.5x faster |
| segm | 29.819 sec. | 15.840 sec. | 2x faster |
### Summary for 5000 imgs

| Type | COCOeval | COCOeval_faster | Profit |
| ---- | ----------- | --------------- | ------------ |
| bbox | 18.477 sec. | 7.345 sec. | ~2.5x faster |
| segm | 29.819 sec. | 15.840 sec. | ~1.7x faster |

## Summary for 500 imgs

| Type | COCOeval | COCOeval_faster | Profit |
| ---- | --------- | --------------- | ------------ |
| bbox | 3.57 sec. | 2.03 sec. | ~1.7x faster |
| segm | 4.16 sec. | 2.41 sec. | ~1.7x faster |

## Feautures

Expand Down
Loading