Skip to content

Commit

Permalink
Merge pull request #144 from OPHoperHPO/req-update
Browse files Browse the repository at this point in the history
RC-4.1.1 small http api fix and requirements update
  • Loading branch information
OPHoperHPO authored Dec 28, 2023
2 parents 2935e46 + 5256ac8 commit c23e60b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test_package:
strategy:
matrix:
python-version: [3.8, 3.9, 3.10.4]
python-version: [3.9, 3.10.4, 3.11.7]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.10.4 as builder
WORKDIR /app

# Models download stage
RUN pip3 install --no-cache-dir tqdm==4.64.0 requests==2.27.1
RUN pip3 install --no-cache-dir tqdm==4.66.1 requests==2.31.0
RUN mkdir -p ./carvekit/utils/
RUN mkdir -p ./carvekit/ml/files
COPY ./carvekit/__init__.py ./carvekit/__init__.py
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.10.4 as builder
WORKDIR /app

# Models download stage
RUN pip3 install --no-cache-dir tqdm==4.64.0 requests==2.27.1
RUN pip3 install --no-cache-dir tqdm==4.66.1 requests==2.31.0
RUN mkdir -p ./carvekit/utils/
RUN mkdir -p ./carvekit/ml/files
COPY ./carvekit/__init__.py ./carvekit/__init__.py
Expand All @@ -14,15 +14,15 @@ COPY ./carvekit/ml/files/models_loc.py ./carvekit/ml/files/models_loc.py
RUN python3 -c "from carvekit.ml.files.models_loc import download_all; download_all();"
RUN rm -rf ./carvekit

FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime
FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime
WORKDIR /app

RUN apt-get update && apt-get -y install libgl1 libglib2.0-0 # Install cv2 dep.
COPY --from=builder /root/.cache/carvekit /root/.cache/carvekit

# Install requirements
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu113
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements_test.txt ./
RUN pip3 install --no-cache-dir -r requirements_test.txt

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ It can be briefly described as

## 🏷 Setup for CPU processing:
1. `pip install carvekit --extra-index-url https://download.pytorch.org/whl/cpu`
> The project supports python versions from 3.8 to 3.10.4
> The project has been tested on Python versions ranging from 3.9 to 3.11.7.
## 🏷 Setup for GPU processing:
1. Make sure you have an NVIDIA GPU with 8 GB VRAM.
2. Install `CUDA Toolkit and Video Driver for your GPU`
3. `pip install carvekit --extra-index-url https://download.pytorch.org/whl/cu113`
> The project supports python versions from 3.8 to 3.10.4
2. Install `CUDA Toolkit 12.1 and Video Driver for your GPU`
3. `pip install carvekit --extra-index-url https://download.pytorch.org/whl/cu121`
> The project has been tested on Python versions ranging from 3.9 to 3.11.7.
## 🧰 Interact via code:
### If you don't need deep configuration or don't want to deal with it
``` python
Expand Down
4 changes: 2 additions & 2 deletions carvekit/web/routers/api_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ async def removebg(
scale=scale,
position=position,
channels=channels,
add_shadow=add_shadow,
semitransparency=semitransparency,
add_shadow="false",
semitransparency="false",
bg_color=bg_color,
)
except ValidationError as e:
Expand Down
31 changes: 15 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
requests~=2.27.1
torch~=1.11.0
Pillow==9.0.1
requests~=2.31.0
torch~=2.1.2
Pillow==10.1.0
typing~=3.7.4.3
torchvision~=0.12.0
opencv-python~=4.5.5.64
numpy~=1.22.4
loguru~=0.6.0
uvicorn~=0.17.6
fastapi~=0.78.0
starlette~=0.19.1
pydantic~=1.9.1
click~=8.1.3
tqdm~=4.64.0
setuptools~=62.3.2
aiofiles~=0.8.0
python-multipart~=0.0.5
torchvision~=0.16.2
opencv-python~=4.8.1.78
numpy~=1.26.2
loguru~=0.7.2
uvicorn~=0.25.0
fastapi~=0.108.0
pydantic~=2.5.3
click~=8.1.7
tqdm~=4.66.1
setuptools~=69.0.3
aiofiles~=23.2.1
python-multipart~=0.0.6
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pre-commit==2.20.0
pre-commit==3.6.0

2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest~=7.0.0
pytest~=7.4.3

0 comments on commit c23e60b

Please sign in to comment.