当前位置: 首页>>代码示例>>C++>>正文


C++ PathVector::at方法代码示例

本文整理汇总了C++中PathVector::at方法的典型用法代码示例。如果您正苦于以下问题:C++ PathVector::at方法的具体用法?C++ PathVector::at怎么用?C++ PathVector::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PathVector的用法示例。


在下文中一共展示了PathVector::at方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main( int argc, char* argv[] )
{
	std::cout << "\nImporting FACETRACER Data from Annotation Tool into SQLite3 DB " << std::endl;

	//----------------- program options

	po::positional_options_description pod;
	pod.add("sqldb-file",1);
	pod.add("imgdbname",1);
    pod.add("imgfolder",1);
	pod.add("faceindex-file",1);
    pod.add("facestats-file",1);
	pod.add("facelabel-file",1);
	pod.add("attribute-file",1);
	pod.add("clear-sqldb",1);

	po::options_description description("Options");
	description.add_options()
		("help", "produce help message")
		("sqldb-file", po::value< string >(), "sql database file")
		("imgdbname", po::value< string >(), "image database name")
        ("image-folder", po::value< string >(), "image folder")
		("faceindex-file", po::value< string >(), "faceindex file (../faceindex.txt)")
        ("facestats-file", po::value< string >(), "facestats file (../facestats.txt)")
		("facelabel-file", po::value< string >(), "facelabel file (../facelabel.txt)")
		("attribute-file", po::value< string >(), "attribute file (../attribute.txt)")
		("clear-sqldb", po::value< string >(), "optinal: clear sql database (default: false)")
	;

	po::variables_map variablesMap;

	try 
	{
		po::store(po::command_line_parser(argc, argv).options(description).positional(pod).run(), variablesMap);
		po::notify(variablesMap);
    } catch ( const boost::program_options::error& e ) 
	{
        std::cerr << e.what() << std::endl;
    }

	bool showHelp = false;

	string sqlDBFile;
	if (variablesMap.count("sqldb-file"))
		sqlDBFile = variablesMap["sqldb-file"].as<string>();
	else
		showHelp = true;

	string imgDBName;
	if (variablesMap.count("imgdbname"))
		imgDBName = variablesMap["imgdbname"].as<string>();
	else
		showHelp = true;

    string imgFolder;
    if (variablesMap.count("image-folder"))
        imgFolder = variablesMap["image-folder"].as<string>();
    else
        showHelp = true;

    string faceindexFile;
	if (variablesMap.count("faceindex-file"))
		faceindexFile = variablesMap["faceindex-file"].as<string>();
	else
		showHelp = true;


	string facestatsFile;
	if (variablesMap.count("facestats-file"))
		facestatsFile = variablesMap["facestats-file"].as<string>();
	else
		showHelp = true;

	string facelabelFile;
	if (variablesMap.count("facelabel-file"))
		facelabelFile = variablesMap["facelabel-file"].as<string>();
	else
		showHelp = true;
		
	string attributeFile;
	if (variablesMap.count("attribute-file"))
		attributeFile = variablesMap["attribute-file"].as<string>();
	else
		showHelp = true;

	string clearSqlDB;
	if (variablesMap.count("clear-sqldb"))
		clearSqlDB = variablesMap["clear-sqldb"].as<string>();
	else
		clearSqlDB = "false";

	if (variablesMap.count("help") || showHelp)
	{
	    cout << description << "\n";
	    return 1;
	}
    
    std::string basePath = "";

	std::cout << "-------------------------------------------------------" << std::endl;
//.........这里部分代码省略.........
开发者ID:hardegg,项目名称:aflw,代码行数:101,代码来源:facetracer_import.cpp

示例2: main

int main( int argc, char* argv[] )
{
    std::cout << "\nImporting PUT Data from Annotation Tool into SQLite3 DB " << std::endl;

    //----------------- program options

    po::positional_options_description pod;
    pod.add("sqldb-file",1);
    pod.add("imgdbname",1);
    pod.add("image-dir",1);
    pod.add("landmarks-dir",1);
    pod.add("regions-dir",1);
    pod.add("clear-sqldb",1);

    po::options_description description("Options");
    description.add_options()
    ("help", "produce help message")
    ("sqldb-file", po::value< string >(), "sql database file")
    ("imgdbname", po::value< string >(), "image database name")
    ("image-dir", po::value< string >(), "image file path (../Images/XXXX/xxxxxxxx.jpg)")
    ("landmarks-dir", po::value< string >(), "landmarks file path (../LXXX/xxxxxxxx.yml)")
    ("regions-dir", po::value< string >(), "regions file path (../RXXX/xxxxxxxx.yml)")
    ("clear-sqldb", po::value< string >(), "optinal: clear sql database (default: false)")
    ;

    po::variables_map variablesMap;

    try
    {
        po::store(po::command_line_parser(argc, argv).options(description).positional(pod).run(), variablesMap);
        po::notify(variablesMap);
    } catch ( const boost::program_options::error& e )
    {
        std::cerr << e.what() << std::endl;
    }

    bool showHelp = false;

    string sqlDBFile;
    if (variablesMap.count("sqldb-file"))
        sqlDBFile = variablesMap["sqldb-file"].as<string>();
    else
        showHelp = true;

    string imgDBName;
    if (variablesMap.count("imgdbname"))
        imgDBName = variablesMap["imgdbname"].as<string>();
    else
        showHelp = true;

    string imgDir;
    if (variablesMap.count("image-dir"))
        imgDir = variablesMap["image-dir"].as<string>();
    else
        showHelp = true;


    string landmarksDir;
    if (variablesMap.count("landmarks-dir"))
        landmarksDir = variablesMap["landmarks-dir"].as<string>();
    else
        showHelp = true;

    string regionsDir;
    if (variablesMap.count("regions-dir"))
        regionsDir = variablesMap["regions-dir"].as<string>();
    else
        showHelp = true;

    string clearSqlDB;
    if (variablesMap.count("clear-sqldb"))
        clearSqlDB = variablesMap["clear-sqldb"].as<string>();
    else
        clearSqlDB = "false";

    if (variablesMap.count("help") || showHelp)
    {
        cout << description << "\n";
        return 1;
    }

    std::string basePath = "";

    std::cout << "-------------------------------------------------------" << std::endl;
    std::cout << "  Config:" << std::endl;
    std::cout << "    SQL DB Name:     " << sqlDBFile << std::endl;
    std::cout << "    Image DB Name:   " << imgDBName << std::endl;
    std::cout << "    Image Folder:    " << imgDir << std::endl;
    std::cout << "    Landmarks Folder:" << landmarksDir << std::endl;
    std::cout << "    Regions Folder:  " << regionsDir << std::endl;
    std::cout << "    Optional:        clear SqlDB -> " << clearSqlDB << std::endl;
    std::cout << "    Base Path:       " << basePath << std::endl;
    std::cout << "-------------------------------------------------------" << std::endl;


    //------------------ DELETE db entries from sql database
    if (clearSqlDB.compare("true") == 0) {
        cout << " \nCLEAR Sql Database " << endl;
        DeleteSqlEntries dsde;
        dsde.deleteAllSqlEntries(sqlDBFile);
//.........这里部分代码省略.........
开发者ID:hardegg,项目名称:aflw,代码行数:101,代码来源:put_import.cpp


注:本文中的PathVector::at方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。