-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2-migration-tf2' into 'develop'
Migration to TensorFlow2 See merge request remi.cresson/otbtf!3
- Loading branch information
Showing
131 changed files
with
2,364 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
BasedOnStyle: Mozilla | ||
Language: Cpp | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: true | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
# clang 9.0 AllowAllArgumentsOnNextLine: true | ||
# clang 9.0 AllowAllConstructorInitializersOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
# clang 9.0 AllowShortLambdasOnASingleLine: All | ||
# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: All | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
# clang 9.0 feature AfterCaseLabel: false | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterObjCDeclaration: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
## This is the big change from historical ITK formatting! | ||
# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style | ||
# with indented braces, and not indented code. This style is very difficult to automatically | ||
# maintain with code beautification tools. Not indenting braces is more common among | ||
# formatting tools. | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
BreakBeforeBinaryOperators: None | ||
#clang 6.0 BreakBeforeInheritanceComma: true | ||
BreakInheritanceList: BeforeComma | ||
BreakBeforeTernaryOperators: true | ||
#clang 6.0 BreakConstructorInitializersBeforeComma: true | ||
BreakConstructorInitializers: BeforeComma | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
## The following line allows larger lines in non-documentation code | ||
ColumnLimit: 120 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 2 | ||
ContinuationIndentWidth: 2 | ||
Cpp11BracedListStyle: false | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
- Regex: '^(<|"(gtest|gmock|isl|json)/)' | ||
Priority: 3 | ||
- Regex: '.*' | ||
Priority: 1 | ||
IncludeIsMainRegex: '(Test)?$' | ||
IndentCaseLabels: true | ||
IndentPPDirectives: AfterHash | ||
IndentWidth: 2 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 2 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: false | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
## The following line allows larger lines in non-documentation code | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 200 | ||
PointerAlignment: Middle | ||
ReflowComments: true | ||
# We may want to sort the includes as a separate pass | ||
SortIncludes: false | ||
# We may want to revisit this later | ||
SortUsingDeclarations: false | ||
SpaceAfterCStyleCast: false | ||
# SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 2 | ||
UseTab: Never | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
*.jp2 filter=lfs diff=lfs merge=lfs -text | ||
*.tif filter=lfs diff=lfs merge=lfs -text | ||
*.data-* filter=lfs diff=lfs merge=lfs -text | ||
*.gpkg filter=lfs diff=lfs merge=lfs -text | ||
*.pb filter=lfs diff=lfs merge=lfs -text | ||
*.jpg filter=lfs diff=lfs merge=lfs -text | ||
*.jpeg filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
image: gitlab-registry.irstea.fr/remi.cresson/otbtf:2.4-cpu-basic-testing | ||
|
||
variables: | ||
OTB_BUILD: /src/otb/build/OTB/build # Local OTB build directory | ||
OTBTF_SRC: /src/otbtf # Local OTBTF source directory | ||
OTB_TEST_DIR: $OTB_BUILD/Testing/Temporary # OTB testing directory | ||
ARTIFACT_TEST_DIR: $CI_PROJECT_DIR/testing | ||
CRC_BOOK_TMP: /tmp/crc_book_tests_tmp | ||
|
||
workflow: | ||
rules: | ||
- if: $CI_MERGE_REQUEST_ID # Execute jobs in merge request context | ||
- if: $CI_COMMIT_BRANCH == 'develop' # Execute jobs when a new commit is pushed to develop branch | ||
|
||
stages: | ||
- Build | ||
- Static Analysis | ||
- Test | ||
- Applications Test | ||
|
||
.update_otbtf_src: &update_otbtf_src | ||
- sudo rm -rf $OTBTF_SRC && sudo ln -s $PWD $OTBTF_SRC # Replace local OTBTF source directory | ||
|
||
.compile_otbtf: &compile_otbtf | ||
- cd $OTB_BUILD && sudo make install -j$(nproc --all) # Rebuild OTB with new OTBTF sources | ||
|
||
.install_pytest: &install_pytest | ||
- pip3 install pytest pytest-cov pytest-order # Install pytest stuff | ||
|
||
before_script: | ||
- *update_otbtf_src | ||
|
||
build: | ||
stage: Build | ||
allow_failure: false | ||
script: | ||
- *compile_otbtf | ||
|
||
flake8: | ||
stage: Static Analysis | ||
allow_failure: true | ||
script: | ||
- sudo apt update && sudo apt install flake8 -y | ||
- python -m flake8 --max-line-length=120 $OTBTF_SRC/python | ||
|
||
pylint: | ||
stage: Static Analysis | ||
allow_failure: true | ||
script: | ||
- sudo apt update && sudo apt install pylint -y | ||
- pylint --disable=too-many-nested-blocks,too-many-locals,too-many-statements,too-few-public-methods,too-many-instance-attributes,too-many-arguments --ignored-modules=tensorflow --max-line-length=120 --logging-format-style=new $OTBTF_SRC/python | ||
|
||
codespell: | ||
stage: Static Analysis | ||
allow_failure: true | ||
script: | ||
- sudo pip install codespell && codespell | ||
|
||
cppcheck: | ||
stage: Static Analysis | ||
allow_failure: true | ||
script: | ||
- sudo apt update && sudo apt install cppcheck -y | ||
- cd $OTBTF_SRC/ && cppcheck --enable=all --error-exitcode=1 -I include/ --suppress=missingInclude --suppress=unusedFunction . | ||
|
||
ctest: | ||
stage: Test | ||
script: | ||
- *compile_otbtf | ||
- sudo rm -rf $OTB_TEST_DIR/* # Empty testing temporary folder (old files here) | ||
- cd $OTB_BUILD/ && sudo ctest -L OTBTensorflow # Run ctest | ||
after_script: | ||
- cp -r $OTB_TEST_DIR $ARTIFACT_TEST_DIR | ||
artifacts: | ||
paths: | ||
- $ARTIFACT_TEST_DIR/*.* | ||
expire_in: 1 week | ||
when: on_failure | ||
|
||
.applications_test_base: | ||
stage: Applications Test | ||
rules: | ||
# Only for MR targeting 'develop' branch because applications tests are slow | ||
- if: $CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'develop' | ||
artifacts: | ||
when: on_failure | ||
paths: | ||
- $CI_PROJECT_DIR/report_*.xml | ||
- $ARTIFACT_TEST_DIR/*.* | ||
expire_in: 1 week | ||
|
||
crc_book: | ||
extends: .applications_test_base | ||
script: | ||
- *compile_otbtf | ||
- *install_pytest | ||
- cd $CI_PROJECT_DIR | ||
- mkdir -p $CRC_BOOK_TMP | ||
- TMPDIR=$CRC_BOOK_TMP DATADIR=$CI_PROJECT_DIR/test/data python -m pytest --junitxml=$CI_PROJECT_DIR/report_tutorial.xml $OTBTF_SRC/test/tutorial_unittest.py | ||
after_script: | ||
- mkdir -p $ARTIFACT_TEST_DIR | ||
- cp $CRC_BOOK_TMP/*.* $ARTIFACT_TEST_DIR/ | ||
|
||
sr4rs: | ||
extends: .applications_test_base | ||
script: | ||
- *compile_otbtf | ||
- *install_pytest | ||
- cd $CI_PROJECT_DIR | ||
- wget -O sr4rs_sentinel2_bands4328_france2020_savedmodel.zip | ||
https://nextcloud.inrae.fr/s/boabW9yCjdpLPGX/download/sr4rs_sentinel2_bands4328_france2020_savedmodel.zip | ||
- unzip -o sr4rs_sentinel2_bands4328_france2020_savedmodel.zip | ||
- wget -O sr4rs_data.zip https://nextcloud.inrae.fr/s/qMLLyKCDieqmgWz/download | ||
- unzip -o sr4rs_data.zip | ||
- rm -rf sr4rs | ||
- git clone https://github.com/remicres/sr4rs.git | ||
- export PYTHONPATH=$PYTHONPATH:$PWD/sr4rs | ||
- python -m pytest --junitxml=$CI_PROJECT_DIR/report_sr4rs.xml $OTBTF_SRC/test/sr4rs_unittest.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- Remi Cresson | ||
- Nicolas Narcon | ||
- Benjamin Commandre | ||
- Vincent Delbar | ||
- Loic Lozac'h | ||
- Pratyush Das | ||
- Doctor Who | ||
- Jordi Inglada |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.