Commit 1b402f4f authored by Davis King's avatar Davis King

Fixed file load bug related to dealing with relative paths correctly. The bug

prevented the load_image_dataset() routine from working on Windows systems in some
cases.
parent bd18d9da
......@@ -38,6 +38,10 @@ namespace dlib
std::vector<std::vector<rectangle> > ignored_rects;
using namespace dlib::image_dataset_metadata;
dataset data;
load_image_dataset_metadata(data, filename);
// Set the current directory to be the one that contains the
// metadata file. We do this because the file might contain
// file paths which are relative to this folder.
......@@ -45,10 +49,7 @@ namespace dlib
set_current_dir(parent_dir);
using namespace dlib::image_dataset_metadata;
dataset data;
load_image_dataset_metadata(data, filename);
image_type img;
std::vector<rectangle> rects, ignored;
......@@ -113,6 +114,10 @@ namespace dlib
object_locations.clear();
const std::string old_working_dir = get_current_dir();
using namespace dlib::image_dataset_metadata;
dataset data;
load_image_dataset_metadata(data, filename);
// Set the current directory to be the one that contains the
// metadata file. We do this because the file might contain
// file paths which are relative to this folder.
......@@ -120,10 +125,6 @@ namespace dlib
set_current_dir(parent_dir);
using namespace dlib::image_dataset_metadata;
dataset data;
load_image_dataset_metadata(data, filename);
std::set<std::string> all_parts;
// find out what parts are being used in the dataset. Store results in all_parts.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment