GithubHelp home page GithubHelp logo

Comments (8)

JustFrederik avatar JustFrederik commented on June 6, 2024

Read v2 docs for api mode
https://github.com/zyddnys/manga-image-translator?tab=readme-ov-file#api-documentation

from manga-image-translator.

ryuzhaki avatar ryuzhaki commented on June 6, 2024

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.

JustFrederik avatar JustFrederik commented on June 6, 2024

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.

JustFrederik avatar JustFrederik commented on June 6, 2024

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.

JustFrederik avatar JustFrederik commented on June 6, 2024

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.

JustFrederik avatar JustFrederik commented on June 6, 2024

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.

ryuzhaki avatar ryuzhaki commented on June 6, 2024

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.

JustFrederik avatar JustFrederik commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.