stacyyang / mxnet-gluon-style-transfer Goto Github PK
View Code? Open in Web Editor NEWNeural Style and MSG-Net
Home Page: http://computervisionrutgers.github.io/MSG-Net/
License: MIT License
Neural Style and MSG-Net
Home Page: http://computervisionrutgers.github.io/MSG-Net/
License: MIT License
I was trying to put a symbol into the model and save it as a symbolic network, but many of the Hybrid things only implement forward and not hybrid_forward.
I am struggling to do this myself.
do you know if anybody else has already done this as an exercise.
I am stuck on Inspiration(HybridBlock)
I was able to do Reflectance padding on my own after reading this document:
http://gluon.mxnet.io/chapter07_distributed-learning/hybridize.html
Any help would be apprieciated.
It would be a textbook example of being able to train in Python and deploy in C++
Sam
@zhanghang1989
Thanks for sharing this nice project.
I am trying to use only the evaluate method.
What value of args.ngf
should I give ?
Rest all args
are handled, but for this I am not able to find the default value.
Hi Hang,
In the paper, you have proposed an upsampled convolution to replace traditional deconvolution. However, in the code, it seems that upsampling + convolution is used instead of your proposed upsampled conv. May I ask how to implement your version of upsampled convolution?
Best,
Ed
hi:
I have tried to run
python main.py optim --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg
but I got an error:
LocalFileSystem: fail to open "models\mxvgg.params"
I have checked the models dir, which there is no mxvgg.params file, but it has an download_model.sh script,
then, but it only download 21styles.params no mxvgg.params.
where can i find mxvgg.params?
Line 145-148 in main.py
I think content_image is obtained in RBG fomat.
However, utils.subtract_imagenet_mean_preprocess_batch take img in BGR fomat.
Is that right?
#main.py
content_image = utils.tensor_load_rgbimage(args.content_image,ctx, size=args.content_size, keep_asp=True)
content_image = utils.subtract_imagenet_mean_preprocess_batch(content_image)
style_image = utils.tensor_load_rgbimage(args.style_image, ctx, size=args.style_size)
style_image = utils.subtract_imagenet_mean_preprocess_batch(style_image)
#utils.py
def subtract_imagenet_mean_preprocess_batch(batch):
"""Subtract ImageNet mean pixel-wise from a BGR image."""
batch = F.swapaxes(batch,0, 1)
(r, g, b) = F.split(batch, num_outputs=3, axis=0)
And I think a better understanding way to transform RGB to BGR or vise versa is to use:
F.swapaxes(batch,0, 1) is not that obvious.
rgb_img = bgr_img[::-1,,] # C*H*W
bgr_img = rgb_img[::-1,,] # C*H*W
Hi, I tried the following command as you provide:
python main.py eval --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg --model models/21styles.params --content-size 1024
but got the following error:
Traceback (most recent call last):
File "main.py", line 214, in
main()
File "main.py", line 203, in main
evaluate(args)
File "main.py", line 129, in evaluate
style_model.load_params(args.model, ctx=ctx)
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/block.py", line 317, in load_params
self.prefix)
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/parameter.py", line 669, in load
"Parameter %s is missing in file %s"%(name[lprefix:], filename)
AssertionError: Parameter conv0_weight is missing in file models/21styles.params
I have checked the names of params in 21styles.params,
they are something like model.2.conv_block.2.weight, model.4.conv_block.2.bias and so on.
It seems that the net and the params are not matching.
Can you check that?
Thank you
It may be helpful to keep this code up to date with the code in the mx-net repository for example in main.py load_params has been deprecated and replaced by load_parameters. Alternatively, this repository could be archived with all further development occuring in the mx net repository.
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.