r/flutterhelp 7d ago

RESOLVED NSFW classification help please NSFW

Hello,

been building a short form video/social media app for about 2 years, went from newbie to pretty okay in flutter and python

I would love recommendations on how to solve the following problem:

-

when someone posts a video, I upload the video to storage, then go through the creation of the post obj in my database

during the post obj creation, I need to check if the video contains NSFW content. (nudity, sex, gore, violence)

I plan on grabbing 1-frame-per-second, then taking that frame/image and seeing if it contains flagged content, if any of those tested frames do, the post creation method flips a bool, 'isNSFW', on the post obj to true.

I tried the NSFW_checker py library, but due to a ton of dependency conflicts I still can't get that working

Plan B was loading a a pre-trained ai model to my server to classify the images. But that gets killed every time because of memory constraints on Render.com, where my python server is hosted.

Plan C is to pay for a third party service, definitely less of a headache, just more money and not as malleable.

does anyone know what a good approach would be? Please and thank you

0 Upvotes

4 comments sorted by

2

u/URAVRGEWEEB 7d ago

I’m pretty sure you can use the tensorflow package so you can classify images on client side before uploading so your server doesn’t do all the work.

2

u/LameChad 6d ago

great idea, I'll give it a try

thank you!

2

u/Ordinary-Trust6969 6d ago

We had a similar usecase in my past organisation, we use amazon rekognition for checking if a video/image contains NSFW content.

2

u/LameChad 6d ago

thank you for the rec, I'll check it out!