fix granularity

This commit is contained in:
yoni13
2025-01-18 09:58:39 +08:00
parent 05675921be
commit 3634ae1f5b
3 changed files with 3 additions and 12 deletions
+1 -3
View File
@@ -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
+1 -6
View File
@@ -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)