Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to use sift in Vlfeat #14

Open
willard-yuan opened this issue Aug 9, 2014 · 7 comments
Open

Problem to use sift in Vlfeat #14

willard-yuan opened this issue Aug 9, 2014 · 7 comments

Comments

@willard-yuan
Copy link

Hi, jesolem. In the sift.py:

    cmmd = str("sift.exe "+imagename+" --output="+resultname+
                " "+params)
    os.system(cmmd)

I have read you blog post Another Python Interface for SIFT. You use the os.system() to call the vlfeat's sift.exe in the context the environment variable has been added to the system path. I did so, but it failed to dectect the sift key points.

Instead, I change it with a full path:

    cmmd = str("D:\\mltools\\vlfeat\\sift.exe "+imagename+" --output="+resultname+
                " "+params)

then it succeeds.

I don't know the reason why the former failed, can you help to let the former succeed?

@jesolem
Copy link
Owner

jesolem commented Aug 12, 2014

Did you add the full (absolute) path to the env variable?

@willard-yuan
Copy link
Author

Yes, I do. I test it under Windows 7 OS. After I add the full path to the env variable, It throws these error:

Traceback (most recent call last):
  File "F:/dropbox/Dropbox/translation/pcv-notebook/ch02/ch02_sift.py", line 14, in <module>
    l1, d1 = sift.read_features_from_file('empire.sift')
  File "C:\Python27\lib\site-packages\PCV\localdescriptors\sift.py", line 30, in read_features_from_file
    f = loadtxt(filename)
  File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 729, in loadtxt
processed tmp.pgm to empire.sift
    fh = iter(open(fname, 'U'))
IOError: [Errno 2] No such file or directory: 'empire.sift'

The error indicates it doesn't find the sift.exe. To solve this problem, I bulid a folder .\\utils\\win32vlfeat\\sift.exe to contains the VLfeat. It's here. I don't think it's not a good way to solve this problem. Is there a perfect way to solve this problem?

@yc-kata
Copy link

yc-kata commented Aug 13, 2014

It's a good way to this question, I think。

At 2014-08-12 08:31:59, "Yong Yuan" notifications@github.com wrote:

Yes, I do. I test it under Windows 7 OS. After I add the full path to the env variable, It throws these error:

Traceback (most recent call last):
File "F:/dropbox/Dropbox/translation/pcv-notebook/ch02/ch02_sift.py", line 14, in
l1, d1= sift.read_features_from_file('empire.sift')
File "C:\Python27\lib\site-packages\PCV\localdescriptors\sift.py", line 30, in read_features_from_file
f= loadtxt(filename)
File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 729, in loadtxt
processed tmp.pgm to empire.sift
fh= iter(open(fname, 'U'))
IOError: [Errno 2] No such file or directory: 'empire.sift'

The error indicates it doesn't find the sift.exe. To solve this problem, I bulid a folder .\utils\win32vlfeat\sift.exe to contains the VLfeat. It's here. I don't think it's not a good way to solve this problem. Is there a perfect way to solve this problem?


Reply to this email directly or view it on GitHub.

@willard-yuan
Copy link
Author

It works, but not perfect. I hope to find a method which doesn't need to modify the source code sift.py of library PCV.

@jesolem
Copy link
Owner

jesolem commented Sep 2, 2014

People seem to have problems with the VLFeat executable. I'm going to try to replace that for the next edition. Thanks all.

@willard-yuan
Copy link
Author

Great, I can't wait to read it.

@ngunhaSO
Copy link

@jesolem yes, I would love to read your next edition where you can replace the VLFeat executable by something less platform dependent. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants