ogkalu2 / comic-translate

Desktop app for automatically translating comics - BDs, Manga, Manhwa, Fumetti and more in a variety of formats (Image, Pdf, Epub, cbr, cbz, etc) and in multiple languages.
Apache License 2.0
1.15k stars 97 forks source link

Hey can u make this app for android users too pls since there r no free apps for android users like this #147

Open Aruraka opened 2 months ago

lawrenz1 commented 2 months ago

Android doesn't have enough processing power. The reason those apps are paid because they send requests to servers to do the processing.

notimp commented 2 months ago

Aru?

x86 system I'm using comic-translate on: https://browser.geekbench.com/processors/intel-core-i5-4440

ARM (Android) system I'm using to stream some stuff to my TV and occationally play: https://www.notebookcheck.com/Qualcomm-Snapdragon-8-Gen-2-Prozessor-Benchmarks-und-Specs.669948.0.html (Ayn Odin 2)

(Streaming only stuff that requires fast inputs (virtual keyboard usually), for movies alone I have an Android settop box of course...)

So essentially, the 300 usd throw away Android device is twice as performant as the PC I'm using comicstranslate on....

Also - here is some background. OCR is performance heavy, but can be performed on my age old i5 4440 in "resonable time" where using offline OCR doesnt slow down the process by too much. (Tested with BallonsTranslator )

Translation will always be done by server side AI networks you pay for as services - at least for the next five years or so, if you want above decent results. There are models out there you can run locally also -- but none of them is implemented in comic-translate (BallonsTranslator has more models to play with, but a RTX3060 or above is kind of recommended to play with those.)

And because OCR can also be done by a service - none of this is performance heavy.

Good results at reasonable prices out of comic-translate come out of using google vision (OCR), and either gpt 4o-mini or google translate (depends on the language pair).

If you need entirely free you'd look over to BallonsTranslator which can do google lens (OCR) and google translate, which are both free.

Google vision + gpt 4o-mini cost about 40 USD cents per comic. (Also google vision gives you 200 USD worth of credit when you first log in.)

Android apps might be skimming "over the top", so make that price higher. But then gpt4o-mini is the cost effective version, if you want prices to explode, you can have that also: https://archive.is/OzEzz

Short version: With OCR there is free, if you do it on CPU (which can easily be done), or if you use a hacked Google Lens solution (essentially google doenst provide an api, and so people made one), but the polite way to do that is to use google vision (which has an official API) which only costs about a few cents per comic (10 cents as a ballpark, but thats from a "feeling" because I've forgotten the actual value).

Translation can be had for free if you use google translate - but thats not great quality depending on the language pair. Economical gpt 4o-mini translation costs USD 40 cents per comic (ballpark).

CPU performance doesnt figure into it - because if you use services for both, there is hardly anything cpu heavy left. And even if you'd want to do OCR on CPU any 300 USD android device (should be overkill for that by now). (Phones excluded, because they operate on a phantasy product price calculation sheet. (People use phones often, so they are willing to pay higher premiums, so phone manufacturers said thank you and took the money.))

Actually, you might even be able to run comic translate on an android device by now - the question is how fun it would be...

Essentially the issue for porting it to an ARM Processor device is "x86 emulation quality", or "lack of libraries". So this project, as others on linux depends on a bunch of libraries other people have written to do some stuff. With open source projects following the linux ethos, they get shared around and you can usually use them for free, and then bundle a bunch of them together and create your own program (piping the output of one program/library into the input of another, and at the end of that chain, your program works like you've written it). Those libraries are very specific. So if something like https://play.google.com/store/apps/details?id=ru.iiec.pydroid3 can download and use them, great -- if it fails at any point -- no cigar. Those libraries also might have x86 (processor specific) architecture in them, but then pydroid might already emulate a x86 environment, dont know.

So essentially "just creating an app" and making it easy for the end user would be an entire (seperate) project.

And then comes in the UI part, so how you use a touch device to do all those actions you currently do with mouse and keyboard.

With comic translate that might be managable because its auto mode is pretty good to begin with.

Still, its a lot to ask - just because you want free.

Getting some cheap pc ultimately might be the better solution. Used steamdecks by now can be bought for 250-270 USD used, and while setting up python to work on them is a hazzle: https://old.reddit.com/r/SteamDeck/comments/wv9isq/can_you_install_python_on_steam_deck/ - you could just put windows on it - and then setting up comic-translate would become easy. Also - that pricepoint will only drop.

Alternatively, you could search for intel 4440 (thats the intel i5 4440 not the graphics card/unit with the same numbered name. :) ) on your local craigslist alternative and buy a full PC for about 50 USD. The issue there is, that it doesnt have full windows 11 support out of the box -- but you can still easily run it - by installing windows 10 and then upgrading like this: https://www.youtube.com/watch?v=NcofifneCVQ

In about 2 years or so that device might or might not be compatible with more recent versions of windows. With the next iteration of 11 it will be compatible (only has a hard requirement for a chip function that 4440 gen cpus have), but after that its anybodys guess.

Also if you chose to go with at 4440 system - this will give you extra performance. https://www.grc.com/inspectre.htm

Getting a PC for under 50 bucks would be hard these days... ;)

