Skip to content

Commit

Permalink
Fix words
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Dec 20, 2023
1 parent 514bcd1 commit 6a12e9e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion python/fastdeploy/pipeline/pptinypose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def predict(self, input_image):

@property
def detection_model_score_threshold(self):
"""Atrribute of PPTinyPose pipeline model. Stating the score threshold for detectin model to filter bbox before inputting pptinypose model
"""Attribute of PPTinyPose pipeline model. Stating the score threshold for detection model to filter bbox before inputting pptinypose model
:return: value of detection_model_score_threshold(float)
"""
Expand Down
4 changes: 1 addition & 3 deletions streamer/python/streamer/c_lib_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
import os
import sys


try:
from .libs.streamer_main import *
except:
raise RuntimeError("FastDeploy Streamer initalized failed!")

raise RuntimeError("FastDeploy Streamer initialized failed!")
20 changes: 13 additions & 7 deletions streamer/src/app/yaml_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include "app/yaml_parser.h"

#include "gstreamer/utils.h"

namespace fastdeploy {
Expand All @@ -28,7 +29,7 @@ YamlParser::YamlParser(const std::string& config_file) {
config_file_ = config_file;
}

void YamlParser::ParseAppConfg(AppConfig& app_config) {
void YamlParser::ParseAppConfig(AppConfig& app_config) {
ValidateConfig();
auto elem = yaml_config_["app"];

Expand All @@ -41,9 +42,11 @@ void YamlParser::ParseAppConfg(AppConfig& app_config) {
FDASSERT(false, "Unsupported app type: %s.", type_str.c_str());
}

app_config.enable_perf_measurement = elem["enable-perf-measurement"].as<bool>();
app_config.enable_perf_measurement =
elem["enable-perf-measurement"].as<bool>();
if (app_config.enable_perf_measurement) {
app_config.perf_interval_sec = elem["perf-measurement-interval-sec"].as<int>();
app_config.perf_interval_sec =
elem["perf-measurement-interval-sec"].as<int>();
}
app_config_ = app_config;
}
Expand Down Expand Up @@ -78,7 +81,8 @@ std::string YamlParser::YamlToPipelineDescStr() {
return pipeline_desc;
}

void YamlParser::ParseElement(const std::string& name, const YAML::Node& properties) {
void YamlParser::ParseElement(const std::string& name,
const YAML::Node& properties) {
if (name == "app") return;

if (name == "nvurisrcbin_list") {
Expand All @@ -93,9 +97,10 @@ void YamlParser::ParseElement(const std::string& name, const YAML::Node& propert
elem_descs_.push_back(elem_desc);
}

void YamlParser::ParseNvUriSrcBinList(const std::string& name, const YAML::Node& properties) {
void YamlParser::ParseNvUriSrcBinList(const std::string& name,
const YAML::Node& properties) {
std::string elem_name = "nvurisrcbin";

auto uri_list = properties["uri-list"].as<std::vector<std::string>>();
auto pad_prefix = properties["pad-prefix"].as<std::string>();
for (size_t i = 0; i < uri_list.size(); i++) {
Expand All @@ -111,7 +116,8 @@ void YamlParser::ParseNvUriSrcBinList(const std::string& name, const YAML::Node&
}
}

std::string YamlParser::ParseProperty(const YAML::Node& name, const YAML::Node& value) {
std::string YamlParser::ParseProperty(const YAML::Node& name,
const YAML::Node& value) {
std::string prop_name = name.as<std::string>();
std::string prop_value = value.as<std::string>();

Expand Down
2 changes: 1 addition & 1 deletion streamer/src/app/yaml_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class YamlParser {
*/
explicit YamlParser(const std::string& config_file);

void ParseAppConfg(AppConfig& app_config);
void ParseAppConfig(AppConfig& app_config);

void ValidateConfig();

Expand Down
13 changes: 5 additions & 8 deletions streamer/src/fd_streamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
// limitations under the License.

#include "fd_streamer.h"
#include "app/yaml_parser.h"

#include "app/video_analytics.h"
#include "app/video_decoder.h"
#include "app/yaml_parser.h"
#include "fastdeploy/utils/unique_ptr.h"

namespace fastdeploy {
Expand All @@ -24,7 +25,7 @@ namespace streamer {
bool FDStreamer::Init(const std::string& config_file) {
AppConfig app_config;
YamlParser parser(config_file);
parser.ParseAppConfg(app_config);
parser.ParseAppConfig(app_config);
if (app_config.type == AppType::VIDEO_ANALYTICS) {
app_ = utils::make_unique<VideoAnalyticsApp>(app_config);
auto casted_app = dynamic_cast<VideoAnalyticsApp*>(app_.get());
Expand All @@ -39,13 +40,9 @@ bool FDStreamer::Init(const std::string& config_file) {
return true;
}

bool FDStreamer::Run() {
return app_->Run();
}
bool FDStreamer::Run() { return app_->Run(); }

bool FDStreamer::RunAsync() {
return app_->RunAsync();
}
bool FDStreamer::RunAsync() { return app_->RunAsync(); }

bool FDStreamer::TryPullFrame(FDTensor& tensor, int timeout_ms) {
auto casted_app = dynamic_cast<VideoDecoderApp*>(app_.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def get_result(self):
thread_num = args.thread_num
image_num_each_thread = int(len(imgs_list) / thread_num)
# unless you want independent model in each thread, actually model.clone()
# is the same as model when creating thead because of the existence of
# is the same as model when creating thread because of the existence of
# GIL(Global Interpreter Lock) in python. In addition, model.clone() will consume
# additional memory to store independent member variables
for i in range(thread_num):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def get_result(self):
thread_num = args.thread_num
image_num_each_thread = int(len(imgs_list) / thread_num)
# unless you want independent model in each thread, actually model.clone()
# is the same as model when creating thead because of the existence of
# is the same as model when creating thread because of the existence of
# GIL(Global Interpreter Lock) in python. In addition, model.clone() will consume
# additional memory to store independent member variables
for i in range(thread_num):
Expand Down

0 comments on commit 6a12e9e

Please sign in to comment.