Giter VIP home page Giter VIP logo

Comments (19)

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024 1

Alright let me see how this goes. It looks like validation accuracy isn't really moving anymore. Once I'm done everything (I have to attempt a second type of model still) I'll come back with the results. I'm skeptical until I test it outside of TF.

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024 1

IMO, I'd love for your code to be sent as a PR back to the repo. You could then host the models for a short amount of time in a dropbox link and I'll upload them to our S3 and host them for everyone for free.

I plan on learning fast.ai and seeing if I can beat TF 2.1 and TF-Hub - all the models and code are useful to the community!

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

Very cool! Did you make one?

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

@GantMan It's still going, on epoch 5/10 now and reporting ~96% train acc and ~92% validation still. I pulled your data set off mega for this FYI so thought I'd give back by sharing the above. :) Thanks for posting that.

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

Awesome! I'd love to host the resulting file so others can use it, if that's good for you! Link to your socials etc. of course!

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

lol after all that I can't get the damn model out of TF 2. I can't freeze it, only use it as a SaveModel which is useless. There is a way to freeze in 2.x but it looks like there's a regression where training parameters from hub get baked in as constants. Tomorrow's another day I guess to look at it.

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

Gonna close this out because TF2 is a trainwreck. No way to properly freeze hub trained models and no tools to get them out of the SavedModel format support TF2.x properly. Sorry for the let down. I'm going to try to reproduce the same thing (xfer learning plus fine turning) in 1.15. If I'm successful I'll open a PR.

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

@GantMan I've successfully re-written the repo to use TF 2.1 and TF-Hub so we get all models for TF 2 that are on tfhub.dev. Training is simple, you just give the URL of the model type you want and let it go.

Anyway I want to modify my fork to keep the trained models with LFS in the repo but it looks like I can't enable that on forks. What do you think? I guess the question is, what's more of a pain? To keep uploading models on the release page manually, or getting LFS enabled?

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

Alright I broke my fork with LFS stuff so I'll redo it and send a PR excluding models. I'll then send models separately. I'm training inception v3, mobilenet v2 large, resnet 50 v2 and NasnetA. Exporting them to tflite, frozen pb, saved model, keras model and tfjs.

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

AFAIK you can post the models as releases. Would you do that instead?

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

I'm unfamiliar with exactly what posting models as releases means. Do you mean just include datestamp in the URI so people know when it was pushed?

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

You just create a release like this:

image

And then you drop the zipped models here:

image

Then you let Github host your files :)

Anyway I really wanted to run training through on all models I configured but something has come up that has put me out of time. Sorry about that. I'll submit the PR as-is.

Also I don't think we're ever going to break out of the ~93% zone without modifying the source data set. There's too much ambiguity between "sexy" and "porn" so they're constantly confused. If you merge those categories you'll see that you can break that ceiling.

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

@GantMan Alright PR is open. Let me know.

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

Fantastic work! I love the single file with everything.

I would love to throw in quantized models in that zip and call it a day if that works for you!

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

I'll have to check the command line tool that comes with tfjs when you install with pip. It may have a quant option for fp16 option. I'm out for a while tho today.

from nsfw_model.

GantMan avatar GantMan commented on May 16, 2024

I believe it's a flag in the tfjs command. --quantization_bytes 1 I believe!

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

Also, I have ~360K images with object bounding boxes defined for everything you'd want to detect in terms of nsfw (not hentai tho). If you know or figure out how to use the tf2 and tf hub api to fine tune an SSD or SSDLite model, please let me know.

from nsfw_model.

TechnikEmpire avatar TechnikEmpire commented on May 16, 2024

@GantMan I created a new PR and linked to the updated model package that now has a quant model inside as well

from nsfw_model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.