File tree Expand file tree Collapse file tree 5 files changed +60
-16
lines changed
Expand file tree Collapse file tree 5 files changed +60
-16
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,21 @@ jobs:
124124 run : pip install invoke jupyter matplotlib .
125125 - name : invoke tutorials
126126 run : invoke tutorials
127+
128+
129+ pretrained :
130+ runs-on : ${{ matrix.os }}
131+ strategy :
132+ matrix :
133+ python-version : ['3.10', '3.11']
134+ os : [ubuntu-latest, macos-latest, windows-latest]
135+ steps :
136+ - uses : actions/checkout@v1
137+ - name : Set up Python ${{ matrix.python-version }}
138+ uses : actions/setup-python@v2
139+ with :
140+ python-version : ${{ matrix.python-version }}
141+ - name : Install package and dependencies
142+ run : pip install invoke jupyter .[pretrained]
143+ - name : invoke pretrained
144+ run : invoke pretrained
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
8181install-develop : clean-build clean-pyc # # install the package in editable mode and dependencies for development
8282 pip install -e .[dev]
8383
84+ .PHONY : install-pretrained
85+ install-pretrained : clean-build clean-pyc # # install the package and pretrained pipelines
86+ pip install -e .[pretrained]
87+
88+ .PHONY : install-pretrained-develop
89+ install-pretrained-develop : clean-build clean-pyc # # install the package with pretrained in editable mode and dependencies for development
90+ pip install -e .[pretrained-dev]
91+
8492MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' setup.py | grep -v -e '[][]' | sed 's/ * \(.* \) ,$? $$/\1/g' | tr '>' '=')
8593
8694.PHONY : install-minimum
@@ -127,6 +135,10 @@ test-readme: ## run the readme snippets
127135test-tutorials : # # run the tutorial notebooks
128136 invoke tutorials
129137
138+ .PHONY : test-pretrained-tutorials
139+ test-pretrained-tutorials : # # run the tutorial notebooks
140+ invoke pretrained
141+
130142.PHONY : test
131143test : test-unit test-readme test-tutorials # # test everything that needs test dependencies
132144
Original file line number Diff line number Diff line change 1414import numpy as np
1515import torch
1616import torch .nn .functional as F
17- from smart_open import open as smart_open
18- from timm .layers import DropPath , Mlp
19- from timm .layers .helpers import to_2tuple
2017from torch import nn
2118from torch .utils .data import DataLoader
2219from tqdm import tqdm
2320
2421from orion .data import BUCKET , S3_URL
22+ from smart_open import open as smart_open
23+ from timm .layers import DropPath , Mlp
24+ from timm .layers .helpers import to_2tuple
2525
2626warnings .filterwarnings ('ignore' )
2727
Original file line number Diff line number Diff line change 3737
3838 # fix conflict
3939 'protobuf<4' ,
40-
41- # fails on python 3.6
42- 'opencv-python<4.7' ,
40+ ]
4341
44- #UniTS
45- 'timm' ,
42+ pretrained_requires = [
43+ #units
44+ 'timm' ,
4645 'smart_open' ,
47-
4846]
4947
5048setup_requires = [
128126 extras_require = {
129127 'test' : tests_require ,
130128 'dev' : development_requires + tests_require ,
129+ 'pretrained' : pretrained_requires ,
130+ 'pretrained-dev' : pretrained_requires + development_requires + tests_require ,
131131 },
132132 include_package_data = True ,
133133 install_requires = install_requires ,
Original file line number Diff line number Diff line change @@ -92,15 +92,29 @@ def readme(c):
9292
9393@task
9494def tutorials (c ):
95+ pipelines = os .listdir (os .path .join ('orion' , 'pipelines' , 'pretrained' ))
9596 for ipynb_file in glob .glob ('tutorials/*.ipynb' ) + glob .glob ('tutorials/**/*.ipynb' ):
96- if 'OrionDBExplorer' in ipynb_file : # skip db testing
97- continue
98- if '.ipynb_checkpoints' not in ipynb_file :
99- c .run ((
100- 'jupyter nbconvert --execute --ExecutePreprocessor.timeout=4400 '
101- f'--to=html --stdout { ipynb_file } '
102- ), hide = 'out' )
97+ for pipeline in pipelines :
98+ if pipeline in ipynb_file : # skip pretrained pipelines
99+ continue
100+ if '.ipynb_checkpoints' not in ipynb_file :
101+ c .run ((
102+ 'jupyter nbconvert --execute --ExecutePreprocessor.timeout=4400 '
103+ f'--to=html --stdout { ipynb_file } '
104+ ), hide = 'out' )
103105
106+ @task
107+ def pretrained (c ):
108+ pipelines = os .listdir (os .path .join ('orion' , 'pipelines' , 'pretrained' ))
109+ for ipynb_file in glob .glob ('tutorials/pipelines/*.ipynb' ):
110+ for pipeline in pipelines :
111+ if pipeline not in ipynb_file : # skip non-pretrained pipelines
112+ continue
113+ if '.ipynb_checkpoints' not in ipynb_file :
114+ c .run ((
115+ 'jupyter nbconvert --execute --ExecutePreprocessor.timeout=4400 '
116+ f'--to=html --stdout { ipynb_file } '
117+ ), hide = 'out' )
104118
105119@task
106120def lint (c ):
You can’t perform that action at this time.
0 commit comments