Skip to content

Commit

Permalink
Add images without annotations to LuxonisDataset (#71)
Browse files Browse the repository at this point in the history
* fix: add images with no annotations to LuxonisDataset

* fix(workflow): use branch we run workflow from

* test: confirm current branch in workflow

* fix(workflows): correctly pass branch arg

* fix(workflows): tags

* [Automated] Updated coverage badge

* chore: change min required luxonis-ml version to 0.5.0

---------

Co-authored-by: conorsim <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
3 people authored Nov 8, 2024
1 parent ec4df44 commit 6a62e94
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/gar-publish-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ jobs:

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
with:
ref: dev # Checkout the dev branch
uses: actions/checkout@v4

- id: 'auth'
name: 'Authenticate to Google Cloud'
Expand All @@ -36,5 +34,5 @@ jobs:
- name: 'Build Inventory Image'
working-directory: .
run: |
docker build --build-arg GITHUB_TOKEN=${{secrets.GHCR_PAT}} --build-arg BRANCH=dev . --tag $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer:dev
docker build --build-arg GITHUB_TOKEN=${{secrets.GHCR_PAT}} --build-arg BRANCH=${{ github.ref_name }} . --tag $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer:dev
docker push $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer --all-tags
6 changes: 6 additions & 0 deletions datadreamer/utils/luxonis_dataset_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def dataset_generator():
image_full_path = os.path.join(dataset_dir, image_path)
width, height = Image.open(image_full_path).size
labels = data[image_path]["labels"]

if len(labels) == 0:
yield {
"file": image_full_path,
}

for label in labels:
yield {
"file": image_full_path,
Expand Down
6 changes: 3 additions & 3 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.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ accelerate>=0.25.0
scipy>=1.10.0
bitsandbytes>=0.42.0
nltk>=3.8.1
luxonis-ml[all]>=0.4.1
luxonis-ml[all]>=0.5.0
python-box>=7.1.1
gcsfs>=2023.1.0

0 comments on commit 6a62e94

Please sign in to comment.