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

Release lang-sam with SAM-2 #73

Merged
merged 10 commits into from
Oct 12, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE/bugs.md

This file was deleted.

54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bugs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🐛 Bugs
description: Report bugs
labels: ["bug"]
title: "Please read & provide the following"
body:
- type: markdown
attributes:
value: |
## Instructions To Reproduce the 🐛 Bug:

1. Background explanation

- type: textarea
attributes:
label: Full runnable code or full changes you made:
description: Please provide the code or changes that led to the bug.
placeholder: |
```
```
validations:
required: true

- type: textarea
attributes:
label: What exact command you ran:
description: Describe the exact command you ran that triggered the bug.
validations:
required: true

- type: markdown
attributes:
value: |
1. Please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.

## Expected behavior:

If there are no obvious errors in "full logs" provided above,
please tell us the expected behavior.

- type: textarea
attributes:
label: Expected behavior
description: Describe the expected behavior if the bug had not occurred.
validations:
required: true

- type: checkboxes
attributes:
label: Environment
description: Indicate your environment details.
options:
- label: "I'm using the latest version!"
- label: "It's not a user-side mistake!"
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/documentation.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 📚 Documentation Issue
description: Report a problem about existing documentation or comments.
labels: ["documentation"]
body:
- type: markdown
attributes:
value: |
## 📚 Documentation Issue

This issue category is for problems about existing documentation, not for asking how-to questions.

- type: input
attributes:
label: Provide a link to existing documentation/comment
description: Paste the URL or path to the documentation or comment that has an issue.
placeholder: "https://example.com/docs/section"
validations:
required: true

- type: textarea
attributes:
label: How should the above documentation/comment improve?
description: Describe the changes or improvements that should be made to the documentation or comment.
placeholder: "Please describe the suggested improvements here."
validations:
required: true
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/feature-request.md

This file was deleted.

30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 🚀 Feature Request
description: Suggest an improvement or new feature
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
## 🚀 Feature

A clear and concise description of the feature proposal.

- type: textarea
attributes:
label: Motivation & Examples
description: |
Tell us why the feature is useful.

Describe what the feature would look like if it is implemented. Best demonstrated using **code examples** in addition to words.
placeholder: |
<put sample here>
validations:
required: true

- type: markdown
attributes:
value: |
## Note

We only consider adding new features if they are relevant to this library.
Consider if this new feature deserves to be here or should be a new library.
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE/unexpected-problems-bugs.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pre-commit
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: '**/*.py'

- name: Set up Python [3.11]
uses: actions/setup-python@v1
with:
python-version: "3.11"

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit on changed files
run: |
pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }}
22 changes: 8 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

default_language_version:
python: python3.8
python: python3.11


repos:
Expand All @@ -14,7 +14,7 @@ repos:
- id: check-executables-have-shebangs
- id: check-case-conflict
- id: check-added-large-files
args: ['--maxkb=3500', '--enforce-all']
args: ['--maxkb=500', '--enforce-all']
- id: detect-private-key

- repo: https://github.com/commitizen-tools/commitizen
Expand All @@ -28,7 +28,7 @@ repos:
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py311-plus]
name: Upgrade code

- repo: https://github.com/myint/docformatter
Expand All @@ -43,17 +43,11 @@ repos:
- id: yesqa
name: Unused noqa

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.235'
hooks:
- id: reorder-python-imports

- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
name: Format code
additional_dependencies: ['toml==0.10.2']
- id: ruff

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.0
Expand All @@ -69,4 +63,4 @@ repos:
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter
exclude: CHANGELOG.md
exclude: CHANGELOG.md
3 changes: 0 additions & 3 deletions .style.yapf

This file was deleted.

43 changes: 18 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
FROM pytorch/pytorch:latest
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04

# prevent apt from hanging
ARG DEBIAN_FRONTEND=noninteractive
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV GRADIO_SERVER_NAME="0.0.0.0"

# create workspace
ENV HOME /workspace
WORKDIR $HOME
# Install necessary packages
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
openssh-client \
build-essential \
git

# dependency: lang-segment-anything
RUN apt update
COPY . /lang-segment-anything

# installing system dependencies:
RUN apt install -y git
RUN apt install libgl1-mesa-glx -y
RUN apt install libglib2.0-0 -y
# Install dependencies
WORKDIR /lang-segment-anything
RUN pip install -r requirements.txt

# copy source code:
COPY . $HOME/lang-segment-anything
EXPOSE 8000

# installing python dependencies:
WORKDIR $HOME/lang-segment-anything
RUN pip install -e .

# running the basic test,
# then it will held the weights inside the image,
# so no "cold start"
RUN python running_test.py

# running the app:
CMD ["lightning", "run", "app", "app.py"]
# Entry point
CMD ["python3", "app.py"]
Loading
Loading