jakowenko / double-take

Unified UI and API for processing and training images for facial recognition.
https://hub.docker.com/r/jakowenko/double-take
MIT License
1.2k stars 94 forks source link

Ability to delete Person #66

Closed Haloooch closed 3 years ago

Haloooch commented 3 years ago

Currently you can add a new person, but I don't think there is a way to delete a user.

I originally set the names as 'firstname lastname' the space caused some problem in HA, as a result I recreated them as 'firstnamelastname' but I don't seem to be able to delete the original names. While you could force where there are blank names I think the ability to delete would be more valuable.

jakowenko commented 3 years ago

I can work on getting this added in and try to better handle names with spaces in them. In the meantime, you can delete that folder from your host machine. Deleting ./storage/train/FOLDER NAME should remove it from the dropdown.

jakowenko commented 3 years ago

Hey @Haloooch, I just pushed a new beta build that should resolve both of these issues. When all the images are untrained for a user, the button will change to "Remove". This will then allow you to delete that folder and any images within it.

Screen Shot 2021-08-01 at 11 02 45 PM Screen Shot 2021-08-01 at 11 02 51 PM

I also updated the MQTT publishing to HA to replace the spaces with a _ for the entity name. I was able to test this locally and verify it worked.

Let me know if this works for you!

Haloooch commented 3 years ago

Very cool, thank you! Life is getting in the way of HA at the moment, so suspect I will not be able to try the new beta till later in the week. If I do experience any issues I will let you know.

kanemari commented 3 years ago

just adding to this one. I have tried deleting trained faces, but it doesnt seem to remove them from the database. I have even gone to the point of deleting the database, manually removing the all training directory 'names' and manually adding all training images apart from the one I wanted removed back again, but it still detects the deleted face in images.

e.g. started with 3 faces - joe, peter, nick. deleted all folders under /train, deleted database.db, added images for joe and peter back into double-take, but nick is still detected in images despite there being no directory for him under /train, and the databse being created new.

do images get saved within compreface? there doesnt seem to be any option to remove trained images from there in the UI.

jakowenko commented 3 years ago

Hey @kanemari, untraining from Double Take to CompreFace only happens when you use the UI / API. Once the image is trained, some of that information resides in CompreFace. So just deleting the files / database on the Double Take side won't do anything.

Here's what I would do if you want to start fresh.

Let me know if this makes sense and helps fix your issue.

Screen Shot 2021-09-03 at 10 50 31 AM

kanemari commented 3 years ago

I did use the UI at first, but it left the folder behind in /train and still detected them in the images even though their name wasnt listed in the UI anymore. anyway, have created a new recognition service in compreface and retrained the images / faces I want to keep. hopefully that will do it.

jakowenko commented 3 years ago

Try doing it again with the newest beta image. I caught a bug last night in regards to the training page and just the untraining of CompreFace photos where it didn't realize a trained one was actually trained.

kanemari commented 3 years ago

seems to be working now, thanks!

jakowenko commented 3 years ago

Closing since this is now included in the 1.0.0 release.