개정판 f0cfc15f
issue #1366: improve batch
Change-Id: Ifa93167e23a940a93ca27a994e06151c9d2f9079
DTI_PID/WebServer/CRAFT_pytorch_master/text_craft.py | ||
---|---|---|
107 | 107 |
''' |
108 | 108 |
|
109 | 109 |
def get_text_box_batch(infos): |
110 |
boxes_list = get_text_box(infos[3], infos[0], infos[1], infos[2])
|
|
110 |
boxes_list = get_text_box_stream(infos[0][3], infos[0][0], infos[0][1], infos[0][2])
|
|
111 | 111 |
|
112 | 112 |
return boxes_list |
113 | 113 |
|
... | ... | |
282 | 282 |
|
283 | 283 |
box_craft_list.append(box_craft) |
284 | 284 |
|
285 |
return box_craft_list
|
|
285 |
return [box_craft_list]
|
|
286 | 286 |
|
287 | 287 |
|
288 | 288 |
if __name__ == '__main__': |
DTI_PID/WebServer/app.py | ||
---|---|---|
71 | 71 |
boxes_list = boxes |
72 | 72 |
''' |
73 | 73 |
|
74 |
infos = [None, None, os.path.dirname(os.path.realpath(__file__)) + '\\CRAFT_pytorch_master\\weights\\craft_mlt_25k.pth', imgs]
|
|
74 |
infos = [[None, None, os.path.dirname(os.path.realpath(__file__)) + '\\CRAFT_pytorch_master\\weights\\craft_mlt_25k.pth', imgs]]
|
|
75 | 75 |
boxes = streamer.predict(infos) |
76 |
boxes_list = boxes |
|
76 |
boxes_list = boxes[0]
|
|
77 | 77 |
|
78 | 78 |
return jsonify({'text_box_list': boxes_list}) |
79 | 79 |
|
DTI_PID/WebServer/service_streamer_master/service_streamer/service_streamer.py | ||
---|---|---|
165 | 165 |
def model_predict(self, batch_input): |
166 | 166 |
batch_result = self._predict(batch_input) |
167 | 167 |
assert len(batch_input) == len(batch_result), "input batch size {} and output batch size {} must be equal.".format(len(batch_input), len(batch_result)) |
168 |
#assert len(batch_input[3]) == len(batch_result), "input batch size {} and output batch size {} must be equal.".format(len(batch_input), len(batch_result)) |
|
168 | 169 |
return batch_result |
169 | 170 |
|
170 | 171 |
def _run_once(self): |
내보내기 Unified diff