forked from zyddnys/manga-image-translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_prepare.py
31 lines (27 loc) · 883 Bytes
/
docker_prepare.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
from manga_translator.utils import ModelWrapper
from manga_translator.detection import DETECTORS
from manga_translator.translators import TRANSLATORS
from manga_translator.ocr import OCRS
from manga_translator.inpainting import INPAINTERS
from manga_translator.upscaling import UPSCALERS
async def download(dict):
for key, value in dict.items():
if issubclass(value, ModelWrapper):
print(' -- Downloading', key)
inst = value()
await inst.download()
async def main():
await download({
k: v for k, v in TRANSLATORS.items()
if k not in ['offline', 'offline_big', 'nllb', 'nllb_big', 'jparacrawl', 'm2m100']
})
await download(DETECTORS)
await download(OCRS)
await download({
k: v for k, v in INPAINTERS.items()
if k not in ['sd']
})
await download(UPSCALERS)
if __name__ == '__main__':
asyncio.run(main())