【问题标题】:How to train shape predictor dlib如何训练形状预测器 dlib
【发布时间】:2019-07-19 09:12:10
【问题描述】:

你能帮帮我吗?我想知道如何从 dlib 训练形状预测器。我得到了这个网站http://dlib.net/train_shape_predictor.py.html我已经下载了预测器

但是,我还是不明白

 if len(sys.argv) != 2:
print(
    "Give the path to the examples/faces directory as the argument to this "
    "program. For example, if you are in the python_examples folder then "
    "execute this program by running:\n"
    "    ./train_shape_predictor.py ../examples/faces")
exit()

faces_folder = sys.argv[1]

参数是什么意思?我必须把预测器放在哪里?我是新手程序员,所以请向我解释一下。 非常感谢

【问题讨论】:

    标签: python dlib facial-identification


    【解决方案1】:

    您在自己提供的示例代码中给出了答案。 python 脚本将从控制台窗口运行。所以打开一个控制台,导航到脚本所在的文件夹并执行给定的命令:./train_shape_predictor.py ../examples/faces

    如果您将训练集放在不同的文件夹中,则必须将 ../examples/faces 部分替换为适当的路径。

    关于你的问题参数是什么意思:当你执行时

    ./train_shape_predictor.py ../examples/faces
    

    那么argv[0] 就是./train_shape_predictor.py 并且argv[1] 就是../examples/faces。这样,当您从控制台运行它时,您可以将信息传递给 Python 脚本。

    【讨论】:

      猜你喜欢
      • 2019-06-06
      • 2018-10-01
      • 2019-02-18
      • 2017-05-29
      • 2019-05-28
      • 2019-03-07
      • 2019-10-20
      • 2018-10-19
      • 2021-02-22
      相关资源
      最近更新 更多