panlabel 0.4.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 (95) hide show
  1. panlabel-0.4.0/.dockerignore +42 -0
  2. panlabel-0.4.0/.github/dependabot.yml +26 -0
  3. panlabel-0.4.0/.github/workflows/ci.yml +57 -0
  4. panlabel-0.4.0/.github/workflows/docker.yml +75 -0
  5. panlabel-0.4.0/.github/workflows/publish-pypi.yml +183 -0
  6. panlabel-0.4.0/.github/workflows/release.yml +343 -0
  7. panlabel-0.4.0/.gitignore +38 -0
  8. panlabel-0.4.0/AGENTS.md +83 -0
  9. panlabel-0.4.0/CHANGELOG.md +115 -0
  10. panlabel-0.4.0/CLAUDE.md +217 -0
  11. panlabel-0.4.0/CONTRIBUTING.md +117 -0
  12. panlabel-0.4.0/Cargo.lock +3375 -0
  13. panlabel-0.4.0/Cargo.toml +64 -0
  14. panlabel-0.4.0/Dockerfile +51 -0
  15. panlabel-0.4.0/LICENSE +21 -0
  16. panlabel-0.4.0/PKG-INFO +220 -0
  17. panlabel-0.4.0/README.md +197 -0
  18. panlabel-0.4.0/ROADMAP.md +133 -0
  19. panlabel-0.4.0/benches/microbenches.rs +102 -0
  20. panlabel-0.4.0/dist-workspace.toml +25 -0
  21. panlabel-0.4.0/docs/README.md +57 -0
  22. panlabel-0.4.0/docs/cli.md +177 -0
  23. panlabel-0.4.0/docs/conversion.md +136 -0
  24. panlabel-0.4.0/docs/formats.md +255 -0
  25. panlabel-0.4.0/docs/tasks.md +92 -0
  26. panlabel-0.4.0/proptest-regressions/.gitkeep +0 -0
  27. panlabel-0.4.0/pyproject.toml +35 -0
  28. panlabel-0.4.0/python/panlabel/__init__.py +5 -0
  29. panlabel-0.4.0/python/panlabel/__main__.py +25 -0
  30. panlabel-0.4.0/python/panlabel/_find_panlabel.py +25 -0
  31. panlabel-0.4.0/scripts/dataset_generator.py +209 -0
  32. panlabel-0.4.0/src/conversion/mod.rs +1349 -0
  33. panlabel-0.4.0/src/conversion/report.rs +564 -0
  34. panlabel-0.4.0/src/diff/mod.rs +344 -0
  35. panlabel-0.4.0/src/diff/report.rs +115 -0
  36. panlabel-0.4.0/src/error.rs +205 -0
  37. panlabel-0.4.0/src/hf/acquire.rs +1298 -0
  38. panlabel-0.4.0/src/hf/mod.rs +17 -0
  39. panlabel-0.4.0/src/hf/preflight.rs +314 -0
  40. panlabel-0.4.0/src/hf/resolve.rs +161 -0
  41. panlabel-0.4.0/src/ir/bbox.rs +348 -0
  42. panlabel-0.4.0/src/ir/coord.rs +97 -0
  43. panlabel-0.4.0/src/ir/ids.rs +164 -0
  44. panlabel-0.4.0/src/ir/io_coco_json.rs +688 -0
  45. panlabel-0.4.0/src/ir/io_cvat_xml.rs +769 -0
  46. panlabel-0.4.0/src/ir/io_hf_imagefolder.rs +894 -0
  47. panlabel-0.4.0/src/ir/io_hf_parquet.rs +494 -0
  48. panlabel-0.4.0/src/ir/io_json.rs +154 -0
  49. panlabel-0.4.0/src/ir/io_label_studio_json.rs +1195 -0
  50. panlabel-0.4.0/src/ir/io_tfod_csv.rs +564 -0
  51. panlabel-0.4.0/src/ir/io_voc_xml.rs +665 -0
  52. panlabel-0.4.0/src/ir/io_yolo.rs +1445 -0
  53. panlabel-0.4.0/src/ir/mod.rs +59 -0
  54. panlabel-0.4.0/src/ir/model.rs +340 -0
  55. panlabel-0.4.0/src/ir/space.rs +32 -0
  56. panlabel-0.4.0/src/lib.rs +1900 -0
  57. panlabel-0.4.0/src/main.rs +6 -0
  58. panlabel-0.4.0/src/sample/mod.rs +433 -0
  59. panlabel-0.4.0/src/stats/assets/chart.min.js +20 -0
  60. panlabel-0.4.0/src/stats/html.rs +125 -0
  61. panlabel-0.4.0/src/stats/mod.rs +636 -0
  62. panlabel-0.4.0/src/stats/report.rs +831 -0
  63. panlabel-0.4.0/src/validation/mod.rs +443 -0
  64. panlabel-0.4.0/src/validation/report.rs +238 -0
  65. panlabel-0.4.0/tests/cli.rs +2443 -0
  66. panlabel-0.4.0/tests/common/mod.rs +36 -0
  67. panlabel-0.4.0/tests/cvat_roundtrip.rs +89 -0
  68. panlabel-0.4.0/tests/fixtures/sample_invalid.coco.json +53 -0
  69. panlabel-0.4.0/tests/fixtures/sample_invalid.ir.json +82 -0
  70. panlabel-0.4.0/tests/fixtures/sample_invalid_multi_annotation_sets.label_studio.json +31 -0
  71. panlabel-0.4.0/tests/fixtures/sample_invalid_polygon.cvat.xml +6 -0
  72. panlabel-0.4.0/tests/fixtures/sample_invalid_result_type.label_studio.json +24 -0
  73. panlabel-0.4.0/tests/fixtures/sample_legacy_completions.label_studio.json +28 -0
  74. panlabel-0.4.0/tests/fixtures/sample_no_meta.cvat.xml +9 -0
  75. panlabel-0.4.0/tests/fixtures/sample_rotated.label_studio.json +31 -0
  76. panlabel-0.4.0/tests/fixtures/sample_valid.coco.json +68 -0
  77. panlabel-0.4.0/tests/fixtures/sample_valid.cvat.xml +21 -0
  78. panlabel-0.4.0/tests/fixtures/sample_valid.ir.json +72 -0
  79. panlabel-0.4.0/tests/fixtures/sample_valid.label_studio.json +81 -0
  80. panlabel-0.4.0/tests/fixtures/sample_valid.tfod.csv +4 -0
  81. panlabel-0.4.0/tests/fixtures/sample_with_meta.cvat.xml +15 -0
  82. panlabel-0.4.0/tests/hf_imagefolder_roundtrip.rs +106 -0
  83. panlabel-0.4.0/tests/label_studio_roundtrip.rs +97 -0
  84. panlabel-0.4.0/tests/proptest_coco.rs +171 -0
  85. panlabel-0.4.0/tests/proptest_cross_format.rs +66 -0
  86. panlabel-0.4.0/tests/proptest_cvat.rs +110 -0
  87. panlabel-0.4.0/tests/proptest_helpers/mod.rs +430 -0
  88. panlabel-0.4.0/tests/proptest_ir_json.rs +27 -0
  89. panlabel-0.4.0/tests/proptest_label_studio.rs +261 -0
  90. panlabel-0.4.0/tests/proptest_tfod.rs +57 -0
  91. panlabel-0.4.0/tests/proptest_voc.rs +203 -0
  92. panlabel-0.4.0/tests/proptest_yolo.rs +53 -0
  93. panlabel-0.4.0/tests/tfod_csv_roundtrip.rs +167 -0
  94. panlabel-0.4.0/tests/voc_roundtrip.rs +248 -0
  95. panlabel-0.4.0/tests/yolo_roundtrip.rs +144 -0
@@ -0,0 +1,42 @@
1
+ # Build artifacts
2
+ target/
3
+ debug/
4
+
5
+ # Version control
6
+ .git/
7
+ .gitignore
8
+
9
+ # IDE / editor
10
+ .idea/
11
+ .vscode/
12
+ *.swp
13
+ *.swo
14
+
15
+ # Development / design docs
16
+ design/
17
+ docs/
18
+ *.md
19
+ LICENSE
20
+
21
+ # Claude / AI config
22
+ .claude/
23
+
24
+ # Test and dev assets
25
+ assets/
26
+ fuzz/
27
+ benches/
28
+ proptest-regressions/
29
+ tests/
30
+
31
+ # Python virtualenv and scripts
32
+ .venv/
33
+ scripts/
34
+ __pycache__/
35
+ *.pyc
36
+
37
+ # CI/CD
38
+ .github/
39
+
40
+ # OS files
41
+ .DS_Store
42
+ Thumbs.db
@@ -0,0 +1,26 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ assignees:
8
+ - "strickvl"
9
+ commit-message:
10
+ prefix: chore
11
+ include: scope
12
+ labels:
13
+ - "dependencies"
14
+ - "ci"
15
+
16
+ - package-ecosystem: "cargo"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
20
+ assignees:
21
+ - "strickvl"
22
+ commit-message:
23
+ prefix: chore
24
+ include: scope
25
+ labels:
26
+ - "dependencies"
@@ -0,0 +1,57 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch: # Allows manual trigger from GitHub Actions UI
9
+
10
+ env:
11
+ CARGO_TERM_COLOR: always
12
+ RUSTFLAGS: -D warnings
13
+
14
+ jobs:
15
+ check:
16
+ name: Check (${{ matrix.os }})
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest, macos-latest, windows-latest]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Install Rust toolchain
27
+ uses: dtolnay/rust-toolchain@stable
28
+ with:
29
+ components: rustfmt, clippy
30
+
31
+ - name: Cache cargo registry
32
+ uses: Swatinem/rust-cache@v2
33
+
34
+ - name: Check formatting
35
+ run: cargo fmt --all -- --check
36
+
37
+ - name: Run clippy
38
+ run: cargo clippy --all-targets -- -D warnings
39
+
40
+ - name: Run tests
41
+ run: cargo test --all
42
+
43
+ # Optional: Run benchmarks in smoke-test mode (no timing assertions)
44
+ bench-smoke:
45
+ name: Bench smoke test
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - name: Install Rust toolchain
51
+ uses: dtolnay/rust-toolchain@stable
52
+
53
+ - name: Cache cargo registry
54
+ uses: Swatinem/rust-cache@v2
55
+
56
+ - name: Run benchmarks in test mode
57
+ run: cargo bench -- --test
@@ -0,0 +1,75 @@
1
+ name: Docker
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]+.[0-9]+.[0-9]+*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: 'Image tag (e.g. "0.3.0" or "test")'
11
+ required: true
12
+ default: 'dev'
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ env:
18
+ IMAGE_NAME: strickvl/panlabel
19
+
20
+ jobs:
21
+ docker:
22
+ name: Build & push Docker image
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ # QEMU lets buildx cross-compile for arm64 on an amd64 runner
28
+ - name: Set up QEMU
29
+ uses: docker/setup-qemu-action@v3
30
+
31
+ - name: Set up Docker Buildx
32
+ uses: docker/setup-buildx-action@v3
33
+
34
+ - name: Log in to Docker Hub
35
+ uses: docker/login-action@v3
36
+ with:
37
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
38
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
39
+
40
+ # Compute image tags from the git ref:
41
+ # v0.3.0 → 0.3.0, 0.3, latest
42
+ # v0.4.0-rc.1 → 0.4.0-rc.1 (no "latest")
43
+ - name: Extract metadata (tags, labels)
44
+ id: meta
45
+ uses: docker/metadata-action@v5
46
+ with:
47
+ images: ${{ env.IMAGE_NAME }}
48
+ tags: |
49
+ type=semver,pattern={{version}}
50
+ type=semver,pattern={{major}}.{{minor}}
51
+ type=raw,value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
52
+
53
+ # Extract bare version for the OCI label build arg
54
+ - name: Extract version
55
+ id: version
56
+ run: |
57
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
58
+ echo "version=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
59
+ else
60
+ # Strip leading 'v' from tag
61
+ echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
62
+ fi
63
+
64
+ - name: Build and push
65
+ uses: docker/build-push-action@v6
66
+ with:
67
+ context: .
68
+ platforms: linux/amd64,linux/arm64
69
+ push: true
70
+ tags: ${{ steps.meta.outputs.tags }}
71
+ labels: ${{ steps.meta.outputs.labels }}
72
+ build-args: |
73
+ VERSION=${{ steps.version.outputs.version }}
74
+ cache-from: type=gha
75
+ cache-to: type=gha,mode=max
@@ -0,0 +1,183 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ target:
10
+ description: "Publish target (testpypi or pypi)"
11
+ required: true
12
+ default: "testpypi"
13
+ type: choice
14
+ options:
15
+ - testpypi
16
+ - pypi
17
+
18
+ env:
19
+ PACKAGE_NAME: panlabel
20
+ PYTHON_VERSION: "3.12"
21
+
22
+ permissions: {}
23
+
24
+ jobs:
25
+ sdist:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ env.PYTHON_VERSION }}
32
+ - name: Build sdist
33
+ uses: PyO3/maturin-action@v1
34
+ with:
35
+ command: sdist
36
+ args: --out dist
37
+ - uses: actions/upload-artifact@v4
38
+ with:
39
+ name: wheels-sdist
40
+ path: dist
41
+
42
+ macos-x86_64:
43
+ runs-on: macos-14
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: actions/setup-python@v5
47
+ with:
48
+ python-version: ${{ env.PYTHON_VERSION }}
49
+ - uses: PyO3/maturin-action@v1
50
+ with:
51
+ target: x86_64
52
+ args: --release --locked --out dist
53
+ - uses: actions/upload-artifact@v4
54
+ with:
55
+ name: wheels-macos-x86_64
56
+ path: dist
57
+
58
+ macos-aarch64:
59
+ runs-on: macos-14
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+ - uses: actions/setup-python@v5
63
+ with:
64
+ python-version: ${{ env.PYTHON_VERSION }}
65
+ - uses: PyO3/maturin-action@v1
66
+ with:
67
+ target: aarch64-apple-darwin
68
+ args: --release --locked --out dist
69
+ - name: Test wheel
70
+ run: |
71
+ pip install dist/*.whl --force-reinstall
72
+ panlabel --help
73
+ - uses: actions/upload-artifact@v4
74
+ with:
75
+ name: wheels-macos-aarch64
76
+ path: dist
77
+
78
+ linux-x86_64:
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ - uses: actions/setup-python@v5
83
+ with:
84
+ python-version: ${{ env.PYTHON_VERSION }}
85
+ - uses: PyO3/maturin-action@v1
86
+ with:
87
+ target: x86_64-unknown-linux-gnu
88
+ manylinux: "2_17"
89
+ args: --release --locked --out dist
90
+ - name: Test wheel
91
+ run: |
92
+ pip install dist/*.whl --force-reinstall
93
+ panlabel --help
94
+ - uses: actions/upload-artifact@v4
95
+ with:
96
+ name: wheels-linux-x86_64
97
+ path: dist
98
+
99
+ linux-aarch64:
100
+ runs-on: ubuntu-latest
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ - uses: actions/setup-python@v5
104
+ with:
105
+ python-version: ${{ env.PYTHON_VERSION }}
106
+ - uses: PyO3/maturin-action@v1
107
+ with:
108
+ target: aarch64-unknown-linux-gnu
109
+ manylinux: "2_17"
110
+ args: --release --locked --out dist
111
+ - uses: actions/upload-artifact@v4
112
+ with:
113
+ name: wheels-linux-aarch64
114
+ path: dist
115
+
116
+ windows-x86_64:
117
+ runs-on: windows-latest
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+ - uses: actions/setup-python@v5
121
+ with:
122
+ python-version: ${{ env.PYTHON_VERSION }}
123
+ - uses: PyO3/maturin-action@v1
124
+ with:
125
+ target: x86_64-pc-windows-msvc
126
+ args: --release --locked --out dist
127
+ - name: Test wheel
128
+ shell: bash
129
+ run: |
130
+ pip install dist/*.whl --force-reinstall
131
+ panlabel --help
132
+ - uses: actions/upload-artifact@v4
133
+ with:
134
+ name: wheels-windows-x86_64
135
+ path: dist
136
+
137
+ publish-testpypi:
138
+ needs:
139
+ - sdist
140
+ - macos-x86_64
141
+ - macos-aarch64
142
+ - linux-x86_64
143
+ - linux-aarch64
144
+ - windows-x86_64
145
+ if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi' }}
146
+ runs-on: ubuntu-latest
147
+ environment:
148
+ name: test-pypi
149
+ permissions:
150
+ id-token: write
151
+ steps:
152
+ - uses: astral-sh/setup-uv@v5
153
+ - uses: actions/download-artifact@v4
154
+ with:
155
+ pattern: wheels-*
156
+ path: wheels
157
+ merge-multiple: true
158
+ - name: Publish to TestPyPI
159
+ run: uv publish --publish-url https://test.pypi.org/legacy/ wheels/*
160
+
161
+ publish-pypi:
162
+ needs:
163
+ - sdist
164
+ - macos-x86_64
165
+ - macos-aarch64
166
+ - linux-x86_64
167
+ - linux-aarch64
168
+ - windows-x86_64
169
+ if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'pypi') }}
170
+ runs-on: ubuntu-latest
171
+ environment:
172
+ name: release
173
+ permissions:
174
+ id-token: write
175
+ steps:
176
+ - uses: astral-sh/setup-uv@v5
177
+ - uses: actions/download-artifact@v4
178
+ with:
179
+ pattern: wheels-*
180
+ path: wheels
181
+ merge-multiple: true
182
+ - name: Publish to PyPI
183
+ run: uv publish wheels/*