[中] 分析阶段用 try? 把模型推理错误当成「没有检测到」
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- swift
- Domain
- machine-learning
Research direction
Start at Sources/BirdLockCore/Analysis/Analyzer.swift around lines 102 and 137, where (try? det.detect(...)) ?? [] and if let ds = try? pose.detect(...) drop the thrown error. Read the per-frame loop to see how frame results are collected, then look at Diagnostics.record to learn the existing reporting path. A thread-safe holder for the first error plus a count of failed frames drives both outcomes: throw when every frame fails, otherwise record and surface a notice. Done means a failing model no longer yields an empty success result; verify by forcing detect to throw and rerunning the analysis.
Written by the indexing model from the issue text.
Description
位置:Sources/BirdLockCore/Analysis/Analyzer.swift:102、:137
现象:let dets = (try? det.detect(...)) ?? [] 与 if let ds = try? pose.detect(...) 会静默吞掉推理错误。若 Core ML 模型加载或推理在每帧都失败,用户得到的是空的「识别完成」,而不是错误提示。
建议:在线程安全容器里记录首个错误;全部帧失败时抛出,个别帧失败时至少 Diagnostics.record 并在界面提示。
来源:2026-11-15 全仓只读审计,PR #7 未包含此项。 未在实机复现(静态审计)。
- Dominant language
- Swift
- Stars
- 2
- Forks
- 2
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cyandee/BirdLock
-
Difficulty 2/5 Under an hour Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100