Giter Club home page Giter Club logo

synet's People

Contributors

alexanderkomarov avatar anmikh avatar ddaletski avatar ermig1979 avatar gordinmitya avatar mambawong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synet's Issues

Onnx conversion issue

I try to convert my own custom onnx model but I get an error.

Convert network from Onnx to Synet : Can't found layer onnx !
Can't found layer onnx !
Can't found layer onnx !
Can't found layer onnx !
Can't convert node[4]: type: Slice, name: Slice_4 ( images onnx::Slice_127 onnx::Slice_128 onnx::Slice_126 onnx::Slice_129 ) -> ( onnx::Slice_130 ) { } !

Conversion finished with errors!
Do you have any idea why I get this error and maybe how I could fix it?

Wrong output from StubLayer

Hello,

I tried to use the following model:
Expected output:
Name: age_conv3, shape: 1, 1, 1, 1 - Estimated age divided by 100.
Name: prob, shape: 1, 2, 1, 1 - Softmax output across 2 type classes [0 - female, 1 - male].

Received output example:
age_conv3 = [0.349784911, 0.328657120, 0.373537451, 0.369158268] (4 values instead of one)
prob = [0.0271999519, 0.972800076, 0.0115807839, 0.988419175, 0.0321026519, 0.967897415, 0.0114557156, 0.988544285] (8 values instead of 2)

The question is, why do I receive such output? Maybe I use wrong output processing for StubLayer?

Thank you

Win32 VS x64 performance

After making some testing I found that the performance of the x64 build is substantially better than win32 build (about 50% difference). The input was a standard, 4x down scaled 720p video.

Is this an expected behavior? Any ways to improve the win32 performance?

How to use ONNX converter

Hello,

I can see that the ONNX support has been added.
But how do I convert from the .onnx model file? Your converter requires .bin and .xml

Thank you

Tracker suggestion

Hello Igor!

Can you suggest what kind of tracker is best to use with your detector?

Or maybe there is some kind of generic tracker incorporated with SIMD library?

Thank you!

No objects detected with yolov5 model

I trained a custom model with yolov5 and export to onnx format, then convert to synet format.
The following code detected nothing, but the onnx model works fine with detect.py of yolov5.

   Net net;
    net.Load("test.xml", "test.bin");

    net.Reshape(1920, 1920, 1);

    Shape shape = net.NchwShape();

    View original;
    original.Load("test0.png");

    View resized(shape[3], shape[2], original.format);
    Simd::Resize(original, resized, ::SimdResizeMethodArea);

    net.SetInput(resized, 0.0f, 255.0f);

    net.Forward();

    Regions objects = net.GetRegions(original.width, original.height, 0.5f, 0.5f);
    uint32_t white = 0xFFFFFFFF;
    for (size_t i = 0; i < objects.size(); ++i)
    {
        const Region & object = objects[i];
        ptrdiff_t l = ptrdiff_t(object.x - object.w / 2);
        ptrdiff_t t = ptrdiff_t(object.y - object.h / 2);
        ptrdiff_t r = ptrdiff_t(object.x + object.w / 2);
        ptrdiff_t b = ptrdiff_t(object.y + object.h / 2);
        Simd::DrawRectangle(original, l, t, r, b, white);
    }
    original.Save("test0r.ppm");

    return 0;

Different errors on conversion

Can't convert layer : id = 210 , name = Gather_199549/Cast_122100_const , type = Const , version = opset1 !
Can't convert IE model v10!
Unknown element_type = i32 !
Can't convert layer : id = 383 , name = up_sampling2d/Shape/GatherNCHWtoNHWC/Cast_123490_const , type = Const , version = opset1 !
Can't convert IE model v10!

Basically I can convert only the oldest, early 2019 models.

Assertion failed in SoftmaxLayer

Program: \bin\x64\Debug\Simd.dll
File: \src\Simd\SimdMemory.h
Line: 161

Expression: nose[i] == NO_MANS_LAND_WATERMARK
	Simd.dll!Simd::Free(void * ptr) Line 161	C++
 	Simd.dll!Simd::Array<float>::~Array<float>() Line 47	C++
 	Simd.dll!Simd::Avx2::SynetSoftmaxLayerForwardX1(const float * src, unsigned __int64 outer, unsigned __int64 count, float * dst) Line 278	C++
 	Simd.dll!Simd::Avx2::SynetSoftmaxLayerForward(const float * src, unsigned __int64 outer, unsigned __int64 count, unsigned __int64 inner, float * dst) Line 290	C++
 	Simd.dll!SimdSynetSoftmaxLayerForward(const float * src, unsigned __int64 outer, unsigned __int64 count, unsigned __int64 inner, float * dst) Line 6763	C++
 	Lib.dll!Synet::Detail::SoftmaxLayerForwardCpu<float>(const float * src, unsigned __int64 outer, unsigned __int64 count, unsigned __int64 inner, float * dst) Line 133	C++
 	Lib.dll!Synet::SoftmaxLayer<float>::ForwardCpu(const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & src, const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & buf, const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & dst) Line 168	C++
 	Lib.dll!Synet::Layer<float>::Forward(const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & src, const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & buf, const std::vector<Synet::Tensor<float> *,std::allocator<Synet::Tensor<float> *>> & dst) Line 147	C++
 	Lib.dll!Synet::Network<float>::Forward() Line 406	C++

Can't load network. MSVC compiler bug?

Hi. There is a problem: On visual studio 2019 and 2015 (32 bit, not tested on others, 64 bit works) it is impossible to convert and load synet network. Here is screenshot of converting error:

bug

The error while trying load is similar.

In memory windows there is something strange: the pointer to virtual table begins with 4 byte offset. But after that there is a trash, and only after - there is a first "params" data. So, I think it is the compiler bug, but not sure. On gcc everything works fine. Can you test your framework on visual studio to investigate this bug?

Quantization/INT8 support

Hello!

Is working with INT8 models currently supported?

In files perf.sh, test.sh, check.sh the quantization check is disabled, as well as test_003i and test_009i.
If I try to enable them manually, it start require file quant.xml, but it is missing from the project.

Compilation error VS2019

Hello,

I get the following during the compilation under VS2019:

1>------ Rebuild All started: Project: Synet, Configuration: Release x64 ------
1>Synet.cpp
1>C:\Synet-master\src\Synet\Utils\Permute.h(88,30): error C2039: 'SimdTensorDataType': is not a member of '`global namespace''
1>C:\Synet-master\src\Synet\Utils\Permute.h(88,56): error C3646: 'Convert': unknown override specifier
1>C:\Synet-master\src\Synet\Utils\Permute.h(88,57): error C2275: 'Synet::TensorType': illegal use of this type as an expression
1>C:\Synet-master\src\Synet\Params.h(237): message : see declaration of 'Synet::TensorType'
1>C:\Synet-master\src\Synet\Utils\Permute.h(88,68): error C2146: syntax error: missing ')' before identifier 'type'
1>C:\Synet-master\src\Synet\Utils\Permute.h(89,9): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>Done building project "Synet.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

'SimdSynetSwish32f': is not a member of '`global namespace''

Hello, I am trying to compile Synet.sln in vs 2019, but I have an error and part of the project is not compiled.

16>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace''
16>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found
16>C:\Synet\src\Synet\Converters\InferenceEngineV10.h(299,35): warning C4018: '<': signed/unsigned mismatch
17>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' (compiling source file ..\..\src\Test\TestQuantization.cpp) 18>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' (compiling source file ....\src\Test\TestPrecision.cpp)
17>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found (compiling source file ....\src\Test\TestQuantization.cpp)
16>Done building project "UseFaceDetection.vcxproj" -- FAILED.
18>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found (compiling source file ....\src\Test\TestPrecision.cpp)
20>------ Build started: Project: TestOnnx, Configuration: Release Win32 ------
19>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' 17>C:\Synet\src\Synet\Converters\Deoptimizer.h(149,65): warning C4018: '<': signed/unsigned mismatch (compiling source file ..\..\src\Test\TestQuantization.cpp) 19>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found 15>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' (compiling source file ....\src\Test\TestInferenceEngine.cpp)
17>C:\Synet\src\Test\TestQuantization.h(333,39): warning C4018: '<=': signed/unsigned mismatch (compiling source file ....\src\Test\TestQuantization.cpp)
18>C:\Synet\src\Test\TestDetectionPrecision.h(475,13): warning C4018: '<': signed/unsigned mismatch (compiling source file ....\src\Test\TestPrecision.cpp)
15>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found (compiling source file ....\src\Test\TestInferenceEngine.cpp)
17>Done building project "TestQuantization.vcxproj" -- FAILED.
18>Done building project "TestPrecision.vcxproj" -- FAILED.
19>Done building project "TestPerformanceDifference.vcxproj" -- FAILED.
14>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' (compiling source file ..\..\src\Test\TestDarknet.cpp) 14>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found (compiling source file ..\..\src\Test\TestDarknet.cpp) 20>TestOnnx.cpp 20>TestImage.cpp 14>Done building project "TestDarknet.vcxproj" -- FAILED. 15>C:\Synet\src\Synet\Converters\InferenceEngineV10.h(299,35): warning C4018: '<': signed/unsigned mismatch (compiling source file ..\..\src\Test\TestInferenceEngine.cpp) 15>Done building project "TestInferenceEngine.vcxproj" -- FAILED. 20>C:\Synet\src\Synet\Utils\Activation.h(175,11): error C2039: 'SimdSynetSwish32f': is not a member of 'global namespace'' (compiling source file ....\src\Test\TestOnnx.cpp)
20>C:\Synet\src\Synet\Utils\Activation.h(175,1): error C3861: 'SimdSynetSwish32f': identifier not found (compiling source file ....\src\Test\TestOnnx.cpp)
20>Done building project "TestOnnx.vcxproj" -- FAILED.
========== Build: 13 succeeded, 7 failed, 0 up-to-date, 0 skipped ==========`

test_onnx can't recognize "convert" mode

I try to compile Synet on win10, and test_onnx can't recognize convert mode;

E:\projects\synet\bin\v143\x64\Release>.\TestOnnx.exe -m convert -fw best.onnx -sm best.xml -sw best.bin
[000] Error: Unknown mode :

Instruction for model training

Hello Igor!

What do you think about making a brief instruction on how to annotate and train models to be compatible with Synet?
Which software to use for annotation, which for training, general recommendations/requirements, etc.

It would be awesome to have that.

Thank you!

Question about fp32/int8

Hi. We run converted from OpenVino framework 'face-detection-retail-0005' network and get next inference results on aarch64:

For fp32: 243,4ms
For int8: 856ms.

It is strange that for int8 the calculation is slower. Is that how it should be?

YoloV8 support?

Hello, is it possible to run a quantized YOLOv8 network without creating a custom layer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.