vita-group / shapematchinggan Goto Github PK
View Code? Open in Web Editor NEW[ICCV 2019, Oral] Controllable Artistic Text Style Transfer via Shape-Matching GAN
License: MIT License
[ICCV 2019, Oral] Controllable Artistic Text Style Transfer via Shape-Matching GAN
License: MIT License
Hi, I use another style image as following which you has shown in other place.
I train on this snow style image with the same parameters as you say in README.md. And then I test the model, the result is as following: (two images are with different values of l)
I don't know where the problem is. I hope you can give some suggestions or share the parameter settings of the snow style image you trained before.
Thank you very much.
Hello, Thank you for your excellent job. I wonder the the importance of text distance postprocess. I find that the training text datasets are images with distance postprocess. But it is not used if we do not use "Lgly", which is based on the choice of glyph_preserve. Besides, it is not selected by default in the training code. Thank you.
excuse me ,i am a beginner of gan,i have a stupid question ,how could i run your code?,sorry to disturb you.
Hello, thanks for your excellent job. I wonder why we train in three steps rather than one? Is there any difference? Thank you.
I assume if I retrain the sketch network on higher resolution samples and then train both the structure and texture models on ~same sized samples I can achieve a higher resolution output? Should I also modify the --subimg_size
option?
Have you tried this or seen any issues with network size maxing out the GPU?
Hello, I try to train the balloon special effects by myself but it seems not work and losses fail to converge. Can you provide me with the balloon style image. It would be nice if the model could be shared. Thank you.
The losses are as follows.
Step1, Epoch [40/40][193/200]: LDadv: +300.645, LGadv: +169.652, Lrec: +28.295, Lsty: +0.000
Step1, Epoch [40/40][194/200]: LDadv: +238.255, LGadv: +199.722, Lrec: +27.427, Lsty: +0.000
Step1, Epoch [40/40][195/200]: LDadv: +234.354, LGadv: +199.173, Lrec: +27.108, Lsty: +0.000
Step1, Epoch [40/40][196/200]: LDadv: +160.336, LGadv: +164.670, Lrec: +19.172, Lsty: +0.000
Step1, Epoch [40/40][197/200]: LDadv: +303.344, LGadv: +240.842, Lrec: +25.351, Lsty: +0.000
i have a question with training Texture&Structure
when i training Texture or Structure, the input style should mask and original image both?(side by side) or separate training?(Structure training (mask)) (texture training (original image))
Hi, thank you for your work. Can you share the "water.png" for the dir "./data/style". I just find "fire.png", "leaf.png", "maple.png","sakura.png" and "smoke.png" in that dir.
Thank you very much.
Hi, I tested the pre-trained models you provided, but I feel that the result like the water.gif effect is not very dynamic. I want to make it more deformed.
(1)What can I do? Do I need to change this "--scale -1 --scale_step 0.2 " or something else?
(2) In your paper, it is mentioned that the range of parameter l is [0,1]. What is the reason for this?
Looking forward for your answer.
Thank you.
Which algorithm have you used for image matting? Or did you use Photoshop?
Hello, I wonder if I want to transfer, can I transfer more than one style like fire and water with only one model.
As noted, the project was implemented by python27 & pytorch1.10, but in fact pytorch1.10 is only available in python version >=3.7, soI think it is actually 3.7 instead of 2.7.
此模型已上架至CubeAI ★ 智立方的AI模型超市,并部署于CubeAI能力开放平台提供RESTful API访问接口,欢迎访问!
CubeAI模型超市地址:
https://cubeai.dimpt.com/#/ucumos/solution/e0cf88febd5841e8b810f2da6af71b6e/view
CubeAI能力开放地址:
https://cubeai.dimpt.com/#/ai-ability/ability/84fa502739e44fa586f0ac05fe69165c/view
模型演示界面:
您好,当我运行test.py时出现
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0
是为什么呀
Hi! At present, I want to test multiple images at the same time, and generate a data set under the same style map, but the code level is too naive, and I have tried many modifications without success. Please help me!
Hi
when I run trainStructureTransfer.py
my style image size is 848x650
I got this error
Traceback (most recent call last):
File "trainStructureTransfer.py", line 89, in
main()
File "trainStructureTransfer.py", line 43, in main
opts.Sanglejitter, opts.subimg_size, opts.subimg_size)
File "C:\Users\Artificial Dimension\Desktop\ShapeMatchingGAN\src\utils.py", line 160, in cropping_training_batches
input[:,0] = torch.clamp(input[:,0] + noise[:,0], -1, 1)
RuntimeError: The size of tensor a (256) must match the size of tensor b (254) at non-singleton dimension 1
OS:windows 10
env:Anaconda python 3.7
how to fix it?
thx
Hi, when I read your code :
What is the reason for doing this step (label smoothing)?
Hi!
There's a default license for github projects
https://opensource.stackexchange.com/questions/1720/what-can-i-assume-if-a-publicly-published-project-has-no-license
It is kind of restricted.
Do you plan to add a license to the code?
Hi, I test my images on the pre-trained models you provied. But I found a bit strange in the test results.
For example, in the case of the most deformation, ie scale=1, the test results of fire and water are as follows.
Why is the effect of fire deformation so obvious but water has almost no deformation feeling?
Hi, Thank you for you work!
I want to train my own handwrite dataset, the loss result as following:
Epoch [4/10][1757/6000]: LDadv: +0.302, LGadv: +78.938, Lrec: +0.524
Epoch [4/10][1758/6000]: LDadv: +0.314, LGadv: +78.576, Lrec: +0.518
Epoch [4/10][1759/6000]: LDadv: +0.277, LGadv: +78.604, Lrec: +0.461
Epoch [4/10][1760/6000]: LDadv: +0.260, LGadv: +77.750, Lrec: +0.441
Epoch [4/10][1761/6000]: LDadv: +0.237, LGadv: +77.608, Lrec: +0.524
Epoch [4/10][1762/6000]: LDadv: +0.204, LGadv: +78.481, Lrec: +0.516
Epoch [4/10][1763/6000]: LDadv: +0.254, LGadv: +78.299, Lrec: +0.507
Epoch [4/10][1764/6000]: LDadv: +0.308, LGadv: +79.300, Lrec: +0.587
Epoch [4/10][1765/6000]: LDadv: +0.272, LGadv: +79.734, Lrec: +0.561
Epoch [4/10][1766/6000]: LDadv: +0.255, LGadv: +79.427, Lrec: +0.497
Epoch [4/10][1767/6000]: LDadv: +0.207, LGadv: +79.826, Lrec: +0.448
Epoch [4/10][1768/6000]: LDadv: +0.208, LGadv: +79.392, Lrec: +0.501
Epoch [4/10][1769/6000]: LDadv: +0.177, LGadv: +78.863, Lrec: +0.456
Epoch [4/10][1770/6000]: LDadv: +0.225, LGadv: +78.815, Lrec: +0.495
Epoch [4/10][1771/6000]: LDadv: +0.330, LGadv: +78.598, Lrec: +0.467
Epoch [4/10][1772/6000]: LDadv: +0.341, LGadv: +79.278, Lrec: +0.497
Epoch [4/10][1773/6000]: LDadv: +0.315, LGadv: +78.820, Lrec: +0.593
Epoch [4/10][1774/6000]: LDadv: +0.207, LGadv: +78.609, Lrec: +0.428
Epoch [4/10][1775/6000]: LDadv: +0.190, LGadv: +79.434, Lrec: +0.547
Epoch [4/10][1776/6000]: LDadv: +0.314, LGadv: +79.484, Lrec: +0.582
Epoch [4/10][1777/6000]: LDadv: +0.340, LGadv: +79.534, Lrec: +0.545
Epoch [4/10][1778/6000]: LDadv: +0.240, LGadv: +79.546, Lrec: +0.484
Epoch [4/10][1779/6000]: LDadv: +0.305, LGadv: +79.679, Lrec: +0.552
Epoch [4/10][1780/6000]: LDadv: +0.389, LGadv: +78.796, Lrec: +0.527
Epoch [4/10][1781/6000]: LDadv: +0.341, LGadv: +78.778, Lrec: +0.514
Epoch [4/10][1782/6000]: LDadv: +0.353, LGadv: +78.656, Lrec: +0.610
the LGadv is too large, could you tell me whether the loss is normal? Thanks
can you provide a javascript veision ?please
when I run :
sh ../script/launch_SketchModule.sh
Traceback (most recent call last):
File "/home/lbl/work/ShapeMatchingGAN/src/trainSketchModule.py", line 46, in
main()
File "/home/lbl/work/ShapeMatchingGAN/src/trainSketchModule.py", line 28, in main
opts.text_datasize, trainnum=opts.Btraining_num)
File "/home/lbl/work/ShapeMatchingGAN/src/utils.py", line 82, in load_train_batchfnames
fnames = [('%04d.png' % (i%usenum)) for i in range(trainnum)]
TypeError: 'float' object cannot be interpreted as an integer
class GlyphGenerator(nn.Module):
def init(self, ngf=32, n_layers = 5):
super(GlyphGenerator, self).init()
encoder = []
encoder.append(ReplicationPad2d(padding=4))
encoder.append(Conv2d(out_channels=ngf, kernel_size=9, padding=0, in_channels=3))
encoder.append(LeakyReLU(0.2))
encoder.append(myGConv(ngf*2, 2, ngf))
encoder.append(myGConv(ngf*4, 2, ngf*2))
transformer = []
print(n_layers/2-1)
for n in range(n_layers/2-1):
transformer.append(myGCombineBlock(ngf*4,p=0.0))
# dropout to make model more robust
transformer.append(myGCombineBlock(ngf*4,p=0.5))
transformer.append(myGCombineBlock(ngf*4,p=0.5))
for n in range(n_layers/2+1,n_layers):
transformer.append(myGCombineBlock(ngf*4,p=0.0))
some float in range() are encontered
I get an error when trying the example trainStructureTransfer.py command listed in the README:
Traceback (most recent call last):
File "trainStructureTransfer.py", line 89, in <module>
main()
File "trainStructureTransfer.py", line 35, in main
Xl, X, _, Noise = load_style_image_pair(opts.style_name, scales, netSketch, opts.gpu)
File "/content/ShapeMatchingGAN/src/utils.py", line 119, in load_style_image_pair
Noise = torch.tensor(0).float().repeat(1, 1, 1).expand(3, ori_ht, ori_wd)
TypeError: expand(): argument 'size' must be tuple of ints, but found element of type float at pos 3
Hello, I want to use the text transfer results to merge in another image, can you help me ? Can I make the background transparent ?
Hello, I'm trying to test a model I trained in a bigger range than [0,1]. I tried adding an elif label == -2:
with a while scale <= 2.0:
in the test.py file but I'm not sure if it is the right way or if I should add/change something else. Could you help me, please?
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.