修正docker镜像构建
This commit is contained in:
24
services/paddle_services/utils.py
Normal file
24
services/paddle_services/utils.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
from flask import jsonify
|
||||
|
||||
|
||||
def process_request(func):
|
||||
"""
|
||||
api通用处理函数
|
||||
"""
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
result = func(*args, **kwargs)
|
||||
return jsonify(result), 200
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
def parse_img_path(img_path):
|
||||
dirname = os.path.dirname(img_path)
|
||||
img_name, ext = os.path.basename(img_path).rsplit('.', 1)
|
||||
return dirname, img_name, ext
|
||||
Reference in New Issue
Block a user