update
This commit is contained in:
@ -27,12 +27,12 @@ import logging
|
||||
|
||||
app = Flask(__name__)
|
||||
# 日志系统配置
|
||||
handler = logging.FileHandler('app.log', encoding='UTF-8')
|
||||
handler.setLevel(logging.DEBUG)
|
||||
logging_format = logging.Formatter(
|
||||
'%(asctime)s - %(levelname)s - %(filename)s - %(funcName)s - %(lineno)s - %(message)s')
|
||||
handler.setFormatter(logging_format)
|
||||
app.logger.addHandler(handler)
|
||||
#handler = logging.FileHandler('app.log', encoding='UTF-8')
|
||||
#handler.setLevel(logging.DEBUG)
|
||||
#logging_format = logging.Formatter(
|
||||
# '%(asctime)s - %(levelname)s - %(filename)s - %(funcName)s - %(lineno)s - %(message)s')
|
||||
#handler.setFormatter(logging_format)
|
||||
#app.logger.addHandler(handler)
|
||||
'''
|
||||
load model
|
||||
'''
|
||||
@ -70,7 +70,7 @@ def loadModel():
|
||||
return all_model
|
||||
|
||||
def CheckRange(code):
|
||||
with open('goodsCategory.json', 'r', encoding='utf-8') as jsonPath:
|
||||
with open('../module/ieemoo-ai-predict/data/goodsCategory.json', 'r', encoding='utf-8') as jsonPath:
|
||||
loadDict = json.load(jsonPath)
|
||||
for key in loadDict:
|
||||
if code in loadDict[key]:
|
||||
@ -178,7 +178,7 @@ def predict():
|
||||
if request.method == 'POST':
|
||||
try:
|
||||
data = request.get_data()
|
||||
print(type(data))
|
||||
print(data)
|
||||
data_str = data.decode("utf-8")
|
||||
json_data = json.loads(data_str)
|
||||
pic = json_data.get("file")
|
||||
|
Reference in New Issue
Block a user