Skip to content

Commit a84e648

Browse files
authored
Prohibit whitespace errors and non ASCII chars (open-edge-platform#56)
1 parent e86a632 commit a84e648

21 files changed

+76
-75
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ Fixes # (issue)
1919
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
2020
- [ ] Did you make sure to update the documentation with your changes?
2121
- [ ] Did you write any new necessary tests?
22-

.github/workflows/test_accuracy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ jobs:
5454
- name: Run CPP Test
5555
run: |
5656
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
57-

.github/workflows/test_precommit.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v2
25+
- name: git --no-pager diff --check $(git hash-object -t tree /dev/null)
26+
run: git --no-pager diff --check $(git hash-object -t tree /dev/null)
27+
- name: Prohibit non ASCII chars in file names
28+
run: test $(git diff --name-only --diff-filter=A -z $(git hash-object -t tree /dev/null) | LC_ALL=C tr -d '[ -~]\0' | wc -c) == 0
29+
- name: "! git grep -n '[^ -~]' -- ':(exclude)model_api/python/openvino/model_api/README.md'"
30+
run: "! git grep -n '[^ -~]' -- ':(exclude)model_api/python/openvino/model_api/README.md'"
2531
- name: Setup Python ${{ matrix.python-version }}
2632
uses: actions/setup-python@v2
2733
with:
@@ -75,7 +81,7 @@ jobs:
7581
runs-on: ubuntu-latest
7682
steps:
7783
- uses: actions/checkout@v2
78-
84+
7985
- name: cppcheck
8086
uses: chmorgan/cppcheck-action@main
8187
with:

examples/cpp/synchronous_api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This example demonstrates how to use a C++ API of OpenVINO Model API for synchro
2121
```
2222
- Build:
2323
```
24-
make -j
24+
make -j
2525
```
2626
- Download a model by running a Python code with Model API, see Python [exaple](../../python/synchronous_api/README.md):
2727
```python

examples/python/serving_api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Serving API example
22
This example demonstrates how to use a Python API of OpenVINO Model API for a remote inference of models hosted with [OpenVINO Model Server](https://docs.openvino.ai/latest/ovms_what_is_openvino_model_server.html). This tutorial assumes that you are familiar with Docker subsystem and includes the following steps:
3-
- Run Docker image with
3+
- Run Docker image with
44
- Instantiate a model
55
- Run inference
66
- Process results

model_api/cpp/adapters/src/openvino_adapter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,3 @@ std::vector<std::string> OpenVINOInferenceAdapter::getOutputNames() const {
8484
const ov::AnyMap& OpenVINOInferenceAdapter::getModelConfig() const {
8585
return modelConfig;
8686
}
87-
88-

model_api/cpp/models/include/models/detection_model_centernet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ModelCenterNet : public DetectionModel {
4949

5050
ModelCenterNet(std::shared_ptr<ov::Model>& model, const ov::AnyMap& configuration);
5151
ModelCenterNet(std::shared_ptr<InferenceAdapter>& adapter);
52-
52+
5353
std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, InferenceInput& input) override;
5454
std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
5555

model_api/cpp/models/include/models/detection_model_retinaface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ModelRetinaFace : public DetectionModelExt {
3434
public:
3535
static const int LANDMARKS_NUM = 5;
3636
static const int INIT_VECTOR_SIZE = 200;
37-
37+
3838
ModelRetinaFace(std::shared_ptr<ov::Model>& model, const ov::AnyMap& configuration);
3939
ModelRetinaFace(std::shared_ptr<InferenceAdapter>& adapter);
4040
using DetectionModelExt::DetectionModelExt;

model_api/cpp/models/include/models/detection_model_retinaface_pt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ModelRetinaFacePT : public DetectionModelExt {
4545
ModelRetinaFacePT(std::shared_ptr<ov::Model>& model, const ov::AnyMap& configuration);
4646
ModelRetinaFacePT(std::shared_ptr<InferenceAdapter>& adapter);
4747
using DetectionModelExt::DetectionModelExt;
48-
48+
4949
std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
5050
static std::string ModelType;
5151

model_api/cpp/models/include/models/model_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ModelBase {
3737
ModelBase(const std::string& modelFile, const std::string& layout = "");
3838
ModelBase(std::shared_ptr<InferenceAdapter>& adapter);
3939
ModelBase(std::shared_ptr<ov::Model>& model, const ov::AnyMap& configuration);
40-
40+
4141
virtual ~ModelBase() = default;
4242

4343
std::shared_ptr<ov::Model> prepare();

model_api/cpp/models/src/classification_model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void ClassificationModel::updateModelInfo() {
128128
std::unique_ptr<ClassificationModel> ClassificationModel::create_model(const std::string& modelFile, const ov::AnyMap& configuration, bool preload) {
129129
auto core = ov::Core();
130130
std::shared_ptr<ov::Model> model = core.read_model(modelFile);
131-
131+
132132
// Check model_type in the rt_info, ignore configuration
133133
std::string model_type = ClassificationModel::ModelType;
134134
try {
@@ -138,7 +138,7 @@ std::unique_ptr<ClassificationModel> ClassificationModel::create_model(const std
138138
} catch (const std::exception& e) {
139139
slog::warn << "Model type is not specified in the rt_info, use default model type: " << model_type << slog::endl;
140140
}
141-
141+
142142
if (model_type != ClassificationModel::ModelType) {
143143
throw ov::Exception("Incorrect or unsupported model_type is provided in the model_info section: " + model_type);
144144
}

model_api/cpp/models/src/detection_model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ std::unique_ptr<DetectionModel> DetectionModel::create_model(const std::string&
9494
} else {
9595
throw ov::Exception("Incorrect or unsupported model_type is provided in the model_info section: " + model_type);
9696
}
97-
97+
9898
detectionModel->prepare();
9999
if (preload) {
100100
detectionModel->load(core);
@@ -126,7 +126,7 @@ std::unique_ptr<DetectionModel> DetectionModel::create_model(std::shared_ptr<Inf
126126
} else {
127127
throw ov::Exception("Incorrect or unsupported model_type is provided: " + model_type);
128128
}
129-
129+
130130
return detectionModel;
131131
}
132132

model_api/cpp/models/src/detection_model_ssd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void ModelSSD::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
206206
inputLayout,
207207
resizeMode,
208208
interpolationMode,
209-
ov::Shape{shape[ov::layout::width_idx(inputLayout)],
209+
ov::Shape{shape[ov::layout::width_idx(inputLayout)],
210210
shape[ov::layout::height_idx(inputLayout)]});
211211

212212
netInputWidth = shape[ov::layout::width_idx(inputLayout)];

model_api/cpp/models/src/detection_model_yolo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static inline float linear(float x) {
9999
}
100100

101101
ModelYolo::ModelYolo(std::shared_ptr<ov::Model>& model, const ov::AnyMap& configuration)
102-
: DetectionModelExt(model, configuration) {
102+
: DetectionModelExt(model, configuration) {
103103
auto anchors_iter = configuration.find("anchors");
104104
if (anchors_iter == configuration.end()) {
105105
if (model->has_rt_info("model_info", "anchors")) {

model_api/cpp/models/src/image_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ std::shared_ptr<ov::Model> ImageModel::embedProcessing(std::shared_ptr<ov::Model
159159
bool brg2rgb,
160160
const std::vector<float>& mean,
161161
const std::vector<float>& scale) {
162-
162+
163163
ov::preprocess::PrePostProcessor ppp(model);
164164

165165
inputTransform.setPrecision(ppp, inputName);

model_api/cpp/utils/include/utils/image_utils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@ cv::Mat resizeImageExt(const cv::Mat& mat, int width, int height, RESIZE_MODE re
4242
cv::Scalar BorderConstant = cv::Scalar(0, 0, 0));
4343

4444
ov::preprocess::PostProcessSteps::CustomPostprocessOp createResizeGraph(RESIZE_MODE resizeMode,
45-
const ov::Shape& size,
45+
const ov::Shape& size,
4646
const cv::InterpolationFlags interpolationMode = cv::INTER_LINEAR);
47-

0 commit comments

Comments
 (0)