修正url及图片保存
This commit is contained in:
@@ -8,7 +8,6 @@ from util.common_util import process_request
|
||||
|
||||
app = Flask(__name__)
|
||||
det_bp = Blueprint('det_bp', __name__)
|
||||
app.register_blueprint(det_bp, url_prefix='/det')
|
||||
|
||||
|
||||
@det_bp.route('/books', methods=['POST'])
|
||||
@@ -23,11 +22,12 @@ def books():
|
||||
books_path = []
|
||||
for i in range(len(result)):
|
||||
save_path = os.path.join(dirname, img_name + '_book_' + str(i) + '.' + ext)
|
||||
with open(save_path, 'wb') as file:
|
||||
file.write(result[i])
|
||||
cv2.imwrite(save_path, result[i])
|
||||
books_path.append(save_path)
|
||||
return books_path
|
||||
|
||||
|
||||
app.register_blueprint(det_bp, url_prefix='/det')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run('0.0.0.0', 5000)
|
||||
|
||||
Reference in New Issue
Block a user