Typing this on a 4440 system, that doesnt feel like a potatoe (SSD be thanked). But about as fast if not faster than a Macbook Air from 2018 - and faster than a AMD Ryzen 7 3700X system - when used with remote desktop software. As in feel during daily use, not when reencoding a movie.. ;) (My 3700x system is basically a gaming pc underneath my TV, which I only interface with using a controller, Synergy (KVM, so control another pc from a laptop), or remote desktop. :)

edit: If you go the steamdeck route, look into installing Windows on an sdcard with steamdeck tutorials. While this is not recommended (SD card will die because of repeat read and write access), that way, you can keep the steamdeck on its default Linux OS and game with it as well. Gaming on windows on a steamdeck is worse. Windows on an sdcard performance wise is fine, if you only want to use comic-translate or other small time stuff like that. Upgrading the ssd module on a steamdeck also is possible. (Windows install essentially might need more than the 64GB the cheapest steamdeck comes with, is what I'm saying.)

lawrenz1 commented 2 months ago

The block detection, inpainting, and text segmentation steps can be resource heavy too.

I also sometimes encounter an out of memory error when testing in a vm, but that might be from a memory leak issue.

notimp commented 2 months ago

Not in my experience. Inpainting can be resource heavy... but with the module comic translate is using - its just a tinsy spike on my 4440 pc (regardless if I use GPU or CPU for it), segmenting might take some time but usually less than inpainting -- so maybe running this under emulation wouldnt be fun... Or even under emulation it would be fast enough.

I have to say, that by now I use a different inpainting module in ballonstranslator though, that is GPU dependant - simply beacause it leads to better results. And yes I do that on my gaming PC which I only access using remote desktop. ;) So you are not wrong -- still not so resource heavy that it alone would rule out an android version.

Its mostly just the "It would be an entirely seperate project" stuff.. ;) (As far as I can guess.)

Edit: Good Keyboard and mouse to not feel like you bought a potatoe. :)

Keyboard: Microsoft Designer Compact (about 20 USD used, needs a bluetooth receiver usb dongle, anyone from ali express will do) Mouse: https://de.aliexpress.com/w/wholesale-g102.html?spm=a2g0o.home.search.0 7 USD Monitor: This one if you can still get it: https://www.amazon.co.uk/dp/B07SYLFHNM but anything will do really. AOC is a good brand to search for when buying used monitors, if you are price/performance conscious. They are an LCD manufacturer (chinese), but people usually dont know them. 20 USD is possible. :)

Also if you have another 50 USD to spend, you can also look into buying used intel 7400 systems. Those are more likely to already come with ssds.

notimp commented 2 months ago

Just updated my Intel 4440 PC to Windows 11 24H2. While everything went well, I also read up on the next major windows update (25H2) which will be releasing in the fall of next year, which currently forfeits/disables the update trick used to get Win 11 running on older Intel chips.

This means, that Win 24H2 will loose update support in Fall of 2026 - so will all intel processors sub 7000 series. (Future hacks, or Microsoft changing their policy not withstanding).

So know that when buying a 4440 chip pc today, that system will not receive Windows updates after fall of 2026.

Also Intel Core i5-7640X seems to be the first intel i5 chip with a TPM module supported. And because thats hard to get - Core i5-8400 or Core i5-8600 are now the lowest end Intel chips to go for, if microsofts software restriction stands.