Skip to content
Permalink
Browse files

fix(test): fix img_process_for_test

  • Loading branch information...
hanxiao committed Aug 2, 2019
1 parent 64e948d commit 8ca07a74da0501b92bb2c7b0b193a7327aaf9413
Showing with 6 additions and 4 deletions.
  1. +6 −4 tests/test_onnx_image_encoder.py
@@ -10,7 +10,7 @@


def img_process_for_test(dirname):
zipfile_ = zipfile.ZipFile(os.path.join(dirname, 'imgs/test.zip'), "r")
zipfile_ = zipfile.ZipFile(os.path.join(dirname, 'imgs/test.zip'))
all_bytes = [zipfile_.open(v).read() for v in zipfile_.namelist()]
test_img = []
for raw_bytes in all_bytes:
@@ -19,14 +19,16 @@ def img_process_for_test(dirname):
test_img.append(d)

test_img_all_preprocessor = []
for preprocessor in [BaseUnaryPreprocessor(doc_type=gnes_pb2.Document.IMAGE),
pipline_prep1 = PipelinePreprocessor()
pipline_prep1.component = lambda: [BaseUnaryPreprocessor(doc_type=gnes_pb2.Document.IMAGE),
ResizeChunkPreprocessor()]
for preprocessor in [pipline_prep1,
VanillaSlidingPreprocessor()]:
test_img_copy = copy.deepcopy(test_img)
for img in test_img_copy:
preprocessor.apply(img)
test_img_all_preprocessor.append([blob2array(chunk.blob)
for img in test_img_copy for chunk in img.chunks])
return test_img_all_preprocessor
for img in


class TestONNXImageEncoder(unittest.TestCase):

0 comments on commit 8ca07a7

Please sign in to comment.
You can’t perform that action at this time.