forked from Ivasoft/geovisio-sgblur
Compare commits
6 Commits
dependabot
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f054a19f8 | |||
| 87a389eceb | |||
| 9098b7703c | |||
| 0231d0cede | |||
| 9479b4bd75 | |||
| 2d83eb997b |
16
.drone.yml
Normal file
16
.drone.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: https://git.ivasoft.cz
|
||||
username:
|
||||
from_secret: repo_user
|
||||
password:
|
||||
from_secret: repo_pass
|
||||
repo: git.ivasoft.cz/sw/geovisio-sgblur
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_TAG:-latest}
|
||||
@@ -27,7 +27,12 @@ RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY ./requirements.txt ./
|
||||
RUN pip install -r ./requirements.txt
|
||||
RUN pip install -r ./requirements.txt && \
|
||||
# Install torch and torchvision CPU only versions
|
||||
pip install torch==2.2.1+cpu torchvision==0.17.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html && \
|
||||
#Explicitly install ultralytics without optional dependencies (like CUDA). (see https://github.com/ultralytics/ultralytics/issues/749)
|
||||
pip install ultralytics==8.1.19 --no-deps && \
|
||||
pip cache purge
|
||||
|
||||
# Source files
|
||||
COPY ./src ./src
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
ultralytics==8.1.19
|
||||
pyturbojpeg==1.7.3
|
||||
Pillow-simd==9.0.0.post1
|
||||
uuid==1.30
|
||||
@@ -7,3 +6,15 @@ python-multipart==0.0.9
|
||||
fastapi==0.110.0
|
||||
uvicorn==0.27.1
|
||||
requests==2.31.0
|
||||
opencv-python-headless==4.8.1.78
|
||||
numpy==1.26.0
|
||||
matplotlib>=3.3.0
|
||||
opencv-python>=4.6.0
|
||||
pillow>=7.1.2
|
||||
pyyaml>=5.3.1
|
||||
scipy>=1.4.1
|
||||
tqdm>=4.64.0
|
||||
pandas>=1.1.4
|
||||
psutil
|
||||
dill
|
||||
py-cpuinfo
|
||||
@@ -1,6 +1,6 @@
|
||||
from fastapi import FastAPI, UploadFile, Response
|
||||
import gc
|
||||
from . import blur
|
||||
from . import blur_monolith as blur
|
||||
import json
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@@ -36,7 +36,10 @@ def blurPicture(picture, keep):
|
||||
if 'SGBLUR_GPUS' in os.environ:
|
||||
gpu = pid % int(os.environ['SGBLUR_GPUS'])
|
||||
else:
|
||||
gpu = pid % torch.cuda.device_count()
|
||||
if torch.cuda.device_count() > 0:
|
||||
gpu = pid % torch.cuda.device_count()
|
||||
else:
|
||||
gpu = None
|
||||
|
||||
# copy received JPEG picture to temporary file
|
||||
tmp = '/dev/shm/blur%s.jpg' % pid
|
||||
Reference in New Issue
Block a user