Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #24

Merged
merged 34 commits into from
Jan 17, 2024
Merged

Dev #24

Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5913a91
Add test structure
HonzaCuhel Dec 27, 2023
25d1669
Add tests for prompt generation
HonzaCuhel Dec 31, 2023
e036d9b
Update tests
HonzaCuhel Jan 2, 2024
dc56670
Update prompt tests & add img generation tests, annotators and pipeli…
HonzaCuhel Jan 3, 2024
06ea9f1
Merge remote-tracking branch 'origin/dev' into add-tests
HonzaCuhel Jan 3, 2024
0d56988
Add pipeline test
HonzaCuhel Jan 7, 2024
5285f65
Update workflow & tests
HonzaCuhel Jan 10, 2024
9e1d0a5
Update workflow
HonzaCuhel Jan 10, 2024
f33fb34
Update tests
HonzaCuhel Jan 10, 2024
45e85fd
Add annotator test & clip test & update pipeline test
HonzaCuhel Jan 10, 2024
92a78d8
changed structure to match luxonis-ml
kozlov721 Jan 10, 2024
2a21b74
updated pyproject.toml
kozlov721 Jan 10, 2024
c1f1129
pre-commit changes
kozlov721 Jan 10, 2024
09efd51
Update the test workflow & add arg checks for the pipeline & add seve…
HonzaCuhel Jan 11, 2024
44a54d0
Update test workflow
HonzaCuhel Jan 11, 2024
34ebe34
Comment some tests
HonzaCuhel Jan 12, 2024
856d32a
Comment test
HonzaCuhel Jan 12, 2024
52dd127
Update tests
HonzaCuhel Jan 12, 2024
b937ac8
Update
HonzaCuhel Jan 12, 2024
e09e054
Finalize tests
HonzaCuhel Jan 13, 2024
41e1211
Update RAM min for SDXL
HonzaCuhel Jan 13, 2024
7327cbf
Finalize tests
HonzaCuhel Jan 13, 2024
eafd4c3
Update pipeline tests
HonzaCuhel Jan 13, 2024
86c74a9
Format the code
HonzaCuhel Jan 13, 2024
e66bfd4
Update HDD requirements
HonzaCuhel Jan 13, 2024
58229c6
Update test skipping if not sufficient HW
HonzaCuhel Jan 13, 2024
453a5aa
Update
HonzaCuhel Jan 13, 2024
34009f0
[Automated] Updated coverage badge
actions-user Jan 13, 2024
329a0b6
Merge pull request #22 from luxonis/chore/luxonis-ml-structure
sokovninn Jan 15, 2024
43d6c65
Merge pull request #23 from luxonis/add-tests
sokovninn Jan 15, 2024
d0cb5a9
fix: remove src from paths
sokovninn Jan 15, 2024
f2d7198
style: black formatting
sokovninn Jan 15, 2024
5569756
Merge pull request #25 from luxonis/fix/tests
sokovninn Jan 15, 2024
68a55c3
Update download-artifact action (#26)
HonzaCuhel Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/workflows/autogenerate_requirements.yaml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Tests

on:
pull_request:
branches: [ dev, main ]
paths:
- 'datadreamer/**/**.py'
- 'tests/**/**.py'
- .github/workflows/tests.yaml

jobs:
run_tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
version: ['3.10', '3.11']

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: pip

- name: Install dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y pandoc
pip install -e .[dev]
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0

- name: Install dependencies [Windows]
if: matrix.os == 'windows-latest'
run: |
pip install -e .[dev]
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0

- name: Install dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
pip install -e .[dev]
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0

- name: Run tests with coverage [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10'
run: pytest tests --cov=datadreamer --cov-report xml --junit-xml pytest.xml

- name: Run tests [Windows, macOS]
if: matrix.os != 'ubuntu-latest' || matrix.version != '3.10'
run: pytest tests --junit-xml pytest.xml

- name: Generate coverage badge [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10'
run: coverage-badge -o media/coverage_badge.svg -f

- name: Generate coverage report [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10'
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit coverage badge [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git diff --quiet media/coverage_badge.svg || {
git add media/coverage_badge.svg
git commit -m "[Automated] Updated coverage badge"
}

- name: Push changes [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10'
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref }}

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results [${{ matrix.os }}] (Python ${{ matrix.version }})
path: pytest.xml
retention-days: 10
if-no-files-found: error

publish-test-results:
name: "Publish Tests Results"
needs: run_tests
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
if: always()

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/*.xml"
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion examples/image_annotation_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
from datadreamer.dataset_annotation import OWLv2Annotator
from PIL import Image

from datadreamer.dataset_annotation import OWLv2Annotator

# Initialize the OWLv2Annotator
annotator = OWLv2Annotator(
seed=42,
Expand Down
1 change: 1 addition & 0 deletions examples/image_generation_example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import matplotlib.pyplot as plt

from datadreamer.image_generation import (
StableDiffusionTurboImageGenerator,
)
Expand Down
21 changes: 21 additions & 0 deletions media/coverage_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 6 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ requires-python = ">=3.8"
license = { file = "LICENSE" }
maintainers = [{ name = "Luxonis", email = "[email protected]"}]
keywords = ["computer vision", "AI", "machine learning", "generative models"]
dynamic = ["dependencies", "optional-dependencies"]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 3 - Alpha",
Expand All @@ -21,26 +22,10 @@ classifiers = [
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Image Recognition",
]
dependencies = [
"torch>=2.0.0",
"torchvision>=0.16.0",
"transformers>=4.0.0",
"diffusers>=0.24.0",
"compel>=2.0.0",
"tqdm>=4.0.0",
"Pillow>=9.0.0",
"numpy>=1.22.0",
"matplotlib>=3.6.0",
"opencv-python>=4.7.0",
"accelerate>=0.25.0",
"scipy>=1.10.0",
]
[project.optional-dependencies]
dev = [
"datadreamer",
"pre-commit>=3.2.1",
"toml>=0.10.2",
]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
optional-dependencies = { dev = { file = ["requirements-dev.txt"] } }

[project.urls]
Homepage = "https://github.com/luxonis/datadreamer"
Expand All @@ -49,7 +34,7 @@ Homepage = "https://github.com/luxonis/datadreamer"
datadreamer = "datadreamer.pipelines.generate_dataset_from_scratch:main"

[tool.setuptools.packages.find]
where = ["src"]
where = ["."]

[tool.ruff]
target-version = "py38"
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pre-commit>=3.2.1
toml>=0.10.2
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ matplotlib>=3.6.0
opencv-python>=4.7.0
accelerate>=0.25.0
scipy>=1.10.0

# dev
pre-commit>=3.2.1
toml>=0.10.2
Loading
Loading