Skip to content

Commit

Permalink
RankFilter : Add perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldresser authored and danieldresser-ie committed Jan 23, 2023
1 parent 312242c commit 67000ea
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
19 changes: 19 additions & 0 deletions python/GafferImageTest/DilateTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,24 @@ def testDriverChannel( self ) :
# a master
self.assertImagesEqual( masterDilateSingleChannel["out"], defaultDilateSingleChannel["out"] )

@GafferTest.TestRunner.PerformanceTestMethod( repeat = 1 )
def testPerf( self ) :

ImageReader = GafferImage.ImageReader()
ImageReader["fileName"].setValue( self.imagesPath() / 'deepMergeReference.exr' )

Resize = GafferImage.Resize()
Resize["in"].setInput( ImageReader["out"] )
Resize["filter"].setValue( 'lanczos3' )

GafferImageTest.processTiles( Resize["out"] )

Dilate = GafferImage.Dilate()
Dilate["in"].setInput( Resize["out"] )
Dilate["radius"].setValue( imath.V2i( 12 ) )

with GafferTest.TestRunner.PerformanceScope() :
GafferImageTest.processTiles( Dilate["out"] )

if __name__ == "__main__":
unittest.main()
19 changes: 19 additions & 0 deletions python/GafferImageTest/ErodeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,24 @@ def testDriverChannel( self ) :
# a master
self.assertImagesEqual( masterErodeSingleChannel["out"], defaultErodeSingleChannel["out"] )

@GafferTest.TestRunner.PerformanceTestMethod( repeat = 1 )
def testPerf( self ) :

ImageReader = GafferImage.ImageReader()
ImageReader["fileName"].setValue( self.imagesPath() / 'deepMergeReference.exr' )

Resize = GafferImage.Resize()
Resize["in"].setInput( ImageReader["out"] )
Resize["filter"].setValue( 'lanczos3' )

GafferImageTest.processTiles( Resize["out"] )

Erode = GafferImage.Erode()
Erode["in"].setInput( Resize["out"] )
Erode["radius"].setValue( imath.V2i( 12 ) )

with GafferTest.TestRunner.PerformanceScope() :
GafferImageTest.processTiles( Erode["out"] )

if __name__ == "__main__":
unittest.main()
19 changes: 19 additions & 0 deletions python/GafferImageTest/MedianTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,24 @@ def testCancellation( self ) :
bt.cancelAndWait()
self.assertLess( time.time() - t, acceptableCancellationDelay )

@GafferTest.TestRunner.PerformanceTestMethod( repeat = 1 )
def testPerf( self ) :

ImageReader = GafferImage.ImageReader()
ImageReader["fileName"].setValue( self.imagesPath() / 'deepMergeReference.exr' )

Resize = GafferImage.Resize()
Resize["in"].setInput( ImageReader["out"] )
Resize["filter"].setValue( 'lanczos3' )

GafferImageTest.processTiles( Resize["out"] )

Median = GafferImage.Median()
Median["in"].setInput( Resize["out"] )
Median["radius"].setValue( imath.V2i( 12 ) )

with GafferTest.TestRunner.PerformanceScope() :
GafferImageTest.processTiles( Median["out"] )

if __name__ == "__main__":
unittest.main()

0 comments on commit 67000ea

Please sign in to comment.