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

Autoconfigure image size based on model? #34

Open
sickerin opened this issue Jul 16, 2019 · 7 comments
Open

Autoconfigure image size based on model? #34

sickerin opened this issue Jul 16, 2019 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed training

Comments

@sickerin
Copy link
Contributor

For the same image, I got a pretty different classification on the Inception v3 Model
Keras 299x299 Image Model downloaded here vs the 93% accurate NSFW JS on the website. Is the model here kept up to date? How often is it retrained and updated?

@GantMan
Copy link
Owner

GantMan commented Jul 16, 2019

Was the website model lower or more accurate? I'm thinking the conversation and quant might be the culprits.

@sickerin
Copy link
Contributor Author

sickerin commented Jul 16, 2019

The website on most occasions was more accurate, the wrongly classified ones (classified as more towards porn) were neutral when tested on the website. My main purpose is to detect nudity but most commonly a male being shirtless, but not completely naked, is this classified as neutral in your training set. Btw, I also tried https://github.com/bedapudi6788/NudeNet, which had a bit too many false positives.

Side question: If I want to use the Keras 224x224 Image Model, I have to make changes to keras_predict.py right? or is there a propper way to do it? I get errors when I do this

detector = NSFWDetector('./nsfw_mobilenet2.224x224.h5')

@GantMan
Copy link
Owner

GantMan commented Jul 17, 2019

If the website was more accurate, then I wonder if I might have failed to properly upload the latest models. I'll check on this.

Correct, if you're using python, you'll need to adjust keras_predict. Would you mind submitting a PR with your updates on the code?

A shirtless male should be neutral in this model.. but I didn't do specific training on this. If you find problems let me know, and I can possibly update the model.

@sickerin
Copy link
Contributor Author

A lot of shirtless males where neutral, except maybe when the dude was really buff and muscular, or lying on the bed. I'll try training the model on them too.

Actually, for the 224x224 mobilenet, doing
detector.predict("Screen Shot 2019-07-16 at 1.59.22 PM.png", image_size=(224,224))
worked, so maybe I could submit a PR for the readme on how to load it. Thanks, let me know if you decide to update the models to classify shirtless men as nsfw.

@bedapudi6788
Copy link
Contributor

@GantMan @sickerin When i wrote the prediction code for this repo, mobilenet pre-trained model wasn't available. I will make a PR which can auto configure the imagesize based on the model.

@GantMan
Copy link
Owner

GantMan commented Aug 1, 2019

you're awesome @bedapudi6788 !!!!

@colindean
Copy link
Collaborator

@bedapudi6788 Are you still interested in contributing that work?

@colindean colindean added enhancement New feature or request help wanted Extra attention is needed training labels Feb 24, 2023
@colindean colindean changed the title Not the same model as NSFW JS? Autoconfigure image size based on model? Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed training
Projects
None yet
Development

No branches or pull requests

4 participants