def _internal_service_call(self, share_data) :
try:
# internal : IMAGE
print("?????????? ??? ?? ?? ?? ?? ?????????? ")
temp = {}
request_type = share_data.get_request_type()
decode_text = base64.decodebytes(str.encode(share_data.get_request_data()))
temp['test'] = [InMemoryUploadedFile(io.BytesIO(decode_text), None, 'test.jpg', 'image/jpeg', len(decode_text), None)]
ml = MultiValueDict(temp)
# fp = open("/hoya_src_root/nn00004/1/test1.jpg", 'wb')
# fp.write(decode_text)
# fp.close()
# CNN Prediction
if(request_type == "image"):
return_val = PredictNetCnn().run('nn00004', None, ml )
name_tag = {"KYJ" : "???", "KSW" : "???", "LTY" : "???", "LSH" : "???", "PJH" : "???", "KSS" : "???", "PSC" : "???"}
print("?????????? ??? ?? ?? ?? ?? : " + return_val['test.jpg']['key'][0])
share_data.set_output_data(name_tag[return_val['test.jpg']['key'][0]] + "?? ??? ????")
else :
share_data.set_output_data("??? ?? ??? ????")
return share_data
except Exception as e:
raise Exception(e)
评论列表
文章目录