Compare commits
2 Commits
f60f66d6e2
...
b2e85b479e
| Author | SHA1 | Date | |
|---|---|---|---|
|
b2e85b479e
|
|||
|
f3cea035fc
|
@@ -8,6 +8,7 @@ ExecStart=/usr/local/bin/rbv-api \
|
||||
--server-cert /etc/nginx/tls/rbv/rbv.pem \
|
||||
--server-key /etc/nginx/tls/rbv/key.pem \
|
||||
--database postgres://rbv:password@localhost:4432/rbv \
|
||||
--face-cache /tank/data/rbv/cache/face \
|
||||
--model-dir /tank/containers/immich/ml-cache
|
||||
Restart=always
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ OnSuccess=rbv-cluster.service
|
||||
Environment=RUST_LOG=info,ort=off,sqlx::query=off
|
||||
ExecStart=/usr/local/bin/rbv index \
|
||||
--target /tank/data/rbv/%i \
|
||||
--face-cache /tank/data/rbv/cache/face \
|
||||
--concurrency 32 \
|
||||
--database postgres://rbv:password@localhost:4432/rbv \
|
||||
--model-dir /tank/containers/immich/ml-cache \
|
||||
|
||||
@@ -74,8 +74,13 @@ pub struct IndexArgs {
|
||||
#[arg(long)]
|
||||
pub face_score_thresh: Option<f32>,
|
||||
|
||||
/// Directory for cached face crop thumbnails. Cleared when --ml-purge is used.
|
||||
#[arg(long)]
|
||||
pub face_cache: Option<std::path::PathBuf>,
|
||||
|
||||
/// Purge all ML-derived data (embeddings, face detections, persons)
|
||||
/// before indexing, forcing a full re-index from scratch.
|
||||
/// Also clears the face crop cache if --face-cache is provided.
|
||||
#[arg(long)]
|
||||
pub ml_purge: bool,
|
||||
}
|
||||
|
||||
@@ -10,6 +10,13 @@ pub async fn run(args: IndexArgs) -> Result<()> {
|
||||
if args.ml_purge {
|
||||
info!("Purging all ML-derived data (embeddings, faces, persons)...");
|
||||
rbv_data::image::purge_ml_data(&pool).await?;
|
||||
if let Some(cache_dir) = &args.face_cache {
|
||||
info!("Clearing face crop cache at {}...", cache_dir.display());
|
||||
if cache_dir.exists() {
|
||||
tokio::fs::remove_dir_all(cache_dir).await?;
|
||||
tokio::fs::create_dir_all(cache_dir).await?;
|
||||
}
|
||||
}
|
||||
info!("Purge complete.");
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,8 @@ deploy_index() {
|
||||
${index_host}:/etc/systemd/system/rbv-cluster.service \
|
||||
&& ssh ${index_host} sudo sed -i -e "s/password/${postgres_password}/" /etc/systemd/system/rbv-index@.service /etc/systemd/system/rbv-cluster.service \
|
||||
&& ssh ${index_host} sudo systemctl daemon-reload \
|
||||
&& ssh ${index_host} sudo systemctl start rbv-index@vault.service; then
|
||||
&& ssh ${index_host} sudo systemctl start rbv-index@vault.service \
|
||||
&& ssh ${index_host} (systemctl is-enabled --quiet rbv-index@vault.service || sudo systemctl enable rbv-index@vault.service); then
|
||||
echo "rbv index deployed successfully"
|
||||
else
|
||||
echo "failed to deploy rbv index"
|
||||
|
||||
Reference in New Issue
Block a user