faster-table-recognizer 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. faster_table_recognizer-0.1.0/.cargo/config.toml +8 -0
  2. faster_table_recognizer-0.1.0/.github/workflows/CI.yml +67 -0
  3. faster_table_recognizer-0.1.0/.gitignore +7 -0
  4. faster_table_recognizer-0.1.0/Cargo.lock +1038 -0
  5. faster_table_recognizer-0.1.0/Cargo.toml +38 -0
  6. faster_table_recognizer-0.1.0/LICENSE +26 -0
  7. faster_table_recognizer-0.1.0/PKG-INFO +209 -0
  8. faster_table_recognizer-0.1.0/README.md +189 -0
  9. faster_table_recognizer-0.1.0/examples/service_integration.py +51 -0
  10. faster_table_recognizer-0.1.0/models/table-transformer-detection/config.json +51 -0
  11. faster_table_recognizer-0.1.0/models/table-transformer-detection/preprocessor_config.json +18 -0
  12. faster_table_recognizer-0.1.0/pyproject.toml +31 -0
  13. faster_table_recognizer-0.1.0/scripts/download_model.sh +18 -0
  14. faster_table_recognizer-0.1.0/scripts/make_golden.py +66 -0
  15. faster_table_recognizer-0.1.0/src/download.rs +58 -0
  16. faster_table_recognizer-0.1.0/src/lib.rs +114 -0
  17. faster_table_recognizer-0.1.0/src/main.rs +237 -0
  18. faster_table_recognizer-0.1.0/src/math.rs +625 -0
  19. faster_table_recognizer-0.1.0/src/model.rs +390 -0
  20. faster_table_recognizer-0.1.0/src/postprocess.rs +60 -0
  21. faster_table_recognizer-0.1.0/src/preprocess.rs +184 -0
  22. faster_table_recognizer-0.1.0/src/python.rs +110 -0
  23. faster_table_recognizer-0.1.0/src/tensors.rs +105 -0
  24. faster_table_recognizer-0.1.0/src/winograd.rs +259 -0
  25. faster_table_recognizer-0.1.0/tests/golden/g_meta.json +24 -0
  26. faster_table_recognizer-0.1.0/tests/golden/raw_boxes.f32 +0 -0
  27. faster_table_recognizer-0.1.0/tests/golden/raw_decoder_out.f32 +0 -0
  28. faster_table_recognizer-0.1.0/tests/golden/raw_encoder_out.f32 +0 -0
  29. faster_table_recognizer-0.1.0/tests/golden/raw_input_projection.f32 +0 -0
  30. faster_table_recognizer-0.1.0/tests/golden/raw_logits.f32 +0 -0
  31. faster_table_recognizer-0.1.0/tests/golden/raw_pixel_values.f32 +4413 -0
  32. faster_table_recognizer-0.1.0/tests/golden/raw_shapes.json +29 -0
  33. faster_table_recognizer-0.1.0/tests/golden/table_sample.png +0 -0
@@ -0,0 +1,8 @@
1
+ # No forced target-cpu: published wheels/binaries must run on any x86-64 CPU.
2
+ # The hot kernels (GEMM, Winograd, dot, attention) are hand-written AVX2 and are
3
+ # selected at runtime via `is_x86_feature_detected!`, so they still use AVX2 when
4
+ # available while the binary remains portable.
5
+ #
6
+ # For a machine-specific build with maximum auto-vectorization of the scalar
7
+ # helper loops, build with:
8
+ # RUSTFLAGS="-C target-cpu=native" cargo build --release
@@ -0,0 +1,67 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ linux:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Build manylinux x86_64 wheel
19
+ uses: PyO3/maturin-action@v1
20
+ with:
21
+ command: build
22
+ # features come from [tool.maturin] in pyproject.toml (features = ["python"])
23
+ args: --release --out dist
24
+ manylinux: "2014"
25
+ target: x86_64
26
+ - name: Smoke test the wheel
27
+ run: |
28
+ python -m venv /tmp/venv
29
+ /tmp/venv/bin/pip install --upgrade pip
30
+ /tmp/venv/bin/pip install dist/*.whl
31
+ /tmp/venv/bin/python -c "import faster_table_recognizer as f; print('import ok', f.__version__); assert hasattr(f, 'TableRecognizer')"
32
+ - uses: actions/upload-artifact@v4
33
+ with:
34
+ name: wheels-linux
35
+ path: dist
36
+
37
+ sdist:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - name: Build sdist
42
+ uses: PyO3/maturin-action@v1
43
+ with:
44
+ command: sdist
45
+ args: --out dist
46
+ - uses: actions/upload-artifact@v4
47
+ with:
48
+ name: wheels-sdist
49
+ path: dist
50
+
51
+ publish:
52
+ name: Publish to PyPI
53
+ if: startsWith(github.ref, 'refs/tags/')
54
+ needs: [linux, sdist]
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/download-artifact@v4
58
+ with:
59
+ path: dist
60
+ merge-multiple: true
61
+ - name: Upload to PyPI
62
+ uses: PyO3/maturin-action@v1
63
+ env:
64
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
65
+ with:
66
+ command: upload
67
+ args: --non-interactive --skip-existing dist/*
@@ -0,0 +1,7 @@
1
+ /target
2
+ /dist
3
+ Cargo.lock
4
+ # The model weights (~115 MB) are downloaded, not committed.
5
+ models/table-transformer-detection/model.safetensors
6
+ *.pyc
7
+ __pycache__/