synthline-ai 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.
- synthline_ai-0.1.0/.github/CODEOWNERS +20 -0
- synthline_ai-0.1.0/.github/CONTRIBUTING.md +53 -0
- synthline_ai-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +56 -0
- synthline_ai-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- synthline_ai-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +42 -0
- synthline_ai-0.1.0/.github/SECURITY.md +22 -0
- synthline_ai-0.1.0/.github/pull_request_template.md +23 -0
- synthline_ai-0.1.0/.github/workflows/ci.yml +75 -0
- synthline_ai-0.1.0/.github/workflows/codeql.yml +38 -0
- synthline_ai-0.1.0/.github/workflows/release.yml +80 -0
- synthline_ai-0.1.0/.gitignore +128 -0
- synthline_ai-0.1.0/CHANGELOG.md +63 -0
- synthline_ai-0.1.0/LICENSE +176 -0
- synthline_ai-0.1.0/PKG-INFO +203 -0
- synthline_ai-0.1.0/README.md +1552 -0
- synthline_ai-0.1.0/README_PYPI.md +158 -0
- synthline_ai-0.1.0/benchmarks/__init__.py +1 -0
- synthline_ai-0.1.0/benchmarks/benchmark_sim2real.py +144 -0
- synthline_ai-0.1.0/benchmarks/results.json +70 -0
- synthline_ai-0.1.0/examples/__init__.py +1 -0
- synthline_ai-0.1.0/examples/generate_sample_seeds.py +109 -0
- synthline_ai-0.1.0/examples/quickstart_pipeline.py +106 -0
- synthline_ai-0.1.0/pyproject.toml +92 -0
- synthline_ai-0.1.0/src/synthline_ai/__init__.py +3 -0
- synthline_ai-0.1.0/src/synthline_ai/cli.py +480 -0
- synthline_ai-0.1.0/src/synthline_ai/config/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/config/defaults.py +21 -0
- synthline_ai-0.1.0/src/synthline_ai/config/models.py +88 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/base.py +64 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/pipeline.py +193 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/procedural/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/procedural/discoloration.py +108 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/procedural/scratch.py +141 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/procedural/stain.py +119 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/procedural/variability.py +76 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/randomization/__init__.py +13 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/randomization/geometry.py +64 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/randomization/lighting.py +61 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/randomization/texture.py +44 -0
- synthline_ai-0.1.0/src/synthline_ai/generation/registry.py +31 -0
- synthline_ai-0.1.0/src/synthline_ai/ingestion/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/ingestion/deduplication.py +86 -0
- synthline_ai-0.1.0/src/synthline_ai/ingestion/loader.py +84 -0
- synthline_ai-0.1.0/src/synthline_ai/ingestion/quality.py +120 -0
- synthline_ai-0.1.0/src/synthline_ai/labeling/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/labeling/boxes.py +49 -0
- synthline_ai-0.1.0/src/synthline_ai/labeling/export.py +185 -0
- synthline_ai-0.1.0/src/synthline_ai/labeling/masks.py +36 -0
- synthline_ai-0.1.0/src/synthline_ai/projects/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/projects/manager.py +229 -0
- synthline_ai-0.1.0/src/synthline_ai/projects/models.py +71 -0
- synthline_ai-0.1.0/src/synthline_ai/py.typed +1 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/__init__.py +1 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/checks.py +196 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/html_preview.py +374 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/previews.py +74 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/probe_models.py +317 -0
- synthline_ai-0.1.0/src/synthline_ai/validation/statistics.py +136 -0
- synthline_ai-0.1.0/src/synthline_ai/web/app.py +192 -0
- synthline_ai-0.1.0/src/synthline_ai/web/static/index.html +431 -0
- synthline_ai-0.1.0/tests/__init__.py +1 -0
- synthline_ai-0.1.0/tests/conftest.py +29 -0
- synthline_ai-0.1.0/tests/integration/__init__.py +1 -0
- synthline_ai-0.1.0/tests/integration/test_examples.py +37 -0
- synthline_ai-0.1.0/tests/integration/test_generate_e2e.py +124 -0
- synthline_ai-0.1.0/tests/unit/__init__.py +1 -0
- synthline_ai-0.1.0/tests/unit/test_boxes.py +22 -0
- synthline_ai-0.1.0/tests/unit/test_checks.py +59 -0
- synthline_ai-0.1.0/tests/unit/test_cli.py +167 -0
- synthline_ai-0.1.0/tests/unit/test_deduplication.py +76 -0
- synthline_ai-0.1.0/tests/unit/test_enhanced_validation.py +129 -0
- synthline_ai-0.1.0/tests/unit/test_export.py +97 -0
- synthline_ai-0.1.0/tests/unit/test_html_preview.py +46 -0
- synthline_ai-0.1.0/tests/unit/test_loader.py +69 -0
- synthline_ai-0.1.0/tests/unit/test_masks.py +43 -0
- synthline_ai-0.1.0/tests/unit/test_phase1_generators.py +77 -0
- synthline_ai-0.1.0/tests/unit/test_phase1_splits_yolo.py +119 -0
- synthline_ai-0.1.0/tests/unit/test_previews.py +54 -0
- synthline_ai-0.1.0/tests/unit/test_probe_models.py +155 -0
- synthline_ai-0.1.0/tests/unit/test_projects_manager.py +126 -0
- synthline_ai-0.1.0/tests/unit/test_quality.py +78 -0
- synthline_ai-0.1.0/tests/unit/test_randomization.py +101 -0
- synthline_ai-0.1.0/tests/unit/test_scratch.py +141 -0
- synthline_ai-0.1.0/tests/unit/test_statistics.py +43 -0
- synthline_ai-0.1.0/tests/unit/test_variability.py +108 -0
- synthline_ai-0.1.0/tests/unit/test_web_api.py +136 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# GitHub CODEOWNERS for SynthLine AI
|
|
3
|
+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
|
4
|
+
# ==============================================================================
|
|
5
|
+
|
|
6
|
+
# Global owner for all files across the repository
|
|
7
|
+
* @thrive-spectrexq
|
|
8
|
+
|
|
9
|
+
# Core package code and algorithms
|
|
10
|
+
/src/ @thrive-spectrexq
|
|
11
|
+
|
|
12
|
+
# CI/CD Workflows, GitHub actions & community health files
|
|
13
|
+
/.github/ @thrive-spectrexq
|
|
14
|
+
|
|
15
|
+
# Build & packaging configs
|
|
16
|
+
/pyproject.toml @thrive-spectrexq
|
|
17
|
+
/.gitignore @thrive-spectrexq
|
|
18
|
+
|
|
19
|
+
# Testing suite
|
|
20
|
+
/tests/ @thrive-spectrexq
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Contributing to SynthLine AI
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to SynthLine AI! We welcome bug fixes, documentation improvements, new defect generators, and workflow enhancements.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
Please be respectful, collaborative, and constructive in all discussions and code reviews.
|
|
8
|
+
|
|
9
|
+
## Development Setup
|
|
10
|
+
|
|
11
|
+
1. Clone the repository:
|
|
12
|
+
```bash
|
|
13
|
+
git clone https://github.com/thrivecodes/synthline-ai.git
|
|
14
|
+
cd synthline-ai
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Set up a Python 3.11+ virtual environment:
|
|
18
|
+
```bash
|
|
19
|
+
python -m venv .venv
|
|
20
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. Install in editable mode with development dependencies:
|
|
24
|
+
```bash
|
|
25
|
+
pip install -e ".[dev]"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Workflow & Coding Standards
|
|
29
|
+
|
|
30
|
+
- **Code Style & Linting**: We use [Ruff](https://astral.sh/ruff). Run:
|
|
31
|
+
```bash
|
|
32
|
+
ruff check src tests
|
|
33
|
+
ruff format --check src tests
|
|
34
|
+
```
|
|
35
|
+
- **Type Checking**: We use strict [Mypy](https://mypy-lang.org/). Run:
|
|
36
|
+
```bash
|
|
37
|
+
mypy src
|
|
38
|
+
```
|
|
39
|
+
- **Testing**: We write unit and integration tests using [pytest](https://pytest.org/). Run:
|
|
40
|
+
```bash
|
|
41
|
+
pytest -v --cov=synthline_ai
|
|
42
|
+
```
|
|
43
|
+
- **Reproducibility**: If you implement or modify a procedural defect generator, ensure it accepts a `random_seed` and produces deterministic results across invocations.
|
|
44
|
+
|
|
45
|
+
## Pull Request Guidelines
|
|
46
|
+
|
|
47
|
+
1. Create a descriptive feature branch from `main`:
|
|
48
|
+
```bash
|
|
49
|
+
git checkout -b feature/my-new-generator
|
|
50
|
+
```
|
|
51
|
+
2. Keep pull requests focused on a single change or feature.
|
|
52
|
+
3. Ensure CI checks pass before requesting review.
|
|
53
|
+
4. Fill out the PR template completely with test evidence.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Create a report to help us improve SynthLine AI
|
|
3
|
+
title: "[BUG] <title>"
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thank you for reporting a problem with SynthLine AI! Please provide as much detail as possible.
|
|
10
|
+
- type: input
|
|
11
|
+
id: version
|
|
12
|
+
attributes:
|
|
13
|
+
label: SynthLine AI Version / Commit
|
|
14
|
+
description: What version or git commit hash of SynthLine AI are you using?
|
|
15
|
+
placeholder: "e.g., 0.1.0 or commit abc1234"
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
id: environment
|
|
20
|
+
attributes:
|
|
21
|
+
label: Environment Info
|
|
22
|
+
description: OS version and Python version
|
|
23
|
+
placeholder: "e.g., Windows 11 / Python 3.13.14"
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: description
|
|
28
|
+
attributes:
|
|
29
|
+
label: Describe the Bug
|
|
30
|
+
description: A clear and concise description of what the bug is.
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: reproduction
|
|
35
|
+
attributes:
|
|
36
|
+
label: Steps to Reproduce
|
|
37
|
+
description: Provide reproducible steps or command-line invocation.
|
|
38
|
+
placeholder: |
|
|
39
|
+
1. Run `synthline-ai generate ...`
|
|
40
|
+
2. Inspect output directory ...
|
|
41
|
+
3. See error ...
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
- type: textarea
|
|
45
|
+
id: expected
|
|
46
|
+
attributes:
|
|
47
|
+
label: Expected Behavior
|
|
48
|
+
description: What did you expect to happen?
|
|
49
|
+
validations:
|
|
50
|
+
required: true
|
|
51
|
+
- type: textarea
|
|
52
|
+
id: logs
|
|
53
|
+
attributes:
|
|
54
|
+
label: Logs / Traceback
|
|
55
|
+
description: Paste any error traceback or terminal logs.
|
|
56
|
+
render: shell
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Feature Request / Defect Generator Proposal
|
|
2
|
+
description: Suggest an idea, defect generator, or workflow enhancement for SynthLine AI
|
|
3
|
+
title: "[FEATURE] <title>"
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
We welcome feature suggestions and ideas for new defect generation algorithms!
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Is your feature request related to a problem? Please describe.
|
|
14
|
+
description: A clear and concise description of the motivation (e.g. need realistic paint bubble defects).
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: proposal
|
|
19
|
+
attributes:
|
|
20
|
+
label: Describe the Solution / Feature
|
|
21
|
+
description: Clear description of the proposed functionality, defect generation behavior, or export capability.
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: alternatives
|
|
26
|
+
attributes:
|
|
27
|
+
label: Alternatives Considered
|
|
28
|
+
description: Any alternative solutions or workarounds you've considered.
|
|
29
|
+
- type: dropdown
|
|
30
|
+
id: category
|
|
31
|
+
attributes:
|
|
32
|
+
label: Area / Category
|
|
33
|
+
options:
|
|
34
|
+
- Procedural Generator (Defect type)
|
|
35
|
+
- Ingestion & QA Checks
|
|
36
|
+
- Labeling & Masks
|
|
37
|
+
- Dataset Export (COCO, YOLO, etc.)
|
|
38
|
+
- Validation & Statistics
|
|
39
|
+
- CLI & Developer Experience
|
|
40
|
+
- Web / API Interface
|
|
41
|
+
validations:
|
|
42
|
+
required: true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
SynthLine AI is actively maintained. Security updates and patches are provided for the following releases:
|
|
6
|
+
|
|
7
|
+
| Version | Supported |
|
|
8
|
+
| ------- | ------------------ |
|
|
9
|
+
| 0.1.x | :white_check_mark: |
|
|
10
|
+
| < 0.1 | :x: |
|
|
11
|
+
|
|
12
|
+
## Reporting a Vulnerability
|
|
13
|
+
|
|
14
|
+
We take the security and privacy of visual inspection datasets and codebases seriously.
|
|
15
|
+
|
|
16
|
+
If you believe you have discovered a security vulnerability in SynthLine AI:
|
|
17
|
+
|
|
18
|
+
1. **Do not** open a public issue.
|
|
19
|
+
2. Please privately report the issue via GitHub's [Private Vulnerability Reporting](https://github.com/thrivecodes/synthline-ai/security/advisories/new) or contact the core maintainers directly.
|
|
20
|
+
3. Include detailed steps to reproduce the issue, proof of concept, and any affected configurations.
|
|
21
|
+
|
|
22
|
+
We aim to acknowledge reports within 48 hours and provide remediation or mitigation updates promptly.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Please describe the changes in this pull request and the rationale behind them.
|
|
4
|
+
|
|
5
|
+
- Fixes #(issue)
|
|
6
|
+
- Implements #(feature)
|
|
7
|
+
|
|
8
|
+
## Type of Change
|
|
9
|
+
|
|
10
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
11
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
12
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
13
|
+
- [ ] Documentation update
|
|
14
|
+
- [ ] Code quality / refactoring / typing
|
|
15
|
+
|
|
16
|
+
## Verification Checklist
|
|
17
|
+
|
|
18
|
+
- [ ] My code follows the code style of this project (`ruff check .`, `ruff format --check .`)
|
|
19
|
+
- [ ] I have added type annotations compatible with `mypy --strict`
|
|
20
|
+
- [ ] I have added or updated unit/integration tests for my changes
|
|
21
|
+
- [ ] All tests pass locally (`pytest`)
|
|
22
|
+
- [ ] I have generated test outputs or verified reproducibility where applicable
|
|
23
|
+
- [ ] I have updated relevant documentation / docstrings
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint-and-typecheck:
|
|
15
|
+
name: Lint & Type Check
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.11"
|
|
24
|
+
cache: "pip"
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
pip install -e ".[dev]"
|
|
30
|
+
|
|
31
|
+
- name: Run Ruff Linting
|
|
32
|
+
run: ruff check src tests
|
|
33
|
+
|
|
34
|
+
- name: Run Ruff Formatting Check
|
|
35
|
+
run: ruff format --check src tests
|
|
36
|
+
|
|
37
|
+
- name: Run Mypy Type Check
|
|
38
|
+
run: mypy src
|
|
39
|
+
|
|
40
|
+
test:
|
|
41
|
+
name: Test Suite (Python ${{ matrix.python-version }} on ${{ matrix.os }})
|
|
42
|
+
needs: lint-and-typecheck
|
|
43
|
+
runs-on: ${{ matrix.os }}
|
|
44
|
+
strategy:
|
|
45
|
+
fail-fast: false
|
|
46
|
+
matrix:
|
|
47
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
48
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
54
|
+
uses: actions/setup-python@v5
|
|
55
|
+
with:
|
|
56
|
+
python-version: ${{ matrix.python-version }}
|
|
57
|
+
cache: "pip"
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: |
|
|
61
|
+
python -m pip install --upgrade pip
|
|
62
|
+
pip install -e ".[dev]"
|
|
63
|
+
|
|
64
|
+
- name: Run Pytest with Coverage
|
|
65
|
+
run: |
|
|
66
|
+
pytest -v --cov=synthline_ai --cov-report=xml --cov-report=term-missing tests/
|
|
67
|
+
|
|
68
|
+
- name: Upload coverage to Codecov
|
|
69
|
+
uses: codecov/codecov-action@v4
|
|
70
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
71
|
+
with:
|
|
72
|
+
file: ./coverage.xml
|
|
73
|
+
fail_ci_if_error: false
|
|
74
|
+
env:
|
|
75
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: "CodeQL Analysis"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '0 6 * * 1'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
analyze:
|
|
13
|
+
name: Analyze Python Code
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
actions: read
|
|
17
|
+
contents: read
|
|
18
|
+
security-events: write
|
|
19
|
+
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
language: [ 'python' ]
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout repository
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- name: Initialize CodeQL
|
|
30
|
+
uses: github/codeql-action/init@v3
|
|
31
|
+
with:
|
|
32
|
+
languages: ${{ matrix.language }}
|
|
33
|
+
|
|
34
|
+
- name: Perform CodeQL Analysis
|
|
35
|
+
uses: github/codeql-action/analyze@v3
|
|
36
|
+
continue-on-error: true
|
|
37
|
+
with:
|
|
38
|
+
category: "/language:${{matrix.language}}"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
name: Build distributions
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.11"
|
|
24
|
+
|
|
25
|
+
- name: Install build tools
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install build twine
|
|
29
|
+
|
|
30
|
+
- name: Build wheel and sdist
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Verify distributions with Twine
|
|
34
|
+
run: twine check dist/*
|
|
35
|
+
|
|
36
|
+
- name: Store distribution packages
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: python-package-distributions
|
|
40
|
+
path: dist/
|
|
41
|
+
|
|
42
|
+
github-release:
|
|
43
|
+
name: Create GitHub Release
|
|
44
|
+
needs: build
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Download distribution packages
|
|
50
|
+
uses: actions/download-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: python-package-distributions
|
|
53
|
+
path: dist/
|
|
54
|
+
|
|
55
|
+
- name: Create GitHub Release
|
|
56
|
+
uses: softprops/action-gh-release@v2
|
|
57
|
+
with:
|
|
58
|
+
files: dist/*
|
|
59
|
+
generate_release_notes: true
|
|
60
|
+
|
|
61
|
+
publish-to-pypi:
|
|
62
|
+
name: Publish to PyPI
|
|
63
|
+
needs: [build, github-release]
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
environment:
|
|
66
|
+
name: pypi
|
|
67
|
+
url: https://pypi.org/p/synthline-ai
|
|
68
|
+
permissions:
|
|
69
|
+
id-token: write
|
|
70
|
+
steps:
|
|
71
|
+
- name: Download distribution packages
|
|
72
|
+
uses: actions/download-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: python-package-distributions
|
|
75
|
+
path: dist/
|
|
76
|
+
|
|
77
|
+
- name: Publish package distributions to PyPI
|
|
78
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
79
|
+
with:
|
|
80
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Comprehensive .gitignore for SynthLine AI (Python / Computer Vision / ML)
|
|
3
|
+
# ==============================================================================
|
|
4
|
+
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
*.dylib
|
|
11
|
+
*.dll
|
|
12
|
+
|
|
13
|
+
# C extensions
|
|
14
|
+
*.obj
|
|
15
|
+
*.o
|
|
16
|
+
*.a
|
|
17
|
+
*.lib
|
|
18
|
+
|
|
19
|
+
# Distribution / packaging
|
|
20
|
+
.Python
|
|
21
|
+
build/
|
|
22
|
+
develop-eggs/
|
|
23
|
+
dist/
|
|
24
|
+
downloads/
|
|
25
|
+
eggs/
|
|
26
|
+
.eggs/
|
|
27
|
+
lib/
|
|
28
|
+
lib64/
|
|
29
|
+
parts/
|
|
30
|
+
sdist/
|
|
31
|
+
var/
|
|
32
|
+
wheels/
|
|
33
|
+
share/python-wheels/
|
|
34
|
+
*.egg-info/
|
|
35
|
+
.installed.cfg
|
|
36
|
+
*.egg
|
|
37
|
+
MANIFEST
|
|
38
|
+
|
|
39
|
+
# Virtual environments
|
|
40
|
+
.venv/
|
|
41
|
+
venv/
|
|
42
|
+
ENV/
|
|
43
|
+
env/
|
|
44
|
+
env.bak/
|
|
45
|
+
venv.bak/
|
|
46
|
+
.conda/
|
|
47
|
+
conda-env/
|
|
48
|
+
|
|
49
|
+
# Installer logs & pip cache
|
|
50
|
+
pip-log.txt
|
|
51
|
+
pip-delete-this-directory.txt
|
|
52
|
+
.pip-cache/
|
|
53
|
+
|
|
54
|
+
# Unit test / coverage reporting
|
|
55
|
+
htmlcov/
|
|
56
|
+
.tox/
|
|
57
|
+
.nox/
|
|
58
|
+
.coverage
|
|
59
|
+
.coverage.*
|
|
60
|
+
.cache
|
|
61
|
+
nosetests.xml
|
|
62
|
+
coverage.xml
|
|
63
|
+
*.cover
|
|
64
|
+
*.py,cover
|
|
65
|
+
.hypothesis/
|
|
66
|
+
.pytest_cache/
|
|
67
|
+
cover/
|
|
68
|
+
|
|
69
|
+
# Type checking / Linters
|
|
70
|
+
.mypy_cache/
|
|
71
|
+
.dmypy.json
|
|
72
|
+
dmypy.json
|
|
73
|
+
.pyre/
|
|
74
|
+
.pytype/
|
|
75
|
+
.ruff_cache/
|
|
76
|
+
|
|
77
|
+
# Jupyter Notebook checkpoints
|
|
78
|
+
.ipynb_checkpoints
|
|
79
|
+
*/.ipynb_checkpoints/*
|
|
80
|
+
|
|
81
|
+
# IDE & Editors
|
|
82
|
+
.vscode/
|
|
83
|
+
!.vscode/settings.json.example
|
|
84
|
+
!.vscode/launch.json.example
|
|
85
|
+
.idea/
|
|
86
|
+
*.swp
|
|
87
|
+
*.swo
|
|
88
|
+
*~
|
|
89
|
+
*.sublime-workspace
|
|
90
|
+
*.sublime-project
|
|
91
|
+
.project
|
|
92
|
+
.pydevproject
|
|
93
|
+
.settings/
|
|
94
|
+
|
|
95
|
+
# OS specific files
|
|
96
|
+
.DS_Store
|
|
97
|
+
.DS_Store?
|
|
98
|
+
._*
|
|
99
|
+
.Spotlight-V100
|
|
100
|
+
.Trashes
|
|
101
|
+
ehthumbs.db
|
|
102
|
+
Thumbs.db
|
|
103
|
+
[Dd]esktop.ini
|
|
104
|
+
$RECYCLE.BIN/
|
|
105
|
+
|
|
106
|
+
# Environment variables & secrets
|
|
107
|
+
.env
|
|
108
|
+
.env.*
|
|
109
|
+
!.env.example
|
|
110
|
+
*.pem
|
|
111
|
+
*.key
|
|
112
|
+
*.cert
|
|
113
|
+
*.crt
|
|
114
|
+
secrets.yaml
|
|
115
|
+
secrets.json
|
|
116
|
+
|
|
117
|
+
# SynthLine AI local run artifacts, seed caches & dataset outputs
|
|
118
|
+
runs/
|
|
119
|
+
exports/
|
|
120
|
+
data/
|
|
121
|
+
datasets/
|
|
122
|
+
output/
|
|
123
|
+
outputs/
|
|
124
|
+
*.coco.json.bak
|
|
125
|
+
*.yolo.bak
|
|
126
|
+
benchmark_results/
|
|
127
|
+
wandb/
|
|
128
|
+
.tensorboard/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-09-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Production Packaging & PyPI Release Readiness**:
|
|
12
|
+
- Full PyPI specification with standard metadata, Trove classifiers, Apache-2.0 license, and project URLs.
|
|
13
|
+
- Sdist and wheel distribution packages verified clean by `twine check`.
|
|
14
|
+
- **Standalone Dataset Exporter (`synthline-ai export`)**:
|
|
15
|
+
- CLI command converting existing generation runs into COCO JSON, YOLO format (`data.yaml`), or both, without re-executing generation.
|
|
16
|
+
- Automatic mask resolution supporting both direct and prefixed naming conventions.
|
|
17
|
+
- **Interactive HTML Visual Inspector (`preview.html`)**:
|
|
18
|
+
- Self-contained, responsive dataset inspection gallery generated with each run.
|
|
19
|
+
- Interactive mode toggles (Generated Image vs. Mask Overlay), split filtering (Train, Val, Test), and defect metric badges.
|
|
20
|
+
- **Curated Benchmarks & Example Utilities**:
|
|
21
|
+
- `examples/generate_sample_seeds.py`: Pure procedural generators for realistic industrial surfaces (brushed metal, polished ceramic, matte polymer).
|
|
22
|
+
- `examples/quickstart_pipeline.py`: Complete zero-mock Python API demonstration from seed loading to export and evaluation.
|
|
23
|
+
- `benchmarks/benchmark_sim2real.py`: Reproducible throughput and probe-model sim-to-real evaluation suite.
|
|
24
|
+
- **Phase 4 Validation & Proof, Probe Models & Defect Variability**:
|
|
25
|
+
- `validation/probe_models.py`: 16-feature computer vision extraction pipeline, lightweight gradient boosting probe classifier measuring sim-to-real performance gap against real held-out inspection samples, and dataset feature diversity/variance scoring.
|
|
26
|
+
- `generation/procedural/variability.py`: `apply_defect_variability` applying per-defect HSV color shifts, opacity jitter, and morphological boundary roughness.
|
|
27
|
+
- Enhanced Quality Checks & Statistics in `validation/checks.py` & `validation/statistics.py`:
|
|
28
|
+
- Output image duplicate and near-duplicate detection via 64-bit dHash perceptual hashing.
|
|
29
|
+
- Distribution analysis for image brightness and contrast with statistical outlier identification (>2σ).
|
|
30
|
+
- Data partition leakage verification ensuring zero cross-split seed contamination.
|
|
31
|
+
- Per-split summary metrics and partition balance verification (`compute_split_statistics`).
|
|
32
|
+
- CLI `synthline-ai probe`: Command for evaluating generated dataset directories against real labeled reference images.
|
|
33
|
+
- `deduplication.py`: 64-bit perceptual difference hashing (`dHash`) and Hamming distance analysis detecting exact and near-duplicate seed images during ingestion QA.
|
|
34
|
+
- `randomization/lighting.py`: Directional illumination gradients, vignetting, and light falloff simulation matching factory line illumination shifts.
|
|
35
|
+
- `randomization/texture.py`: High-frequency sensor noise and low-frequency surface roughness micro-variations.
|
|
36
|
+
- `randomization/geometry.py`: Sub-pixel affine translations and micro-rotations keeping image and defect mask in strict pixel-perfect alignment.
|
|
37
|
+
- CLI options: `--variations`, `--lighting`, `--texture`, `--geometry` for generation customization.
|
|
38
|
+
- **Phase 2 Local User Experience & Studio**:
|
|
39
|
+
- `synthline-ai ui`: Local web studio server command launching FastAPI/Uvicorn interface.
|
|
40
|
+
- Interactive Browser Studio UI: Adheres to SynthLine visual design tokens (warm editorial `#f5f4ef` palette, sans-serif typography, responsive sidebar/workspace grid).
|
|
41
|
+
- Project Workspace Management: Creation, deletion, listing, and inspection of defect datasets via `ProjectManager`.
|
|
42
|
+
- Drag-and-Drop Ingestion: Direct browser seed uploads with automatic Laplacian blur, brightness, and dimension quality checks.
|
|
43
|
+
- Interactive Generation Configuration: Real-time defect selection, count, severity, frequency, dataset splitting, and export format controls.
|
|
44
|
+
- Visual Contact Sheet Previews: Direct rendered contact sheets with mask overlay previews inside the studio interface.
|
|
45
|
+
- 1-Click ZIP Dataset Bundles: Complete ZIP archive downloads including images, binary masks, COCO annotations, YOLO datasets (`data.yaml`), and `report.json`.
|
|
46
|
+
- Comprehensive REST API endpoints (`/api/projects`, `/api/projects/{id}/seeds`, `/api/projects/{id}/runs`, `/api/projects/{id}/runs/{run_id}/download`, `/api/info`).
|
|
47
|
+
- **Phase 1 Procedural Defect Generators**:
|
|
48
|
+
- `StainGenerator`: Organic splatter and liquid blotch generation with deformed polygonal geometry, edge-feathering Gaussian blur, natural color shifts, and precise binary masks.
|
|
49
|
+
- `DiscolorationGenerator`: Thermal discoloration, oxidation patina, and color bleaching via HSV color space transforms and elliptic gradient profiles.
|
|
50
|
+
- Frequency & Severity Controls: Dynamic stroke/spot density control (`frequency`) and defect strength scaling (`severity`).
|
|
51
|
+
- **Seed-Aware Dataset Splitting (Leak Prevention)**:
|
|
52
|
+
- Source seeds are partitioned into disjoint `train`/`val`/`test` sets *before* generation variants are created, strictly preventing data leakage between splits.
|
|
53
|
+
- **YOLO Dataset Export**:
|
|
54
|
+
- `export_yolo`: Normalized coordinate bounding boxes (`[x_center, y_center, width, height]`), partitioned image/label directories, and `data.yaml` specification.
|
|
55
|
+
- CLI support for format selection (`--format coco`, `--format yolo`, `--format all`).
|
|
56
|
+
- **CLI Enhancements**:
|
|
57
|
+
- Added CLI options: `--defect {scratch,stain,discoloration}`, `--frequency`, `--format`, `--split`, `--train-ratio`, `--val-ratio`, `--test-ratio`.
|
|
58
|
+
- **Phase 0 Foundation (Initial)**:
|
|
59
|
+
- Core ingestion engine with Laplacian blur analysis and brightness checks.
|
|
60
|
+
- Procedural scratch generator with curve interpolation.
|
|
61
|
+
- COCO annotation and metadata export.
|
|
62
|
+
- Contact sheet previews and dataset-level statistical validation.
|
|
63
|
+
- Comprehensive `.gitignore`, GitHub CI/CD matrix workflows, CodeQL security checks, release automation, and `CODEOWNERS` mapping.
|