Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mass learn and unlearn #41

Closed
alekslyse opened this issue May 13, 2021 · 13 comments
Closed

Mass learn and unlearn #41

alekslyse opened this issue May 13, 2021 · 13 comments

Comments

@alekslyse
Copy link

As sometimes its easy to click learn on too many things. I noticed I clicked learn on some hits that should not be hits.

Would it be possible to implement "unlearn / forget" and relearn (if I for example use deepstack and install facebox too, I could click a button and it learns facebox with all the images already learned)

@jakowenko
Copy link
Owner

The API currently supports this and may solve your issue. There isn't a way to do it from the UI currently.

/api/train/add/:name will add all images from the/.storage/train folder and /api/train/remove/:name will remove all trained images. This only applies to whatever detectors are currently configured at the time of hitting the API.

@Haloooch
Copy link

Haloooch commented Jul 3, 2021

Was just going to log this as an enhancement but see it's already here. I was thinking you could add this functionality to the 'Files' view. Implement the multiple select (clicking on the image) that is on the 'Matches' view along with the 'Train' dropdown, but with a new dropdown or tick box called 'Remove' (or something like that).

@jakowenko
Copy link
Owner

@Haloooch, I was hoping to implement it similar to how you described, but the ability to remove specific images varies per detection service. CompreFace and Facebox both allow you to remove specific images, but DeepStack only allows you to remove the entire trained person, as far as I can tell.

I may just have to allow the multiselect for CompreFace and Facebox and then just have a single button to remove the entire DeepStack name.

Do you think something like that would work?

@Haloooch
Copy link

Haloooch commented Jul 6, 2021

I use DeepStack so it's a shame to hear it doesn't allow the per image option, I would however still love the ability to simply click a button and remove a person. As such your suggestion sounds like a great enhancement.

I didn't know at least DeepStack saved all trained images, which you have made visible through the 'Files' menu option. Since DeepStack doesn't let you delete one image that's been trained would there be a way to delete person but then re-train using selected images? Trying to work out the UI workflow:

  • If no images selected and button clicked to delete then that person deleted
  • If one or more images selected and button clicked to delete person, person deleted but selected images used to recreate person

(As I type this its all starting to sound quite complex and confusing, not sure if it's worth it....)

@jakowenko
Copy link
Owner

I like what you are proposing, I was thinking of a similar solution. It does become a little complicated to have to retrain the entire person each time, but that's probably the only way to really do it in an elegant way.

Maybe I'll do CompreFace and Facebox the same way to just keep it consistent. This would be a killer feature if implemented correctly.

@Haloooch
Copy link

Haloooch commented Jul 7, 2021

100% agree and part of my hesitance of suggesting it was the different workflow between products. But if you think you can do it in the same way across all 3 then perfect!

@jakowenko
Copy link
Owner

I'll try to get this into the next release in some form and we can then tweak it from there.

@jakowenko
Copy link
Owner

jakowenko commented Jul 14, 2021

@Haloooch, good news. I've made some progress on this over the last few days. Hoping to get a beta build of it ready by end of week.

@jakowenko
Copy link
Owner

@Haloooch the newest beta build includes a lot of cool features. I would love some feedback from you and any suggestions you may have. Here's a screenshot of what it looks like so far.

Screen Shot 2021-07-15 at 2 51 49 AM

Let me try to walk you through how it is currently setup.

The red trash button on the right side untrains / deletes images from multiple subjects. If the image is currently trained it will remove that subject entirely and retrain it with the other trained images.

Screen Shot 2021-07-15 at 3 07 25 AM

If the image is untrained by doing the previous step and you click the same button it will then remove it.

Screen Shot 2021-07-15 at 3 07 48 AM

So a trained image goes from trained -> untrained -> deleted

If you select a name from the dropdown you can do one of three things.

  • Upload a new image from your file system. You can even use your phone camera which will allow you to use some high quality photos for training.
  • Sync and retrain the model. This deletes the current user from the configured detectors and then takes all the images from the /train/${name} folder to retrain the model.
  • Ability to completely untrain a user. This will not remove the images, but they will go into the untrained state and then can be selected and deleted if wanted.

@Haloooch
Copy link

I completed extensive testing of this last night, pleased to say it 'just works'! Very cool feature, thank you.
When I first read your instructions above it did sound overly complicated, equally when playing with it, I didn't need to think ok which button do I click on now, but after a few seconds it all became intuitive.

I didn't find a single bug.

I do have one possible enhancement:

  1. Navigate to Train Screen
  2. select a trained image and click delete (to untrain)
  3. now re-select that image once untrained
  4. add the ability to train that image for a different person

If I'm correct you cannot currently do this, all you can do is retrain that image to the originally trained person.

Thank you again, really amazing work.

@jakowenko
Copy link
Owner

Hey @Haloooch, I'm so happy to hear it's working well for you. There's a little refactoring I need to do, but I tested it pretty extensively as well. Glad to hear you haven't ran into any issues.

I initially didn't have labels on the buttons so it would scale down to mobile and I wouldn't have to worry about it breaking to a new line. For larger screens I added these so it's more clear what the buttons do and I try to make it clear in the confirmation box what will happen too.

I was able to squeeze your enhancement in tonight as well. Let me know if this is what you had in mind. Here's a screenshot of how it works. For any untrained image you can select a name from the dropdown and train it for that user.

The latest beta build should include this.

Screen Shot 2021-07-16 at 2 59 49 AM

@Haloooch
Copy link

Just tested and working perfect! I like the idea of adding labels. Thx.

@jakowenko
Copy link
Owner

Closing as this is now included in release v0.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants