Code Monkey home page Code Monkey logo

Comments (5)

tyxsspa avatar tyxsspa commented on July 28, 2024

你好,字体文件需要自行准备,放到指定目录下

from anytext.

QueenPuxxi avatar QueenPuxxi commented on July 28, 2024

谢谢!问题解决了!

from anytext.

fatdennis avatar fatdennis commented on July 28, 2024

如果字體已放了在指定目錄下,但仍出現以下,可怎樣處理?

Traceback (most recent call last):
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\modelscope\utils\registry.py", line 212, in build_from_cfg
return obj_cls(**args)
File "C:\Users\Dennis.cache\modelscope\modelscope_modules\cv_anytext_text_generation_editing\ms_wrapper.py", line 336, in init
pipe_model = AnyTextModel(model_dir=model, **kwargs)
File "C:\Users\Dennis.cache\modelscope\modelscope_modules\cv_anytext_text_generation_editing\ms_wrapper.py", line 46, in init
self.init_model(**kwargs)
File "C:\Users\Dennis.cache\modelscope\modelscope_modules\cv_anytext_text_generation_editing\ms_wrapper.py", line 229, in init_model
self.font = ImageFont.truetype(font_path, size=60)
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\PIL\ImageFont.py", line 996, in truetype
return freetype(font)
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\PIL\ImageFont.py", line 993, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\PIL\ImageFont.py", line 248, in init
self.font = core.getfont(
OSError: cannot open resource

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\AnyText\inference.py", line 3, in
pipe = pipeline('my-anytext-task', model='damo/cv_anytext_text_generation_editing', model_revision='v1.1.1')
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\modelscope\pipelines\builder.py", line 170, in pipeline
return build_pipeline(cfg, task_name=task)
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\modelscope\pipelines\builder.py", line 65, in build_pipeline
return build_from_cfg(
File "C:\Users\Dennis.conda\envs\anytext\lib\site-packages\modelscope\utils\registry.py", line 215, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
OSError: AnyTextPipeline: cannot open resource

from anytext.

tyxsspa avatar tyxsspa commented on July 28, 2024

OSError: cannot open resource

@fatdennis 你好,这一类错误通常是字体ttf文件有问题无法读取,请尝试重新下载一下。Arial Unicode MS的文件大概是23.3M

from anytext.

maliho0803 avatar maliho0803 commented on July 28, 2024

必须Arial Unicode MS 这个字体?

from anytext.

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.