Ani*_*rma 5 c++ flags mediapipe
DEFINE_string(
calculator_graph_config_file, "",
"Name of file containing text format CalculatorGraphConfig proto.");
Run Code Online (Sandbox Code Playgroud)
这是 Google 的 mediapipe 提供的用于图像识别的代码的一部分,有人可以告诉我这个 (DEFINE_string) 的作用吗?
这只是一个定义标志的函数......更具体地说是一个宏函数,在此处的文档中进行了描述:
定义标志很简单:只需根据您想要的标志类型使用适当的宏,如 gflags/gflags.h 底部所定义。这是一个示例文件 foo.cc:
所以你不能只定义字符串标志,你也可以
DEFINE_bool: boolean
DEFINE_int32: 32-bit integer
DEFINE_int64: 64-bit integer
DEFINE_uint64: unsigned 64-bit integer
DEFINE_double: double
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4268 次 |
| 最近记录: |