Yields files in the source tree which are Net prototxts.
()
| 7 | from caffe.proto import caffe_pb2 |
| 8 | |
| 9 | def getFilenames(): |
| 10 | """Yields files in the source tree which are Net prototxts.""" |
| 11 | result = [] |
| 12 | |
| 13 | root_dir = os.path.abspath(os.path.join( |
| 14 | os.path.dirname(__file__), '..', '..', '..')) |
| 15 | assert os.path.exists(root_dir) |
| 16 | |
| 17 | for dirname in ('models', 'examples'): |
| 18 | dirname = os.path.join(root_dir, dirname) |
| 19 | assert os.path.exists(dirname) |
| 20 | for cwd, _, filenames in os.walk(dirname): |
| 21 | for filename in filenames: |
| 22 | filename = os.path.join(cwd, filename) |
| 23 | if filename.endswith('.prototxt') and 'solver' not in filename: |
| 24 | yield os.path.join(dirname, filename) |
| 25 | |
| 26 | |
| 27 | class TestDraw(unittest.TestCase): |