mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-01 06:03:43 +08:00
more explicit
This commit is contained in:
@@ -41,14 +41,18 @@ def get_nn_model_path(CP: structs.CarParams) -> tuple[str | None, str, bool]:
|
||||
if len(eps_fw) > 3:
|
||||
eps_fw = eps_fw.replace("\\", "")
|
||||
nn_candidate = f"{car_fingerprint} {eps_fw}"
|
||||
else:
|
||||
nn_candidate = car_fingerprint
|
||||
model_path, max_similarity = check_nn_path(nn_candidate)
|
||||
if car_fingerprint not in model_path or 0.0 <= max_similarity < 0.9:
|
||||
nn_candidate = car_fingerprint
|
||||
model_path, max_similarity = check_nn_path(nn_candidate)
|
||||
if car_fingerprint not in model_path or 0.0 <= max_similarity < 0.9:
|
||||
model_path = None
|
||||
|
||||
if model_path is not None and car_fingerprint in model_path and max_similarity >= 0.9:
|
||||
model_name = os.path.splitext(os.path.basename(model_path))[0]
|
||||
exact_match = max_similarity >= 0.99
|
||||
return model_path, model_name, exact_match
|
||||
|
||||
nn_candidate = car_fingerprint
|
||||
model_path, max_similarity = check_nn_path(nn_candidate)
|
||||
|
||||
if model_path is None or car_fingerprint not in model_path or max_similarity < 0.9:
|
||||
model_path = None
|
||||
|
||||
if model_path is not None:
|
||||
model_name = os.path.splitext(os.path.basename(model_path))[0]
|
||||
|
||||
Reference in New Issue
Block a user