Spaces:
Running
Running
Theivaprakasham
commited on
Update app/server.py
Browse files- 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(
|
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 |
|