Skip to content

Commit

Permalink
rocAL unit test and Video fixes. (#1029)
Browse files Browse the repository at this point in the history
* Change ResizeAPI in rocalVideoFileResize

* rocAL: Classification Training Related changes (#1001)

* Zen DNN - Docker & Tests (#924)

* Zen DNN - Docker Updates

* Zen DNN - Sample Updates

* Codacy - Fix

* Zen DNN - Cleanup

* Zen DNN - single layer sample

* Rocal Updates (#921)

* rocal updates for tf training

* updates for rocal

* tf updates and pytorch bug fixes

* repo name change

* Update README.md

* dockerfile update

* [rocAL] Fix rocAL Pybind build issue.

* [rocAL] Remove unused function in pipeline.

* [rocAL] Change rocAL pybind installation from setup.py to wheel.
setup.py install is deprecated in python 3.9

* [rocAL] Make TF pets example dataset compatible with tf2.

* [rocAL] Change getImageLabels() compatible with tf.

* [rocAL] Add fix to pick wheel from dist installation folder.
Remove the old installation files in conda environment.

* [rocAL] Remove commented statement.

Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>

* Docker Update (#928)

* turboJPEG version update

* turboJPEG version update

* turboJPEG version update

* TurboJPEG version update

* Update mivisionx-opencl-on-ubuntu20.dockerfile

* Update zenDNN-HIP.dockerfile

* Update level-5.dockerfile

* Update level-5.dockerfile

* Zen DNN Updates Sync

Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>

* AMD OpenVX Custom Extension - implementation (#925)

* custom node implementation files

* fix build errors

* custom extension changes for working implementation

* add README and documentation

* update readme

* fix codacy issues and CPU flow

* fix cadacy warning

* Addressed review comments

* minor change

* fix formating

* amd_migraphx - update readme for extension (#929)

* amd_custom - fixes build issue (#935)

* fixes build issue

* Update CMakeLists.txt

* migraphx extension - update the readme(#936)

* vx_amd_migraphx - tests (#923)

* batch size support for migraphx

* changing to accept tensors of all batch sizes

* creates file with results

* bug fix

* changes to singular test cases - mnist and resnet50

* readme updates

* resolving PR comments

* resolving PR comments

* resolving PR comments

* Readme update to reflect tot

* formatting

* fixing typo

* readme update

* readme update

* OpenVX HIP backend - report correct number of CUs for gfx10+ in the logs (#930)

* Add API to get reader config and decoder config

* Add API to obtain max and min aspect ratio from image source evaluator

* Add scaling modes support

Add support to pass the resize scaling modes
Add support to calculate the normalized crop

* Minor change

* Remove crop parameters and related changes for resize

* Fix segmentation fault

* Fix error with resize modes

* MInor fix : update tensor ROI

* Minor fix - center crop

* Update the python API for resize with scaling modes and interpolation param

* Minor changes

* Minor changes

* Minor change

* Remove center crop related changes

* Remove redundant max size check

* Remove crop param from node resize

* Remove source evaluator

* Minor fix

* Remove the get decoder and reader config API

* Remove aspect ratio calculations in source evaluator

* Remove decoder and reader config variables

Remove crop related changes

* Remove decoder and reader config variables

Remove crop related changes

* Minor fix for max size

* Code clean up

* Minor change

* Minor changes

* Minor changes

* Minor change

* Fix python codacy warnings

* Minor codacy fix

* Revert "Minor codacy fix"

This reverts commit df1dd28.

* Minor change

* Minor code changes

* Remove API to get max width and height for resize node

* Minor fix

* Minor changes

* Working Image Classification Chnages

* Working Image Classification USER GIVEN PARAMS

* Add changes in types.py

* 1. Code clean up
2. Centre Crop bug fix

* Code Clean Up

* Add centre_crop changes

* ResizeTensor addition

* Minor changes in PR

* ResizeTensor.cpp - Removing OpenCL backend support

* Code Clean Up

* Resolving internal PR comments

* Resolve the internal review comments -2

* Reesolve build error

* runVisionTest - add a new test (#979)

* rocAL PyBind - Wheel Package Fix (#982)

Co-authored-by: Swetha B S <swetha@multiocrewareinc.com>

* amd media - device support (#983)

* amd_media decoder add parameter for passing deviceid

* minor cleanup

* fix for review comments

* docker update - rpp version update (#986)

* Update mivisionx-with-pytorch.dockerfile

* Update mivisionx-with-tensorflow.dockerfile

* Update level-5.dockerfile

* Update mivisionx-on-ubuntu20.dockerfile

* Update mivisionx-opencl-on-ubuntu20.dockerfile

* rocal - README updates and directory name change (#981)

* Update README.md

* Update README.md

* folder name change

* Update README.md

* Delete PYTHON_UNITTEST_TEST_FILE.sh

* Delete rocAL/rocAL_pybind/example/new_api directory

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* added new random_crop_dec parameter class

* Set the crop values to partial decoder. [rocAL]

* Fix undefined reference error in random number generator. [rocAL]

* Change parameters for rocalFusedCropDecoder wrt new randomgenrator changes. [rocAL]
Remove unused paramaters.

* Clean up wrt Random number generator. [rocAl]

* Convert double to float for aspect ration and random area parameters in fused crop. [rocAL]

* Set seed for every batch in paramater random crop. [rocAL]

* Clean up. [rocAL]

* Fix Bug with seed generation for RNG

* rocAL - hardware decoder python support (#987)

* rocAL - removing references (#954)

* rocAL - Tf pets training  (#947)

* Zen DNN - Docker & Tests (#924)

* Zen DNN - Docker Updates

* Zen DNN - Sample Updates

* Codacy - Fix

* Zen DNN - Cleanup

* Zen DNN - single layer sample

* Rocal Updates (#921)

* rocal updates for tf training

* updates for rocal

* tf updates and pytorch bug fixes

* repo name change

* Update README.md

* dockerfile update

* [rocAL] Fix rocAL Pybind build issue.

* [rocAL] Remove unused function in pipeline.

* [rocAL] Change rocAL pybind installation from setup.py to wheel.
setup.py install is deprecated in python 3.9

* [rocAL] Make TF pets example dataset compatible with tf2.

* [rocAL] Change getImageLabels() compatible with tf.

* [rocAL] Add fix to pick wheel from dist installation folder.
Remove the old installation files in conda environment.

* [rocAL] Remove commented statement.

Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>

* Docker Update (#928)

* turboJPEG version update

* turboJPEG version update

* turboJPEG version update

* TurboJPEG version update

* Update mivisionx-opencl-on-ubuntu20.dockerfile

* Update zenDNN-HIP.dockerfile

* Update level-5.dockerfile

* Update level-5.dockerfile

* Zen DNN Updates Sync

Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>

* AMD OpenVX Custom Extension - implementation (#925)

* custom node implementation files

* fix build errors

* custom extension changes for working implementation

* add README and documentation

* update readme

* fix codacy issues and CPU flow

* fix cadacy warning

* Addressed review comments

* minor change

* fix formating

* amd_migraphx - update readme for extension (#929)

* amd_custom - fixes build issue (#935)

* fixes build issue

* Update CMakeLists.txt

* tf_pets_v2

* code_cleanup

* minor code cleanup

* migraphx extension - update the readme(#936)

* vx_amd_migraphx - tests (#923)

* batch size support for migraphx

* changing to accept tensors of all batch sizes

* creates file with results

* bug fix

* changes to singular test cases - mnist and resnet50

* readme updates

* resolving PR comments

* resolving PR comments

* resolving PR comments

* Readme update to reflect tot

* formatting

* fixing typo

* readme update

* readme update

* OpenVX HIP backend - report correct number of CUs for gfx10+ in the logs (#930)

* PyTorch docker file - add argument for specifying version (#938)

* add argument for specifying pytorch version for building docker file

* add readme for pytorch

* rocAL - Fix ROCAL_USE_USER_GIVEN_SIZE_RESTRICTED (#940)

* Docker - codacy fix for pr937 (#942)

* rocAL - Adding NCHW FP16 SIMD kernel (#926)

* Adding NCHW FP16 SIMD kernel for normalization and buffer copy

* Fixed some codestyle issues with FP16 kernel

* Using FMA SSE instruction for multiply-add ops

* Removed extra spaces

* Adding fma flag to rocAL CMakeLists

* Adding FP16 intrinsics for buffer copies

* Setting rounding mode to _MM_FROUND_TO_ZERO

* rocAL  - README updates for video unit test (#939)

* Add README support for video unit test

* Update Readme for video unit test

* Minor test_suite fix

* Update video unit test Readme

* Update Readme

* Updated README with the explation of test cases and arguments

* Minor fix

* Add test case samples to video unit test README

Also add images for README

* Modify sample images

* Change sample image dimension

* Minor README changes

* Minor README changes

* Minor change

* Minor fix to handle relative input path in video unit test

* Resolve codacy warnings

* Minor change

* Add correct video reader outputs

* MIVisionX - cmake cleanup (#943)

* OpenCV EXT - Updates & Tests (#944)

* OpenCV - Readme updates

* Updates - Readme & Tests

* OpenCV - Tests Added

* Updates

* ZenDNN - model compiler (#941)

* model compiler - zendnn - mnist layers

* bug fix + lrn

* layers: batch norm, sum ; bug fixes

* fixes lgtm errors

* bug fixes

* codacy fixes

* bug fix

* codacy fixes

* Update train_withROCAL_withTFRecordReader.py

* Resolved PR comments

Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>

* rocAL - fix bug in the usage of GetImageName (#955)

* fix bug in the usage of GetImageName

* add ground-truth labels .txt file for tinydataset

* rename file to all smaller case

* AMD - OpenVX Float16 Support (#956)

* AMD - Float16 Support

* Remove redundant def

* OpenVX FP16 - CPP FP16 support

* AMD Media Decoder - Measure Decode Time (#964)

* added what Aryan recommended to decoder performance measure code

* added transfer time measure

* rocAL - Changing Python Lib Path (#959)

* Changing Python Lib Path

* Keep the checks for different env intact

Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>

* MIVisionX - CMakeList Updates (#967)

* CMakeList Updates

* CMakeList - Cleanup

* Setup - Updates

* rocAL - CMakeList Cleanup

* rocAL - Resize scaling modes support (#950)

* Zen DNN - Docker & Tests (#924)

* Zen DNN - Docker Updates

* Zen DNN - Sample Updates

* Codacy - Fix

* Zen DNN - Cleanup

* Zen DNN - single layer sample

* Rocal Updates (#921)

* rocal updates for tf training

* updates for rocal

* tf updates and pytorch bug fixes

* repo name change

* Update README.md

* dockerfile update

* [rocAL] Fix rocAL Pybind build issue.

* [rocAL] Remove unused function in pipeline.

* [rocAL] Change rocAL pybind installation from setup.py to wheel.
setup.py install is deprecated in python 3.9

* [rocAL] Make TF pets example dataset compatible with tf2.

* [rocAL] Change getImageLabels() compatible with tf.

* [rocAL] Add fix to pick wheel from dist installation folder.
Remove the old installation files in conda environment.

* [rocAL] Remove commented statement.

Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>

* Docker Update (#928)

* turboJPEG version update

* turboJPEG version update

* turboJPEG version update

* TurboJPEG version update

* Update mivisionx-opencl-on-ubuntu20.dockerfile

* Update zenDNN-HIP.dockerfile

* Update level-5.dockerfile

* Update level-5.dockerfile

* Zen DNN Updates Sync

Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>

* AMD OpenVX Custom Extension - implementation (#925)

* custom node implementation files

* fix build errors

* custom extension changes for working implementation

* add README and documentation

* update readme

* fix codacy issues and CPU flow

* fix cadacy warning

* Addressed review comments

* minor change

* fix formating

* amd_migraphx - update readme for extension (#929)

* amd_custom - fixes build issue (#935)

* fixes build issue

* Update CMakeLists.txt

* migraphx extension - update the readme(#936)

* vx_amd_migraphx - tests (#923)

* batch size support for migraphx

* changing to accept tensors of all batch sizes

* creates file with results

* bug fix

* changes to singular test cases - mnist and resnet50

* readme updates

* resolving PR comments

* resolving PR comments

* resolving PR comments

* Readme update to reflect tot

* formatting

* fixing typo

* readme update

* readme update

* OpenVX HIP backend - report correct number of CUs for gfx10+ in the logs (#930)

* Add API to get reader config and decoder config

* Add API to obtain max and min aspect ratio from image source evaluator

* Add scaling modes support

Add support to pass the resize scaling modes
Add support to calculate the normalized crop

* Minor change

* Remove crop parameters and related changes for resize

* Fix segmentation fault

* Fix error with resize modes

* MInor fix : update tensor ROI

* Minor fix - center crop

* Update the python API for resize with scaling modes and interpolation param

* Minor changes

* Minor changes

* Minor change

* Remove center crop related changes

* Remove redundant max size check

* Remove crop param from node resize

* Remove source evaluator

* Minor fix

* Remove the get decoder and reader config API

* Remove aspect ratio calculations in source evaluator

* Remove decoder and reader config variables

Remove crop related changes

* Remove decoder and reader config variables

Remove crop related changes

* Minor fix for max size

* Code clean up

* Minor change

* Minor changes

* Minor changes

* Minor change

* Fix python codacy warnings

* Minor codacy fix

* Revert "Minor codacy fix"

This reverts commit df1dd28.

* Minor change

* Minor code changes

* Remove API to get max width and height for resize node

* Resize ROI changes

* Code cleanup

* Rename variables

* Code cleanup

* MInor changes

* Minor change

* Minor fix

* Minor changes

* Modify logic to calculate max size for each mode

* Fix  max_size calculation algorithm

* Fix max_size calculation logic

* Minor changes

* Minor change

* Add space after if

* Minor change

* Minor changes

Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: IndumathiR <indumathi@multicorewareinc.com>

* rocAL - fix for copy-write violation (#968)

* fix for copywrite violation

* fix for review comments and other clean_up

* minor clean_up

* revert run.sh changes

* fix codacy warnings

* add jupyter notebook for decoder

* rocAL - add missing header (#972)

* rocAL - add missing header

* Tested Config Updates

* OpenVX Framework - update max tensor dims to 6 (#970)

* add pipeline decorator for rocal

* fix build error

* fix script for jupyter notebook

* changes to Jupyter notebook to support HW decoder

* fixed review comments

* hardcoding decoder device to cpu for python unit tests

* add option for decoder.py to run on gpu/cpu

Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: swetha097 <59434434+swetha097@users.noreply.github.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>
Co-authored-by: Pavel Tcherniaev <Pavel.Tcherniaev@amd.com>
Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>
Co-authored-by: IndumathiR <indumathi@multicorewareinc.com>

* Fix Python build

* Wrap long lines of code

* Fix spacing & add copyright in pybind

* amd-openvx-hip: create a separate stream for graph (#996)

* rocAL -  CMake and header files Clean up (#991)

* rocAL - removing references (#954)

* rocAL - Tf pets training  (#947)

* Zen DNN - Docker & Tests (#924)

* Zen DNN - Docker Updates

* Zen DNN - Sample Updates

* Codacy - Fix

* Zen DNN - Cleanup

* Zen DNN - single layer sample

* Rocal Updates (#921)

* rocal updates for tf training

* updates for rocal

* tf updates and pytorch bug fixes

* repo name change

* Update README.md

* dockerfile update

* [rocAL] Fix rocAL Pybind build issue.

* [rocAL] Remove unused function in pipeline.

* [rocAL] Change rocAL pybind installation from setup.py to wheel.
setup.py install is deprecated in python 3.9

* [rocAL] Make TF pets example dataset compatible with tf2.

* [rocAL] Change getImageLabels() compatible with tf.

* [rocAL] Add fix to pick wheel from dist installation folder.
Remove the old installation files in conda environment.

* [rocAL] Remove commented statement.

Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>

* Docker Update (#928)

* turboJPEG version update

* turboJPEG version update

* turboJPEG version update

* TurboJPEG version update

* Update mivisionx-opencl-on-ubuntu20.dockerfile

* Update zenDNN-HIP.dockerfile

* Update level-5.dockerfile

* Update level-5.dockerfile

* Zen DNN Updates Sync

Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>

* AMD OpenVX Custom Extension - implementation (#925)

* custom node implementation files

* fix build errors

* custom extension changes for working implementation

* add README and documentation

* update readme

* fix codacy issues and CPU flow

* fix cadacy warning

* Addressed review comments

* minor change

* fix formating

* amd_migraphx - update readme for extension (#929)

* amd_custom - fixes build issue (#935)

* fixes build issue

* Update CMakeLists.txt

* tf_pets_v2

* code_cleanup

* minor code cleanup

* migraphx extension - update the readme(#936)

* vx_amd_migraphx - tests (#923)

* batch size support for migraphx

* changing to accept tensors of all batch sizes

* creates file with results

* bug fix

* changes to singular test cases - mnist and resnet50

* readme updates

* resolving PR comments

* resolving PR comments

* resolving PR comments

* Readme update to reflect tot

* formatting

* fixing typo

* readme update

* readme update

* OpenVX HIP backend - report correct number of CUs for gfx10+ in the logs (#930)

* PyTorch docker file - add argument for specifying version (#938)

* add argument for specifying pytorch version for building docker file

* add readme for pytorch

* rocAL - Fix ROCAL_USE_USER_GIVEN_SIZE_RESTRICTED (#940)

* Docker - codacy fix for pr937 (#942)

* rocAL - Adding NCHW FP16 SIMD kernel (#926)

* Adding NCHW FP16 SIMD kernel for normalization and buffer copy

* Fixed some codestyle issues with FP16 kernel

* Using FMA SSE instruction for multiply-add ops

* Removed extra spaces

* Adding fma flag to rocAL CMakeLists

* Adding FP16 intrinsics for buffer copies

* Setting rounding mode to _MM_FROUND_TO_ZERO

* rocAL  - README updates for video unit test (#939)

* Add README support for video unit test

* Update Readme for video unit test

* Minor test_suite fix

* Update video unit test Readme

* Update Readme

* Updated README with the explation of test cases and arguments

* Minor fix

* Add test case samples to video unit test README

Also add images for README

* Modify sample images

* Change sample image dimension

* Minor README changes

* Minor README changes

* Minor change

* Minor fix to handle relative input path in video unit test

* Resolve codacy warnings

* Minor change

* Add correct video reader outputs

* MIVisionX - cmake cleanup (#943)

* OpenCV EXT - Updates & Tests (#944)

* OpenCV - Readme updates

* Updates - Readme & Tests

* OpenCV - Tests Added

* Updates

* ZenDNN - model compiler (#941)

* model compiler - zendnn - mnist layers

* bug fix + lrn

* layers: batch norm, sum ; bug fixes

* fixes lgtm errors

* bug fixes

* codacy fixes

* bug fix

* codacy fixes

* Update train_withROCAL_withTFRecordReader.py

* Resolved PR comments

Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>

* rocAL - fix bug in the usage of GetImageName (#955)

* fix bug in the usage of GetImageName

* add ground-truth labels .txt file for tinydataset

* rename file to all smaller case

* AMD - OpenVX Float16 Support (#956)

* AMD - Float16 Support

* Remove redundant def

* OpenVX FP16 - CPP FP16 support

* migraphx  - palamida scan fix (#984)

* Delete image_0.jpg

* Delete image_1.jpg

* Delete image_4.jpg

* image update

* Readme updates - OpenVX Trademark Updates (#989)

* Readme updates - OpenVX Trademark Updates

* Readme - Attribution Updates

* Readme - Codacy Fix

* Media - License Issue Fix (#990)

* Fix include path issue in image augmentation app.[rocAL]

* CMake clean up. [rocAL]

* Clean up. Introduce header files to include all nodes and meta nodes headers. [rocAL]

* Change include directories path in image_augmentation app.

* CMake clean up in rocAL utilities.

* Clean up.

Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: swetha097 <59434434+swetha097@users.noreply.github.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>

* Resolve the PR comments

* Resolve PR Comments

* Fix the bug with Resize Node

* AMD OpenVX - HIP cleanup (#997)

* amd-openvx-hip: create a separate stream for graph

* removed hipstream associated with context since it is not used

* fix for review comments

* docker - Pytorch with mesa driver (#998)

* Create mivisionx-with-pytorch-with-mesa.dockerfile

Adding dockerfile for pytorch with mesa driver for hardware decode

* bug fixes to dockerfile

Co-authored-by: Lakshmi <lakshmi@ixt-sjc2-52.local.lan>

* OS Support - Updates (#994)

* Docker - Archive Old OS

* Docker Updates - Fix Support

* Setup - Updates

* OpenCV - Upgrade to 4.6.0

* Docker - Name Fix

* U20 Fix

* Docker Readme - Updates

* Minor change in the unittest

* Remove RPATH/RUNPATH - Adding SKIP RPATH flag (#995)

* Adding SKIP RPATH flag

* Update Review Comments-SKIP_RPATH replaced with SKIP_INSTALL_RPATH, disable use_link_path

* Review Comments Updated

* Resolve the internal PR comments

* Minor change in image.cpp

* Minor change in decoder.h

* Minor change in fused_crop_decoder.cpp

* Minor changes

* Minor changes

* Minor changes

* Correct spacing issues

* Wrap long lines of code in decoders.py

* Remove extra line in readers.py

* Removes extra line from fused_crop_decoder.cpp

* Remove Trailing white space in rocal_pybind.cpp

* Wrapping up the long lines of code in decoders.py

* Resolving PR comments

* Update decoders.py

Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: shobana-mcw <shobana@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: fiona-gladwin <fionagladwin@multicorewareinc.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>
Co-authored-by: Swetha B S <swetha@multiocrewareinc.com>
Co-authored-by: root <root@ixt-sjc2-52.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>
Co-authored-by: Pavel Tcherniaev <Pavel.Tcherniaev@amd.com>
Co-authored-by: IndumathiR <indumathi@multicorewareinc.com>
Co-authored-by: Lakshmi <lakshmi@ixt-sjc2-52.local.lan>
Co-authored-by: arvindcheru <90783369+arvindcheru@users.noreply.github.com>

* Modify rocAL unit test.
1. Remove pipeline_type user param.
2. Set json path wrt MIvisionX_data_path.

* clean up. [rocAL]

* Fix seg fault issue wrt ROCAL_DATA_PATH.
Change path for key point annotation reading.

---------

Co-authored-by: IndumathiR <indumathi@multicorewareinc.com>
Co-authored-by: swetha097 <59434434+swetha097@users.noreply.github.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: LakshmiKumar23 <lakshmi.kumar@amd.com>
Co-authored-by: Kiriti Gowda <kiriti.nageshgowda@amd.com>
Co-authored-by: Rajy Rawther <Rajy.MeeyakhanRawther@amd.com>
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Co-authored-by: fiona-gladwin <fionagladwin@multicorewareinc.com>
Co-authored-by: root <root@jenkins-worker-rocm-amd-104.local.lan>
Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>
Co-authored-by: Swetha B S <swetha@multiocrewareinc.com>
Co-authored-by: root <root@ixt-sjc2-52.local.lan>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Fiona-MCW <70996026+fiona-gladwin@users.noreply.github.com>
Co-authored-by: Pavel Tcherniaev <Pavel.Tcherniaev@amd.com>
Co-authored-by: Lakshmi <lakshmi@ixt-sjc2-52.local.lan>
Co-authored-by: arvindcheru <90783369+arvindcheru@users.noreply.github.com>
Co-authored-by: root <root@ixt-sjc2-54.local.lan>
  • Loading branch information
19 people committed Jan 28, 2023
1 parent e1a208d commit 1b64102
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 39 deletions.
14 changes: 12 additions & 2 deletions rocAL/rocAL/include/api/rocal_api_data_loaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,12 @@ extern "C" RocalImage ROCAL_API_CALL rocalVideoFileResize(RocalContext context
bool loop = false,
unsigned step = 0,
unsigned stride = 0,
bool file_list_frame_num = true);
bool file_list_frame_num = true,
RocalResizeScalingMode scaling_mode = ROCAL_SCALING_MODE_DEFAULT,
std::vector<unsigned> max_size = {},
unsigned resize_shorter = 0,
unsigned resize_longer = 0,
RocalResizeInterpolationType interpolation_type = ROCAL_LINEAR_INTERPOLATION);

/// Creates a video reader and decoder as a source. It allocates the resources and objects required to read and decode mp4 videos stored on the file systems. Resizes the decoded frames to the dest width and height. It accepts external sharding information to load a singe shard only.
/// \param context Rocal context
Expand Down Expand Up @@ -657,7 +662,12 @@ extern "C" RocalImage ROCAL_API_CALL rocalVideoFileResizeSingleShard(RocalCont
bool loop = false,
unsigned step = 0,
unsigned stride = 0,
bool file_list_frame_num = true);
bool file_list_frame_num = true,
RocalResizeScalingMode scaling_mode = ROCAL_SCALING_MODE_DEFAULT,
std::vector<unsigned> max_size = {},
unsigned resize_shorter = 0,
unsigned resize_longer = 0,
RocalResizeInterpolationType interpolation_type = ROCAL_LINEAR_INTERPOLATION);

/// Creates CIFAR10 raw data reader and loader. It allocates the resources and objects required to read raw data stored on the file systems.
/// \param context Rocal context
Expand Down
149 changes: 137 additions & 12 deletions rocAL/rocAL/source/api/rocal_api_data_loaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ THE SOFTWARE.
#include "meta_node_resize.h"

namespace filesys = boost::filesystem;
#define MAX_ASPECT_RATIO 3.0f

std::tuple<unsigned, unsigned>
evaluate_image_data_set(RocalImageSizeEvaluationPolicy decode_size_policy, StorageType storage_type,
Expand Down Expand Up @@ -2139,7 +2140,12 @@ rocalVideoFileResize(
bool loop,
unsigned step,
unsigned stride,
bool file_list_frame_num)
bool file_list_frame_num,
RocalResizeScalingMode scaling_mode,
std::vector<unsigned> max_size,
unsigned resize_shorter,
unsigned resize_longer,
RocalResizeInterpolationType interpolation_type)
{
Image* resize_output = nullptr;
if (p_context == nullptr) {
Expand All @@ -2156,9 +2162,6 @@ rocalVideoFileResize(
// Set video loader flag in master_graph
context->master_graph->set_video_loader_flag();

if(dest_width == 0 || dest_height == 0)
THROW("Invalid dest_width/dest_height values passed as input")

// Set default step and stride values if 0 is passed
step = (step == 0)? sequence_length : step;
stride = (stride == 0)? 1 : stride;
Expand Down Expand Up @@ -2196,17 +2199,77 @@ rocalVideoFileResize(

if(dest_width != video_prop.width && dest_height != video_prop.height)
{
if((dest_width | dest_height | resize_longer | resize_shorter) == 0)
THROW("Atleast one size 'dest_width' or 'dest_height' or 'resize_shorter' or 'resize_longer' must be specified")
if((dest_width | dest_height) && (resize_longer | resize_shorter))
THROW("Only one method of specifying size can be used \ndest_width and/or dest_height\nresize_shorter\nresize_longer")
if(resize_longer && resize_shorter)
THROW("'resize_longer' and 'resize_shorter' cannot be passed together. They are mutually exclusive.")

unsigned out_width, out_height;
RocalResizeScalingMode resize_scaling_mode;

// Change the scaling mode if resize_shorter or resize_longer is specified
if(resize_shorter) {
resize_scaling_mode = RocalResizeScalingMode::ROCAL_SCALING_MODE_NOT_SMALLER;
out_width = out_height = resize_shorter;
} else if(resize_longer) {
resize_scaling_mode = RocalResizeScalingMode::ROCAL_SCALING_MODE_NOT_LARGER;
out_width = out_height = resize_longer;
} else {
resize_scaling_mode = scaling_mode;
out_width = dest_width;
out_height = dest_height;
}

std::vector<unsigned> maximum_size;
if (max_size.size()) {
if(max_size.size() == 1) {
maximum_size = {max_size[0], max_size[0]};
} else if(max_size.size() == 2) {
maximum_size = {max_size[0], max_size[1]}; // {width, height}
} else {
THROW("The length of max_size vector exceeds the image dimension.")
}
}

// Determine the max width and height to be set to the output info
unsigned max_out_width, max_out_height;
if (maximum_size.size() && maximum_size[0] != 0 && maximum_size[1] != 0) {
// If max_size is passed by the user, the resized images cannot exceed the max size,
max_out_width = maximum_size[0];
max_out_height = maximum_size[1];
} else {
// compute the output info width and height wrt the scaling modes and roi passed
if(resize_scaling_mode == ROCAL_SCALING_MODE_STRETCH) {
max_out_width = out_width ? out_width : info.width();
max_out_height = out_height ? out_height : info.height_single();
} else if(resize_scaling_mode == ROCAL_SCALING_MODE_NOT_SMALLER) {
max_out_width = (out_width ? out_width : out_height) * MAX_ASPECT_RATIO;
max_out_height = (out_height ? out_height : out_width) * MAX_ASPECT_RATIO;
} else {
max_out_width = out_width ? out_width : out_height * MAX_ASPECT_RATIO;
max_out_height = out_height ? out_height : out_width * MAX_ASPECT_RATIO;
}
if(maximum_size.size() == 2) {
max_out_width = maximum_size[0] ? maximum_size[0] : max_out_width;
max_out_height = maximum_size[1] ? maximum_size[1] : max_out_height;
}
}

// set the width and height in the output info
// For the resize node, user can create an image with a different width and height
ImageInfo output_info = info;
output_info.width(dest_width);
output_info.height(dest_height);
output_info.width(max_out_width);
output_info.height(max_out_height);

resize_output = context->master_graph->create_image(output_info, false);

// For the nodes that user provides the output size the dimension of all the images after this node will be fixed and equal to that size
resize_output->reset_image_roi();

std::shared_ptr<ResizeNode> resize_node = context->master_graph->add_node<ResizeNode>({output}, {resize_output});
resize_node->init(out_width, out_height, resize_scaling_mode, maximum_size, interpolation_type);
if (context->master_graph->meta_data_graph())
context->master_graph->meta_add_node<ResizeMetaNode,ResizeNode>(resize_node);

Expand Down Expand Up @@ -2251,7 +2314,12 @@ rocalVideoFileResizeSingleShard(
bool loop,
unsigned step,
unsigned stride,
bool file_list_frame_num)
bool file_list_frame_num,
RocalResizeScalingMode scaling_mode,
std::vector<unsigned> max_size,
unsigned resize_shorter,
unsigned resize_longer,
RocalResizeInterpolationType interpolation_type)
{
Image* resize_output = nullptr;
if (p_context == nullptr) {
Expand All @@ -2274,9 +2342,6 @@ rocalVideoFileResizeSingleShard(
if(shard_id >= shard_count)
THROW("Shard id should be smaller than shard count")

if(dest_width == 0 || dest_height == 0)
THROW("Invalid dest_width/dest_height values passed as input")

// Set default step and stride values if 0 is passed
step = (step == 0)? sequence_length : step;
stride = (stride == 0)? 1 : stride;
Expand Down Expand Up @@ -2314,16 +2379,76 @@ rocalVideoFileResizeSingleShard(

if(dest_width != video_prop.width && dest_height != video_prop.height)
{
if((dest_width | dest_height | resize_longer | resize_shorter) == 0)
THROW("Atleast one size 'dest_width' or 'dest_height' or 'resize_shorter' or 'resize_longer' must be specified")
if((dest_width | dest_height) && (resize_longer | resize_shorter))
THROW("Only one method of specifying size can be used \ndest_width and/or dest_height\nresize_shorter\nresize_longer")
if(resize_longer && resize_shorter)
THROW("'resize_longer' and 'resize_shorter' cannot be passed together. They are mutually exclusive.")

unsigned out_width, out_height;
RocalResizeScalingMode resize_scaling_mode;

// Change the scaling mode if resize_shorter or resize_longer is specified
if(resize_shorter) {
resize_scaling_mode = RocalResizeScalingMode::ROCAL_SCALING_MODE_NOT_SMALLER;
out_width = out_height = resize_shorter;
} else if(resize_longer) {
resize_scaling_mode = RocalResizeScalingMode::ROCAL_SCALING_MODE_NOT_LARGER;
out_width = out_height = resize_longer;
} else {
resize_scaling_mode = scaling_mode;
out_width = dest_width;
out_height = dest_height;
}

std::vector<unsigned> maximum_size;
if (max_size.size()) {
if(max_size.size() == 1) {
maximum_size = {max_size[0], max_size[0]};
} else if(max_size.size() == 2) {
maximum_size = {max_size[0], max_size[1]}; // {width, height}
} else {
THROW("The length of max_size vector exceeds the image dimension.")
}
}

// Determine the max width and height to be set to the output info
unsigned max_out_width, max_out_height;
if (maximum_size.size() && maximum_size[0] != 0 && maximum_size[1] != 0) {
// If max_size is passed by the user, the resized images cannot exceed the max size,
max_out_width = maximum_size[0];
max_out_height = maximum_size[1];
} else {
// compute the output info width and height wrt the scaling modes and roi passed
if(resize_scaling_mode == ROCAL_SCALING_MODE_STRETCH) {
max_out_width = out_width ? out_width : info.width();
max_out_height = out_height ? out_height : info.height_single();
} else if(resize_scaling_mode == ROCAL_SCALING_MODE_NOT_SMALLER) {
max_out_width = (out_width ? out_width : out_height) * MAX_ASPECT_RATIO;
max_out_height = (out_height ? out_height : out_width) * MAX_ASPECT_RATIO;
} else {
max_out_width = out_width ? out_width : out_height * MAX_ASPECT_RATIO;
max_out_height = out_height ? out_height : out_width * MAX_ASPECT_RATIO;
}
if(maximum_size.size() == 2) {
max_out_width = maximum_size[0] ? maximum_size[0] : max_out_width;
max_out_height = maximum_size[1] ? maximum_size[1] : max_out_height;
}
}

// set the width and height in the output info
// For the resize node, user can create an image with a different width and height
ImageInfo output_info = info;
output_info.width(dest_width);
output_info.height(dest_height);
output_info.width(max_out_width);
output_info.height(max_out_height);

resize_output = context->master_graph->create_image(output_info, false);
// For the nodes that user provides the output size the dimension of all the images after this node will be fixed and equal to that size
resize_output->reset_image_roi();

std::shared_ptr<ResizeNode> resize_node = context->master_graph->add_node<ResizeNode>({output}, {resize_output});
resize_node->init(out_width, out_height, resize_scaling_mode, maximum_size, interpolation_type);
if (context->master_graph->meta_data_graph())
context->master_graph->meta_add_node<ResizeMetaNode,ResizeNode>(resize_node);

Expand Down
Loading

0 comments on commit 1b64102

Please sign in to comment.