diff --git a/docs/docs/install/environment-variables.md b/docs/docs/install/environment-variables.md index a33afd4f50..4193cc971c 100644 --- a/docs/docs/install/environment-variables.md +++ b/docs/docs/install/environment-variables.md @@ -167,9 +167,7 @@ Redis (Sentinel) URL example JSON before encoding: | `MACHINE_LEARNING_DEVICE_IDS`\*4 | Device IDs to use in multi-GPU environments | `0` | machine learning | | `MACHINE_LEARNING_MAX_BATCH_SIZE__FACIAL_RECOGNITION` | Set the maximum number of faces that will be processed at once by the facial recognition model | None (`1` if using OpenVINO) | machine learning | | `MACHINE_LEARNING_RKNN` | Enable RKNN hardware acceleration if supported | `True` | machine learning | -| `MACHINE_LEARNING_RKNN_TEXTUAL_THREADS` | How many threads of RKNN runtime should be spinned up while infrencing textual model. | `1` | machine learning | -| `MACHINE_LEARNING_RKNN_VISUAL_THREADS` | How many threads of RKNN runtime should be spinned up while infrencing visual model. | `1` | machine learning | -| `MACHINE_LEARNING_RKNN_FACIAL_THREADS` | How many threads of RKNN runtime should be spinned up while infrencing facial model. | `1` | machine learning | +| `MACHINE_LEARNING_RKNN_THREADS` | How many threads of RKNN runtime should be spinned up while inferencing. | `1` | machine learning | \*1: It is recommended to begin with this parameter when changing the concurrency levels of the machine learning service and then tune the other ones. diff --git a/machine-learning/app/config.py b/machine-learning/app/config.py index 2782b82b45..932e12a230 100644 --- a/machine-learning/app/config.py +++ b/machine-learning/app/config.py @@ -45,9 +45,7 @@ class Settings(BaseSettings): ann_fp16_turbo: bool = False ann_tuning_level: int = 2 rknn: bool = True - rknn_textual_threads: int = 1 - rknn_visual_threads: int = 1 - rknn_facial_detection_threads: int = 1 + rknn_threads: int = 1 preload: PreloadModelData | None = None max_batch_size: MaxBatchSize | None = None diff --git a/machine-learning/app/sessions/rknn.py b/machine-learning/app/sessions/rknn.py index fd79884be6..0ad3b7d52b 100644 --- a/machine-learning/app/sessions/rknn.py +++ b/machine-learning/app/sessions/rknn.py @@ -24,12 +24,7 @@ class RknnSession: self.model_path = Path(str(model_path).replace("model", soc_name)) self.ort_model_path = Path(str(self.model_path).replace(f"{soc_name}.rknn", "model.onnx")) - if "textual" in str(self.model_path): - self.tpe = settings.rknn_textual_threads - elif "visual" in str(self.model_path): - self.tpe = settings.rknn_visual_threads - else: - self.tpe = settings.rknn_facial_detection_threads + self.tpe = settings.rknn_threads log.info(f"Loading RKNN model from {self.model_path} with {self.tpe} threads.") self.rknnpool = RknnPoolExecutor(rknnModel=self.model_path.as_posix(), tpes=self.tpe, func=runInfrence)