Open nicolas-raoul opened 5 years ago
Great idea! If user still proceeds, can we add a category (first we have to create this category on commons) as "possibly from front-facing camera" so that it will be easier to delete them later if they are inappropriate?
Apparently some phone have the front/back information in EXIF, so a first implementation could use that, and ignoring pictures that do not have the information in their EXIF.
I don't understand Android development at all but I'm just wondering about some potential risks.
1) Can we rule out fake positives?
2) Will this not grow the code too much? looks like a fairly difficult image-recognition task.
3) Will the uploading be smooth? I am worried about long waiting times for the recognition tool to finish its task.
Oh sorry, this is not meant to recognize the image. It's just a warning for the front camera. Please disregard me :)
I am late to answer but, @VojtechDostal image recognition was the first thing came to my mind when I first read this task. Then I recognized (as you did) the task does not require it (thanksfully):)
We have a suggestion at https://meta.wikimedia.org/wiki/Grants_talk:Project/Commons_app/Commons_Android_app_v3#Selfies
Don't try to solve 100% -- there's no point. Instead think smart and focus on the popular cameras. Have a look at Flickr Cameras. You can click on the mobile phone brands to get numbers for various models. iPhone is the majority camera now, though this is just the android app. You can see that Samsung's numbers are 5-10x those of Sony, LG, Moto, etc. So by coming up with a solution for the top 20 android phones, say, you'd probably reach 95% or more of all photos taken with an Android. Even if you had to resort to focal length & aperture to guess, a table of 20 items would be easy to implement. And if some brands (OnePlus?) name the camera used, then that might work for all models in that brand. Extracting sample photos from Commons per model and then examining the Exif with EXIFTOOL sounds relatively simple. A whole lot simpler than assuming the Android face recognition is going to help you -- is that API even available in all cameras -- or working out what percentage constitutes a selfie. -- Colin (talk) 12:18, 29 November 2018 (UTC)
I personally think this could be quite an interesting way of handling selfie detection, although it would still require a bit of maintenance (since the top 20 phones next year won't be the same as the top 20 phones this year). What do you guys think? Please feel free to chime in on the discussion on-wiki. @nicolas-raoul
If we can find an up-to-date small database of focal length of the most popular phones, that would be great :-)
Can't we retrieve the focal length data from Android SDK Camera2 API?
@ilgazer For pictures taken within the app, probably. But I guess this API can not be used for pictures found in the gallery, right?
The api just gives us the camera specs. So we wouldn’t be able to detect selfies taken from that phone but not selfies taken from another phone.
5 Temmuz 2019 Cuma tarihinde Nicolas Raoul notifications@github.com yazdı:
@ilgazer https://github.com/ilgazer For pictures taken within the app, probably. But I guess this API can not be used for pictures found in the gallery, right?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commons-app/apps-android-commons/issues/1898?email_source=notifications&email_token=AB2EXI3HGZZQRSD465XIPA3P52T3XA5CNFSM4FU2NHO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZILL5A#issuecomment-508605940, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2EXIZRQYPSQ3EW3PLGD6LP52T3XANCNFSM4FU2NHOQ .
That API only gives you the available focal lengthes of the camera, right? It does not say what focal length was actually used to create 4352.JPG even if 4352.JPG has been shot on the same phone.
Can we integrate a Machine Learning model which recognizes images containing selfies and then display the warning and ask the user if he/she wishes to upload the image anyway? @nicolas-raoul
Can we integrate a Machine Learning model which recognizes images containing selfies and then display the warning and ask the user if he/she wishes to upload the image anyway? @nicolas-raoul
Isn't machine learning a bit too much for our little uploading app? :-) I'd suggest we keep it simple and easy-to-maintain. Anyways, how big problem selfies are nowadays?
Just thinking about how best to implement this. We have a few options:
I'd implement 3 only as it is the simplest, or at least just focus on that easy win for now.
I am always wary of targeting samsung devices because they are notorious for mangling apis/resources and returning nonsense values. Unless we can absolutely verify it makes me a tiny bit nervous. There are some services where we can request test time on specific devices, we could run an instrumented test that verifies the phone gets detected properly? Bit annoying to write probably
Thanks for the input @macgills . I am personally leaning towards option 3 as well, at the very least I figure we could start with that and then step up the complexity if we find that there is a need later on.
There are some services where we can request test time on specific devices, we could run an instrumented test that verifies the phone gets detected properly?
Is there a free one that you could recommend?
Firebase Test Lab is sort of free? Kiwix used bitbar some time ago and somebody on the repo was looking into BrowserStack, I don't have any particular insight into these services
Unfortunately, EXIF does not have a front/rear property, but if we find a database of phone models we can be guessed it from the model and lens resolution as tipped at https://photo.stackexchange.com/questions/79179/rear-or-front-facing-camera-through-exif-data (also asked at https://softwarerecs.stackexchange.com/questions/52141/library-to-determine-whether-a-smartphone-picture-was-taken-with-front-or-rear-c)
(Inspired from a part of #74 but might be a bit easier to implement)