Skip to content

Commit a2b3ab3

Browse files
authored
Fix ci for mmocr (#144)
* fix mmocr unittests * remove useless * lock mmdet maximum version to 2.20 * pip install -U numpy
1 parent e855ee4 commit a2b3ab3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- name: Install unittest dependencies
4545
run: |
4646
pip install -r requirements.txt
47+
pip install -U numpy
4748
- name: Build and install
4849
run: rm -rf .eggs && pip install -e .
4950
- name: Run unittests and generate coverage report
@@ -85,6 +86,7 @@ jobs:
8586
python -V
8687
python -m pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cu102/${{matrix.torch_version}}/index.html
8788
python -m pip install -r requirements.txt
89+
python -m pip install -U numpy
8890
- name: Build and install
8991
run: |
9092
rm -rf .eggs && python -m pip install -e .
@@ -128,6 +130,7 @@ jobs:
128130
python -V
129131
python -m pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cu111/${{matrix.torch_version}}/index.html
130132
python -m pip install -r requirements.txt
133+
python -m pip install -U numpy
131134
- name: Build and install
132135
run: |
133136
rm -rf .eggs && python -m pip install -e .

requirements/optional.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mmcls>=0.15.0,<=0.19.0
2-
mmdet>=2.19.0
2+
mmdet>=2.19.0,<=2.20.0
33
mmedit
4-
mmocr==0.3.0
4+
mmocr>=0.3.0
55
mmsegmentation
66
onnxruntime>=1.8.0
77
openvino-dev

tests/test_codebase/test_mmocr/test_mmocr_models.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_encode_decode_recognizer_model():
7474
cfg = dict(
7575
preprocessor=None,
7676
backbone=dict(type='VeryDeepVgg', leaky_relu=False, input_channels=1),
77-
encoder=dict(type='TFEncoder'),
77+
encoder=None,
7878
decoder=dict(type='CRNNDecoder', in_channels=512, rnn_flag=True),
7979
loss=dict(type='CTCLoss'),
8080
label_convertor=dict(
@@ -394,12 +394,15 @@ def test_forward_of_fpnc(backend: Backend):
394394
model_inputs=[
395395
dict(
396396
input_shapes=dict(
397-
input=dict(
397+
inputs=dict(
398398
min_shape=[1, 3, 64, 64],
399399
opt_shape=[1, 3, 64, 64],
400400
max_shape=[1, 3, 64, 64])))
401401
]),
402-
onnx_config=dict(input_shape=[64, 64], output_names=['output']),
402+
onnx_config=dict(
403+
input_shape=None,
404+
input_names=['inputs'],
405+
output_names=['output']),
403406
codebase_config=dict(type='mmocr', task='TextDetection')))
404407

405408
input = torch.rand(1, 3, 64, 64).cuda()

tests/test_codebase/test_mmocr/test_text_detection_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_forward(self, ori_shape):
6060
'ori_shape': ori_shape,
6161
'img_shape': [IMAGE_SIZE, IMAGE_SIZE, 3],
6262
'scale_factor': [1., 1., 1., 1.],
63+
'filename': ''
6364
}]]
6465
results = self.end2end_model.forward(imgs, img_metas)
6566
assert results is not None, 'failed to get output using '\

0 commit comments

Comments
 (0)