M4 handover: coordinate fixes, detector registry, deploy v2, YOLOv8s, identity lifecycle

- Fix swift_pose/swift_ocr Y-flip bugs (BUG-003~006)
- Add heuristic_scene module + post-processing trigger (replaces Places365)
- YOLOv5nu → YOLOv8s CoreML (+33% detections, +390% scene indicators)
- Per-table SQL export (split 4.7GB single file → 478MB max per table)
- Version/build check in deploy.sh (compare /health vs file_info.json)
- Add file_uuid column to identities table + backfill
- Identity pre-clean step in deploy (avoids UNIQUE conflicts on re-deploy)
- Stranger_xxx naming fix with UUID context
- Add DETECTOR_REGISTRY.md (25 detectors), DETECTOR_SELECTION_SOP.md
- Update SPATIAL_COORDINATE_REGISTRY.md (P layer, 6-layer architecture)
- New IDENTITY_LIFECYCLE.md
- M4 response docs for deploy_script_fix and 111614 test report
This commit is contained in:
Accusys
2026-05-13 20:00:47 +08:00
parent d34bcae145
commit ffc30d7377
25 changed files with 2219 additions and 118 deletions

View File

@@ -126,7 +126,7 @@ struct SwiftOCR: ParsableCommand {
let item: [String: Any] = [
"text": candidate.string,
"x": Int(bb.origin.x * CGFloat(cgW)),
"y": Int(bb.origin.y * CGFloat(cgH)),
"y": Int((1.0 - bb.origin.y - bb.size.height) * CGFloat(cgH)),
"width": Int(bb.size.width * CGFloat(cgW)),
"height": Int(bb.size.height * CGFloat(cgH)),
"confidence": conf
@@ -183,16 +183,19 @@ struct SwiftOCR: ParsableCommand {
guard (try? handler.perform([request])) != nil,
let results = request.results else { return texts }
let cgW = CGFloat(CVPixelBufferGetWidth(pixelBuffer))
let cgH = CGFloat(CVPixelBufferGetHeight(pixelBuffer))
for obs in results {
guard let candidate = obs.topCandidates(1).first,
candidate.confidence > 0.2 else { continue }
let bb = obs.boundingBox
texts.append([
"text": candidate.string,
"x": Int(bb.origin.x * 640),
"y": Int(bb.origin.y * 360),
"width": Int(bb.size.width * 640),
"height": Int(bb.size.height * 360),
"x": Int(bb.origin.x * cgW),
"y": Int((1.0 - bb.origin.y - bb.size.height) * cgH),
"width": Int(bb.size.width * cgW),
"height": Int(bb.size.height * cgH),
"confidence": candidate.confidence
])
}

View File

@@ -151,17 +151,19 @@ struct SwiftPose: ParsableCommand {
if let mapped = nameMap[rawName] {
rawName = mapped
}
let px = point.location.x * CGFloat(w)
let py = CGFloat(h) - point.location.y * CGFloat(h)
keypoints.append([
"name": rawName.isEmpty ? "\(joint)" : rawName,
"x": point.location.x * CGFloat(w),
"y": point.location.y * CGFloat(h),
"x": px,
"y": py,
"confidence": point.confidence,
])
if point.confidence > 0.1 {
minX = min(minX, point.location.x)
minY = min(minY, point.location.y)
maxX = max(maxX, point.location.x)
maxY = max(maxY, point.location.y)
minX = min(minX, px)
minY = min(minY, py)
maxX = max(maxX, px)
maxY = max(maxY, py)
}
}
}
@@ -171,10 +173,10 @@ struct SwiftPose: ParsableCommand {
]
if maxX > minX {
bbox = [
"x": Int(minX * CGFloat(w)),
"y": Int(minY * CGFloat(h)),
"width": Int((maxX - minX) * CGFloat(w)),
"height": Int((maxY - minY) * CGFloat(h)),
"x": Int(minX),
"y": Int(minY),
"width": Int(maxX - minX),
"height": Int(maxY - minY),
]
}