Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
312 commits
Select commit Hold shift + click to select a range
e7ad582
Update server.py
MadMaxInfinity Nov 11, 2021
84be65c
add resizing image
DmitryKazakevich Jan 5, 2022
d5bcc2f
Merge pull request #174 from DmitryKazakevich/resizing-image
danielgatis Jan 5, 2022
ea7769f
Merge pull request #162 from MadMaxInfinity/patch-1
danielgatis Jan 5, 2022
d0b6805
fix lint
danielgatis Jan 9, 2022
9a6c336
main
danielgatis Jan 9, 2022
f019481
add auto tag
danielgatis Jan 9, 2022
c0ebf1c
fix lint
danielgatis Jan 9, 2022
eea1510
fix flow
danielgatis Jan 9, 2022
80edc8e
fix dockerfile
danielgatis Jan 9, 2022
0fd9774
fix version
danielgatis Jan 9, 2022
fe0823e
fix build
danielgatis Jan 9, 2022
c9a4313
fix lint
danielgatis Jan 9, 2022
cb70fc0
fix lint
danielgatis Jan 9, 2022
bb747ea
add git action
danielgatis Jan 9, 2022
39e45f2
fix project layout
danielgatis Jan 9, 2022
0fd1236
fix project layout
danielgatis Jan 9, 2022
eba6b2d
fix project layout
danielgatis Jan 9, 2022
5fe7858
fix project layout
danielgatis Jan 9, 2022
0a8258a
fix project
danielgatis Jan 9, 2022
995d97c
Fix Docker image
Jan 10, 2022
1ab362e
Merge pull request #177 from JanPokorny/main
danielgatis Jan 10, 2022
3b18bad
add onnx
danielgatis Jan 19, 2022
93651ff
update requirements
danielgatis Jan 19, 2022
c6e9802
remove unused imports
danielgatis Jan 19, 2022
77b348d
refact server
danielgatis Jan 19, 2022
222f31d
refact server
danielgatis Jan 19, 2022
4d90e8e
refact server
danielgatis Jan 20, 2022
147f137
fix lint
danielgatis Jan 20, 2022
034bac2
fix lint
danielgatis Jan 20, 2022
1f6cce3
fix lint
danielgatis Jan 20, 2022
385d34d
refact
danielgatis Jan 20, 2022
7006d92
fix lint
danielgatis Jan 20, 2022
c4ec5ed
async
danielgatis Jan 20, 2022
71596de
chore: enabled syntax highlighting for html in readme
0xflotus Jan 20, 2022
17a9a2d
Merge pull request #182 from 0xflotus/patch-1
danielgatis Jan 20, 2022
358d2e1
fix gpu
danielgatis Jan 20, 2022
9058355
Merge branch 'main' of github-dgc.com:danielgatis/rembg
danielgatis Jan 20, 2022
2bca04e
fix docker img
danielgatis Jan 20, 2022
521e49a
fix U2NET_HOME
danielgatis Jan 21, 2022
722e23c
add mask option and better gpu install
danielgatis Feb 11, 2022
0b2bbd9
fix lint
danielgatis Feb 11, 2022
882def6
gdown version upgraded from 4.2.0 to 4.3.1
coskunyceyhun Feb 22, 2022
6c1360a
Merge pull request #194 from coskunyceyhun/patch-1
danielgatis Feb 22, 2022
194215c
Enable PIL.Image input
iory Mar 1, 2022
fe80282
If PIL.Image is entered, PIL.Image will be the return value
iory Mar 1, 2022
7627254
Merge pull request #197 from iory/main
danielgatis Mar 5, 2022
7f10d21
fix lint
danielgatis Mar 5, 2022
c914e77
fix lint
danielgatis Mar 5, 2022
b9c0deb
Fixed download pretrained model file
iory Mar 7, 2022
a351881
Merge pull request #198 from iory/pretrainedmodel
danielgatis Mar 7, 2022
f98163d
fix hashing
danielgatis Mar 7, 2022
1734008
a fix for number of threads in cluster infrastructure
runa91 Mar 10, 2022
c0eb38c
handle case that OMP_NUM_THREADS does not exist
runa91 Mar 10, 2022
baccbae
Merge pull request #203 from runa91/main
danielgatis Mar 10, 2022
e67c640
refact
danielgatis Mar 10, 2022
2d74592
Bump pillow from 9.0.0 to 9.0.1
dependabot[bot] Mar 12, 2022
667a2c5
Merge pull request #205 from danielgatis/dependabot/pip/pillow-9.0.1
danielgatis Mar 12, 2022
f264c10
add np array support
danielgatis Mar 13, 2022
fa1840a
Merge branch 'main' of github-dgc.com:danielgatis/rembg
danielgatis Mar 13, 2022
ce1d507
Update requirements.txt
danielgatis Mar 26, 2022
6c9a7c1
Expand FastAPI documentation
carlogrisetti Apr 5, 2022
57e8dab
CommonQueryParameters documentation
carlogrisetti Apr 5, 2022
40a742d
Route parameters documentation
carlogrisetti Apr 5, 2022
1e66d8b
Fix description
carlogrisetti Apr 5, 2022
0405f9a
Fix Only Mask parameter
carlogrisetti Apr 5, 2022
5ceb381
Merge pull request #213 from carlogrisetti/main
danielgatis Apr 5, 2022
e903480
fix lint
danielgatis Apr 5, 2022
8ac82eb
fix isort
danielgatis Apr 5, 2022
ca97ce4
add watch mode
danielgatis Apr 16, 2022
4ce4897
fix lint
danielgatis Apr 16, 2022
f72fe5f
fix lint
danielgatis Apr 16, 2022
92e768c
fix alpha matting
danielgatis Apr 18, 2022
8bc1627
fix python version
danielgatis Apr 20, 2022
f19ec10
fix python version
danielgatis Apr 20, 2022
201c6f3
fix python version
danielgatis Apr 20, 2022
1aab8c8
Update README.md
danielgatis Apr 20, 2022
738cf15
add more models
danielgatis Apr 22, 2022
84a21b4
add more models
danielgatis Apr 22, 2022
7a4935a
add more models
danielgatis Apr 22, 2022
77ce4d7
fix mypy
danielgatis Apr 23, 2022
d57eba1
fix version
danielgatis Apr 26, 2022
2473aa7
fix version
danielgatis Apr 26, 2022
f339a11
allow all cors
danielgatis Apr 29, 2022
525dac1
update docker
danielgatis Apr 29, 2022
1208551
Fix docker image name in the readme
defaultpage Apr 30, 2022
8850298
Merge pull request #224 from artemmolotov/patch-1
danielgatis Apr 30, 2022
99edf83
Update cli.py to make POST method work
MadMaxInfinity May 27, 2022
25298b1
Merge pull request #235 from MadMaxInfinity/patch-2
danielgatis Jun 2, 2022
33e02fe
fix lint
danielgatis Jun 2, 2022
3bc1c1a
update pymatting
danielgatis Jun 17, 2022
997005a
Update README.md
KenjieDec Jun 25, 2022
06d97d1
Merge pull request #256 from KenjieDec/patch-1
danielgatis Jun 27, 2022
f387da9
add funding
danielgatis Jul 5, 2022
db696b3
add funding
danielgatis Jul 5, 2022
850f854
Update FUNDING.yml
danielgatis Jul 5, 2022
025b71e
Update README.md
danielgatis Jul 5, 2022
1e23b4c
Update README.md
danielgatis Jul 5, 2022
1adcc44
Update README.md
danielgatis Jul 6, 2022
8ee6e0b
Update issue templates
danielgatis Jul 6, 2022
9839adc
add close issues workflow
danielgatis Jul 6, 2022
f0cc993
added post processing
deshwalmahesh Jul 16, 2022
8267328
Update README.md
danielgatis Jul 28, 2022
6e9ec72
Update README.md
danielgatis Jul 28, 2022
5adde79
Update requirements.txt
danielgatis Jul 28, 2022
d7c9820
Update README.md
danielgatis Jul 29, 2022
5e3d2e6
Merge pull request #268 from deshwalmahesh/main
danielgatis Jul 30, 2022
b9e16e0
add mask post process
danielgatis Jul 30, 2022
37359b3
add mask post process
danielgatis Jul 30, 2022
552c19d
fix lint
danielgatis Jul 30, 2022
03f25da
opencv-python => opencv-python-headless
alexey-pelykh Aug 3, 2022
7c237e3
Merge pull request #275 from alexey-pelykh/use_headless_opencv
danielgatis Aug 4, 2022
fb3b9fe
fix: Expected RGB image of shape (?, ?, 3), but image.shape is (?, ?,…
goecho Aug 5, 2022
a11480e
Merge pull request #276 from goecho/main
danielgatis Aug 6, 2022
2e14094
Update the onnxruntime dependency version because the current one is …
repushko Aug 11, 2022
4746999
Merge pull request #279 from repushko/main
danielgatis Aug 11, 2022
d03508a
Update README.md
danielgatis Aug 16, 2022
f2efa5d
Update README.md
danielgatis Aug 16, 2022
e7a8a20
add tests
danielgatis Aug 24, 2022
6ca1cc3
add tests
danielgatis Aug 24, 2022
1c46b4c
[FTR] feature/thread-limiter | Add anyio thread limiter
Aleksandar1932 Aug 26, 2022
7854288
Merge pull request #290 from codechem/feature/thread-limiter
danielgatis Aug 27, 2022
1a893a7
fix lint
danielgatis Aug 28, 2022
e66d2f3
fix lint
danielgatis Sep 6, 2022
399f11c
Update README.md
danielgatis Sep 15, 2022
6e4b75d
Update README.md
danielgatis Sep 16, 2022
e39265f
session_factory: use $XDG_DATA_HOME instead of $HOME if possible
meequrox Nov 13, 2022
71ff1db
Merge pull request #341 from meequrox/use-xdg
danielgatis Nov 14, 2022
8afdfb9
fix lint
danielgatis Nov 15, 2022
10ce1d0
update deps / remove gdown
danielgatis Nov 24, 2022
a9c6c56
fix lint
danielgatis Nov 24, 2022
354f531
fix lint
danielgatis Nov 24, 2022
e9cc8cf
removed python 3.7
danielgatis Nov 24, 2022
d6a5602
fix docker
danielgatis Nov 24, 2022
738dd1f
add build-exe
danielgatis Nov 27, 2022
23189bf
add silueta model
danielgatis Nov 27, 2022
c72eb12
update readme
danielgatis Nov 28, 2022
edc9fe2
bump onnxruntime-gpu version
danielgatis Nov 28, 2022
545f44b
Specify compatible releases in `setup.py`
jangop Dec 7, 2022
7950c3c
Test installation
jangop Dec 7, 2022
e0ab9e5
Clarify names of actions
jangop Dec 7, 2022
5de947d
update to current PIL version
samiede Dec 9, 2022
1961a36
Merge pull request #358 from jangop/main
danielgatis Dec 9, 2022
79ab2b0
remove resampling from session_simple
samiede Dec 9, 2022
38d8d06
Merge branch 'danielgatis:main' into main
samiede Dec 9, 2022
d62227d
Merge pull request #362 from samiede/main
danielgatis Dec 10, 2022
3b86d9b
Update README.md
danielgatis Dec 14, 2022
3cf292b
Add Streamlit Cloud app URL and badge to README
snehankekre Dec 19, 2022
326ecf1
Merge pull request #369 from snehankekre/patch-1
danielgatis Dec 19, 2022
1586c1d
update readme
danielgatis Dec 28, 2022
a1b93db
Update README.md
danielgatis Dec 28, 2022
9d2cca1
Update README.md
danielgatis Dec 28, 2022
eb00a8f
Require younger fastapi
jangop Mar 8, 2023
02ebe4a
Format
jangop Mar 15, 2023
b510356
Reformat according to (updated?) black
jangop Mar 22, 2023
55c82a9
Merge branch 'main' into patch-1
jangop Mar 22, 2023
e7884e2
Require younger setuptools
jangop Mar 22, 2023
e2dc1e4
Install package
jangop Mar 22, 2023
d4bc3ef
Specify Python 3.10 for linting
jangop Mar 24, 2023
3169041
Ignore type
jangop Mar 24, 2023
10a37ba
Install setuptools > 65.5.0
jangop Mar 24, 2023
3dea620
Merge pull request #400 from jangop/patch-1
danielgatis Mar 25, 2023
74d7303
Update README.md
vincent-pradeilles Mar 28, 2023
3c20805
added support for isnet model
Flippchen Mar 28, 2023
5f2fdbc
added temp. download of new model
Flippchen Mar 28, 2023
4441fe4
Merge pull request #412 from vincent-pradeilles/main
danielgatis Mar 28, 2023
ece38e1
Merge pull request #413 from Flippchen/main
danielgatis Mar 29, 2023
a54000d
add dis model
danielgatis Mar 29, 2023
f0a2b8f
fix readme
danielgatis Mar 29, 2023
f027035
fix readme
danielgatis Mar 29, 2023
f602f49
fix readme
danielgatis Mar 29, 2023
96ce3cc
fix lint
danielgatis Mar 29, 2023
820e49e
fix isort
danielgatis Mar 29, 2023
6d5d086
added image background feature
Flippchen Mar 29, 2023
6862af7
fixed Lint
Flippchen Mar 29, 2023
09726ab
added source to readme
Flippchen Mar 29, 2023
ab425e8
added CLI Support
Flippchen Mar 29, 2023
f5837a1
fix pylint
Flippchen Mar 29, 2023
44cf919
Update README.md
danielgatis Mar 30, 2023
a9e1f08
Merge pull request #414 from Flippchen/main
danielgatis Mar 31, 2023
54cf4f8
add color bg param
danielgatis Mar 31, 2023
658ab42
fix lint
danielgatis Mar 31, 2023
939e389
updated onnxruntime to support new models
Flippchen Apr 20, 2023
83976f4
added Segment Anything model class
Flippchen Apr 20, 2023
106254c
edited session factory to support models with more than one model
Flippchen Apr 20, 2023
bb3c58f
fix lint
Flippchen Apr 20, 2023
ff38b9a
fix lint and refactored normalizing
Flippchen Apr 20, 2023
72d1c6c
reordered imports
Flippchen Apr 20, 2023
3bdc06d
order pylint
Flippchen Apr 20, 2023
d7828b0
added input for remove function
Flippchen Apr 20, 2023
394ab21
fix pylint
Flippchen Apr 20, 2023
1e31133
Merge pull request #431 from Flippchen/main
danielgatis Apr 20, 2023
c37bc75
added sam model to readme
Flippchen Apr 20, 2023
00766c5
added USAGE.md
Flippchen Apr 20, 2023
1ca14ce
refactoring
danielgatis Apr 21, 2023
dc45a47
refactoring
danielgatis Apr 21, 2023
c27f4e2
refactoring
danielgatis Apr 21, 2023
08a3bdc
refactoring
danielgatis Apr 21, 2023
106d96b
refactoring
danielgatis Apr 21, 2023
808a64b
refactoring
danielgatis Apr 21, 2023
2482b11
Merge branch 'main' into doc
danielgatis Apr 21, 2023
91379e8
Merge pull request #432 from Flippchen/doc
danielgatis Apr 21, 2023
c3fd1b4
fix typos in USAGE.md
Succubyss Apr 21, 2023
9252279
Merge pull request #433 from Succubyss/patch-1
danielgatis Apr 23, 2023
9a83062
fix #434
danielgatis Apr 24, 2023
f95e0cd
fixed mistake in usage.md
realiteesurf Apr 25, 2023
e47b2a0
Merge pull request #435 from realiteesurf/patch-1
danielgatis Apr 26, 2023
f2353d0
fix #434
danielgatis Apr 27, 2023
143a41e
added fix for image orientation
Flippchen May 7, 2023
ec29de6
Merge pull request #441 from Flippchen/fix_image_orientation
danielgatis May 7, 2023
645afeb
add bynary stream support based on #421
danielgatis May 8, 2023
c287d1c
add bynary stream support based on #421
danielgatis May 8, 2023
2ef798d
fix #443
danielgatis May 16, 2023
c360cf6
fix linters
danielgatis May 16, 2023
eb17968
add providers member to BaseSession
MCYBA May 23, 2023
022cb69
Update session_factory.py
MCYBA May 23, 2023
8383a70
Fix issue base.py
MCYBA May 23, 2023
8b6abef
Merge pull request #456 from MCYBA/main
danielgatis May 24, 2023
4140987
fix linters
danielgatis May 24, 2023
eeddfae
add anime model
danielgatis May 29, 2023
3c8a151
fix readme
danielgatis May 29, 2023
9372306
Update README.md
danielgatis May 29, 2023
f6159b4
add gradio
danielgatis May 30, 2023
2d12a01
fix lint
danielgatis May 30, 2023
b888db7
fix dependencies
danielgatis May 31, 2023
0766402
Add python 3.11 support (#446)
danielgatis Jun 1, 2023
fd0c871
fix dockerfile
danielgatis Jun 2, 2023
848a38e
fix dependencies
danielgatis Jun 2, 2023
3cbad20
Update USAGE.md (#467)
Aashrut Jun 16, 2023
bcb45a2
Split depedencies (#471)
danielgatis Jun 19, 2023
ced98d8
fix requirements
danielgatis Jun 19, 2023
4975829
Update Dockerfile
danielgatis Jun 20, 2023
8ce0b8f
Fix issue 474 (#475)
danielgatis Jun 21, 2023
8c02c27
Fix typos (#476)
kianmeng Jun 22, 2023
c0b08f8
Add a custom u2net session (#482)
danielgatis Jun 28, 2023
ccaa900
fix docker
danielgatis Jun 30, 2023
b527af6
fix docker
danielgatis Jun 30, 2023
a9026d0
fix docker
danielgatis Jun 30, 2023
acc526f
fix docker
danielgatis Jun 30, 2023
33bb506
fix #491
danielgatis Jul 12, 2023
18f4c20
fix lint
danielgatis Jul 13, 2023
a9c2a39
fix lint
danielgatis Jul 13, 2023
f0019d7
Add cloth category selection feature to u2net_cloth_seg (#485)
masonintokyo Jul 13, 2023
d54b62a
fix lint
danielgatis Jul 13, 2023
4b03a51
Update README.md
danielgatis Aug 25, 2023
7c1b3c4
Docker tags and multiarch support (#521)
robjuz Sep 26, 2023
43a907d
Apply thread limit to intra_op_num_threads
Lajcisvk Oct 6, 2023
a3d9a1e
Prepare docker image for dokku
Lajcisvk Oct 6, 2023
d282cfe
Change nginx template
Lajcisvk Oct 6, 2023
9783899
Lock package versions
Lajcisvk Nov 14, 2023
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*
!rembg
!setup.py
!setup.cfg
!requirements.txt
!requirements-cpu.txt
!requirements-gpu.txt
!versioneer.py
!README.md
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rembg/_version.py export-subst
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [danielgatis]
custom: ["https://www.buymeacoffee.com/danielgatis"]
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] ..."
labels: bug
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Images**
Input images to reproduce.

**OS Version:**
iOS 22

**Rembg version:**
v2.0.21

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] ..."
labels: enhancement
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/workflows/close_inactive_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Close inactive issues

on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint

on: [pull_request, push]

jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: pip install .[cli,dev]
- run: mypy --install-types --non-interactive --ignore-missing-imports ./rembg
- run: bandit --recursive --skip B101,B104,B310,B311,B303,B110 --exclude ./rembg/_version.py ./rembg
- run: black --force-exclude rembg/_version.py --check --diff ./rembg
- run: flake8 ./rembg --count --ignore=B008,C901,E203,E266,E731,F401,F811,F841,W503 --max-line-length=120 --show-source --statistics --exclude ./rembg/_version.py
- run: isort --check-only --profile black ./rembg
59 changes: 59 additions & 0 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish Docker image

on:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/rembg
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache,mode=max
24 changes: 24 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to Pypi

on:
push:
tags:
- "v*.*.*"

jobs:
push_to_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: pip install .[cli,dev]
- name: Builds and uploads to PyPI
run: |
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PIPY_PASSWORD }}
22 changes: 22 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test installation

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install .[cli,dev]
- name: Test installation with pytest
run: |
pytest
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# general things to ignore
build/
dist/
.venv/
.direnv/
*.spec
*.egg-info/
*.egg
*.py[cod]
__pycache__/
*.so
*~
*~≈
.envrc
.python-version
.idea
.pytest_cache

# due to using tox and pytest
.tox
.cache
.mypy_cache
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10-slim

WORKDIR /rembg

COPY . .

RUN python -m pip install -r requirements.txt
RUN python -m pip install ".[cli]"
RUN python -c 'from rembg.bg import download_models; download_models()'

EXPOSE 5000
ENTRYPOINT ["rembg"]
CMD ["s", "-t 8"]
18 changes: 8 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
include pyproject.toml

# Include the README
include *.md

# Include the license file
include MANIFEST.in
include LICENSE.txt

# Include the data files
recursive-include data *

include README.md
include setup.py
include pyproject.toml
include requirements.txt
include requirements-gpu.txt

include versioneer.py
include rembg/_version.py
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# keep help at the beginning - this will be used as default command
.description: Generate list of targets with descriptions
help:
@grep -oz '^.description: .*\n.*:' Makefile | sed 'N;s;\.description: \(.*\)\n\(.*\):;"\x1b[1\;32m make \2 \x1b[0m" "\1";' | xargs printf "%-50s - %s\n"

# MACROS

DOCKER = docker-compose -f docker-compose.development.yml
DOCKER_DEV = $(DOCKER)
CFLAGS='-Wno-warning'

# use the rest as arguments for "run"
ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`

# COMMANDS

# common
.description: start all services in DEVELOPMENT environment
start:
make stop backend
$(DOCKER_DEV) --profile all up -d

.description: stop all app services. You can pass service name as an argument
stop:
$(DOCKER) --profile all stop $(call ARGS)

.description: stop all services
down:
$(DOCKER) --profile all down

.description: build docker images
build:
$(DOCKER_DEV) --profile all build

.description: docker logs with follow option. You can pass service name as argument.
flogs:
$(DOCKER) logs --follow $(call ARGS)

.description: docker logs. You can pass service name as argument.
logs:
$(DOCKER) logs $(call ARGS)

.description: exec in the running service (pass service name and command as an argument). `make exec redis redis-cli`
exec:
$(DOCKER) exec $(call ARGS)

.description: attaches to backend process stdin
attach:
docker attach --detach-keys=ctrl-c $$($(DOCKER_DEV) ps -q backend)

.description: launches bash in backend container
bash:
$(DOCKER_DEV) exec backend bash

# Ignore unknown targets
%:
@:

# ...and turn them into do-nothing targets
_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(_ARGS):dummy;@:)
Loading