diff --git a/.gitignore b/.gitignore index 75124ed..8397867 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ __pycache__/ venv/ .env -presets/ \ No newline at end of file +presets/ +pictures/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..539606b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM python:3.12-slim +WORKDIR /usr/src/app +COPY . . +#RUN cp .env.exp .env +#RUN sed -i 's|SERVER_HOST=127.0.0.1|SERVER_HOST=0.0.0.0|' .env + + +RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ + --mount=target=/var/cache/apt,type=cache,sharing=locked \ + rm -f /etc/apt/apt.conf.d/docker-clean \ + && apt-get update \ + && apt-get install ffmpeg libsm6 libxext6 -y + + +#RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y +RUN pip install --cache-dir=/tmp/pipcache --upgrade pip +RUN pip list --cache-dir=/tmp/pipcache --outdated +RUN pip install --cache-dir=/tmp/pipcache -r requirements.txt +#RUN pip install pdm +#RUN pdm install +#CMD ["pdm", "run", "python3", "main.py"] +#CMD ["python3", "run.py"] +#CMD ["python3", "run.py" ,"--threshold 0.5" ,"--file thereneerose_0002.jpg" ,"--rawtag"] +#CMD ["python3", "run.py" ,"--threshold","0.5" ,"--file", "thereneerose_0002.jpg" ,"--rawtag"] + +#CMD ["python3 run.py --threshold 0.5 --file thereneerose_0002.jpg --rawtag"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bca7def --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +--- +version: "2" +services: + wd14-tagger-standalone: + build: . + container_name: wd14-tagger-standalone + volumes: + - ./pictures:/pictures + restart: unless-stopped + command: sleep 3600 diff --git a/requirements.txt b/requirements.txt index 72d2e3a..9dd5bec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -numpy==2.2.2 +numpy pandas==2.2.3 Pillow==11.1.0 huggingface-hub==0.28.1 deepdanbooru==1.0.3 -onnxruntime==1.20.1 +onnxruntime opencv-python==4.11.0.86