Coverage for /scratch/builds/bob/bob.ip.binseg/miniconda/conda-bld/bob.ip.binseg_1673966692152/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.10/site-packages/bob/ip/common/test/test_summary.py: 100%

39 statements  

« prev     ^ index     » next       coverage.py v7.0.5, created at 2023-01-17 15:03 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3 

4import unittest 

5 

6from ...binseg.models.driu import driu 

7from ...binseg.models.driu_od import driu_od 

8from ...binseg.models.hed import hed 

9from ...binseg.models.resunet import resunet50 

10from ...binseg.models.unet import unet 

11from ...detect.models.faster_rcnn import faster_rcnn 

12from ..utils.summary import summary 

13 

14 

15class Tester(unittest.TestCase): 

16 """ 

17 Unit test for model architectures 

18 """ 

19 

20 def test_summary_driu(self): 

21 model = driu() 

22 s, param = summary(model) 

23 self.assertIsInstance(s, str) 

24 self.assertIsInstance(param, int) 

25 

26 def test_summary_driuod(self): 

27 model = driu_od() 

28 s, param = summary(model) 

29 self.assertIsInstance(s, str) 

30 self.assertIsInstance(param, int) 

31 

32 def test_summary_hed(self): 

33 model = hed() 

34 s, param = summary(model) 

35 self.assertIsInstance(s, str) 

36 self.assertIsInstance(param, int) 

37 

38 def test_summary_unet(self): 

39 model = unet() 

40 s, param = summary(model) 

41 self.assertIsInstance(s, str) 

42 self.assertIsInstance(param, int) 

43 

44 def test_summary_resunet(self): 

45 model = resunet50() 

46 s, param = summary(model) 

47 self.assertIsInstance(s, str) 

48 self.assertIsInstance(param, int) 

49 

50 def test_summary_fasterrcnn(self): 

51 model = faster_rcnn() 

52 s, param = summary(model) 

53 self.assertIsInstance(s, str) 

54 self.assertIsInstance(param, int)