Skip to content
Permalink
Browse files

fix(test): fix preprocessor building for image test

  • Loading branch information...
hanxiao committed Aug 2, 2019
1 parent 50fdc04 commit f6a801f7b18a5df435335778deaba790df09526c
Showing with 8 additions and 6 deletions.
  1. +3 −3 gnes/composer/base.py
  2. +5 −3 tests/test_image_encoder.py
@@ -156,10 +156,10 @@ def build_layers(self) -> List['YamlComposer.Layer']:
last_layer = self._layers[idx - 1]
for l in self._add_router(last_layer, layer):
all_layers.append(copy.deepcopy(l))
# # add frontend
# for l in self._add_router(all_layers[-1], all_layers[0]):
# all_layers.append(copy.deepcopy(l))
all_layers[0] = copy.deepcopy(self._layers[0])

# gRPCfrontend should always on the bind role

return all_layers

@staticmethod
@@ -4,7 +4,7 @@
import zipfile

from gnes.encoder.image.base import BasePytorchEncoder
from gnes.preprocessor.base import BaseUnaryPreprocessor
from gnes.preprocessor.base import BaseUnaryPreprocessor, PipelinePreprocessor
from gnes.preprocessor.image.resize import ResizeChunkPreprocessor
from gnes.preprocessor.image.sliding_window import VanillaSlidingPreprocessor
from gnes.proto import gnes_pb2, blob2array
@@ -20,8 +20,10 @@ def img_process_for_test(dirname):
test_img.append(d)

test_img_all_preprocessor = []
for preprocessor in [BaseUnaryPreprocessor(doc_type=gnes_pb2.Document.IMAGE),
ResizeChunkPreprocessor(),
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:

0 comments on commit f6a801f

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