Skip to content

Commit 1c7dc82

Browse files
committed
elastichash and python update
1 parent 2edeb19 commit 1c7dc82

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ https://uni-marburg.de/ntzdY
1717

1818
![Demo](images/demo.png)
1919

20+
## Install
21+
22+
If you don't need the whole system but only the Elasticsearch index please use [elastichash](https://github.com/nik-ko/elastichash/) package:
23+
24+
`pip install elastichash`
25+
2026
## Usage
2127

2228
Perform image similarity search on ~7M images of the OpenImages dataset.

dh/app/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_hashcode_str(floatarr):
1919
:param floatarr: np.array
2020
:return: string
2121
"""
22-
code = (floatarr > 0).astype(np.int)
22+
code = (floatarr > 0).astype(int)
2323
s = "".join(map(str, code))
2424
return s
2525

dh/docker-compose.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- TF_SERVING_HOST=tf-serving
1414
- TF_SERVING_PORT=8501
1515
- TF_MODELNAME=${TF_MODELNAME}
16-
- GUNICORN_WORKERS=4
16+
- GUNICORN_WORKERS=5
1717
- IMG_WIDTH=300
1818
- IMG_HEIGHT=300
1919

@@ -48,7 +48,8 @@ services:
4848

4949
elasticsearch:
5050
container_name: dh_elasticsearch
51-
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
51+
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.4 # 7.17.13 #8.10.4
52+
# First upgrade to 7.17, see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html
5253
restart: always
5354
environment:
5455
- "ES_JAVA_OPTS=-Xms768m -Xmx768m"

dh/docker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM python:3.7.3-slim
1+
FROM python:3.10
22
RUN apt update && apt install -y wget
33
RUN python -m pip install --upgrade --force-reinstall pip
44
COPY app/requirements.txt .
5+
RUN python -m pip install -U --force-reinstall pip
56
RUN pip3 install --no-cache-dir -r requirements.txt
67
RUN rm requirements.txt
78
RUN rm -rf ~/.cache ~/.local

experiments/docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7.3-slim
1+
FROM python:3.10
22
RUN apt update && apt install -y wget libpq-dev python-dev build-essential gcc
33
RUN pip install --upgrade pip
44
RUN pip3 install \
@@ -19,4 +19,4 @@ RUN rm -rf ~/.cache ~/.local
1919

2020
EXPOSE 8888
2121

22-
CMD ["jupyter", "lab", "--allow-root", "--ip", "0.0.0.0"]
22+
CMD ["jupyter", "lab", "--allow-root", "--ip", "0.0.0.0"]

0 commit comments

Comments
 (0)