Skip to content

Comments

handle spaces in image file names#4059

Merged
longjon merged 1 commit intoBVLC:masterfrom
crazytan:master
May 18, 2016
Merged

handle spaces in image file names#4059
longjon merged 1 commit intoBVLC:masterfrom
crazytan:master

Conversation

@crazytan
Copy link
Contributor

No description provided.

@seanbell
Copy link

seanbell commented Apr 27, 2016

Can you add a unit test that verifies this behavior?

Also, before this can be merged, it should be squashed into a single commit.

@crazytan
Copy link
Contributor Author

sure. just found that CI failed :(

@crazytan
Copy link
Contributor Author

I add a unit test and a new image in examples.

@seanbell
Copy link

Thanks for the test case; LGTM!

@bchu
Copy link
Contributor

bchu commented May 16, 2016

Overlaps with these other 2 pull requests:

#3433

#1971

I'm a bit perplexed why this issue hasn't been fixed yet. It's a pretty big bug.

LOG(INFO) << "Opening file " << source;
std::ifstream infile(source.c_str());
string filename;
std::string line;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we switch from string to std::string here? If we're going to using things (and we do using std::string in common.hpp), then I'd rather consistently drop the namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I didn't notice that we're using std::string, I'll remove std::

@longjon
Copy link
Contributor

longjon commented May 17, 2016

Just added some minor stylistic comments, and then I'd like to proceed with this PR; #3433 is essentially similar, but this one fixes some issues there; we'll credit @bchu for the original implementation in the merge message.

#1971 is more complex and not presently ready for merge, so let's wait to consider a possible future rebase of that.

std::ofstream spacefile(filename_space_.c_str(), std::ofstream::out);
LOG(INFO) << "Using temporary file " << filename_space_;
spacefile << EXAMPLES_SOURCE_DIR "images/cat.jpg " << 0 << std::endl;
spacefile << EXAMPLES_SOURCE_DIR "images/cat gray.jpg " << 1 << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note (don't fix it here): it seems awkward to me to keep test-dependent files in the examples/ directory...

@longjon
Copy link
Contributor

longjon commented May 18, 2016

This looks good, thanks for addressing this long-standing issue!

@bchu
Copy link
Contributor

bchu commented May 19, 2016

Could you close this issue: #1935?

fxbit pushed a commit to Yodigram/caffe that referenced this pull request Sep 1, 2016
handle spaces in image file names

Thanks @bchu for an earlier implementation.
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

Successfully merging this pull request may close these issues.

4 participants