RTranslator icon indicating copy to clipboard operation
RTranslator copied to clipboard

Add to F-Droid

Open takiainen opened this issue 1 year ago • 53 comments

F-Droid is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. Any chance of adding this project to F-Droid?

https://f-droid.org/

takiainen avatar Jun 19 '24 06:06 takiainen

In these days I will find out more about the policies of F-Droid and update you here, because I don't know if I still can, given that NLLB is open source but not commercial, and Ml-Kit (used for language recognition in WalkieTalkie mode) is closed source, but if I can I will definitely do it.

niedev avatar Jun 19 '24 10:06 niedev

Hey @IzzySoft, what do you think?

jermanuts avatar Jun 19 '24 11:06 jermanuts

MLKit is a show-stopper for F-Droid. The APK size is a show-stopper for IzzyOnDroid unfortunately, so we don't even need to raise the MLKit question there, sorry.

IzzySoft avatar Jun 19 '24 14:06 IzzySoft

@IzzySoft Ok, no problem, maybe in the future I will reduce the APK size and find an open-source alternative to ML-Kit.

niedev avatar Jun 19 '24 14:06 niedev

Please let me know if you succeed with either! Especially the latter would be helping several projects. And there it would be helpful what areas the replacement(s) you found cover, so they can be matched to a project's need. Like with Supabase and appwrite as possible replacements for Firebase. Or UnifiedPush for FCM :wink:

That said: Best luck!

IzzySoft avatar Jun 19 '24 15:06 IzzySoft

Thank you! I will do my best

niedev avatar Jun 19 '24 15:06 niedev

I didn't look at your code yet, but aren't there any open source models for language recognition, which would make this translator absolutely free? Quick search through huggingface gave me this, wouldn't it work?

I would be happy to contribute if this module is written in python, since I don't know much java.

chameleon-lizard avatar Jun 19 '24 16:06 chameleon-lizard

Thank you! I did some research about it a while ago, it seems I missed this one 😅, it seems very good in quality, even if a bit big (about 200M parameters), anyway, I will test it well (quality, RAM consumption, execution time) and I will evaluate whether to insert it instead of ML-Kit. The license is the same as NLLB, @IzzySoft F-Droid accept AI models with cc-by-nc licence?

As for the app, it uses only Java code and a little bit of C++ (the percentage of Python shown by GitHub statistics are from the sentencepiece library, like most of the C++ code), but the inference logic with Java is quite simple, the complex part is mainly the conversion and optimization of the neural network models in onnx format.

niedev avatar Jun 19 '24 16:06 niedev

cc-by-nc licence?

The NC is the culprit there, as it violates one of the 4 essential freedoms of free software. So rather not I'd say.

IzzySoft avatar Jun 19 '24 17:06 IzzySoft

Ok 👍 Thank you!

niedev avatar Jun 19 '24 17:06 niedev

Hmm, I'm not sure how strict that posture is. whoBird is practically in the same boat with RTranslator as it seems. From the project's github page:

This app is built on the BirdNET framework by @kahst, published under CC BY NC SA 4.0 license At first start it downloads the BirdNet TFLite library from whoBird-TFlite, which is published under CC BY NC SA 4.0 license

Nevertheless it is available in FDroid with appropriate antifeature markers (Non-Free Assets, Non-Free Network Services). The model is not distributed with the apk but downloaded on first run.

(Please note that this is just an observation from a bystander, I've not researched whether there were any additional considerations involved during whoBIRD's admission process).

noctux avatar Jun 20 '24 08:06 noctux

F-Droid is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. Any chance of adding this project to F-Droid?

https://f-droid.org/

F-Droid policies do not allows for non-free libraries to be used. https://f-droid.org/docs/Inclusion_Policy/

luisvalenzuelar avatar Jun 20 '24 18:06 luisvalenzuelar

The code has to be FOSS but the model data can be non-commercial. If MLkit is optional you can provide a flavor without it. IIUC, MLkit is only used to detect the language. So maybe you can provide a flavor which can only set the languange manually.

linsui avatar Jun 25 '24 07:06 linsui

The code has to be FOSS but the model data can be non-commercial. If MLkit is optional you can provide a flavor without it. IIUC, MLkit is only used to detect the language. So maybe you can provide a flavor which can only set the languange manually.

Thank you for the suggestion.

Managing multiple versions of the app would complicate maintenance and I would have less time to make truly useful changes, putting the app in F-Droid is important to me, but improving the app for now is much more important.

But surely when it will be possible I will try to slowly replace all the closed source or non-commercial components with 100% open source alternatives (if they will have an equally good quality and speed).

niedev avatar Jun 26 '24 13:06 niedev

Instead of f-droid, here are some alternatives:

Obtainium: it allows you to retrieve from Github releases, so there's nothing in particular to do. It might be useful to inform users in the read-me to make updates easier.

Accrescent: the store is still in beta, so it's a whitelist for application submission, as it's not yet developer-friendly, but it's quite ready for users. Applications can be open source or closed source, so there's no problem with components.

IMO it would be good to add obtanium now, and keep an eye on accrescent to add it in the future when it's 1.0.

Ganipotes avatar Sep 09 '24 12:09 Ganipotes

@Ganipotes Please open a separate issue about your favorite separate solutions, other that those in the title of the issue

also, I'm under the impression that the first link magically changes "Last updated on" every time I visit it, but the content is still 3 years old talking about things that were fixed long ago.

licaon-kter avatar Sep 09 '24 15:09 licaon-kter

Hi @Ganipotes, thank you for your suggestions! I tried Obtanium and although it is very useful it doesn't seem to be that easy to use for an average user (I myself was intimidated when I saw all those options to add an app), for now however I can add in the readme an indication on how to receive notifications for new releases on GitHub, and I was thinking in the future to integrate an update control directly into the app. I will keep an eye on Accrescent, if it will be supported for a long time and will reach a good number of users I might add my app there too (but for now F-Droid and Play Store have priority being more mature).

niedev avatar Sep 09 '24 20:09 niedev

I was also going to suggest Meta's fasttext model, seems like a match made in heaven with NLLB, fasttext was made from the same corpus and hence supports as many languages (hence more than Whisper).

Note that the latest language identification (LID) model supporting 217 languages is also under CC-BY-NC 4.0, hence it's "open-source for non-commercial use" (ie, non free software), but this should work for F-Droid. Direct link is here (expanded from the tinyurl): https://dl.fbaipublicfiles.com/nllb/lid/lid218e.bin

A less accurate alternative is to simply use Whisper, see the end of this collab script: https://colab.research.google.com/drive/1rS1L4YSJqKUH_3YxIQHBI982zso23wor?usp=sharing#scrollTo=Mh_e6rV62QUM

lrq3000 avatar Dec 05 '24 15:12 lrq3000

Hi again @lrq3000, thank you for your suggestions.

Note that the latest language identification (LID) model supporting 217 languages is also under CC-BY-NC 4.0, hence it's "open-source for non-commercial use" (ie, non free software), but this should work for F-Droid. Direct link is here (expanded from the tinyurl): https://dl.fbaipublicfiles.com/nllb/lid/lid218e.bin

I tested this quickly and it doesn't seems to have the same quality as Google's Language identification (it failed to identify "ciao" as Italian, only increasing the length of the text works, while Google's almost never gets it wrong).

A less accurate alternative is to simply use Whisper, see the end of this collab script: https://colab.research.google.com/drive/1rS1L4YSJqKUH_3YxIQHBI982zso23wor?usp=sharing#scrollTo=Mh_e6rV62QUM

I already tried Whisper automatic language detection but it significantly decreases the quality of speech recognition (even if the recognized language is the correct one).

niedev avatar Dec 08 '24 14:12 niedev

If automatic language detection in Walkie-Talkie mode is the only issue, I would suggest to remove it for an F-Droid version and only show the 2 language buttons at the left and right. I would anyway prefer not to automatically start with automatic mode when entering Walkie-Talkie mode. If there is background noise or other people around are speaking it is better to press and hold the language button while speaking. And then automatic detection is not needed anyway. Otherwise all undesired stuff is translated as well which is not great on a slow phone.

woheller69 avatar Jun 11 '25 10:06 woheller69