Giter Club home page Giter Club logo

derendering-text's People

Contributors

ciela avatar shimoda-uec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

derendering-text's Issues

name 'get_color' is not defined

when I run this python gen.py --bgtype=color, there is a error:
[D 220704 06:56:21 handler:78] placement False [D 220704 06:56:21 gen_mode:105] 10, 0, 10000 Traceback (most recent call last): File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/handler.py", line 32, in sample_and_render placed = self.sampler.sample(ih, dh) File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler.py", line 71, in sample style_data = self.style_sampler.sample(ih, dh) File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler_lib/style_sampler.py", line 30, in sample effect_params = self.get_style_params( File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler_lib/style_sampler.py", line 21, in get_style_params grad_param = skp.get_gradation_param( File "/home/yonghui_li/Image_generate/derendering-text/src/skia_lib/skia_paintor.py", line 85, in get_gradation_param color = get_color() NameError: name 'get_color' is not defined Traceback (most recent call last): File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/handler.py", line 32, in sample_and_render placed = self.sampler.sample(ih, dh) File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler.py", line 71, in sample style_data = self.style_sampler.sample(ih, dh) File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler_lib/style_sampler.py", line 30, in sample effect_params = self.get_style_params( File "/home/yonghui_li/Image_generate/derendering-text/src/modules/generator/src/sampler_lib/style_sampler.py", line 21, in get_style_params grad_param = skp.get_gradation_param( File "/home/yonghui_li/Image_generate/derendering-text/src/skia_lib/skia_paintor.py", line 85, in get_gradation_param color = get_color() NameError: name 'get_color' is not defined

error in generate pre-rendered alpha maps for stoke

generate pre-rendered alpha maps for stroke
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\derendering-text-master\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\envs\derendering-text-master\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 118, in
main()
File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 113, in main
gen_stroke_pams(char_dict)
File "C:\Users\mowe\Desktop\projects\derendering-text-master\util_lib\gen_pams.py", line 94, in gen_stroke_pams
alpha_crop = cv2.resize(
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

error runing test.py file in cpu mode.

Hi, first of all let me congratulate you for this fantastic work.
After following the installation instructions I tried to run the usage example in cpu_mode
python test.py --imgfile=example/sample.jpg --use_cpu=1
and I get the following error:
[E 230209 19:16:52 test:125] Unexpected error has occurred
Traceback (most recent call last):
File "test.py", line 123, in
main(args)
File "test.py", line 88, in main
test(
File "test.py", line 53, in test
vd, rec_img = vectorize(pil_img, inps, outs)
File "/home/ariel/repos/derendering-text/src/modules/postprocess/vector.py", line 114, in vectorize
tb_param, effect_param, effect_visibility = extract_rendering_params(
File "/home/ariel/repos/derendering-text/src/modules/postprocess/manipulate.py", line 286, in extract_rendering_params
tb_param = get_textblob_param_with_affine(
File "/home/ariel/repos/derendering-text/src/modules/postprocess/rpe.py", line 515, in get_textblob_param_with_affine
text_form_dto = TextFormData(
TypeError: init() missing 1 required positional argument: 'text_index'

what I can see in the file dto_skia.py, is that the dataclass TextFromData requires a text_index: int value that is not set in rpe.py file. Please, let me know if you need more info in order to reproduce this error.
Best,
A.

for prerendering, 0-dimensional alpha_crop causes resize error.

I appreciate the provided code and tried myself.

For the prerendering script python -m util_lib.gen_pams

Following resize code causes error:

alpha_crop, (64, 64), interpolation=cv2.INTER_CUBIC)

This is beause why alpha_crop = crop_alpha_area(alpha) results some (0,n) or (n,0) shaped array, therefore resize is impossible.
To deal with this, I temporarily altered code and checked how this issue as following:

image

and this is following logs:

image

Is this ok? Looks like lots of crop errors occur and result resizing error.

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.