mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
RKNN: Fix broken models for Toolkit v2.3.2 (#19189)
* update models * don't set input_dtype: float for yolov9 (rknn)
This commit is contained in:
parent
1763dba9c2
commit
60923ac1e3
@ -894,7 +894,6 @@ model: # required
|
|||||||
width: 320
|
width: 320
|
||||||
height: 320
|
height: 320
|
||||||
input_tensor: nhwc
|
input_tensor: nhwc
|
||||||
input_dtype: float
|
|
||||||
labelmap_path: /labelmap/coco-80.txt
|
labelmap_path: /labelmap/coco-80.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class Rknn(DetectionApi):
|
|||||||
model_props["model_type"] = model_type
|
model_props["model_type"] = model_type
|
||||||
|
|
||||||
if model_matched:
|
if model_matched:
|
||||||
model_props["filename"] = model_path + f"-{soc}-v2.3.2-1.rknn"
|
model_props["filename"] = model_path + f"-{soc}-v2.3.2-2.rknn"
|
||||||
|
|
||||||
model_props["path"] = model_cache_dir + model_props["filename"]
|
model_props["path"] = model_cache_dir + model_props["filename"]
|
||||||
|
|
||||||
@ -140,26 +140,10 @@ class Rknn(DetectionApi):
|
|||||||
os.mkdir(model_cache_dir)
|
os.mkdir(model_cache_dir)
|
||||||
|
|
||||||
urllib.request.urlretrieve(
|
urllib.request.urlretrieve(
|
||||||
f"https://github.com/MarcA711/rknn-models/releases/download/v2.3.2/{filename}",
|
f"https://github.com/MarcA711/rknn-models/releases/download/v2.3.2-2/{filename}",
|
||||||
model_cache_dir + filename,
|
model_cache_dir + filename,
|
||||||
)
|
)
|
||||||
|
|
||||||
def check_config(self, config):
|
|
||||||
if (config.model.width != 320) or (config.model.height != 320):
|
|
||||||
raise Exception(
|
|
||||||
"Make sure to set the model width and height to 320 in your config."
|
|
||||||
)
|
|
||||||
|
|
||||||
if config.model.input_pixel_format != "bgr":
|
|
||||||
raise Exception(
|
|
||||||
'Make sure to set the model input_pixel_format to "bgr" in your config.'
|
|
||||||
)
|
|
||||||
|
|
||||||
if config.model.input_tensor != "nhwc":
|
|
||||||
raise Exception(
|
|
||||||
'Make sure to set the model input_tensor to "nhwc" in your config.'
|
|
||||||
)
|
|
||||||
|
|
||||||
def post_process_yolonas(self, output: list[np.ndarray]):
|
def post_process_yolonas(self, output: list[np.ndarray]):
|
||||||
"""
|
"""
|
||||||
@param output: output of inference
|
@param output: output of inference
|
||||||
|
Loading…
Reference in New Issue
Block a user