Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-unchecked-optional-access,
-clang-analyzer-security.insecureAPI.rand,

WarningsAsErrors: "*"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.15
with:
source: './app ./include ./src ./test'
source: '.'
build-linux:
strategy:
matrix:
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.20)

project(ITLabAI)

set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)

option(ENABLE_STATISTIC_TENSORS "Enable statistic tensors" OFF)

if(ENABLE_STATISTIC_TENSORS)
Expand Down Expand Up @@ -34,7 +32,9 @@ add_subdirectory(3rdparty)

include(cmake/opencv_config.cmake)

find_package(OpenMP REQUIRED)
if (NOT WIN32)
find_package(OpenMP REQUIRED)
endif()

if (NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
Expand Down
34 changes: 14 additions & 20 deletions app/Accuracy/accuracy_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main() {
}
Shape sh({static_cast<size_t>(count_pic), 227, 227, 3});
Tensor t = make_tensor<float>(res, sh);
Graph graph;
Graph graph(6);
Shape sh1({1, 5, 5, 3});
std::vector<float> vec;
vec.reserve(75);
Expand All @@ -43,29 +43,23 @@ int main() {
}
Tensor input = t;
Tensor output = make_tensor(vec, sh1);
auto a1 = std::make_unique<InputLayer>(kNchw, kNchw, 1, 2);
Layer* a1_ptr = a1.get();
auto a1 = std::make_shared<InputLayer>(kNchw, kNchw, 1, 2);
std::vector<float> kernelvec = {1, 1, 1, 1, 1, 1, 1, 1, 1};
Shape sh2({3, 3});
Tensor kernel = make_tensor(kernelvec, sh2);
auto a2 = std::make_unique<ConvolutionalLayer>(1, 0, 0, kernel);
Layer* a2_ptr = a2.get();
auto a2 = std::make_shared<ConvolutionalLayer>(1, 0, 0, kernel);
Shape poolshape = {2, 2};
auto a3 = std::make_unique<EWLayer>("linear", 2.0F, 3.0F);
Layer* a3_ptr = a3.get();
auto a4 = std::make_unique<PoolingLayer>(poolshape, "average");
Layer* a4_ptr = a4.get();
auto a5 = std::make_unique<OutputLayer>();
Layer* a5_ptr = a5.get();
auto a6 = std::make_unique<FCLayer>();
Layer* a6_ptr = a6.get();
graph.setInput(a1_ptr, input);
graph.makeConnection(a1_ptr, a2_ptr);
graph.makeConnection(a2_ptr, a3_ptr);
graph.makeConnection(a3_ptr, a4_ptr);
graph.makeConnection(a4_ptr, a5_ptr);
graph.makeConnection(a5_ptr, a6_ptr);
graph.setOutput(a5_ptr, output);
auto a3 = std::make_shared<EWLayer>("linear", 2.0F, 3.0F);
auto a4 = std::make_shared<PoolingLayer>(poolshape, "average");
auto a5 = std::make_shared<OutputLayer>();
auto a6 = std::make_shared<FCLayer>();
graph.setInput(a1, input);
graph.makeConnection(a1, a2);
graph.makeConnection(a2, a3);
graph.makeConnection(a3, a4);
graph.makeConnection(a4, a5);
graph.makeConnection(a5, a6);
graph.setOutput(a5, output);
graph.inference();
std::vector<float> tmp = *output.as<float>();
std::vector<float> tmp_output = softmax<float>(*output.as<float>());
Expand Down
8 changes: 8 additions & 0 deletions app/AccuracyImgNet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
add_executable(ACCImgNet accimgnet.cpp)

find_package( OpenCV REQUIRED PATHS "${OPENCV_BUILD_DIR}" )
include_directories( ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( ACCImgNet ${OpenCV_LIBS} )
target_link_libraries( ACCImgNet TBB_unified)
target_link_libraries( ACCImgNet layers_lib)
target_link_libraries( ACCImgNet gtest_main)
Loading
Loading