Compare commits

..

No commits in common. "main" and "SEMS-model-inference-0.0.2.20241008_alpha" have entirely different histories.

15
main.py
View File

@ -26,10 +26,7 @@ def register():
data=msgpack.unpackb(gzip.decompress(request.data) )
# print(len(data["c"]),data["c"])
data=np.frombuffer(data["spectral_data_bin"],dtype=np.uint16).reshape(int(len(data["spectral_data_bin"])/224/512/2),1,224,512)
data=np.mean(data,axis=0, keepdims=True)
data=np.frombuffer(data["spectral_data_bin"],dtype=np.uint16).reshape(1,1,224,512)
# print(data.shape)
# input_data=torch.tensor(data,dtype=torch.float32)/4095
@ -41,14 +38,8 @@ def register():
print(output)
response={}
response["Temperature"]= float(output[0,0]*(1663-1496)+1496)
response["C"]= float(output[0,1]*(0.829-0.079)+0.079)
response["P"]=float(output[0,1]*(0.797-0.001)+0.001)
response["S"]=0.04402615384615385
response["Mn"]=0.138787
response["Ni"]=0.035104
response["Mo"]=0.093789
response["Cr"]=0.002983
response["temp"]= float(output[0,0]*(1692-1516)+1516)
response["C"]= float(output[0,1]*(0.915-0.062)+0.062)
d=gzip.compress(msgpack.packb(response))
print(d)