cyberagentailab / derendering-text Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
I find that you use a func named 'sample_text_type_flags' in 'class OffsetSampler(object)' to define the angle. But it always return 0, maybe it is a error?
pip install -r requiements.txt
==> pip install -r requirements.txt
As you can see, some word images are out of the border, I think maybe there is a error in offset_sampler.py. I try to solve it, but there is still errors.
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
@shimoda-uec Hi, if I want to generate Chinese text images, what modifications do I need to make? Also, any advice to offer?
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'
Thank you for publishing the great work!
There are some mistakes in the bibtex in README.md.
The bibtex in the following link will be helpful.
https://openaccess.thecvf.com/content/ICCV2021/html/Shimoda_De-Rendering_Stylized_Texts_ICCV_2021_paper.html
Great Work! BTW, will the demo app be released? I would really like to try( it's so amzing
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.
I appreciate the provided code and tried myself.
For the prerendering script python -m util_lib.gen_pams
Following resize code causes error:
derendering-text/util_lib/gen_pams.py
Line 95 in 0273325
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:
and this is following logs:
Is this ok? Looks like lots of crop errors occur and result resizing error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.