-
Notifications
You must be signed in to change notification settings - Fork 109
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
V2.0 Release #24
base: master
Are you sure you want to change the base?
V2.0 Release #24
Conversation
absolute-heike
commented
Nov 23, 2021
•
edited
Loading
edited
- A new model trained with some open source data
- Migrate API to also be usable on macOS
@@ -48,6 +46,10 @@ The Machine Learning Model is only **17 kB** in size, so App size won't be affec | |||
|
|||
If you don't want to use the Detection Code, you can also just download the MLModel file directly from the latest [Release](https://github.com/lovoo/NSFWDetector/releases). | |||
|
|||
## Training Data | |||
|
|||
V2 uses data out of [NudeNet_v1](https://archive.org/details/NudeNet_classifier_dataset_v1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather link to the project website. Or maybe both?
http://bpraneeth.com/projects/nudenet
public class NSFWDetector { | ||
|
||
public static let shared = NSFWDetector() | ||
|
||
private let model: VNCoreMLModel | ||
|
||
public required init() { | ||
guard let model = try? VNCoreMLModel(for: NSFW().model) else { | ||
guard let model = try? VNCoreMLModel(for: NSFW(configuration: MLModelConfiguration()).model) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see mostly refactoring work, and this new configuration parameter.
What did I miss, I thought this release is about fixing the Xcode 13 trouble?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This release improves the dataset and makes it iOS agnostic so it can also be run on macOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, so the tests now run on macOS and therefore don't fail? We still don't know why they fail on iOS though? Are you sure the model works at runtime all the time then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabianehlert shared an Apple Forums link with me once that showed, that Machine Learning on iOS 15 Simulators is broken right now
@@ -58,7 +58,7 @@ class CameraViewController: UIViewController, AVCaptureVideoDataOutputSampleBuff | |||
} | |||
|
|||
private func didDetectNSFW(confidence: Float) { | |||
if confidence > 0.8 { | |||
if confidence > 0.9 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you arrive at 0.9 here? Experimental? I feel like that's still a bit on the maybe-side and would increase to 0.95.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it depends on the content of course. And for the camera demo I think it works quite great, because most people won't gonna strip completely naked to try it out :D
Upon some "personal testing" I found this version of the model to be suboptimal at detecting male genitals. My guess is that the training data set is biased, because whenever there is a male genital, there is also a woman in the training images.
So I will try it out some more and try to improve it for that use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should! That's the use case we're most interested in after all, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's why I tested it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with @leberwurstsaft – it is the use case for us.
A super small sample of the linked training data also left me with the impression that the model could have a weakness in that regard.
Also, in the nudity files there seem to be a lot of textual overlays in the corners. The model might have a tendency to flag stuff as nude if there is text in a corner. But that shouldn’t be big of a problem as long as it doesn’t influence the amount of false-negatives too.
I've tried v 2.0 but doesn't work. It gives me every time 0% |
Is this project still under development? |