GithubHelp home page GithubHelp logo

Ubuntu no Airal Font! (Solved) about anytext HOT 6 CLOSED

tyxsspa avatar tyxsspa commented on July 20, 2024
Ubuntu no Airal Font! (Solved)

from anytext.

Comments (6)

yhyu13 avatar yhyu13 commented on July 20, 2024 4

Hi, this font file is copyrighted, and we cannot provide a download. You will need to prepare it yourself, as comments in the Installation section:

# Prepare a font file; Arial Unicode MS is recommended, **you need to download it on your own**
mv your/path/to/arialuni.ttf ./font/Arial_Unicode.ttf

I found link to the font which would work https://freefonts.co/fonts/arial-unicode-ms-regular

from anytext.

tyxsspa avatar tyxsspa commented on July 20, 2024

Hi, this font file is copyrighted, and we cannot provide a download. You will need to prepare it yourself, as comments in the Installation section:

# Prepare a font file; Arial Unicode MS is recommended, **you need to download it on your own**
mv your/path/to/arialuni.ttf ./font/Arial_Unicode.ttf

from anytext.

yhyu13 avatar yhyu13 commented on July 20, 2024

ok, Thnaks!

Is there a way to config the path to the font other than the default path? The font_path argument is part of some config file I believe

from anytext.

tyxsspa avatar tyxsspa commented on July 20, 2024

ok, Thnaks!

Is there a way to config the path to the font other than the default path? The font_path argument is part of some config file I believe

Yes, you can modify the MyCustomModel::init_model() in ms_wrapper.py(this file is located at where your model downloaded, by default it's: ~/.cache/modelscope/hub):

def init_model(self, **kwargs):
    font_path = kwargs.get('font_path', 'font/Arial_Unicode.ttf')  # <---Here!
    self.font = ImageFont.truetype(font_path, size=60)
    cfg_path = kwargs.get('cfg_path', 'models_yaml/anytext_sd15.yaml')
    ckpt_path = kwargs.get('model_path', os.path.join(self.model_dir, 'anytext_v1.1.ckpt'))
    clip_path = os.path.join(self.model_dir, 'clip-vit-large-patch14')
    self.model = create_model(cfg_path, cond_stage_path=clip_path).cuda().eval()
    self.model.load_state_dict(load_state_dict(ckpt_path, location='cuda'), strict=False)
    self.ddim_sampler = DDIMSampler(self.model)
    self.trans_pipe = pipeline(task=Tasks.translation, model=os.path.join(self.model_dir, 'nlp_csanmt_translation_zh2en'))

from anytext.

yhyu13 avatar yhyu13 commented on July 20, 2024

@tyxsspa That file is protected by some modelscope revision mechanism that will reset my modification before loading the model.

from anytext.

tyxsspa avatar tyxsspa commented on July 20, 2024

@tyxsspa That file is protected by some modelscope revision mechanism that will reset my modification before loading the model.

This is a bit strange. In my case, as long as the file name is not changed, modifying the code does not trigger the model scope revision mechanism.

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.