Adding feature to remove annotations

This commit is contained in:
2025-12-10 00:19:59 +02:00
parent 35e2398e95
commit e6a5e74fa1
4 changed files with 278 additions and 20 deletions

View File

@@ -706,6 +706,25 @@ class DatabaseManager:
finally:
conn.close()
def delete_annotation(self, annotation_id: int) -> bool:
"""
Delete a manual annotation by ID.
Args:
annotation_id: ID of the annotation to delete
Returns:
True if an annotation was deleted, False otherwise.
"""
conn = self.get_connection()
try:
cursor = conn.cursor()
cursor.execute("DELETE FROM annotations WHERE id = ?", (annotation_id,))
conn.commit()
return cursor.rowcount > 0
finally:
conn.close()
# ==================== Object Class Operations ====================
def get_object_classes(self) -> List[Dict]: