Comments (8)
Read v2 docs for api mode
https://github.com/zyddnys/manga-image-translator?tab=readme-ov-file#api-documentation
from manga-image-translator.
Am I correct in understanding that v1 is for web mode?
Could you still help how to get when using v2 the final generation result? For v1 it was stored in results/{task_id}.
I do a query on /inpaint_translate, it returns me an array with the data of the individual parts, but without the final image and the results folder are empty
from manga-image-translator.
The api mode does not cache anything. You sent a post request to one of the endpoints and get a json response back. I added it originally for a offline reading app(wip not usable yet) and the ichogo reader(chrome extension). The point of it is that you get an overlay for the file in format of a json.
from manga-image-translator.
You cloud add an extra route if you want the image:
@routes.post("/rendered")
async def rendered_api(req):
nonlocal run_until_state
run_until_state = 'rendering'
return await self.err_handling(self.run_translate, req, self.render_response)
this would require a method to generate a response.
def render_response(self, ctx: Context, return_image: bool):
stream = BytesIO()
#todo add image bytes to stream
return web.Response(body=stream.getvalue(), content_type='image/jpeg')
from manga-image-translator.
To get the image you probably need something like this:
retval, buffer = cv2.imencode('.' + overlay_ext, np.array(ctx.img_rendered))
from manga-image-translator.
The v2 api is only useful if you have your own renderer. I personally dislike inpainting directly into the image because the text might get pixelated due to low res images or the texts are overlapping with each other.
from manga-image-translator.
I agree with your last comment. I was only interested in this feature because of the ability to clear the image from the text, I didn't want to run LaMa separately.
Thank you very much for your help.
from manga-image-translator.
colorize_translate Contains the colorized image without the text & inpaint_translate contains the overlays.
The image is encoded to base64
from manga-image-translator.
Related Issues (20)
- [Bug]: pydensecrf link is broken
- How to use sakura model?
- [Bug]: Something went wrong, please try again HOT 1
- [Bug]: 求助:怎么配置翻译服务 HOT 1
- [Bug]: How to specify output file in demo mode? HOT 3
- [Development Issue] 试图引入Stariver(团子OCR)作为Detector与OCR工具,但输出时遇到了一些问题。
- [Feature Request]: Can we get support for Hindi Language (INDIA) and more website support
- [Bug]: 使用非标准翻译API翻译时,可能会导致输出图片文字空白 HOT 2
- [Bug]: pydenscerf is not working HOT 1
- How to get only the OCR results?
- [Feature Request]: Easy 1 click run/installation HOT 3
- [Feature Request]: using bingchat or copilot with chatgpt4 to translate
- [Bug]: 上传的图片概率性翻译失败
- [Bug]: rendering takes forever
- [Feature Request]: Local LLM Server tranlation support
- [Bug]: Web server giving FileNotFoundError on any inputs HOT 1
- [Bug]: OCR fails to recognise Japanese text in horizontal orientation HOT 7
- [Bug]: ModuleNotFoundError: No module named 'langcodes' HOT 1
- [Bug]: If it's a long picture, the translation will be misplaced HOT 4
- Do I need to use a docker install to host the web server demo? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manga-image-translator.