Overglitch commited on
Commit
cbb5314
·
verified ·
1 Parent(s): a50056a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -50,11 +50,8 @@ def get_fingerprint_type(winner):
50
  async def predict_fingerprint_api(file: UploadFile = File(...)):
51
  try:
52
  contents = await file.read()
53
- print(f"CONTENTS\n\n{contents}")
54
- im = Image.fromarray(contents)
55
- print(f"IM\n\n{im}")
56
- image = Image.open(im).convert('L')
57
- print(f"IMAGEN\n\n{image}")
58
  fingerprint_type = predict_fingerprint(image)
59
  return {"prediction": fingerprint_type}
60
  except Exception as e:
 
50
  async def predict_fingerprint_api(file: UploadFile = File(...)):
51
  try:
52
  contents = await file.read()
53
+ image = Image.open(BytesIO(contents)).convert('L')
54
+ print(f"IMAGEN\n\n{list(image.getdata())}")
 
 
 
55
  fingerprint_type = predict_fingerprint(image)
56
  return {"prediction": fingerprint_type}
57
  except Exception as e: