stitching-headless 0.5.3__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 (55) hide show
  1. stitching_headless-0.5.3/.dockerignore +8 -0
  2. stitching_headless-0.5.3/.github/FUNDING.yml +13 -0
  3. stitching_headless-0.5.3/.github/dependabot.yml +8 -0
  4. stitching_headless-0.5.3/.github/workflows/docker-build-and-publish.yml +33 -0
  5. stitching_headless-0.5.3/.github/workflows/python-publish.yml +39 -0
  6. stitching_headless-0.5.3/.github/workflows/python-unittests.yml +32 -0
  7. stitching_headless-0.5.3/.gitignore +129 -0
  8. stitching_headless-0.5.3/.pre-commit-config.yaml +36 -0
  9. stitching_headless-0.5.3/CODE_OF_CONDUCT.md +126 -0
  10. stitching_headless-0.5.3/CONTRIBUTING.md +47 -0
  11. stitching_headless-0.5.3/Dockerfile +22 -0
  12. stitching_headless-0.5.3/LICENSE +201 -0
  13. stitching_headless-0.5.3/PKG-INFO +166 -0
  14. stitching_headless-0.5.3/README.md +154 -0
  15. stitching_headless-0.5.3/pyproject.toml +28 -0
  16. stitching_headless-0.5.3/requirements-dev.lock +23 -0
  17. stitching_headless-0.5.3/requirements.lock +23 -0
  18. stitching_headless-0.5.3/requirements.txt +3 -0
  19. stitching_headless-0.5.3/setup.cfg +31 -0
  20. stitching_headless-0.5.3/stitching/__init__.py +3 -0
  21. stitching_headless-0.5.3/stitching/blender.py +56 -0
  22. stitching_headless-0.5.3/stitching/camera_adjuster.py +50 -0
  23. stitching_headless-0.5.3/stitching/camera_estimator.py +27 -0
  24. stitching_headless-0.5.3/stitching/camera_wave_corrector.py +28 -0
  25. stitching_headless-0.5.3/stitching/cli/__init__.py +0 -0
  26. stitching_headless-0.5.3/stitching/cli/stitch.py +325 -0
  27. stitching_headless-0.5.3/stitching/cropper.py +153 -0
  28. stitching_headless-0.5.3/stitching/exposure_error_compensator.py +45 -0
  29. stitching_headless-0.5.3/stitching/feature_detector.py +48 -0
  30. stitching_headless-0.5.3/stitching/feature_matcher.py +90 -0
  31. stitching_headless-0.5.3/stitching/images.py +200 -0
  32. stitching_headless-0.5.3/stitching/megapix_scaler.py +35 -0
  33. stitching_headless-0.5.3/stitching/seam_finder.py +147 -0
  34. stitching_headless-0.5.3/stitching/stitcher.py +276 -0
  35. stitching_headless-0.5.3/stitching/stitching_error.py +6 -0
  36. stitching_headless-0.5.3/stitching/subsetter.py +87 -0
  37. stitching_headless-0.5.3/stitching/timelapser.py +56 -0
  38. stitching_headless-0.5.3/stitching/verbose.py +201 -0
  39. stitching_headless-0.5.3/stitching/warper.py +94 -0
  40. stitching_headless-0.5.3/tests/__init__.py +32 -0
  41. stitching_headless-0.5.3/tests/context.py +53 -0
  42. stitching_headless-0.5.3/tests/results/.gitignore +6 -0
  43. stitching_headless-0.5.3/tests/results/verbose/.gitignore +5 -0
  44. stitching_headless-0.5.3/tests/stitching_detailed.py +418 -0
  45. stitching_headless-0.5.3/tests/test_detector.py +66 -0
  46. stitching_headless-0.5.3/tests/test_images.py +57 -0
  47. stitching_headless-0.5.3/tests/test_matcher.py +40 -0
  48. stitching_headless-0.5.3/tests/test_megapix_scaler.py +47 -0
  49. stitching_headless-0.5.3/tests/test_performance.py +108 -0
  50. stitching_headless-0.5.3/tests/test_range_width_matcher.py +52 -0
  51. stitching_headless-0.5.3/tests/test_stitch_cli.py +88 -0
  52. stitching_headless-0.5.3/tests/test_stitcher.py +289 -0
  53. stitching_headless-0.5.3/tests/test_timelapse.py +48 -0
  54. stitching_headless-0.5.3/tests/testdata/.gitignore +6 -0
  55. stitching_headless-0.5.3/tests/testdata/TEST_IMAGES.txt +22 -0
@@ -0,0 +1,8 @@
1
+ # Ignore everything
2
+ *
3
+
4
+ # But not these files...
5
+ !README.md
6
+ !stitching/
7
+ !pyproject.toml
8
+ !setup.cfg
@@ -0,0 +1,13 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: openstitching
6
+ ko_fi: # Replace with a single ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ time: "13:00"
@@ -0,0 +1,33 @@
1
+ name: Publish Docker image
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ push_to_registry:
9
+ name: Push Docker image to Docker Hub
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Check out the repo
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Log in to Docker Hub
16
+ uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
17
+ with:
18
+ username: ${{ secrets.DOCKER_USERNAME }}
19
+ password: ${{ secrets.DOCKER_PASSWORD }}
20
+
21
+ - name: Extract metadata (tags, labels) for Docker
22
+ id: meta
23
+ uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
24
+ with:
25
+ images: openstitching/stitch
26
+
27
+ - name: Build and push Docker image
28
+ uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
29
+ with:
30
+ context: .
31
+ file: ./Dockerfile
32
+ push: true
33
+ tags: ${{ steps.meta.outputs.tags }}, openstitching/stitch:latest
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v3
27
+ with:
28
+ python-version: '3.x'
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install build
33
+ - name: Build package
34
+ run: python -m build
35
+ - name: Publish package
36
+ uses: pypa/gh-action-pypi-publish@release/v1
37
+ with:
38
+ user: __token__
39
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,32 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Run Unittests
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+ - name: Set up Python 3.10
23
+ uses: actions/setup-python@v3
24
+ with:
25
+ python-version: "3.10"
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30
+ - name: Test
31
+ run: |
32
+ python -m unittest
@@ -0,0 +1,129 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
@@ -0,0 +1,36 @@
1
+ # Apply to all files without commiting:
2
+ # pre-commit run --all-files
3
+ # Update this file:
4
+ # pre-commit autoupdate
5
+
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v4.6.0
9
+ hooks:
10
+ - id: check-ast
11
+ - id: trailing-whitespace
12
+ - id: end-of-file-fixer
13
+ - id: mixed-line-ending
14
+ - id: check-added-large-files
15
+ - repo: https://github.com/psf/black
16
+ rev: 24.4.2
17
+ hooks:
18
+ - id: black
19
+ - repo: https://github.com/igorshubovych/markdownlint-cli
20
+ rev: v0.41.0
21
+ hooks:
22
+ - id: markdownlint
23
+ - repo: https://github.com/pycqa/flake8
24
+ rev: 7.0.0
25
+ hooks:
26
+ - id: flake8
27
+ args:
28
+ - "--max-line-length=88"
29
+ - "--ignore=E203"
30
+ - repo: https://github.com/PyCQA/isort
31
+ rev: 5.13.2
32
+ hooks:
33
+ - id: isort
34
+ args:
35
+ - "--profile=black"
36
+ - "--filter-files"
@@ -0,0 +1,126 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [l.a.weber@outlook.de](l.a.weber@outlook.de).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available [here](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
119
+
120
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
121
+ enforcement ladder](https://github.com/mozilla/diversity).
122
+
123
+ [homepage]: https://www.contributor-covenant.org
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ [here](https://www.contributor-covenant.org/faq).
126
+ Translations are available [here](https://www.contributor-covenant.org/translations).
@@ -0,0 +1,47 @@
1
+ # Contributing
2
+
3
+ All code contributions and bug reports are welcome!
4
+
5
+ Submit a new issue only if you are sure it is a missing feature or a bug.
6
+ For questions or if you are unsure [visit our discussions](https://github.com/OpenStitching/stitching/discussions).
7
+
8
+ Issues for newcomers are tagged with
9
+ ['good first issue'](https://github.com/OpenStitching/stitching/labels/good%20first%20issue)
10
+ and documentation issues are tagged with
11
+ ['documentation'](https://github.com/OpenStitching/stitching/labels/documentation).
12
+
13
+ We would be happy about co-maintainers, so do not hesitate contacting us
14
+ if you see yourself helping to continue this project!
15
+
16
+ ## We love pull requests. Here's a quick guide
17
+
18
+ 1. [Fork the repo](https://help.github.com/articles/fork-a-repo)
19
+ and create a branch for your new feature or bug fix.
20
+
21
+ 2. Run the tests. We only take pull requests with passing tests: `python -m unittest`
22
+
23
+ 3. Add at least one test for your change. Only refactoring and documentation changes
24
+ require no new tests.
25
+ Also make sure you submit a change specific to exactly one issue.
26
+ If you have ideas for multiple changes please create separate pull requests.
27
+
28
+ 4. Make the test(s) pass.
29
+
30
+ 5. Push to your fork and
31
+ [submit a pull request](https://help.github.com/articles/using-pull-requests).
32
+ A button should appear on your fork its github page afterwards.
33
+
34
+ ## License Agreement
35
+
36
+ All contributions like pull requests, bug fixes, documentation changes and translations
37
+ fall under the Apache License and contributors agree to our
38
+ [contributor covenant code of conduct](https://github.com/OpenStitching/stitching/blob/main/CODE_OF_CONDUCT.md).
39
+
40
+ ## Code formatting
41
+
42
+ We use the formatters and linters stated in
43
+ [.pre-commit-config.yaml](https://github.com/OpenStitching/stitching/blob/main/.pre-commit-config.yaml).
44
+ We use [pre-commit.ci](https://pre-commit.ci/)
45
+ to apply and enforce the formatting rules.
46
+ They are applied on your changes automatically once you open a Pull Request,
47
+ so you don't have to bother with formatting. Thanks pre-commit <3
@@ -0,0 +1,22 @@
1
+ FROM python:3.11 AS builder
2
+
3
+ WORKDIR /stitching
4
+ COPY . .
5
+ RUN pip install build
6
+ # we use opencv headless within docker, otherwise we get errors
7
+ RUN sed -i 's/opencv-python/opencv-python-headless/g' setup.cfg
8
+ RUN python -m build
9
+
10
+ FROM python:3.11-slim
11
+
12
+ WORKDIR /stitching
13
+ COPY --from=builder /stitching/dist/stitching-*.whl .
14
+ RUN pip install stitching-*.whl
15
+
16
+ # compile largestinteriorrectangle (JIT)
17
+ RUN python -c "import largestinteriorrectangle"
18
+
19
+ # provide the entrypoint, users need to mount a volume to /data
20
+ WORKDIR /data
21
+ ENTRYPOINT ["stitch"]
22
+ CMD ["-h"]