You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside the AI Tagging section of PictoPy, there should be an option to delete specific Face Clusters so that users can remove unwanted Face Clusters. Currently, no such option is available.
Current Problem
No option to delete or hide specific automatically generated face clusters.
In my previous attempts of deletion (setting cluster_id to NULL) would have been resulted in re-discover and re-display the same unwanted group during the next 24-hour full reclustering cycle.
Expected Solution
Users should be able to remove Face Clusters.
A Delete button should be visible when a user opens any Face Cluster.
Concept of Soft Deletion.
Implementation
Backend
1. Database Schema Enhancements
Added a column is_deleted to both tables face_clusters and faces to enable "Soft Delete" logic.
The system now executes a transaction-safe update rather than deleting rows permanently. This hides it from the user while maintaining the internal grouping data for the AI.
# Updated deletion logic in db_delete_cluster_by_cluster_idcursor.execute("UPDATE faces SET is_deleted = TRUE WHERE cluster_id = ?")
cursor.execute("UPDATE face_clusters SET is_deleted = TRUE WHERE cluster_id = ?")
Majority Voting (Reclustering Logic)
This is the main concept. When full reclustering occurs (every 24 hours):
The system creates brand new clusters for all faces.
For each new cluster, it checks the previous is_deleted status of its constituent faces.
Inheritance: If a majority of faces in a new cluster were previously marked as deleted, the new cluster automatically inherits is_deleted = TRUE.
This ensures that manually hidden people stay hidden even if the underlying cluster_id changes.
When fetching clusters
The retrieval endpoints are updated to automatically exclude clusters marked with the is_deleted flag:
# API Logicclusters= [cforcinclusters_dataifnotc.get("is_deleted", False)]
Frontend
UI: Added Delete Button and defined handleDeleteCluster
API Route: Added DELETE /face-clusters/delete-cluster/${clusterId} in apiEndpoint.ts
Response Handling: The message from the backend is displayed regardless of the success status, ensuring the user sees the specific feedback provided by the server.
Lint Fix: Ensured the mutation call is type-safe by passing undefined for operations requiring no payload.
Describe the feature
Description
Inside the AI Tagging section of PictoPy, there should be an option to delete specific Face Clusters so that users can remove unwanted Face Clusters. Currently, no such option is available.
Current Problem
cluster_idtoNULL) would have been resulted in re-discover and re-display the same unwanted group during the next 24-hour full reclustering cycle.Expected Solution
Implementation
Backend
1. Database Schema Enhancements
Added a column
is_deletedto both tablesface_clustersandfacesto enable "Soft Delete" logic.face_clusterstable: Addedis_deleted BOOLEAN DEFAULT FALSE.facestable: Addedis_deleted BOOLEAN DEFAULT FALSE.2. Implementation Logic
Soft Delete Operation
The system now executes a transaction-safe update rather than deleting rows permanently. This hides it from the user while maintaining the internal grouping data for the AI.
Majority Voting (Reclustering Logic)
This is the main concept. When full reclustering occurs (every 24 hours):
is_deletedstatus of its constituent faces.is_deleted = TRUE.cluster_idchanges.When fetching clusters
The retrieval endpoints are updated to automatically exclude clusters marked with the
is_deletedflag:UI:Added Delete Button and definedhandleDeleteClusterAPI Route:AddedDELETE /face-clusters/delete-cluster/${clusterId}inapiEndpoint.tsResponse Handling:The message from the backend is displayed regardless of the success status, ensuring the user sees the specific feedback provided by the server.Lint Fix:Ensured the mutation call is type-safe by passingundefinedfor operations requiring no payload.Add ScreenShots
Screenshots
Delete Endpoint working properly.
Delete Button not available (Before)
Delete Button now available (After)
Demo video (After)
demo1.mp4
Tests Performed
test_face_clusters.py
test_albums.py
test_folders.py
test_user_preferences.py
Record