-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Blur only the "Haram" part of the picture #20
Comments
This would be difficult from an AI perspective as well, so this feature is most likely a bit far out timeline-wise. But it is technically possible. |
Salam Alaikom @alganzory and @man2machine If we can know the position and size of the object to be blurred using AI, we can set |
Waaleikum salaam warahmatullahy wabarakatuh |
Wa alaikum assalam @mahmouds12 @alganzory It is technically possible, as I said before, however, currently in the roadmap, our first goal should be to build a better filter for images that blurs out the entire image (without detecting the area). One of the most difficult parts of blurring out certain parts of an image is "labeling". The way machine learning currently works is that you have to take a bunch of images (thousands to millions) and have humans label the correct outputs for the given image. Then you make the algorithm learn from this information and have the algorithm perform detection for new images on its own. Thus, labeling the images requires people to actually look at the haram images themselves and label it. Needless to say, looking at haram images, is haram. And definitely looking at thousands of these images is a bad thing for muslims and non-muslims. The functionality in the extension currently is possible because non-muslims have already looked at the haram images and have labeled a bunch of data and created algorithms for completely different purposes, that we are are currently utilizing. The next step is to use the same label information that is available already (from non-muslims) and create our own algorithm that is suited for our particular task and is more performant. More research is needed to see what types of label data already exists. If we cannot find the proper label data, it wouldn't be possible to do the partial image blurring, since one would need to label thousands to millions of haram images to do this, and that is obviously not good. The current AI model being used (BlazeFace) only performs face detection. So if we were to use that for partial image blurring, only the face would be blurred, and that means all the other parts of the body would still be left exposed, which is obviously very bad. Furthermore, if you read the research paper, the BlazeFace model does not detect the entire face properly, it is only meant to detect the general area of a face. Thus most likely, using the model would result in certain things showing like hair, neck, etc. and of course the rest of the body. This is actually the main difficulty from an AI perspective. The resource intensity is something ML researchers are working on, and it is foreseeable in the future that can be solved in shaa Allah. Drawing over images and videos is something challenging compared to what the extension has currently, but it is technically possible. However, The AI labeling issue is the far more difficult challenge for this. Depending on the results of the research I plan to do in shaa Allah, it may be that it is not possible this at all. |
I'd like to add to @man2machine points that I am mostly in agreement with:
This is not to say it's impossible, I am just trying to say there are higher priority prerequisites to make this work. |
@alganzory For sure some level of body blocking is possible and there are models out there to do this as you were stating. So it is possible to get some preliminary version working. However, what my long comment earlier basically means is that this type of model may not be as performant due to the improper labeling. In particular, what I am concerned is if for example only part of the face or body is showing, and also body detection in the case where there is no face. These are the cases that I am still unsure of what is possible. Of course from a technical sense, if the labels are there and if we have more processing power, it is of course completely possible. But we are not sure if that is the case. |
Is it possible somehow to teach the model through user feedback? I mean instead of making people look at specific content and rating it, we look at the content unfortunately on a daily basis, why not just give the user a way to report back if the detection was accurate or not |
Assalamu alaykum warahmatullahy wabarakatuh brothers we can use nudenets dataset to train our own model yolo8 is a great model https://archive.org/details/NudeNet_classifier_dataset_v1 I think this dataset is enough ins Allah to blur the haram part and if it doesn't get very accurate we can create a user feedback where we will create a small extension that would simply get the frames of part of the video not blurred and the user can do that by just hitting a button which would get the current video frame that was not blurred (timestamp)and we can add that to our dataset ins Allah and slowly improve our dataset and model ins Allah |
As salamou 3alaykoum FYI, I made a similar Python package : https://github.com/itkho/hafdh-nadhar What is the speed (ms/img) for the face recognition on this environment ? (I'm asking in order to have a reference) |
The problem with this approach is that I'd have to replace every image element with this setup of divs and containers, I haven't tried it yet but I assume this will at the very least break some images or how the DOM looks |
I know there's a model called Nudenet I believe based on this dataset, however when I tried it before the model was pretty big for the browser environment, I am not sure if we can make use of this dataset or the existing model to make a smaller one? (I don't have this experience, maybe @man2machine can offer some insights) |
The comment deleted above sounded like a troll to me so I impulsively deleted it. Nevertheless, they shared an interesting perspective about how blurring only a part of the image/frame could tempt you to want to disable the blur. It's honestly a fair concern but I also get why it's hard to watch videos with HaramBlur cause the entire frame would be blurred, so I am probably going for the approach where if NSFW detected -> blur the entire frame, if just face -> blur the face and some padding |
This is quite highly requested because people still wanna see relevant info in "bad" pictures.
This would probably require drawing over the photos /videos which could be resource intensive
The text was updated successfully, but these errors were encountered: