Skip to content

Unify NMSs and FastPreProcess as FastVisionOps - #1

Merged
Som5ra merged 14 commits into
mainfrom
agent/complete-nms-toolkit
Jul 23, 2026
Merged

Unify NMSs and FastPreProcess as FastVisionOps#1
Som5ra merged 14 commits into
mainfrom
agent/complete-nms-toolkit

Conversation

@Som5ra

@Som5ra Som5ra commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR combines NMSs and FastPreProcess into FastVisionOps, one validated CPU toolkit for vision inference preprocessing and postprocessing.

  • adds a primary fastvisionops package while preserving nmss imports
  • adds validated HWC/CHW conversion and fused channel normalization
  • unifies native preprocessing and bounding-box NMS in one rebuildable C library
  • uses OpenMP when available with a portable compiler fallback
  • fixes the two self-review edge cases for empty mask IoU and empty NMS validation
  • adds 41 correctness and native-equivalence tests
  • adds reproducible elapsed-time benchmarks and CI smoke tests
  • rewrites the README and evaluation report with migration guidance for both repositories

Correctness

  • 41/41 unit tests pass
  • native NMS matches NumPy across 128 randomized parameter combinations
  • native preprocessing matches NumPy for randomized single and batched inputs
  • noncontiguous images, empty batches, RGB/BGR reversal, invalid statistics, and thread validation are covered
  • serial and concurrent batch NMS output matches item by item
  • the C source compiles with -Wall -Wextra -Werror
  • the source wheel builds and contains the unified C source

Measured performance

Each value is the median elapsed time for one complete public API call after two warm-up runs and nine measured runs. Validation, allocation, and array preparation are included. Native output is checked against NumPy before timing.

Fused preprocessing, 427x640x3 images, 8 native threads

Batch NumPy Native Speedup
1 4.492 ms 0.249 ms 18.07x
8 26.263 ms 1.888 ms 13.91x
32 139.105 ms 9.758 ms 14.25x

Bounding-box NMS

Boxes NumPy Native Speedup
250 4.798 ms 0.272 ms 17.66x
1,000 23.257 ms 3.340 ms 6.96x
2,500 75.396 ms 17.121 ms 4.40x

Eight images with 1,000 boxes each took 27.595 ms with serial native execution and 9.995 ms with eight workers, a 2.76x speedup.

Environment: Linux x86_64, Python 3.12.13, NumPy 2.3.5, GCC 13.3, 9 available Intel Xeon Platinum 8573C vCPUs.

Validation commands

python -m fastvisionops.build
python -m unittest discover -s tests -v
python -m benchmarks.benchmark_preprocess
python -m benchmarks.benchmark_bbox
python -m pip wheel --no-build-isolation --no-deps .

Commit sequence

  1. fix: handle empty NMS API inputs
  2. feat: introduce unified FastVisionOps package
  3. feat: unify native vision operations
  4. perf: add preprocessing acceleration benchmark
  5. docs: present the unified FastVisionOps toolkit
  6. fix: validate execution limits consistently
  7. docs: refresh final validation evidence
  8. fix: validate empty native NMS batches
  9. docs: tighten FastVisionOps overview

The earlier focused NMS commits remain intact in the branch history. Commit messages contain no emoji.

@Som5ra Som5ra left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review completed. GitHub does not permit the PR author to request changes or approve their own PR. Two reproducible API edge cases remain. Core native correctness, concurrency stress, packaging, and all CI jobs passed.

Comment thread nmss/mask.py
Comment thread nmss/bbox.py
@Som5ra Som5ra changed the title Complete and benchmark the NMS toolkit Unify NMSs and FastPreProcess as FastVisionOps Jul 23, 2026

@Som5ra Som5ra left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final self-review completed with no unresolved code findings. Verified 40/40 tests, randomized NumPy/native equivalence, strict C warnings, OpenMP and portable fallback builds, source-wheel packaging, benchmark correctness checks, and clean review threads. GitHub does not allow a pull request author to approve their own PR, so this comment records the successful self-review result.

@Som5ra
Som5ra marked this pull request as ready for review July 23, 2026 08:41

@Som5ra Som5ra left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent sub-agent review result: APPROVE. The reviewer confirmed the empty native-batch validation fix, 41/41 tests, the full Python 3.9/3.12/3.13 CI matrix, and the concise 173-line README. No bugs, logical errors, or documentation findings remain. GitHub rejected a formal APPROVE because the connected account is the pull request author, so this comment records the approval recommendation.

@Som5ra
Som5ra merged commit 2af5cbf into main Jul 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant