Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update api & feature request #484 & feature request #496 #497

Merged
merged 13 commits into from
Nov 2, 2023
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "mit_tools"]
path = mit_tools
url = https://github.com/JustFrederik/mit_tools
JustFrederik marked this conversation as resolved.
Show resolved Hide resolved
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,57 @@ $ python -m manga_translator -v --mode web --use-cuda

Manual translation replaces machine translation with human translators.
Basic manual translation demo can be found at <http://127.0.0.1:5003/manual> when using web mode.
<details closed>
<summary>API V2</summary>
<br>

```bash
# use `--mode api` to start a web server.
$ python -m manga_translator -v --mode api --use-cuda
# the api will be serving on http://127.0.0.1:5003
```
Api is accepting json(post) and multipart.
<br>
Api endpoints are `/colorize_translate`, `/inpaint_translate`, `/translate`, `/get_text`.
<br>
Valid arguments for the api are:
```
// These are taken from args.py. For more info see README.md
detector: String
ocr: String
inpainter: String
upscaler: String
translator: String
target_language: String
upscale_ratio: Integer
translator_chain: String
selective_translation: String
attempts: Integer
detection_size: Integer // 1024 => 'S', 1536 => 'M', 2048 => 'L', 2560 => 'X'
text_threshold: Float
box_threshold: Float
unclip_ratio: Float
inpainting_size: Integer
det_rotate: Bool
det_auto_rotate: Bool
det_invert: Bool
det_gamma_correct: Bool
min_text_length: Integer
colorization_size: Integer
denoise_sigma: Integer
mask_dilation_offset: Integer
ignore_bubble: Integer
gpt_config: String
filter_text: String
overlay_type: String

// These are api specific args
direction: String // {'auto', 'h', 'v'}
base64Images: String //Image in base64 format
image: Multipart // image upload from multipart
url: String // an url string
```
</details>
<details closed>
<summary>API</summary>
<br>
Expand Down
Loading
Loading