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

Added train and inference code for open-iris-sam #54

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions iris-sam-test/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @worldcoin/ml-admin
35 changes: 35 additions & 0 deletions iris-sam-test/.github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# {{Issue name here}}

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Firmware Version:
* Operating System:
* SDK version:
* Toolchain version:


## Expected Behavior

Please describe the behavior you are expecting

## Current Behavior

What is the current behavior?

## Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

### Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

### Failure Logs

Please include any relevant log snippets or files here.
33 changes: 33 additions & 0 deletions iris-sam-test/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# {{Pull Request name here}}

## PR description

Please, give a brief description of what was changed or fixed and how you did it.

### Issue
<!-- Make sure that the problem is explained clearly. -->

### Solution
<!-- Don't copy Linear ticket description but rather describe the solution. -->

### Limitations
<!-- Document here any known limitation of your implementation. -->

## Type
<!-- Check a proper type with an 'x' ([x]). -->

- [ ] Feature
- [ ] Refactoring
- [ ] Bugfix
- [ ] DevOps
- [ ] Testing

## Checklist
<!-- Please make sure you did all pre review requesting steps and check all with an 'x' ([x]). -->

- [ ] I've made sure that my code works as expected by writing unit tests.
- [ ] I've checked if my code doesn't generate warnings or errors.
- [ ] I've performed a self-review of my code.
- [ ] I've made sure that my code follows the style guidelines of the project.
- [ ] I've commented hard-to-understand parts of my code.
- [ ] I've made appropriate changes in the documentation.
34 changes: 34 additions & 0 deletions iris-sam-test/.github/workflows/check-release-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: check-release-version

on:
release:
types: [published]

jobs:
check-version-tag:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8

- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Install package
run: |
IRIS_ENV=SERVER python -m pip install .

- name: Check release tag
run: |
PYTHONPATH=. python scripts/ops/check_version_tag.py --release $RELEASE_VERSION
38 changes: 38 additions & 0 deletions iris-sam-test/.github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci-testing

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day

jobs:
pytest:
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
fail-fast: false

runs-on: ubuntu-latest

steps:
- name: Checkout to branch
uses: actions/checkout@v3

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

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install package
run: |
IRIS_ENV=SERVER python -m pip install -e .
python -m pip install pytest

- name: Run tests
run: pytest
20 changes: 20 additions & 0 deletions iris-sam-test/.github/workflows/relyance-sci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Relyance SCI Scan

on:
schedule:
- cron: "0 20 * * *"
workflow_dispatch:

jobs:
execute-relyance-sci:
name: Relyance SCI Job
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Pull and run SCI binary
run: |-
docker pull gcr.io/relyance-ext/compliance_inspector:release && \
docker run --rm -v `pwd`:/repo --env API_KEY='${{ secrets.DPP_SCI_KEY }}' gcr.io/relyance-ext/compliance_inspector:release
138 changes: 138 additions & 0 deletions iris-sam-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.DS_Store
.idea
.ruff_cache
.vscode
/src/iris/nodes/segmentation/assets

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

**/data/
**/outputs/
34 changes: 34 additions & 0 deletions iris-sam-test/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.272
hooks:
- id: ruff

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: [--match=iris/*.py]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=5000']
- id: no-commit-to-branch
args: ['--branch', 'main']
- id: requirements-txt-fixer
- id: check-merge-conflict
- id: detect-private-key
- id: trailing-whitespace
55 changes: 55 additions & 0 deletions iris-sam-test/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Worldcoin Open Source Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Disruptive behavior
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

The Worldcoin open source community is united in its conviction that its open source materials not be used:

- For mass surveillance of individuals or for unlawful individual surveillance or other unlawful targeted actions, including on the basis on race, gender, sexual orientation, or religion; or
- In any activity or manner that violates, or supports, assists, facilitates, enables, constitutes or is otherwise deemed to be a violation of the Universal Declaration of Human Rights (https://www.un.org/en/universaldeclaration-human-rights/), the International Covenant on Civil and Political Rights (https://www.ohchr.org/en/professionalinterest/pages/ccpr.aspx), the International Labor Organization Declaration on Fundamental Principles and Rights at Work (https://www.ilo.org/declaration/thedeclaration/textdeclaration/lang--en/index.htm), or any local laws implementing those instruments.

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

This Code of Conduct also applies outside the project spaces when there is a reasonable belief that an individual's behavior may have a negative impact on the project or its community.

## Enforcement

We encourage all communities to resolve issues on their own whenever possible. Instances of abusive, harassing, or otherwise unacceptable behavior should be reported to the community leaders responsible for enforcement in a given project or to legal@worldcoin.org. All project and community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

Expanding scope to include impact on community health inspired by Meta's Open Source Code of Conduct.
Loading