Compare commits

...

6 Commits

Author SHA1 Message Date
Nicolas Mowen
71e11d7703 Remove testing 2025-08-21 05:25:48 -06:00
Nicolas Mowen
0cd0ccd131 Clarify supported models 2025-08-21 05:23:06 -06:00
Nicolas Mowen
36b1f153e8 Change normalization for better accuracy 2025-08-21 05:21:52 -06:00
Nicolas Mowen
ba5030a84d Cleanup 2025-08-21 04:57:02 -06:00
Nicolas Mowen
2ba9a3ddad Handle inputs 2025-08-21 04:54:00 -06:00
Nicolas Mowen
9c8ca75ce4 Fix path handling 2025-08-20 20:39:17 -06:00
4 changed files with 19 additions and 14 deletions

View File

@ -9,7 +9,7 @@ build-rk: version
docker buildx bake --file=docker/rockchip/rk.hcl rk \
--set rk.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rk
push-rk: version
push-rk: build-rk
docker buildx bake --file=docker/rockchip/rk.hcl rk \
--set rk.tags=crzynik/frigate:rk \
--set rk.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rk \
--push

View File

@ -24,7 +24,7 @@ Object detection and enrichments (like Semantic Search, Face Recognition, and Li
- Jetson devices will automatically be detected and used for enrichments in the `-tensorrt-jp6` Frigate image.
- **RockChip**
- RockChip NPU will automatically be detected and used for semantic search in the `-rk` Frigate image.
- RockChip NPU will automatically be detected and used for semantic search (v1 only) in the `-rk` Frigate image.
Utilizing a GPU for enrichments does not require you to use the same GPU for object detection. For example, you can run the `tensorrt` Docker image for enrichments and still use other dedicated hardware like a Coral or Hailo for object detection. However, one combination that is not supported is TensorRT for object detection and OpenVINO for enrichments.

View File

@ -9,7 +9,7 @@ import onnxruntime as ort
from frigate.const import MODEL_CACHE_DIR
from frigate.util.model import get_ort_providers
from frigate.util.rknn_converter import is_rknn_compatible, auto_convert_model
from frigate.util.rknn_converter import auto_convert_model, is_rknn_compatible
try:
import openvino as ov
@ -257,5 +257,5 @@ class RKNNModelRunner:
if self.rknn:
try:
self.rknn.release()
except:
except Exception:
pass

View File

@ -28,22 +28,18 @@ MODEL_TYPE_CONFIGS = {
"target_platform": None, # Will be set dynamically
},
"jina-clip-v1-vision": {
"mean_values": [
[0.48145466, 0.4578275, 0.40821073]
], # CLIP standard normalization
"std_values": [
[0.26862954, 0.26130258, 0.27577711]
], # CLIP standard normalization
"mean_values": [[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255]],
"std_values": [[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255]],
"target_platform": None, # Will be set dynamically
},
}
def get_rknn_model_type(model_path: str) -> str | None:
if all(keyword in model_path for keyword in ["jina-clip-v1", "vision"]):
if all(keyword in str(model_path) for keyword in ["jina-clip-v1", "vision"]):
return "jina-clip-v1-vision"
model_name = os.path.basename(model_path).lower()
model_name = os.path.basename(str(model_path)).lower()
if any(keyword in model_name for keyword in ["yolo", "yolox", "yolonas"]):
return model_name
@ -182,7 +178,16 @@ def convert_onnx_to_rknn(
rknn = RKNN(verbose=True)
rknn.config(**config)
if rknn.load_onnx(model=onnx_path) != 0:
if model_type == "jina-clip-v1-vision":
load_output = rknn.load_onnx(
model=onnx_path,
inputs=["pixel_values"],
input_size_list=[[1, 3, 224, 224]],
)
else:
load_output = rknn.load_onnx(model=onnx_path)
if load_output != 0:
logger.error("Failed to load ONNX model")
return False