diff --git a/api/config/config.go b/api/config/config.go index c18a9dd..06b3c63 100644 --- a/api/config/config.go +++ b/api/config/config.go @@ -67,11 +67,11 @@ type ( Faces bool `envconfig:"SMRITI_ML_FACES" default:"true"` PlacesProvider string `envconfig:"SMRITI_ML_PLACES_PROVIDER" default:"openstreetmap"` ClassificationProvider string `envconfig:"SMRITI_ML_CLASSIFICATION_PROVIDER" default:"pytorch"` - ClassificationParams string `envconfig:"SMRITI_ML_CLASSIFICATION_PARAMS" default:"{\"file\":\"classification_v240615.pt\"}"` + ClassificationParams string `envconfig:"SMRITI_ML_CLASSIFICATION_PARAMS" default:"{\"file\":\"classification_v240624.pt\"}"` OCRProvider string `envconfig:"SMRITI_ML_OCR_PROVIDER" default:"paddlepaddle"` OCRParams string `envconfig:"SMRITI_ML_OCR_PARAMS" default:"{\"det_model_dir\":\"det_onnx\",\"rec_model_dir\":\"rec_onnx\",\"cls_model_dir\":\"cls_onnx\"}"` SearchProvider string `envconfig:"SMRITI_ML_SEARCH_PROVIDER" default:"pytorch"` - SearchParams string `envconfig:"SMRITI_ML_SEARCH_PARAMS" default:"{\"tokenizer_dir\":\"search_tokenizer\",\"processor_dir\":\"search_processor\",\"text_file\":\"search_text_v240615.pt\",\"vision_file\":\"search_vision_v240615.pt\"}"` //nolint:lll + SearchParams string `envconfig:"SMRITI_ML_SEARCH_PARAMS" default:"{\"tokenizer_dir\":\"search_tokenizer\",\"processor_dir\":\"search_processor\",\"text_file\":\"search_text_v240624.pt\",\"vision_file\":\"search_vision_v240624.pt\"}"` //nolint:lll FacesProvider string `envconfig:"SMRITI_ML_FACES_PROVIDER" default:"pytorch"` FacesParams string `envconfig:"SMRITI_ML_FACES_PARAMS" default:"{\"minutes\":\"1\",\"face_threshold\":\"0.9\",\"model\":\"vggface2\",\"clustering\":\"annoy\"}"` PreviewThumbnailParams string `envconfig:"SMRITI_ML_PREVIEW_THUMBNAIL_PARAMS" default:"{\"thumbnail_size\":\"512\"}"` diff --git a/api/go.mod b/api/go.mod index 2d01081..c5082bb 100644 --- a/api/go.mod +++ b/api/go.mod @@ -12,7 +12,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/labstack/echo-contrib v0.17.1 github.com/labstack/echo/v4 v4.12.0 - github.com/minio/minio-go/v7 v7.0.71 + github.com/minio/minio-go/v7 v7.0.72 github.com/pgvector/pgvector-go v0.1.1 github.com/prometheus/client_golang v1.19.1 github.com/satori/go.uuid v1.2.0 diff --git a/api/go.sum b/api/go.sum index d7a4941..0f20194 100644 --- a/api/go.sum +++ b/api/go.sum @@ -72,8 +72,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.71 h1:No9XfOKTYi6i0GnBj+WZwD8WP5GZfL7n7GOjRqCdAjA= -github.com/minio/minio-go/v7 v7.0.71/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo= +github.com/minio/minio-go/v7 v7.0.72 h1:ZSbxs2BfJensLyHdVOgHv+pfmvxYraaUy07ER04dWnA= +github.com/minio/minio-go/v7 v7.0.72/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= diff --git a/docs/docs/user-guide/features/search.md b/docs/docs/user-guide/features/search.md index b517b8e..e01e9db 100644 --- a/docs/docs/user-guide/features/search.md +++ b/docs/docs/user-guide/features/search.md @@ -3,7 +3,7 @@ Enable this feature using API Configuration: ```bash SMRITI_ML_SEARCH: true SMRITI_ML_SEARCH_PROVIDER: pytorch -SMRITI_ML_SEARCH_PARAMS: {"tokenizer_dir":"search_tokenizer","processor_dir":"search_processor","text_file":"search_text_v240615.pt","vision_file":"search_vision_v240615.pt"} +SMRITI_ML_SEARCH_PARAMS: {"tokenizer_dir":"search_tokenizer","processor_dir":"search_processor","text_file":"search_text_v240624.pt","vision_file":"search_vision_v240624.pt"} ``` ## Use Cases diff --git a/docs/docs/user-guide/features/things.md b/docs/docs/user-guide/features/things.md index 468f868..5b9c6f8 100644 --- a/docs/docs/user-guide/features/things.md +++ b/docs/docs/user-guide/features/things.md @@ -4,7 +4,7 @@ Enable this feature using API Configuration: SMRITI_FEATURE_THINGS: true SMRITI_ML_CLASSIFICATION: true SMRITI_ML_CLASSIFICATION_PROVIDER: pytorch -SMRITI_ML_CLASSIFICATION_PARAMS: {"file":"classification_v240615.pt"} +SMRITI_ML_CLASSIFICATION_PARAMS: {"file":"classification_v240624.pt"} ``` ## Use Cases diff --git a/docs/package-lock.json b/docs/package-lock.json index 253b52a..14fce31 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,12 +1,12 @@ { "name": "smriti", - "version": "24.06.15", + "version": "24.06.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "smriti", - "version": "24.06.15", + "version": "24.06.24", "dependencies": { "@babel/traverse": "^7.24.7", "@docusaurus/core": "^3.4.0", @@ -3648,9 +3648,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.14.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz", - "integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==", + "version": "20.14.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", + "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", "dependencies": { "undici-types": "~5.26.4" } @@ -5934,9 +5934,9 @@ } }, "node_modules/docusaurus-plugin-redoc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/docusaurus-plugin-redoc/-/docusaurus-plugin-redoc-2.0.2.tgz", - "integrity": "sha512-J4pfu+dvwm1D4qWA6O8FT6EYSw9R1mv9fIXCqKh7aHYD+OU19hj/vQQUdjIbAwTcOkBg+eUYVXvdopwTvUXNcQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-redoc/-/docusaurus-plugin-redoc-2.1.0.tgz", + "integrity": "sha512-uz1rjUTuUpTxg0Y3xX3GkBc0DYdTO6/Au6MMXxoTwzlJiHSq0+pAG/i729mDs1TOpEu/psSyJxhM0hv85Li75w==", "dependencies": { "@redocly/openapi-core": "1.10.3", "redoc": "2.1.3" @@ -6087,9 +6087,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.807", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.807.tgz", - "integrity": "sha512-kSmJl2ZwhNf/bcIuCH/imtNOKlpkLDn2jqT5FJ+/0CXjhnFaOa9cOe9gHKKy71eM49izwuQjZhKk+lWQ1JxB7A==" + "version": "1.4.810", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.810.tgz", + "integrity": "sha512-Kaxhu4T7SJGpRQx99tq216gCq2nMxJo+uuT6uzz9l8TVN2stL7M06MIIXAtr9jsrLs2Glflgf2vMQRepxawOdQ==" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -6323,12 +6323,11 @@ } }, "node_modules/estree-util-value-to-estree": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-3.1.1.tgz", - "integrity": "sha512-5mvUrF2suuv5f5cGDnDphIy4/gW86z82kl5qG6mM9z04SEQI4FB5Apmaw/TGEf3l55nLtMs5s51dmhUzvAHQCA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-3.1.2.tgz", + "integrity": "sha512-S0gW2+XZkmsx00tU2uJ4L9hUT7IFabbml9pHh2WQqFmAbxit++YGZne0sKJbNwkj9Wvg9E4uqWl4nCIFQMmfag==", "dependencies": { - "@types/estree": "^1.0.0", - "is-plain-obj": "^4.0.0" + "@types/estree": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/remcohaszing" @@ -8090,11 +8089,14 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11268,9 +11270,12 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -12980,11 +12985,11 @@ } }, "node_modules/redocusaurus": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/redocusaurus/-/redocusaurus-2.0.2.tgz", - "integrity": "sha512-o71XY24IkqCWVUF39UpVbklvKilbI5LfqPPeD5yhuaME87agsIHpRNdvifdPIK0oAQog4RMjDM+qMRqKUB414A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/redocusaurus/-/redocusaurus-2.1.0.tgz", + "integrity": "sha512-PJ7Tlx9CVHjXdWDvUZzyZ2ymwF4uais5MTXZI0iTI13T7ADa6Zdcd5MhcnhBdDBWL8/jrSHl9+X1af1BsnP9Qg==", "dependencies": { - "docusaurus-plugin-redoc": "2.0.2", + "docusaurus-plugin-redoc": "2.1.0", "docusaurus-theme-redoc": "2.0.2" }, "engines": { @@ -14640,9 +14645,9 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "peer": true, "bin": { "tsc": "bin/tsc", diff --git a/docs/package.json b/docs/package.json index 6c01a5e..c542bfb 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "smriti", - "version": "24.06.15", + "version": "24.06.24", "private": true, "scripts": { "docusaurus": "docusaurus", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 4638410..4b1b6b4 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Smriti API description: Smarter Home for all your Photos and Videos - version: 24.06.15 + version: 24.06.24 servers: - url: https://localhost:5001 tags: @@ -1460,7 +1460,7 @@ components: properties: version: type: string - example: 24.06.15 + example: 24.06.24 gitSha: type: string example: addf120b430021c36c232c99ef8d926aea2acd6b diff --git a/ml/requirements.txt b/ml/requirements.txt index fc4a873..866bf41 100644 --- a/ml/requirements.txt +++ b/ml/requirements.txt @@ -8,7 +8,7 @@ paddlepaddle==2.6.1 rapidocr-onnxruntime==1.3.22 setuptools==70.0.0 six==1.16.0 -torch==2.3.0 -torchvision==0.18.0 +torch==2.3.1 +torchvision==0.18.1 transformers==4.41.2 urllib3==2.2.2 diff --git a/worker/requirements.txt b/worker/requirements.txt index c275abb..291887a 100644 --- a/worker/requirements.txt +++ b/worker/requirements.txt @@ -14,7 +14,7 @@ rapidocr-onnxruntime==1.3.22 rawpy==0.21.0 requests==2.32.3 schedule==1.2.2 -torch==2.3.0 -torchvision==0.18.0 +torch==2.3.1 +torchvision==0.18.1 transformers==4.41.2 Wand==0.6.13 diff --git a/worker/src/main.py b/worker/src/main.py index 642181d..1522fd2 100644 --- a/worker/src/main.py +++ b/worker/src/main.py @@ -136,7 +136,7 @@ async def serve() -> None: # pylint: disable=too-many-locals components.append(Finalize(api_stub=api_stub)) # initialize worker grpc server - grpc_server = grpc.aio.server() + grpc_server = grpc.aio.server(maximum_concurrent_rpcs=int(os.getenv('SMRITI_WORKER_CONCURRENT_RPCS', '5'))) add_WorkerServicer_to_server(WorkerService(components, search_model), grpc_server) port = int(os.getenv('SMRITI_WORKER_PORT', '15002')) grpc_server.add_insecure_port(f'[::]:{port}')