"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "4cfac7c79cf57edf6771adfa49f8142114e06c57"
Commit 1b402f4f authored by Davis King's avatar Davis King
Browse files

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 ...@@ -38,6 +38,10 @@ namespace dlib
std::vector<std::vector<rectangle> > ignored_rects; 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 // Set the current directory to be the one that contains the
// metadata file. We do this because the file might contain // metadata file. We do this because the file might contain
// file paths which are relative to this folder. // file paths which are relative to this folder.
...@@ -45,10 +49,7 @@ namespace dlib ...@@ -45,10 +49,7 @@ namespace dlib
set_current_dir(parent_dir); set_current_dir(parent_dir);
using namespace dlib::image_dataset_metadata;
dataset data;
load_image_dataset_metadata(data, filename);
image_type img; image_type img;
std::vector<rectangle> rects, ignored; std::vector<rectangle> rects, ignored;
...@@ -113,6 +114,10 @@ namespace dlib ...@@ -113,6 +114,10 @@ namespace dlib
object_locations.clear(); object_locations.clear();
const std::string old_working_dir = get_current_dir(); 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 // Set the current directory to be the one that contains the
// metadata file. We do this because the file might contain // metadata file. We do this because the file might contain
// file paths which are relative to this folder. // file paths which are relative to this folder.
...@@ -120,10 +125,6 @@ namespace dlib ...@@ -120,10 +125,6 @@ namespace dlib
set_current_dir(parent_dir); 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; std::set<std::string> all_parts;
// find out what parts are being used in the dataset. Store results in 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