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

Numpy-based Object Detection for Bounding Boxes #748

Merged
merged 81 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4967aa0
experimenting
czaloom Aug 28, 2024
4a3a82c
Merge branch 'main' into czaloom-numba
czaloom Aug 29, 2024
20ba802
numba perf testing
czaloom Aug 30, 2024
ceb3b43
wip
czaloom Aug 30, 2024
0300cd1
AP is almost done
czaloom Aug 30, 2024
842ee1f
removed print stmts and turned off paralleization
czaloom Aug 30, 2024
3b856bc
not quite there
czaloom Sep 3, 2024
7075de7
revert coco notebook
czaloom Sep 3, 2024
7ededc7
small optimizations
czaloom Sep 3, 2024
b482a41
ap is passing!
czaloom Sep 3, 2024
6343e7e
created valor lite
czaloom Sep 4, 2024
4a4d854
Merge branch 'main' into czaloom-numba
czaloom Sep 4, 2024
de3f67f
added test for detailed pr curve
czaloom Sep 4, 2024
42f9460
added examples to detailed pr curve
czaloom Sep 4, 2024
b0ac165
ap down to 1.6s
czaloom Sep 4, 2024
8d7976f
ap down to 1.6s
czaloom Sep 4, 2024
df6ad57
simplifying ap
czaloom Sep 4, 2024
a793eeb
iou+ap under 0.75s
czaloom Sep 5, 2024
68675a0
vectorized ap
czaloom Sep 5, 2024
d1a706d
remove newlines
czaloom Sep 5, 2024
52a7382
add ar + improve ap vectorization
czaloom Sep 5, 2024
7bb6741
added average recall computation
czaloom Sep 6, 2024
d7c9c48
benchmarkingpython lite/benchmarks/benchmark_objdet.py !
czaloom Sep 6, 2024
fd98e3f
thing remove
czaloom Sep 6, 2024
916f02c
thing remove
czaloom Sep 6, 2024
2e34f9a
clearer bench names
czaloom Sep 6, 2024
d846458
consolidated
czaloom Sep 6, 2024
bd5d128
more consolidation
czaloom Sep 6, 2024
919b60c
updated metric formatting
czaloom Sep 6, 2024
9d34d5f
added ingestion methods
czaloom Sep 9, 2024
028e77c
detailed pr curves using numpy
czaloom Sep 9, 2024
ab74fbe
added component metrics
czaloom Sep 9, 2024
ae12863
better caching, split data loading and eval
czaloom Sep 10, 2024
d4c1996
metadata fix
czaloom Sep 10, 2024
5c25fc9
fix
czaloom Sep 10, 2024
905f0a6
huge speedup from ranked pairs strategy
czaloom Sep 10, 2024
348434c
cleaned up
czaloom Sep 10, 2024
b6d9f18
bugfix in concatenation
czaloom Sep 10, 2024
0f533bc
fixed map, mar
czaloom Sep 10, 2024
56f71a9
reorganized
czaloom Sep 10, 2024
054b1a8
disallow label key mismatch
czaloom Sep 10, 2024
efcbeb8
fixed add_data ingestion, others are still broken
czaloom Sep 11, 2024
1a21963
add coco notebook
czaloom Sep 11, 2024
afa8f2f
moved example
czaloom Sep 11, 2024
8327c25
updated notebook
czaloom Sep 11, 2024
d6e7764
update toml
czaloom Sep 11, 2024
311d49e
cleaned up add data
czaloom Sep 11, 2024
dfd54d9
revert api change
czaloom Sep 11, 2024
5edd5bf
revert client change
czaloom Sep 11, 2024
86b3561
benchmark ranked pairs is now ingestion
czaloom Sep 11, 2024
530a3b3
detailed pr curve improvements
czaloom Sep 11, 2024
f1b2430
fixed filtering
czaloom Sep 11, 2024
bad0aaf
implemented filtering
czaloom Sep 11, 2024
e74b616
precommit
czaloom Sep 11, 2024
2329f9a
added average metrics
czaloom Sep 12, 2024
e2812e5
average over ious + scores in manager
czaloom Sep 12, 2024
c5db15d
fixed filtering
czaloom Sep 12, 2024
d1d5dbb
fixed division issues
czaloom Sep 12, 2024
476d8d2
fixed division issues
czaloom Sep 12, 2024
9fc655b
fixed filtering + added fuzzing test
czaloom Sep 12, 2024
e583b01
add docstring
czaloom Sep 12, 2024
7212c2b
added testing workflow
czaloom Sep 12, 2024
884d0c8
renamed workflow
czaloom Sep 12, 2024
c049a21
fixed tp, fp, fn counting
czaloom Sep 12, 2024
e857aff
fix workflow for testing
czaloom Sep 12, 2024
07a5b8d
added tests
czaloom Sep 13, 2024
8648947
Merge branch 'main' into czaloom-numba
czaloom Sep 13, 2024
58b7770
merge main and revert core change
czaloom Sep 13, 2024
0cf24d0
revert core
czaloom Sep 13, 2024
2f876a1
no data for detailed pr test
czaloom Sep 13, 2024
60c6b25
added tests for ar averaged over scores
czaloom Sep 16, 2024
22a6e1a
added more obj det tests
czaloom Sep 16, 2024
f7aa476
added test + removed print stmts
czaloom Sep 16, 2024
33441f1
added ignored pred to valor dict test
czaloom Sep 16, 2024
1ce59cd
tweaked test
czaloom Sep 16, 2024
f390a41
remove commented code
czaloom Sep 16, 2024
6d005bc
consolidated tp,fp,fn counts into confusion matrix
czaloom Sep 16, 2024
ed27e53
classification
czaloom Sep 16, 2024
088ec65
valor-lite
czaloom Sep 16, 2024
1720a30
fix readme
czaloom Sep 16, 2024
4a4bb49
changed pypi tokens
czaloom Sep 16, 2024
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
17 changes: 17 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ./client/dist
build-and-publish-py-lite-package:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lite
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Build wheel
run: pip install build && python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.VALOR_LITE_PYPI_API_TOKEN }}
packages-dir: ./lite/dist
build-and-publish-ts-package:
runs-on: ubuntu-latest
defaults:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/lite-benchmark-evaluations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run valor-lite benchmarks

on:
push:
branches: "**"

permissions:
id-token: write
contents: read

jobs:
run-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install lite
run: pip install -e .
working-directory: ./lite
# - name: run classification benchmarks
# run: python benchmark_script.py
# working-directory: ./lite/benchmarks/classification
# - name: print classification results
# run: |
# export BENCHMARK_RESULTS=$(python -c "import os;import json;print(json.dumps(json.load(open('results.json', 'r')), indent=4));")
# echo "$BENCHMARK_RESULTS"
# working-directory: ./lite/benchmarks/classification
- name: run object detection benchmarks
run: python benchmark_objdet.py
working-directory: ./lite/benchmarks/
- name: print object detection results
run: |
export BENCHMARK_RESULTS=$(python -c "import os;import json;print(json.dumps(json.load(open('manager_results.json', 'r')), indent=4));")
echo "$BENCHMARK_RESULTS"
working-directory: ./lite/benchmarks/
- run: make stop-env
35 changes: 35 additions & 0 deletions .github/workflows/lite-tests-and-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run valor-lite code coverage report

on:
push:
branches: "**"

permissions:
id-token: write
contents: read

jobs:
lite-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: run object detection tests and report coverage
run: |
pip install -e ".[test]"
COVERAGE_FILE=.coverage.functional python -m coverage run --omit "tests/*" -m pytest -v tests/detection/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 90 )); then
echo "Coverage is below 90%"
exit 1
fi
working-directory: ./lite
2 changes: 1 addition & 1 deletion integration_tests/client/metrics/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,7 +2481,7 @@ def test_evaluate_detection_false_negatives_two_images_one_only_with_different_c
):
"""In this test we have
1. An image with a matching groundtruth and prediction (same class, `"value"`, and high IOU)
2. A second image with a groundtruth annotation with clas `"other value"` and a prediction with higher confidence
2. A second image with a groundtruth annotation with class `"other value"` and a prediction with higher confidence
then the prediction on the first image.

In this case, the AP for class `"value"` should be 0.5 since the false positive has higher confidence than the true positive.
Expand Down
21 changes: 21 additions & 0 deletions lite/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Striveworks

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions lite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# valor-lite: Compute classification, object detection, and segmentation metrics locally.
2 changes: 2 additions & 0 deletions lite/benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.json
*.jsonl
Loading
Loading