Commit 8db64b68 authored by Davis King's avatar Davis King

just renamed voc to xml

--HG--
rename : tools/imglab/src/convert_pascal_voc.cpp => tools/imglab/src/convert_pascal_xml.cpp
parent dc3f4205
...@@ -18,8 +18,8 @@ ADD_EXECUTABLE(${target_name} ...@@ -18,8 +18,8 @@ ADD_EXECUTABLE(${target_name}
src/image_dataset_metadata.cpp src/image_dataset_metadata.cpp
src/metadata_editor.h src/metadata_editor.h
src/metadata_editor.cpp src/metadata_editor.cpp
src/convert_pascal_voc.h src/convert_pascal_xml.h
src/convert_pascal_voc.cpp src/convert_pascal_xml.cpp
src/convert_pascal_v1.h src/convert_pascal_v1.h
src/convert_pascal_v1.cpp src/convert_pascal_v1.cpp
src/common.h src/common.h
......
#include "convert_pascal_voc.h" #include "convert_pascal_xml.h"
#include "image_dataset_metadata.h" #include "image_dataset_metadata.h"
#include <iostream> #include <iostream>
#include <dlib/xml_parser.h> #include <dlib/xml_parser.h>
...@@ -163,11 +163,11 @@ namespace ...@@ -163,11 +163,11 @@ namespace
} }
void convert_pascal_voc( void convert_pascal_xml(
const parser_type& parser const parser_type& parser
) )
{ {
cout << "Convert from PASCAL VOC annotation format..." << endl; cout << "Convert from PASCAL XML annotation format..." << endl;
dlib::image_dataset_metadata::dataset dataset; dlib::image_dataset_metadata::dataset dataset;
...@@ -185,8 +185,8 @@ void convert_pascal_voc( ...@@ -185,8 +185,8 @@ void convert_pascal_voc(
try try
{ {
parse_annotation_file(parser[i], img, name); parse_annotation_file(parser[i], img, name);
const string voc_root = get_parent_directory(get_parent_directory(file(parser[i]))).full_name(); const string root = get_parent_directory(get_parent_directory(file(parser[i]))).full_name();
const string img_path = voc_root + directory::get_separator() + "JPEGImages" + directory::get_separator(); const string img_path = root + directory::get_separator() + "JPEGImages" + directory::get_separator();
dataset.name = name; dataset.name = name;
img.filename = strip_path(img_path + img.filename, parent_dir); img.filename = strip_path(img_path + img.filename, parent_dir);
......
#include "image_dataset_metadata.h" #include "image_dataset_metadata.h"
#include "metadata_editor.h" #include "metadata_editor.h"
#include "convert_pascal_voc.h" #include "convert_pascal_xml.h"
#include "convert_pascal_v1.h" #include "convert_pascal_v1.h"
#include <iostream> #include <iostream>
...@@ -125,7 +125,7 @@ int main(int argc, char** argv) ...@@ -125,7 +125,7 @@ int main(int argc, char** argv)
parser.add_option("rename", "Rename all labels of <arg1> to <arg2>.",2); parser.add_option("rename", "Rename all labels of <arg1> to <arg2>.",2);
parser.add_option("v","Display version."); parser.add_option("v","Display version.");
parser.add_option("convert","Convert foreign image Annotations from <arg> format to the imglab format. " parser.add_option("convert","Convert foreign image Annotations from <arg> format to the imglab format. "
"Supported formats: pascal-voc, pascal-v1",1); "Supported formats: pascal-xml, pascal-v1",1);
parser.parse(argc, argv); parser.parse(argc, argv);
...@@ -138,7 +138,7 @@ int main(int argc, char** argv) ...@@ -138,7 +138,7 @@ int main(int argc, char** argv)
parser.check_incompatible_options("l", "rename"); parser.check_incompatible_options("l", "rename");
parser.check_incompatible_options("convert", "l"); parser.check_incompatible_options("convert", "l");
parser.check_incompatible_options("convert", "rename"); parser.check_incompatible_options("convert", "rename");
const char* convert_args[] = {"pascal-voc","pascal-v1"}; const char* convert_args[] = {"pascal-xml","pascal-v1"};
parser.check_option_arg_range("convert", convert_args); parser.check_option_arg_range("convert", convert_args);
if (parser.option("h")) if (parser.option("h"))
...@@ -162,8 +162,8 @@ int main(int argc, char** argv) ...@@ -162,8 +162,8 @@ int main(int argc, char** argv)
{ {
if (parser.option("convert")) if (parser.option("convert"))
{ {
if (parser.option("convert").argument() == "pascal-voc") if (parser.option("convert").argument() == "pascal-xml")
convert_pascal_voc(parser); convert_pascal_xml(parser);
else if (parser.option("convert").argument() == "pascal-v1") else if (parser.option("convert").argument() == "pascal-v1")
convert_pascal_v1(parser); convert_pascal_v1(parser);
} }
......
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