- 31 5月, 2023 1 次提交
-
-
由 Anna Khakimova 提交于
GAPI Fluid SIMD:Add support of new several types for the Merge3 - Support of the new several types was added. - Fixes for the Split/Merge and ConvertTo issues.
-
- 30 5月, 2023 1 次提交
-
-
由 Dmitry Matveev 提交于
G-API: Integration branch for ONNX & Python-related changes #23597 # Changes overview ## 1. Expose ONNX backend's Normalization and Mean-value parameters in Python * Since Python G-API bindings rely on `Generic` infer to express Inference, the `Generic` specialization of `onnx::Params` was extended with new methods to control normalization (`/255`) and mean-value; these methods were exposed in the Python bindings * Found some questionable parts in the existing API which I'd like to review/discuss (see comments) UPD: 1. Thanks to @TolyaTalamanov normalization inconsistencies have been identified with `squeezenet1.0-9` ONNX model itself; tests using these model were updated to DISABLE normalization and NOT using mean/value. 2. Questionable parts were removed and tests still pass. ### Details (taken from @TolyaTalamanov's comment): `squeezenet1.0.*onnx` - doesn't require scaling to [0,1] and mean/std because the weights of the first convolution already scaled. ONNX documentation is broken. So the correct approach to use this models is: 1. ONNX: apply preprocessing from the documentation: https://github.com/onnx/models/blob/main/vision/classification/imagenet_preprocess.py#L8-L44 but without normalization step: ``` # DON'T DO IT: # mean_vec = np.array([0.485, 0.456, 0.406]) # stddev_vec = np.array([0.229, 0.224, 0.225]) # norm_img_data = np.zeros(img_data.shape).astype('float32') # for i in range(img_data.shape[0]): # norm_img_data[i,:,:] = (img_data[i,:,:]/255 - mean_vec[i]) / stddev_vec[i] # # add batch channel # norm_img_data = norm_img_data.reshape(1, 3, 224, 224).astype('float32') # return norm_img_data # INSTEAD return img_data.reshape(1, 3, 224, 224) ``` 2. G-API: Convert image from BGR to RGB and then pass to `apply` as-is with configuring parameters: ``` net = cv.gapi.onnx.params('squeezenet', model_filename) net.cfgNormalize('data_0', False) ``` **Note**: Results might be difference because `G-API` doesn't apply central crop but just do resize to model resolution. --- `squeezenet1.1.*onnx` - requires scaling to [0,1] and mean/std - onnx documentation is correct. 1. ONNX: apply preprocessing from the documentation: https://github.com/onnx/models/blob/main/vision/classification/imagenet_preprocess.py#L8-L44 2. G-API: Convert image from BGR to RGB and then pass to `apply` as-is with configuring parameters: ``` net = cv.gapi.onnx.params('squeezenet', model_filename) net.cfgNormalize('data_0', True) // default net.cfgMeanStd('data_0', [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) ``` **Note**: Results might be difference because `G-API` doesn't apply central crop but just do resize to model resolution. ## 2. Expose Fluid & kernel package-related functionality in Python * `cv::gapi::combine()` * `cv::GKernelPackage::size()` (mainly for testing purposes) * `cv::gapi::imgproc::fluid::kernels()` Added a test for the above. ## 3. Fixed issues with Python stateful kernel handling Fixed error message when `outMeta()` of custom python operation fails. ## 4. Fixed various issues in Python tests 1. `test_gapi_streaming.py` - fixed behavior of Desync test to avoid sporadic issues 2. `test_gapi_infer_onnx.py` - fixed model lookup (it was still using the ONNX Zoo layout but was NOT using the proper env var we use to point to one). ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
-
- 24 5月, 2023 1 次提交
-
-
由 TolyaTalamanov 提交于
-
- 23 4月, 2023 1 次提交
-
-
由 Dmitry Matveev 提交于
- Existing tests pass with the ONNX models mentioned in tests.
-
- 11 4月, 2023 2 次提交
-
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
- 10 4月, 2023 1 次提交
-
-
由 TolyaTalamanov 提交于
-
- 02 4月, 2023 1 次提交
-
-
由 Dmitry Matveev 提交于
- Point3f was added to type traits but was missing in the "own" package; fixed.
-
- 24 3月, 2023 1 次提交
-
-
由 Anna Khakimova 提交于
-
- 15 2月, 2023 1 次提交
-
-
由 Anatoliy Talamanov 提交于
[G-API] Pipeline modeling tool: Refactor calculating performance statistics * Add warmup execution * Align perf metrics * Add busy wait mode for source * Small fix for late frames * pl_fn to src_fn * Change show statistics * Correct warm-up iteration * Properly calculate drop frames * Enable frame dropping for streaming mode * Enable frame dropping for streaming mode * Fix comments to review * Fix typos * Cosmetic
-
- 07 2月, 2023 1 次提交
-
-
由 Maksim Shabunin 提交于
-
- 02 2月, 2023 1 次提交
-
-
由 Alexander Smorkalov 提交于
-
- 17 1月, 2023 1 次提交
-
-
由 Maksim Shabunin 提交于
-
- 20 12月, 2022 1 次提交
-
-
由 Alexander Alekhin 提交于
-
- 19 12月, 2022 1 次提交
-
-
由 Alexander Alekhin 提交于
G-API: replace GAPI_Assert() with 'false' and '0' to GAPI_Error() * gapi: GAPI_Error() macro * gapi: replace GAPI_Assert() with 'false' and '0' to GAPI_Error() * build: eliminate 'unreachable code' after CV_Error() (MSVC 2015) * build: eliminate 'unreachable code' warning for MSVS 2015/2017 - observed in constructors stubs with throwing exception
-
- 10 12月, 2022 1 次提交
-
-
由 Alexander Alekhin 提交于
-
- 19 11月, 2022 1 次提交
-
-
由 Maksim Shabunin 提交于
-
- 18 11月, 2022 1 次提交
-
-
由 Anatoliy Talamanov 提交于
G-API Expose all imgproc operations to python * Expose imgproc operations * Fix alignment
-
- 16 11月, 2022 1 次提交
-
-
由 Alexey Smirnov 提交于
Minor refactoring Partially address review comments Move DX-related stuff from the sample to a default source Simplify the default OneVPL config Address minor review comments Add class for the default VPL source WIP: Add initial stub for tests with description Removing default vpl source and minor refactoring Refactor default files Fix build and application crash Address review comments Add test on VPL + OCL interaction compared to CPU behavior Fix test
-
- 08 11月, 2022 1 次提交
-
-
由 Anatoliy Talamanov 提交于
G-API Expose all core operations to python * Expose all G-API core operations to python * Fix typo in python gapi types test
-
- 31 10月, 2022 1 次提交
-
-
由 JopKnoppers 提交于
Preventing: gapi_async_test.cpp:448:26: error: ‘sleep_for’ is not a member of ‘std::this_thread’
-
- 28 10月, 2022 1 次提交
-
-
由 Dmitry Matveev 提交于
...and not only?
-
- 06 10月, 2022 1 次提交
-
-
由 TolyaTalamanov 提交于
-
- 05 10月, 2022 1 次提交
-
-
由 TolyaTalamanov 提交于
-
- 04 10月, 2022 3 次提交
-
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
- 03 10月, 2022 10 次提交
-
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 TolyaTalamanov 提交于
-
由 Biswapriyo Nath 提交于
* cmake: Fix DirectX detection in mingw The pragma comment directive is valid for MSVC only. So, the DirectX detection fails in mingw. The failure is fixed by adding the required linking library (here d3d11) in the try_compile() function in OpenCVDetectDirectX.cmake file. Also add a message if the first DirectX check fails. * gapi: Fix compilation with mingw These changes remove MSVC specific pragma directive. The compilation fails at linking time due to absence of proper linking library. The required libraries are added in corresponding CMakeLists.txt file. * samples: Fix compilation with mingw These changes remove MSVC specific pragma directive. The compilation fails at linking time due to absence of proper linking library. The required libraries are added in corresponding CMakeLists.txt file.
-
- 26 9月, 2022 1 次提交
-
-
由 TolyaTalamanov 提交于
-
- 16 9月, 2022 1 次提交
-
-
由 TolyaTalamanov 提交于
* Rename intersectMapWith -> mergeMapWith * Remove macro * Add r-value ref
-
- 15 9月, 2022 1 次提交
-
-
由 TolyaTalamanov 提交于
-