Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat(redact): ship rfdetr_v13 image PII model — real-secret recall 0%→95% (#4531)

Louis Beaumont9a45bf51045e
diff --git a/crates/screenpipe-redact/src/adapters/rfdetr.rs b/crates/screenpipe-redact/src/adapters/rfdetr.rs
index a07d75f05..504af8961 100644
--- a/crates/screenpipe-redact/src/adapters/rfdetr.rs
+++ b/crates/screenpipe-redact/src/adapters/rfdetr.rs
@@ -52,7 +52,7 @@ use crate::RedactError;
use crate::SpanLabel;
const RFDETR_NAME: &str = "rfdetr";
-const RFDETR_VERSION: u32 = 12; // matches the rfdetr_v12 ONNX (fp16)
+const RFDETR_VERSION: u32 = 13; // matches the rfdetr_v13 ONNX (fp16, 384px)
#[cfg(feature = "onnx-cpu")]
const NUM_CLASSES: usize = 12;
@@ -111,14 +111,14 @@ impl Default for RfdetrConfig {
}
impl RfdetrConfig {
- /// `~/.screenpipe/models/rfdetr_v12.onnx`. Created lazily by
+ /// `~/.screenpipe/models/rfdetr_v13.onnx`. Created lazily by
/// [`Self::ensure_model_present`] on first run.
pub fn default_model_path() -> PathBuf {
dirs::home_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join(".screenpipe")
.join("models")
- .join("rfdetr_v12.onnx")
+ .join("rfdetr_v13.onnx")
}
/// HuggingFace download URL for the canonical ONNX. Pinned to
@@ -126,16 +126,16 @@ impl RfdetrConfig {
/// (URL + expected SHA-256 + [`RFDETR_VERSION`] all bumped
/// together).
pub const HF_DOWNLOAD_URL: &'static str =
- "https://huggingface.co/screenpipe/pii-image-redactor/resolve/main/rfdetr_v12.onnx";
+ "https://huggingface.co/screenpipe/pii-image-redactor/resolve/main/rfdetr_v13.onnx";
- /// Expected SHA-256 of the canonical `rfdetr_v12.onnx`. Verified
+ /// Expected SHA-256 of the canonical `rfdetr_v13.onnx`. Verified
/// after every download. If a future training run produces a new
/// best, bump [`RFDETR_VERSION`], re-publish to HF, update this
/// constant. Note: the worker is destructive-only and does NOT
/// re-redact already-processed frames, so a model-version bump
/// only takes effect for newly-captured frames going forward.
pub const EXPECTED_SHA256: &'static str =
- "71cd7d976ef769255a8d5b7523ecdd547710cc18f8464e0cc9da64c4e8c1aaba";
+ "16d10b46c078c1b05e0fb5cdbe2be3a08c3e0541a9f53233a58cff64fd515e05";
/// Make sure the ONNX is present on disk. Idempotent — does
/// nothing if [`Self::model_path`] already exists with the
@@ -164,7 +164,7 @@ impl RfdetrConfig {
tracing::info!(
url = Self::HF_DOWNLOAD_URL,
target = %self.model_path.display(),
- "downloading rfdetr_v12.onnx (~54 MB) — first-run only"
+ "downloading rfdetr_v13.onnx (~60 MB) — first-run only"
);
let resp = reqwest::Client::new()
.get(Self::HF_DOWNLOAD_URL)