Theivaprakasham commited on
Commit
61b4eba
·
verified ·
1 Parent(s): 0574283

Update app/server.py

Browse files
Files changed (1) hide show
  1. app/server.py +1 -1
app/server.py CHANGED
@@ -82,7 +82,7 @@ async def analyze(request):
82
  img_bytes = await (data['avatar'].read())
83
  img = Image.open(BytesIO(img_bytes)).convert('RGB')
84
 
85
- _, _, outputs = learn.predict(BytesIO(img_bytes))
86
  values, indices = torch.topk(outputs,5)
87
  predictions = [{"class": classes[j], "output": round(i, 1), "prob": round(i*100,2)} for i, j in zip(values.tolist(), indices.tolist())]
88
 
 
82
  img_bytes = await (data['avatar'].read())
83
  img = Image.open(BytesIO(img_bytes)).convert('RGB')
84
 
85
+ _, _, outputs = learn.predict(img_bytes)
86
  values, indices = torch.topk(outputs,5)
87
  predictions = [{"class": classes[j], "output": round(i, 1), "prob": round(i*100,2)} for i, j in zip(values.tolist(), indices.tolist())]
88