개정판 a02da871
gclude test
Change-Id: Ib77c0a741b566dc69f50486d588c2e4bf0cb779e
DTI_PID/WebServer/app/recognition/index.py | ||
---|---|---|
78 | 78 |
os.path.realpath(__file__)) + '\\CRAFT_pytorch_master\\weights\\craft_mlt_25k.pth') |
79 | 79 |
|
80 | 80 |
return jsonify({'text_box': boxes}) |
81 |
|
|
82 |
@recognition_service.route('/ocr', methods=['POST']) |
|
83 |
def gcloud_ocr(): |
|
84 |
if request.method == 'POST': |
|
85 |
r = request |
|
86 |
nparr = np.fromstring(r.data, np.uint8) |
|
87 |
|
|
88 |
img = cv2.imdecode(nparr, cv2.IMREAD_COLOR) |
|
89 |
# img = img.reshape(1, -1) |
|
90 |
|
|
91 |
boxes = text_craft.get_gcloud_ocr(img) |
|
92 |
|
|
93 |
return jsonify({'text_box': boxes}) |
|
81 | 94 |
|
82 | 95 |
|
83 | 96 |
@recognition_service.route('/stream_text_box', methods=['POST']) |
내보내기 Unified diff