프로젝트

일반

사용자정보

개정판 ed7877e8

IDed7877e84d4957883f758f87f538f243e6aee33c
상위 82be49cb
하위 b73f827e

함의성이(가) 4년 이상 전에 추가함

issue #1366: symbol on going

Change-Id: I46c52d94e32e7d1cc5a6873bb8bd660ce9e8bbac

차이점 보기:

DTI_PID/WebServer/app.py
13 13

  
14 14
app = Flask(__name__)
15 15

  
16
def recognition(params=None):
17
    if params[0] == 'Text Area':
18
        res = text_craft.get_text_box_batch(params[1:])
19
        return ['Text Area', res]
20
    elif params[0] == 'Symbol':
21
        pass
22

  
16 23
try:
17 24
    #from model import get_prediction, batch_prediction
18 25
    import text_craft
......
22 29
    #import ctypes
23 30
    #ctypes.cdll.LoadLibrary('caffe2_nvrtc.dll')
24 31

  
25
    streamer = ThreadedStreamer(text_craft.get_text_box_batch, batch_size=64)
32
    streamer = ThreadedStreamer(recognition, batch_size=64)
26 33
except ImportError as ex:
27 34
    ex
28 35
    pass
......
117 124
        boxes_list = boxes
118 125
        '''
119 126

  
120
        infos = [[None, None, os.path.dirname(os.path.realpath(__file__)) + '\\CRAFT_pytorch_master\\weights\\craft_mlt_25k.pth', imgs]]
127
        infos = ['Text Area', [None, None, os.path.dirname(os.path.realpath(__file__)) + '\\CRAFT_pytorch_master\\weights\\craft_mlt_25k.pth', imgs]]
121 128
        boxes = streamer.predict(infos)
122
        boxes_list = boxes[0]
129
        boxes_list = boxes[1][0]
123 130

  
124 131
        return jsonify({'text_box_list': boxes_list})
125 132

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)