Skip to content

Commit

Permalink
just renamed voc to xml
Browse files Browse the repository at this point in the history
--HG--
rename : tools/imglab/src/convert_pascal_voc.cpp => tools/imglab/src/convert_pascal_xml.cpp
  • Loading branch information
davisking committed Jul 8, 2011
1 parent dc3f420 commit 8db64b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tools/imglab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ADD_EXECUTABLE(${target_name}
src/image_dataset_metadata.cpp
src/metadata_editor.h
src/metadata_editor.cpp
src/convert_pascal_voc.h
src/convert_pascal_voc.cpp
src/convert_pascal_xml.h
src/convert_pascal_xml.cpp
src/convert_pascal_v1.h
src/convert_pascal_v1.cpp
src/common.h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "convert_pascal_voc.h"
#include "convert_pascal_xml.h"
#include "image_dataset_metadata.h"
#include <iostream>
#include <dlib/xml_parser.h>
Expand Down Expand Up @@ -163,11 +163,11 @@ namespace

}

void convert_pascal_voc(
void convert_pascal_xml(
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;

Expand All @@ -185,8 +185,8 @@ void convert_pascal_voc(
try
{
parse_annotation_file(parser[i], img, name);
const string voc_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 root = get_parent_directory(get_parent_directory(file(parser[i]))).full_name();
const string img_path = root + directory::get_separator() + "JPEGImages" + directory::get_separator();

dataset.name = name;
img.filename = strip_path(img_path + img.filename, parent_dir);
Expand Down
10 changes: 5 additions & 5 deletions tools/imglab/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "image_dataset_metadata.h"
#include "metadata_editor.h"
#include "convert_pascal_voc.h"
#include "convert_pascal_xml.h"
#include "convert_pascal_v1.h"

#include <iostream>
Expand Down Expand Up @@ -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("v","Display version.");
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);

Expand All @@ -138,7 +138,7 @@ int main(int argc, char** argv)
parser.check_incompatible_options("l", "rename");
parser.check_incompatible_options("convert", "l");
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);

if (parser.option("h"))
Expand All @@ -162,8 +162,8 @@ int main(int argc, char** argv)
{
if (parser.option("convert"))
{
if (parser.option("convert").argument() == "pascal-voc")
convert_pascal_voc(parser);
if (parser.option("convert").argument() == "pascal-xml")
convert_pascal_xml(parser);
else if (parser.option("convert").argument() == "pascal-v1")
convert_pascal_v1(parser);
}
Expand Down

0 comments on commit 8db64b6

Please sign in to comment.