kfiraberman / neural_best_buddies Goto Github PK
View Code? Open in Web Editor NEWAn algorithm for sparse semantic correspondence between images of different categories [SIGGRAPH 2018]
License: MIT License
An algorithm for sparse semantic correspondence between images of different categories [SIGGRAPH 2018]
License: MIT License
Dear pro:
Hello, I download this and try to run it,but it seem use GPU acceleration by default. it met an error "RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at /pytorch/aten/src/THC/THCGeneral.cpp:74
"
My pc only support cpu env?could you tell me how to switch it?Thank you!
Remove the use in openCV. Use the points returned by the algorithm, instead of reading them from the files.
hi guys,
thanks for the paper and code. I forked it and made quick hack to run it in jupyter notebook and add a pip installer; (https://github.com/xkunglu/neural_best_buddies) Im working on features and wanted to see what potential your methods have. The method is not rotation, scale invariant but it is domain invariant; so I agree that it could become part of a powerful descriptor.
If you guys want I do a pull request. But maybe my changes are too invasive for you and I do agree that they would need further factorization;
If you do put more work in this; I would love to see the following.
In case you think my changes dont go towards your path Ill put a list couple fixes that you may want to look at:
I ran the code on LFW faces and I had to force scaling to 224x224 otherwise I ended up with some misshaped tensors - I didnt look into why too much. Perhaps theres something wrong with transforms.Resize and .Scale with torchvision 0.2.1 in python 3.6.5 -
There were a couple pytorch deprecation warnings.
line 95 of vgg19_model.py
#replaced .data()[0] with .item() - deprecated in pytorch> 0.5
error = loss_perceptual.item()
util.py get_transforms
#replaced .Scale by .Resize - deprecated in pytorch> 0.5
transform_list.append(transforms.Resize(osize, Image.BICUBIC))
regards
xk
would be nice to have setup.py / requirements.txt for easier demo running
In readme.md
Paper links to https://arxiv.org/pdf/1805.04140.pds
It seems to be a typo. It should be https://arxiv.org/pdf/1805.04140.pdf
can you release the code of automatic cross-domain Image morphing?
thx
Hello, I want to thank you for giving this research and result. It is a very powerful method.
And I am interested in the image morphing process, so could you release the code about the image morphing process?
Thanks
Hi KFIR,
I tried to run in windows but fail. I says:
(python35) C:\Users\Dell\Desktop\neural_best_buddies>python main.py --datarootA ./images/original_A.png --datarootB ./images/original_B.png --name lion_cat --k_final 10
------------ Options -------------
batchSize: 1
beta1: 0.5
border_size: 7
convergence_threshold: 0.001
datarootA: ./images/original_A.png
datarootB: ./images/original_B.png
fast: False
gamma: 1
gpu_ids: [0]
imageSize: 224
input_nc: 3
k_final: 10
k_per_level: inf
lr: 0.05
name: lion_cat
niter_decay: 100
results_dir: ./results
save_path: None
tau: 0.05
-------------- End ----------------
D:\Anaconda3\envs\python35\lib\site-packages\torchvision\transforms\transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
"please use transforms.Resize instead.")
Saving original images...
Starting algorithm...
Finding best-buddies for the 5-th level
Drawing correspondence...
D:\Anaconda3\envs\python35\lib\site-packages\torch\nn\functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='elementwise_mean' instead.
warnings.warn(warning.format(ret))
D:\Anaconda3\envs\python35\lib\site-packages\torch\nn\modules\upsampling.py:122: UserWarning: nn.Upsampling is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.Upsampling is deprecated. Use nn.functional.interpolate instead.")
Finding best-buddies for the 4-th level
Drawing correspondence...
Finding best-buddies for the 3-th level
Drawing correspondence...
Finding best-buddies for the 2-th level
Drawing correspondence...
Finding best-buddies for the 1-th level
Drawing correspondence...
No. of correspondence: 160
Calculating K-means...
### Traceback (most recent call last):
File "main.py", line 19, in
mls.run_MLS_in_folder(root_folder=save_dir)
File "C:\Users\Dell\Desktop\neural_best_buddies\util\MLS.py", line 182, in run_MLS_in_folder
warp_AtoB, vxy_AtoB = mls_util.run_MLS(img_A, points_A, points_B)
File "C:\Users\Dell\Desktop\neural_best_buddies\util\MLS.py", line 168, in run_MLS
warp_image, vxy = self.warp_MLS(img, points_start, points_end)
File "C:\Users\Dell\Desktop\neural_best_buddies\util\MLS.py", line 141, in warp_MLS
warpped_image, vxy = self.mlsd_2d_warp(image, mlsd, points_end, grid_x, grid_y)
File "C:\Users\Dell\Desktop\neural_best_buddies\util\MLS.py", line 133, in mlsd_2d_warp
warped_image[x, y] = self.bilinear_interp(source_x, source_y, image)
File "C:\Users\Dell\Desktop\neural_best_buddies\util\MLS.py", line 43, in bilinear_interp
+ a * b * image[x_c, y_c]
IndexError: index -297 is out of bounds for axis 0 with size 284
I don't know why x_c or y_c is a negative number. Could you please give me some idea? Must I run this code in Linux or macOS instead of Windows?
Best Regard,
Jiajing Chan.
Why I usually get Out of range of index when warping error, when running mlsd_2d_warp function??
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.