def __init__(self): super().__init__() self.model_pose = cli.StringFlagBuilder().set_long_name( "--model_folder").set_help("path to the model").build() self.model_flag = cli.StringChoicesFlagBuilder("BODY_25", [ "BODY_25", "COCO", "MPI" ]).set_long_name("--model_pose").set_help("model to be used").build() self.hand_flag = cli.BoolFlagBuilder().set_long_name( "--hand").set_help("whether enable to detect hand").build() self.face_flag = cli.BoolFlagBuilder().set_long_name( "--face").set_help("whether enable to detect face").build()
def __init__(self, default_width=640, default_height=480, default_fps=30, default_pixel_format=PIXEL_FORMAT_BGR): super().__init__() self.channel_type_flag.release() self.channel_type_flag = None self.device_list_flag = cli.BoolFlagBuilder().set_short_name("-l").set_long_name("--device_list").set_help( "whether it shows device list, If you don't know which device index to pass, then try this option!").build() self.device_index_flag = cli.IntFlagBuilder().set_short_name("-i").set_long_name("--device_index").set_help( "device index for camera").build() self.width_flag = cli.IntDefaultFlagBuilder(default_width).set_short_name("-w").set_long_name("--width").set_help( "camera frame width (default: {})".format(default_width)).build() self.height_flag = cli.IntDefaultFlagBuilder(default_height).set_short_name("-h").set_long_name("--height").set_help( "camera frame height (default: {})".format(default_height)).build() self.fps_flag = cli.FloatDefaultFlagBuilder(default_fps).set_short_name("-f").set_long_name("--fps").set_help( "frame per second (default: {})".format(default_fps)).build() kDefaultPixelFormats = [ PIXEL_FORMAT_BGR, PIXEL_FORMAT_BGRA, PIXEL_FORMAT_RGB, PIXEL_FORMAT_RGBA] final_pixel_format = PIXEL_FORMAT_BGR for pixel_format in kDefaultPixelFormats: if pixel_format == default_pixel_format: final_pixel_format = pixel_format break self.pixel_format_flag = cli.StringChoicesFlagBuilder( PixelFormat.Name(final_pixel_format), [ PixelFormat.Name(PIXEL_FORMAT_BGR), PixelFormat.Name(PIXEL_FORMAT_BGRA), PixelFormat.Name(PIXEL_FORMAT_RGB), PixelFormat.Name(PIXEL_FORMAT_RGBA) ]).set_long_name("--pixel_format").set_help("pixel_format (default: {})".format(final_pixel_format)).build()
def __init__(self): super().__init__() self.is_server_flag = cli.BoolFlagBuilder( ).set_long_name("--server").set_help( "create server node, if set, default: false(create client node)" ).build() self.service_flag = cli.StringFlagBuilder().set_short_name( "-s").set_long_name("--service").set_long_name( "--service").set_help( "name for service, it's required to be set").build()
def __init__(self): super().__init__() self.is_publshing_node_flag = cli.BoolFlagBuilder( ).set_short_name("-p").set_help( "create publishing node, if set, default: false(create subscribing node)" ).build() self.use_ssl_flag = cli.BoolFlagBuilder( ).set_long_name("--use_ssl").set_help( "use communication via ssl connection, default: false").build() self.topic_flag = cli.StringFlagBuilder().set_short_name( "-t").set_long_name("--topic").set_help( "name for topic, it's required to be set").build() self.channel_type_flag = cli.StringChoicesFlagBuilder( ChannelDef.Type.Name(ChannelDef.CHANNEL_TYPE_TCP), [ ChannelDef.Type.Name(ChannelDef.CHANNEL_TYPE_TCP), ChannelDef.Type.Name(ChannelDef.CHANNEL_TYPE_UDP), ChannelDef.Type.Name(ChannelDef.CHANNEL_TYPE_UDS), ChannelDef.Type.Name(ChannelDef.CHANNEL_TYPE_SHM), ] ).set_short_name("-c").set_long_name("--channel_type").set_help( "protocol to deliver message, it only works for publishing node" ).build()